/* Generated by Cython 3.0.12 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "define_macros": [
            [
                "NPY_NO_DEPRECATED_API",
                "NPY_1_7_API_VERSION"
            ]
        ],
        "extra_compile_args": [
            "-Wno-unreachable-code"
        ],
        "include_dirs": [
            "/tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/_core/include"
        ],
        "name": "cytimes.pddt",
        "sources": [
            "src/cytimes/pddt.py"
        ]
    },
    "module_name": "cytimes.pddt"
}
END: Cython Metadata */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
#if defined(CYTHON_LIMITED_API) && 0
  #ifndef Py_LIMITED_API
    #if CYTHON_LIMITED_API+0 > 0x03030000
      #define Py_LIMITED_API CYTHON_LIMITED_API
    #else
      #define Py_LIMITED_API 0x03030000
    #endif
  #endif
#endif

#include "Python.h"

    #if PY_MAJOR_VERSION >= 3
      #define __Pyx_PyFloat_FromString(obj)  PyFloat_FromString(obj)
    #else
      #define __Pyx_PyFloat_FromString(obj)  PyFloat_FromString(obj, NULL)
    #endif
    

    #if PY_MAJOR_VERSION <= 2
    #define PyDict_GetItemWithError _PyDict_GetItemWithError
    #endif
    

    #if (PY_VERSION_HEX < 0x030700b1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600)) && !defined(PyContextVar_Get)
    #define PyContextVar_Get(var, d, v)         ((d) ?             ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) :             ((v)[0] = NULL, 0)         )
    #endif
    
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
    #error Cython requires Python 2.7+ or Python 3.3+.
#else
#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API
#define __PYX_EXTRA_ABI_MODULE_NAME "limited"
#else
#define __PYX_EXTRA_ABI_MODULE_NAME ""
#endif
#define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
#define CYTHON_HEX_VERSION 0x03000CF0
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #define HAVE_LONG_LONG
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
#if defined(GRAALVM_PYTHON)
  /* For very preliminary testing purposes. Most variables are set the same as PyPy.
     The existence of this section does not imply that anything works or is even tested */
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 1
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #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_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_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
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#elif defined(PYPY_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #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_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
  #endif
  #if PY_VERSION_HEX < 0x03090000
    #undef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#elif defined(CYTHON_LIMITED_API)
  #ifdef Py_LIMITED_API
    #undef __PYX_LIMITED_VERSION_HEX
    #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
  #endif
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 1
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_CLINE_IN_TRACEBACK
  #define CYTHON_CLINE_IN_TRACEBACK 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 1
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #endif
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #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_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 1
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #ifndef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #ifndef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #endif
  #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
  #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_GIL
  #define CYTHON_FAST_GIL 0
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL 1
  #endif
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
  #ifndef CYTHON_USE_FREELISTS
    #define CYTHON_USE_FREELISTS 0
  #endif
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #ifndef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #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
  #ifndef 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 || PY_VERSION_HEX >= 0x030B00A2
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #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_GIL
    #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6)
  #endif
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #if PY_VERSION_HEX < 0x030400a1
    #undef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #elif !defined(CYTHON_USE_TP_FINALIZE)
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #if PY_VERSION_HEX < 0x030600B1
    #undef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS 0
  #elif !defined(CYTHON_USE_DICT_VERSIONS)
    #define CYTHON_USE_DICT_VERSIONS  (PY_VERSION_HEX < 0x030C00A5)
  #endif
  #if PY_VERSION_HEX < 0x030700A3
    #undef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK 0
  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
    #define CYTHON_USE_EXC_INFO_STACK 1
  #endif
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
  #ifndef CYTHON_USE_FREELISTS
    #define CYTHON_USE_FREELISTS 1
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if !defined(CYTHON_VECTORCALL)
#define CYTHON_VECTORCALL  (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
#endif
#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_MAJOR_VERSION < 3
    #include "longintrepr.h"
  #endif
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(maybe_unused)
        #define CYTHON_UNUSED [[maybe_unused]]
      #endif
    #endif
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
  #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_USE_CPP_STD_MOVE
  #if defined(__cplusplus) && (\
    __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
    #define CYTHON_USE_CPP_STD_MOVE 1
  #else
    #define CYTHON_USE_CPP_STD_MOVE 0
  #endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
            typedef unsigned char     uint8_t;
            typedef unsigned short    uint16_t;
            typedef unsigned int      uint32_t;
        #else
            typedef unsigned __int8   uint8_t;
            typedef unsigned __int16  uint16_t;
            typedef unsigned __int32  uint32_t;
        #endif
    #endif
    #if _MSC_VER < 1300
        #ifdef _WIN64
            typedef unsigned long long  __pyx_uintptr_t;
        #else
            typedef unsigned int        __pyx_uintptr_t;
        #endif
    #else
        #ifdef _WIN64
            typedef unsigned __int64    __pyx_uintptr_t;
        #else
            typedef unsigned __int32    __pyx_uintptr_t;
        #endif
    #endif
#else
    #include <stdint.h>
    typedef uintptr_t  __pyx_uintptr_t;
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(fallthrough)
        #define CYTHON_FALLTHROUGH [[fallthrough]]
      #endif
    #endif
    #ifndef CYTHON_FALLTHROUGH
      #if __has_cpp_attribute(clang::fallthrough)
        #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
      #elif __has_cpp_attribute(gnu::fallthrough)
        #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
      #endif
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif
#ifdef __cplusplus
  template <typename T>
  struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
  #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
#else
  #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
#endif
#if CYTHON_COMPILING_IN_PYPY == 1
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
#else
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
#endif
#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))

#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

#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_DefaultClassType PyClass_Type
  #define __Pyx_PyCode_New(a, p, 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)
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_DefaultClassType PyType_Type
#if CYTHON_COMPILING_IN_LIMITED_API
    static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
                                                    PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                                    PyObject *fv, PyObject *cell, PyObject* fn,
                                                    PyObject *name, int fline, PyObject *lnos) {
        PyObject *exception_table = NULL;
        PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
        #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
        PyObject *version_info;
        PyObject *py_minor_version = NULL;
        #endif
        long minor_version = 0;
        PyObject *type, *value, *traceback;
        PyErr_Fetch(&type, &value, &traceback);
        #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
        minor_version = 11;
        #else
        if (!(version_info = PySys_GetObject("version_info"))) goto end;
        if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
        minor_version = PyLong_AsLong(py_minor_version);
        Py_DECREF(py_minor_version);
        if (minor_version == -1 && PyErr_Occurred()) goto end;
        #endif
        if (!(types_module = PyImport_ImportModule("types"))) goto end;
        if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
        if (minor_version <= 7) {
            (void)p;
            result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else if (minor_version <= 10) {
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else {
            if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
        }
    end:
        Py_XDECREF(code_type);
        Py_XDECREF(exception_table);
        Py_XDECREF(types_module);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return result;
    }
    #ifndef CO_OPTIMIZED
    #define CO_OPTIMIZED 0x0001
    #endif
    #ifndef CO_NEWLOCALS
    #define CO_NEWLOCALS 0x0002
    #endif
    #ifndef CO_VARARGS
    #define CO_VARARGS 0x0004
    #endif
    #ifndef CO_VARKEYWORDS
    #define CO_VARKEYWORDS 0x0008
    #endif
    #ifndef CO_ASYNC_GENERATOR
    #define CO_ASYNC_GENERATOR 0x0200
    #endif
    #ifndef CO_GENERATOR
    #define CO_GENERATOR 0x0020
    #endif
    #ifndef CO_COROUTINE
    #define CO_COROUTINE 0x0080
    #endif
#elif PY_VERSION_HEX >= 0x030B0000
  static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
                                                    PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                                    PyObject *fv, PyObject *cell, PyObject* fn,
                                                    PyObject *name, int fline, PyObject *lnos) {
    PyCodeObject *result;
    PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
    if (!empty_bytes) return NULL;
    result =
      #if PY_VERSION_HEX >= 0x030C0000
        PyUnstable_Code_NewWithPosOnlyArgs
      #else
        PyCode_NewWithPosOnlyArgs
      #endif
        (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes);
    Py_DECREF(empty_bytes);
    return result;
  }
#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_PyCode_New(a, p, 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
#endif
#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
  #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
#else
  #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
  #define __Pyx_Py_Is(x, y)  Py_Is(x, y)
#else
  #define __Pyx_Py_Is(x, y) ((x) == (y))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
  #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
#else
  #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
  #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
#else
  #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
  #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
#else
  #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
#endif
#define __Pyx_NoneAsNull(obj)  (__Pyx_Py_IsNone(obj) ? NULL : (obj))
#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
#else
  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
#endif
#ifndef CO_COROUTINE
  #define CO_COROUTINE 0x80
#endif
#ifndef CO_ASYNC_GENERATOR
  #define CO_ASYNC_GENERATOR 0x200
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef Py_TPFLAGS_SEQUENCE
  #define Py_TPFLAGS_SEQUENCE 0
#endif
#ifndef Py_TPFLAGS_MAPPING
  #define Py_TPFLAGS_MAPPING 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#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
  #if PY_VERSION_HEX >= 0x030d00A4
  #  define __Pyx_PyCFunctionFast PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
  #else
  #  define __Pyx_PyCFunctionFast _PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
  #endif
#endif
#if CYTHON_METH_FASTCALL
  #define __Pyx_METH_FASTCALL METH_FASTCALL
  #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
  #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
#else
  #define __Pyx_METH_FASTCALL METH_VARARGS
  #define __Pyx_PyCFunction_FastCall PyCFunction
  #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
#endif
#if CYTHON_VECTORCALL
  #define __pyx_vectorcallfunc vectorcallfunc
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  PY_VECTORCALL_ARGUMENTS_OFFSET
  #define __Pyx_PyVectorcall_NARGS(n)  PyVectorcall_NARGS((size_t)(n))
#elif CYTHON_BACKPORT_VECTORCALL
  typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
                                            size_t nargsf, PyObject *kwnames);
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  ((size_t)1 << (8 * sizeof(size_t) - 1))
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
#else
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  0
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(n))
#endif
#if PY_MAJOR_VERSION >= 0x030900B1
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_CheckExact(func)
#else
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_Check(func)
#endif
#define __Pyx_CyOrPyCFunction_Check(func)  PyCFunction_Check(func)
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  (((PyCFunctionObject*)(func))->m_ml->ml_meth)
#elif !CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  PyCFunction_GET_FUNCTION(func)
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FLAGS(func)  (((PyCFunctionObject*)(func))->m_ml->ml_flags)
static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
    return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
}
#endif
static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
#if CYTHON_COMPILING_IN_LIMITED_API
    return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
#else
    return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
#endif
}
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCFunction(func, cfunc)
#if __PYX_LIMITED_VERSION_HEX < 0x030900B1
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  ((void)m, PyType_FromSpecWithBases(s, b))
  typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
#else
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  PyType_FromModuleAndSpec(m, s, b)
  #define __Pyx_PyCMethod  PyCMethod
#endif
#ifndef METH_METHOD
  #define METH_METHOD 0x200
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyThreadState_Current PyThreadState_Get()
#elif !CYTHON_FAST_THREAD_STATE
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
#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 CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
{
    void *result;
    result = PyModule_GetState(op);
    if (!result)
        Py_FatalError("Couldn't find the module state");
    return result;
}
#endif
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype)  __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((func_ctype) PyType_GetSlot((type), Py_##name))
#else
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((type)->name)
#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 PY_MAJOR_VERSION < 3
    #if CYTHON_COMPILING_IN_PYPY
        #if PYPY_VERSION_NUM < 0x07030600
            #if defined(__cplusplus) && __cplusplus >= 201402L
                [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
            #elif defined(__GNUC__) || defined(__clang__)
                __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
            #elif defined(_MSC_VER)
                __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
            #endif
            static CYTHON_INLINE int PyGILState_Check(void) {
                return 0;
            }
        #else  // PYPY_VERSION_NUM < 0x07030600
        #endif  // PYPY_VERSION_NUM < 0x07030600
    #else
        static CYTHON_INLINE int PyGILState_Check(void) {
            PyThreadState * tstate = _PyThreadState_Current;
            return tstate && (tstate == PyGILState_GetThisThreadState());
        }
    #endif
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || 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 > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStrWithError(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
    PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
    if (res == NULL) PyErr_Clear();
    return res;
}
#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
#define __Pyx_PyDict_GetItemStrWithError  PyDict_GetItemWithError
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#else
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
#if CYTHON_COMPILING_IN_PYPY
    return PyDict_GetItem(dict, name);
#else
    PyDictEntry *ep;
    PyDictObject *mp = (PyDictObject*) dict;
    long hash = ((PyStringObject *) name)->ob_shash;
    assert(hash != -1);
    ep = (mp->ma_lookup)(mp, name, hash);
    if (ep == NULL) {
        return NULL;
    }
    return ep->me_value;
#endif
}
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#endif
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetFlags(tp)   (((PyTypeObject *)tp)->tp_flags)
  #define __Pyx_PyType_HasFeature(type, feature)  ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
  #define __Pyx_PyObject_GetIterNextFunc(obj)  (Py_TYPE(obj)->tp_iternext)
#else
  #define __Pyx_PyType_GetFlags(tp)   (PyType_GetFlags((PyTypeObject *)tp))
  #define __Pyx_PyType_HasFeature(type, feature)  PyType_HasFeature(type, feature)
  #define __Pyx_PyObject_GetIterNextFunc(obj)  PyIter_Next
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v)
#else
  #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v)
#endif
#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  {\
    PyTypeObject *type = Py_TYPE((PyObject*)obj);\
    assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
    PyObject_GC_Del(obj);\
    Py_DECREF(type);\
}
#else
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  PyObject_GC_Del(obj)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GetLength(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((void)u, 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((void)u, (0))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)u)
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GetLength(u))
#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_READY(op)       (0)
  #else
    #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                                0 : _PyUnicode_Ready((PyObject *)(op)))
  #endif
  #define __Pyx_PyUnicode_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)         ((int)PyUnicode_KIND(u))
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #else
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
    #else
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
    #endif
  #endif
#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) ? 65535U : 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((int)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] = (Py_UNICODE) 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
  #if !defined(PyUnicode_DecodeUnicodeEscape)
    #define PyUnicode_DecodeUnicodeEscape(s, size, errors)  PyUnicode_Decode(s, size, "unicode_escape", errors)
  #endif
  #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
    #undef PyUnicode_Contains
    #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
  #endif
  #if !defined(PyByteArray_Check)
    #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
  #endif
  #if !defined(PyObject_Format)
    #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
  #endif
#endif
#define __Pyx_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
#ifndef PyObject_Unicode
  #define PyObject_Unicode             PyObject_Str
#endif
#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
#if CYTHON_COMPILING_IN_CPYTHON
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#else
  #define __Pyx_PySequence_ListKeepNew(obj)  PySequence_List(obj)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        __Pyx_IS_TYPE(obj, &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
#else
  #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
  #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#else
  static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *module = PyImport_AddModule(name);
      Py_XINCREF(module);
      return module;
  }
#endif
#if 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 __Pyx_Py3Int_Check(op)       PyLong_Check(op)
  #define __Pyx_Py3Int_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
#else
  #define __Pyx_Py3Int_Check(op)       (PyLong_Check(op) || PyInt_Check(op))
  #define __Pyx_Py3Int_CheckExact(op)  (PyLong_CheckExact(op) || PyInt_CheckExact(op))
#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   __Pyx_PyIndex_AsHash_t
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsSsize_t
#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(WIN32) || defined(MS_WINDOWS)
  #if !defined(_USE_MATH_DEFINES)
    #define _USE_MATH_DEFINES
  #endif
#endif
#include <math.h>
#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_MARK_ERR_POS(f_index, lineno) \
    { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__;  (void)__pyx_clineno; }
#define __PYX_ERR(f_index, lineno, Ln_error) \
    { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }

#ifdef CYTHON_EXTERN_C
    #undef __PYX_EXTERN_C
    #define __PYX_EXTERN_C CYTHON_EXTERN_C
#elif defined(__PYX_EXTERN_C)
    #ifdef _MSC_VER
    #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
    #else
    #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
    #endif
#else
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE__cytimes__pddt
#define __PYX_HAVE_API__cytimes__pddt
/* Early includes */
#include <string.h>
#include <stdio.h>

    /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */
    
#include "numpy/arrayobject.h"
#include "numpy/ndarrayobject.h"
#include "numpy/ndarraytypes.h"
#include "numpy/arrayscalars.h"
#include "numpy/ufuncobject.h"
#include <stddef.h>
#include "pythread.h"
#include "datetime.h"

    /* Backport for Python 2.x */
    #if PY_MAJOR_VERSION < 3
        #ifndef PyDateTime_DELTA_GET_DAYS
            #define PyDateTime_DELTA_GET_DAYS(o) (((PyDateTime_Delta*)o)->days)
        #endif
        #ifndef PyDateTime_DELTA_GET_SECONDS
            #define PyDateTime_DELTA_GET_SECONDS(o) (((PyDateTime_Delta*)o)->seconds)
        #endif
        #ifndef PyDateTime_DELTA_GET_MICROSECONDS
            #define PyDateTime_DELTA_GET_MICROSECONDS(o) (((PyDateTime_Delta*)o)->microseconds)
        #endif
    #endif

    /* Backport for Python < 3.6 */
    #if PY_VERSION_HEX < 0x030600a4
        #ifndef PyDateTime_TIME_GET_FOLD
            #define PyDateTime_TIME_GET_FOLD(o) ((void)(o), 0)
        #endif
        #ifndef PyDateTime_DATE_GET_FOLD
            #define PyDateTime_DATE_GET_FOLD(o) ((void)(o), 0)
        #endif
    #endif

    /* Backport for Python < 3.6 */
    #if PY_VERSION_HEX < 0x030600a4
        #define __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)             ((void)(fold), PyDateTimeAPI->DateTime_FromDateAndTime(year, month, day, hour, minute, second,                 microsecond, tz, PyDateTimeAPI->DateTimeType))
        #define __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)             ((void)(fold), PyDateTimeAPI->Time_FromTime(hour, minute, second, microsecond, tz, PyDateTimeAPI->TimeType))
    #else /* For Python 3.6+ so that we can pass tz */
        #define __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)             PyDateTimeAPI->DateTime_FromDateAndTimeAndFold(year, month, day, hour, minute, second,                 microsecond, tz, fold, PyDateTimeAPI->DateTimeType)
        #define __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)             PyDateTimeAPI->Time_FromTimeAndFold(hour, minute, second, microsecond, tz, fold, PyDateTimeAPI->TimeType)
    #endif

    /* Backport for Python < 3.7 */
    #if PY_VERSION_HEX < 0x030700b1
        #define __Pyx_TimeZone_UTC NULL
        #define __Pyx_TimeZone_FromOffsetAndName(offset, name) ((void)(offset), (void)(name), (PyObject*)NULL)
    #else
        #define __Pyx_TimeZone_UTC PyDateTime_TimeZone_UTC
        #define __Pyx_TimeZone_FromOffsetAndName(offset, name) PyTimeZone_FromOffsetAndName(offset, name)
    #endif

    /* Backport for Python < 3.10 */
    #if PY_VERSION_HEX < 0x030a00a1
        #ifndef PyDateTime_TIME_GET_TZINFO
            #define PyDateTime_TIME_GET_TZINFO(o)                 ((((PyDateTime_Time*)o)->hastzinfo) ? ((PyDateTime_Time*)o)->tzinfo : Py_None)
        #endif
        #ifndef PyDateTime_DATE_GET_TZINFO
            #define PyDateTime_DATE_GET_TZINFO(o)                 ((((PyDateTime_DateTime*)o)->hastzinfo) ? ((PyDateTime_DateTime*)o)->tzinfo : Py_None)
        #endif
    #endif
    
#include <stdlib.h>
#include <time.h>
#include <stdint.h>

    #if PY_VERSION_HEX >= 0x030d00b1 || defined(PyTime_t)
        #define __Pyx_PyTime_t PyTime_t
    #else
        #define __Pyx_PyTime_t _PyTime_t
    #endif

    #if PY_VERSION_HEX >= 0x030d00b1 || defined(PyTime_TimeRaw)
        static CYTHON_INLINE __Pyx_PyTime_t __Pyx_PyTime_TimeUnchecked(void) {
            __Pyx_PyTime_t tic;
            (void) PyTime_TimeRaw(&tic);
            return tic;
        }
    #else
        #define __Pyx_PyTime_TimeUnchecked()  _PyTime_GetSystemClock()
    #endif

    #if PY_VERSION_HEX >= 0x030d00b1 || defined(PyTime_AsSecondsDouble)
        #define __Pyx_PyTime_AsSecondsDouble(t)  PyTime_AsSecondsDouble(t)
    #else
        #define __Pyx_PyTime_AsSecondsDouble(t)  _PyTime_AsSecondsDouble(t)
    #endif
    
#ifdef _OPENMP
#include <omp.h>
#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 <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if 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_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#define __Pyx_PyUnicode_FromOrdinal(o)       PyUnicode_FromOrdinal((int)o)
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#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);
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#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
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_VERSION_HEX >= 0x030C00A7
  #ifndef _PyLong_SIGN_MASK
    #define _PyLong_SIGN_MASK 3
  #endif
  #ifndef _PyLong_NON_SIZE_BITS
    #define _PyLong_NON_SIZE_BITS 3
  #endif
  #define __Pyx_PyLong_Sign(x)  (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
  #define __Pyx_PyLong_IsNeg(x)  ((__Pyx_PyLong_Sign(x) & 2) != 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (!__Pyx_PyLong_IsNeg(x))
  #define __Pyx_PyLong_IsZero(x)  (__Pyx_PyLong_Sign(x) & 1)
  #define __Pyx_PyLong_IsPos(x)  (__Pyx_PyLong_Sign(x) == 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  (__Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
  #define __Pyx_PyLong_SignedDigitCount(x)\
        ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
  #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
    #define __Pyx_PyLong_IsCompact(x)     PyUnstable_Long_IsCompact((PyLongObject*) x)
    #define __Pyx_PyLong_CompactValue(x)  PyUnstable_Long_CompactValue((PyLongObject*) x)
  #else
    #define __Pyx_PyLong_IsCompact(x)     (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
    #define __Pyx_PyLong_CompactValue(x)  ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
  #endif
  typedef Py_ssize_t  __Pyx_compact_pylong;
  typedef size_t  __Pyx_compact_upylong;
  #else
  #define __Pyx_PyLong_IsNeg(x)  (Py_SIZE(x) < 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (Py_SIZE(x) >= 0)
  #define __Pyx_PyLong_IsZero(x)  (Py_SIZE(x) == 0)
  #define __Pyx_PyLong_IsPos(x)  (Py_SIZE(x) > 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  __Pyx_sst_abs(Py_SIZE(x))
  #define __Pyx_PyLong_SignedDigitCount(x)  Py_SIZE(x)
  #define __Pyx_PyLong_IsCompact(x)  (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
  #define __Pyx_PyLong_CompactValue(x)\
        ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
  typedef sdigit  __Pyx_compact_pylong;
  typedef digit  __Pyx_compact_upylong;
  #endif
  #if PY_VERSION_HEX >= 0x030C00A5
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->long_value.ob_digit)
  #else
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->ob_digit)
  #endif
#endif
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
#include <string.h>
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] = (char) 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
#include <string.h>
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; }

#if !CYTHON_USE_MODULE_STATE
static PyObject *__pyx_m = NULL;
#endif
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm = __FILE__;
static const char *__pyx_filename;

/* Header.proto */
#if !defined(CYTHON_CCOMPLEX)
  #if defined(__cplusplus)
    #define CYTHON_CCOMPLEX 1
  #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
    #define CYTHON_CCOMPLEX 1
  #else
    #define CYTHON_CCOMPLEX 0
  #endif
#endif
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #include <complex>
  #else
    #include <complex.h>
  #endif
#endif
#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
  #undef _Complex_I
  #define _Complex_I 1.0fj
#endif

/* #### Code section: filename_table ### */

static const char *__pyx_f[] = {
  "src/cytimes/pddt.py",
  "__init__.cython-30.pxd",
  "contextvars.pxd",
  "datetime.pxd",
  "time.pxd",
  "src/cytimes/utils.pxd",
  "type.pxd",
  "bool.pxd",
  "complex.pxd",
  "src/cytimes/parser.pxd",
};
/* #### Code section: utility_code_proto_before_types ### */
/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

/* NoFastGil.proto */
#define __Pyx_PyGILState_Ensure PyGILState_Ensure
#define __Pyx_PyGILState_Release PyGILState_Release
#define __Pyx_FastGIL_Remember()
#define __Pyx_FastGIL_Forget()
#define __Pyx_FastGilFuncInit()

/* #### Code section: numeric_typedefs ### */

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":787
 * # in Cython to enable them only on the right systems.
 * 
 * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 */
typedef npy_int8 __pyx_t_5numpy_int8_t;

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":788
 * 
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t
 */
typedef npy_int16 __pyx_t_5numpy_int16_t;

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":789
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int64      int64_t
 * #ctypedef npy_int96      int96_t
 */
typedef npy_int32 __pyx_t_5numpy_int32_t;

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":790
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_int96      int96_t
 * #ctypedef npy_int128     int128_t
 */
typedef npy_int64 __pyx_t_5numpy_int64_t;

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":794
 * #ctypedef npy_int128     int128_t
 * 
 * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 */
typedef npy_uint8 __pyx_t_5numpy_uint8_t;

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":795
 * 
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t
 */
typedef npy_uint16 __pyx_t_5numpy_uint16_t;

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":796
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint64     uint64_t
 * #ctypedef npy_uint96     uint96_t
 */
typedef npy_uint32 __pyx_t_5numpy_uint32_t;

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":797
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_uint96     uint96_t
 * #ctypedef npy_uint128    uint128_t
 */
typedef npy_uint64 __pyx_t_5numpy_uint64_t;

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":801
 * #ctypedef npy_uint128    uint128_t
 * 
 * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_float64    float64_t
 * #ctypedef npy_float80    float80_t
 */
typedef npy_float32 __pyx_t_5numpy_float32_t;

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":802
 * 
 * ctypedef npy_float32    float32_t
 * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_float80    float80_t
 * #ctypedef npy_float128   float128_t
 */
typedef npy_float64 __pyx_t_5numpy_float64_t;

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":809
 * ctypedef double complex complex128_t
 * 
 * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 */
typedef npy_longlong __pyx_t_5numpy_longlong_t;

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":810
 * 
 * ctypedef npy_longlong   longlong_t
 * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_intp       intp_t
 */
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":812
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uintp      uintp_t
 * 
 */
typedef npy_intp __pyx_t_5numpy_intp_t;

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":813
 * 
 * ctypedef npy_intp       intp_t
 * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_double     float_t
 */
typedef npy_uintp __pyx_t_5numpy_uintp_t;

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":815
 * ctypedef npy_uintp      uintp_t
 * 
 * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t
 */
typedef npy_double __pyx_t_5numpy_float_t;

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":816
 * 
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longdouble longdouble_t
 * 
 */
typedef npy_double __pyx_t_5numpy_double_t;

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":817
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef float complex       cfloat_t
 */
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
/* #### Code section: complex_type_declarations ### */
/* Declarations.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    typedef ::std::complex< float > __pyx_t_float_complex;
  #else
    typedef float _Complex __pyx_t_float_complex;
  #endif
#else
    typedef struct { float real, imag; } __pyx_t_float_complex;
#endif
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);

/* Declarations.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    typedef ::std::complex< double > __pyx_t_double_complex;
  #else
    typedef double _Complex __pyx_t_double_complex;
  #endif
#else
    typedef struct { double real, imag; } __pyx_t_double_complex;
#endif
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);

/* Declarations.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    typedef ::std::complex< long double > __pyx_t_long_double_complex;
  #else
    typedef long double _Complex __pyx_t_long_double_complex;
  #endif
#else
    typedef struct { long double real, imag; } __pyx_t_long_double_complex;
#endif
static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);

/* #### Code section: type_declarations ### */

/*--- Type declarations ---*/
struct __pyx_obj_7cytimes_6parser_Configs;
struct __pyx_obj_7cytimes_6parser_Result;
struct __pyx_obj_7cytimes_6parser_Parser;
struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar;
struct __pyx_opt_args_7cpython_11contextvars_get_value;
struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default;

/* "cpython/contextvars.pxd":112
 * 
 * 
 * cdef inline object get_value(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the default value of the context variable,
 */
struct __pyx_opt_args_7cpython_11contextvars_get_value {
  int __pyx_n;
  PyObject *default_value;
};

/* "cpython/contextvars.pxd":129
 * 
 * 
 * cdef inline object get_value_no_default(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the provided default value if no such value was found.
 */
struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default {
  int __pyx_n;
  PyObject *default_value;
};

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1113
 * 
 * # Iterator API added in v1.6
 * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil             # <<<<<<<<<<<<<<
 * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil
 * 
 */
typedef int (*__pyx_t_5numpy_NpyIter_IterNextFunc)(NpyIter *);

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1114
 * # Iterator API added in v1.6
 * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil
 * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "numpy/arrayobject.h":
 */
typedef void (*__pyx_t_5numpy_NpyIter_GetMultiIndexFunc)(NpyIter *, npy_intp *);
struct __pyx_opt_args_7cpython_8datetime_time_new;
struct __pyx_opt_args_7cpython_8datetime_datetime_new;
struct __pyx_opt_args_7cpython_8datetime_timezone_new;
struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp;

/* "datetime.pxd":292
 * # Create time object using DateTime CAPI factory function
 * # Note, there are no range checks for any of the arguments.
 * cdef inline time time_new(int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)
 * 
 */
struct __pyx_opt_args_7cpython_8datetime_time_new {
  int __pyx_n;
  int fold;
};

/* "datetime.pxd":297
 * # Create datetime object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline datetime datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)
 * 
 */
struct __pyx_opt_args_7cpython_8datetime_datetime_new {
  int __pyx_n;
  int fold;
};

/* "datetime.pxd":306
 * 
 * # Create timedelta object using DateTime CAPI factory function.
 * cdef inline object timezone_new(object offset, object name=None):             # <<<<<<<<<<<<<<
 *     if PY_VERSION_HEX < 0x030700b1:
 *         raise RuntimeError('Time zones are not available from the C-API.')
 */
struct __pyx_opt_args_7cpython_8datetime_timezone_new {
  int __pyx_n;
  PyObject *name;
};

/* "datetime.pxd":312
 * 
 * # Create datetime object using DB API constructor.
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.DateTime_FromTimestamp(
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)
 */
struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp {
  int __pyx_n;
  PyObject *tz;
};
struct __pyx_opt_args_7cytimes_6parser__timelex;
struct __pyx_opt_args_7cytimes_6parser_6Parser_parse;
struct __pyx_opt_args_7cytimes_6parser_parse;
struct __pyx_opt_args_7cytimes_6parser_parse_dtobj;

/* "cytimes/parser.pxd":18
 * # Timelex
 * cpdef list timelex(str dtstr)
 * cdef list _timelex(str dtstr, Py_ssize_t start=?, Py_ssize_t size=?)             # <<<<<<<<<<<<<<
 * 
 * # Configs
 */
struct __pyx_opt_args_7cytimes_6parser__timelex {
  int __pyx_n;
  Py_ssize_t start;
  Py_ssize_t size;
};

/* "cytimes/parser.pxd":102
 *         str _tk1, _tk2, _tk3, _tk4
 *     # Parse
 *     cpdef datetime.datetime parse(             # <<<<<<<<<<<<<<
 *         self, str dtstr, object default=?,
 *         object year1st=?, object day1st=?,
 */
struct __pyx_opt_args_7cytimes_6parser_6Parser_parse {
  int __pyx_n;
  PyObject *__pyx_default;
  PyObject *year1st;
  PyObject *day1st;
  int ignoretz;
  int isoformat;
};

/* "cytimes/parser.pxd":151
 * cdef Parser _default_parser
 * 
 * cpdef datetime.datetime parse(             # <<<<<<<<<<<<<<
 *     str dtstr, object default=?,
 *     object year1st=?, object day1st=?,
 */
struct __pyx_opt_args_7cytimes_6parser_parse {
  int __pyx_n;
  PyObject *__pyx_default;
  PyObject *year1st;
  PyObject *day1st;
  int ignoretz;
  int isoformat;
  struct __pyx_obj_7cytimes_6parser_Configs *cfg;
};

/* "cytimes/parser.pxd":157
 *     Configs cfg=?)
 * 
 * cpdef datetime.datetime parse_dtobj(             # <<<<<<<<<<<<<<
 *     object dtobj, object default=?,
 *     object year1st=?, object day1st=?,
 */
struct __pyx_opt_args_7cytimes_6parser_parse_dtobj {
  int __pyx_n;
  PyObject *__pyx_default;
  PyObject *year1st;
  PyObject *day1st;
  int ignoretz;
  int isoformat;
  struct __pyx_obj_7cytimes_6parser_Configs *cfg;
};
struct __pyx_t_7cytimes_5utils_ymd;
typedef struct __pyx_t_7cytimes_5utils_ymd __pyx_t_7cytimes_5utils_ymd;
struct __pyx_t_7cytimes_5utils_hmsf;
typedef struct __pyx_t_7cytimes_5utils_hmsf __pyx_t_7cytimes_5utils_hmsf;
struct __pyx_t_7cytimes_5utils_iso;
typedef struct __pyx_t_7cytimes_5utils_iso __pyx_t_7cytimes_5utils_iso;
struct __pyx_opt_args_7cytimes_5utils_math_mod;
struct __pyx_opt_args_7cytimes_5utils_math_round_div;
struct __pyx_opt_args_7cytimes_5utils_math_ceil_div;
struct __pyx_opt_args_7cytimes_5utils_math_floor_div;
struct __pyx_opt_args_7cytimes_5utils_date_new;
struct __pyx_opt_args_7cytimes_5utils_date_now;
struct __pyx_opt_args_7cytimes_5utils_dt_new;
struct __pyx_opt_args_7cytimes_5utils_dt_now;
struct __pyx_opt_args_7cytimes_5utils_dt_to_tm;
struct __pyx_opt_args_7cytimes_5utils_dt_to_isoformat;
struct __pyx_opt_args_7cytimes_5utils_dt_to_us;
struct __pyx_opt_args_7cytimes_5utils_dt_to_seconds;
struct __pyx_opt_args_7cytimes_5utils_dt_to_ordinal;
struct __pyx_opt_args_7cytimes_5utils_dt_as_epoch;
struct __pyx_opt_args_7cytimes_5utils_dt_as_epoch_iso_W;
struct __pyx_opt_args_7cytimes_5utils_dt_fr_us;
struct __pyx_opt_args_7cytimes_5utils_dt_fr_seconds;
struct __pyx_opt_args_7cytimes_5utils_dt_fr_ordinal;
struct __pyx_opt_args_7cytimes_5utils_dt_fr_ts;
struct __pyx_opt_args_7cytimes_5utils_dt_combine;
struct __pyx_opt_args_7cytimes_5utils_dt_fr_date;
struct __pyx_opt_args_7cytimes_5utils_dt_add;
struct __pyx_opt_args_7cytimes_5utils_dt_astimezone;
struct __pyx_opt_args_7cytimes_5utils_time_new;
struct __pyx_opt_args_7cytimes_5utils_time_now;
struct __pyx_opt_args_7cytimes_5utils_time_to_isoformat;
struct __pyx_opt_args_7cytimes_5utils_time_to_us;
struct __pyx_opt_args_7cytimes_5utils_time_to_seconds;
struct __pyx_opt_args_7cytimes_5utils_time_fr_us;
struct __pyx_opt_args_7cytimes_5utils_time_fr_seconds;
struct __pyx_opt_args_7cytimes_5utils_td_new;
struct __pyx_opt_args_7cytimes_5utils_tz_new;
struct __pyx_opt_args_7cytimes_5utils_tz_local;
struct __pyx_opt_args_7cytimes_5utils_tz_local_seconds;
struct __pyx_opt_args_7cytimes_5utils_tz_name;
struct __pyx_opt_args_7cytimes_5utils_tz_dst;
struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset;
struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset_seconds;
struct __pyx_opt_args_7cytimes_5utils_tz_utcformat;
struct __pyx_opt_args_7cytimes_5utils_dt64_as_int64_us;
struct __pyx_opt_args_7cytimes_5utils__dt64_Y_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils__dt64_M_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils__dt64_W_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils_dt64_to_dt;
struct __pyx_opt_args_7cytimes_5utils__raise_dt64_as_int64_unit_error;
struct __pyx_opt_args_7cytimes_5utils_td64_as_int64_us;
struct __pyx_opt_args_7cytimes_5utils__td64_Y_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils__td64_M_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils__td64_W_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils_arr_clip;
struct __pyx_opt_args_7cytimes_5utils_arr_min;
struct __pyx_opt_args_7cytimes_5utils_arr_max;
struct __pyx_opt_args_7cytimes_5utils_arr_min_arr;
struct __pyx_opt_args_7cytimes_5utils_arr_max_arr;
struct __pyx_opt_args_7cytimes_5utils_arr_abs;
struct __pyx_opt_args_7cytimes_5utils_arr_mul;
struct __pyx_opt_args_7cytimes_5utils_arr_div;
struct __pyx_opt_args_7cytimes_5utils_arr_mod;
struct __pyx_opt_args_7cytimes_5utils_arr_round_div;
struct __pyx_opt_args_7cytimes_5utils_arr_ceil_div;
struct __pyx_opt_args_7cytimes_5utils_arr_floor_div;
struct __pyx_opt_args_7cytimes_5utils_arr_round_to_mul;
struct __pyx_opt_args_7cytimes_5utils_arr_ceil_to_mul;
struct __pyx_opt_args_7cytimes_5utils_arr_floor_to_mul;
struct __pyx_opt_args_7cytimes_5utils_arr_add_arr;
struct __pyx_opt_args_7cytimes_5utils_arr_sub_arr;
struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_year;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_quarter;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_month;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_weekday;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_day;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_hour;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_minute;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_second;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_millisecond;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_microsecond;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_nanosecond;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_times;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_isocalendar;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_is_leap_year;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_is_long_year;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_leap_bt_year;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_year;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_bf_year;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_of_year;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_quarter;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_bf_quarter;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_of_quarter;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_month;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_bf_month;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Q;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_W;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_h;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_m;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_s;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ms;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_us;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ns;
struct __pyx_opt_args_7cytimes_5utils__dt64arr_Y_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils__dt64arr_M_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils__dt64arr_W_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_iso_W;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_to_ordinal;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_to_ts;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_unit;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_round;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_ceil;
struct __pyx_opt_args_7cytimes_5utils_dt64arr_floor;
struct __pyx_opt_args_7cytimes_5utils__raise_dt64arr_as_int64_unit_error;
struct __pyx_opt_args_7cytimes_5utils_td64arr_as_int64_us;
struct __pyx_opt_args_7cytimes_5utils__td64arr_Y_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils__td64arr_M_as_int64_D;
struct __pyx_opt_args_7cytimes_5utils__td64arr_W_as_int64_D;

/* "utils.pxd":108
 * 
 * # Struct -----------------------------------------------------------------------------------------------
 * ctypedef struct ymd:             # <<<<<<<<<<<<<<
 *     int year
 *     int month
 */
struct __pyx_t_7cytimes_5utils_ymd {
  int year;
  int month;
  int day;
};

/* "utils.pxd":113
 *     int day
 * 
 * ctypedef struct hmsf:             # <<<<<<<<<<<<<<
 *     int hour
 *     int minute
 */
struct __pyx_t_7cytimes_5utils_hmsf {
  int hour;
  int minute;
  int second;
  int microsecond;
};

/* "utils.pxd":119
 *     int microsecond
 * 
 * ctypedef struct iso:             # <<<<<<<<<<<<<<
 *     int year
 *     int week
 */
struct __pyx_t_7cytimes_5utils_iso {
  int year;
  int week;
  int weekday;
};

/* "utils.pxd":137
 * 
 * # Math -------------------------------------------------------------------------------------------------
 * cdef inline long long math_mod(long long num, long long factor, long long offset=0):             # <<<<<<<<<<<<<<
 *     """Computes the modulo of a number by the factor, handling
 *     negative numbers accoring to Python's modulo semantics `<'int'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_math_mod {
  int __pyx_n;
  PY_LONG_LONG offset;
};

/* "utils.pxd":162
 *     return r + offset
 * 
 * cdef inline long long math_round_div(long long num, long long factor, long long offset=0):             # <<<<<<<<<<<<<<
 *     """Divides a number by the factor and rounds the result to
 *     the nearest integer (half away from zero), handling negative
 */
struct __pyx_opt_args_7cytimes_5utils_math_round_div {
  int __pyx_n;
  PY_LONG_LONG offset;
};

/* "utils.pxd":189
 *     return q + offset
 * 
 * cdef inline long long math_ceil_div(long long num, long long factor, long long offset=0):             # <<<<<<<<<<<<<<
 *     """Divides a number by the factor and rounds the result up
 *     to the nearest integer, handling negative numbers accoring
 */
struct __pyx_opt_args_7cytimes_5utils_math_ceil_div {
  int __pyx_n;
  PY_LONG_LONG offset;
};

/* "utils.pxd":213
 *     return q + offset
 * 
 * cdef inline long long math_floor_div(long long num, long long factor, long long offset=0):             # <<<<<<<<<<<<<<
 *     """Divides a number by the factor and rounds the result
 *     down to the nearest integer, handling negative numbers
 */
struct __pyx_opt_args_7cytimes_5utils_math_floor_div {
  int __pyx_n;
  PY_LONG_LONG offset;
};

/* "utils.pxd":1110
 * # datetime.date ----------------------------------------------------------------------------------------
 * # . generate
 * cdef inline datetime.date date_new(int year=1, int month=1, int day=1):             # <<<<<<<<<<<<<<
 *     """Create a new `<'datetime.date'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_date_new {
  int __pyx_n;
  int year;
  int month;
  int day;
};

/* "utils.pxd":1124
 *     return datetime.date_new(year, month, day)
 * 
 * cdef inline datetime.date date_now(object tz=None):             # <<<<<<<<<<<<<<
 *     """Get the current date `<'datetime.date'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_date_now {
  int __pyx_n;
  PyObject *tz;
};

/* "utils.pxd":1233
 * # datetime.datetime ------------------------------------------------------------------------------------
 * # . generate
 * cdef inline datetime.datetime dt_new(             # <<<<<<<<<<<<<<
 *     int year=1, int month=1, int day=1,
 *     int hour=0, int minute=0, int second=0,
 */
struct __pyx_opt_args_7cytimes_5utils_dt_new {
  int __pyx_n;
  int year;
  int month;
  int day;
  int hour;
  int minute;
  int second;
  int microsecond;
  PyObject *tz;
  int fold;
};

/* "utils.pxd":1259
 *     )
 * 
 * cdef inline datetime.datetime dt_now(object tz=None):             # <<<<<<<<<<<<<<
 *     """Get the current datetime `<'datetime.datetime'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_dt_now {
  int __pyx_n;
  PyObject *tz;
};

/* "utils.pxd":1348
 * 
 * # . conversion: to
 * cdef inline tm dt_to_tm(datetime.datetime dt, bint utc=False) except *:             # <<<<<<<<<<<<<<
 *     """Convert datetime to `<'struct:tm'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_dt_to_tm {
  int __pyx_n;
  int utc;
};

/* "utils.pxd":1503
 *     return tm_strftime(dt_to_tm(dt, False), "".join(fmt_l))
 * 
 * cdef inline str dt_to_isoformat(datetime.datetime dt, str sep="T", bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert datetime to string in ISO format `<'str'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_dt_to_isoformat {
  int __pyx_n;
  PyObject *sep;
  int utc;
};

/* "utils.pxd":1534
 *         )
 * 
 * cdef inline long long dt_to_us(datetime.datetime dt, bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert datetime to `EPOCH` microseconds `<'int'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_dt_to_us {
  int __pyx_n;
  int utc;
};

/* "utils.pxd":1559
 *     return us
 * 
 * cdef inline double dt_to_seconds(datetime.datetime dt, bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert datetime to `EPOCH` seconds `<'float'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_dt_to_seconds {
  int __pyx_n;
  int utc;
};

/* "utils.pxd":1584
 *     return ss
 * 
 * cdef inline int dt_to_ordinal(datetime.datetime dt, bint utc=False) except -1:             # <<<<<<<<<<<<<<
 *     """Convert datetime to Gregorian ordinal days `<'int'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_dt_to_ordinal {
  int __pyx_n;
  int utc;
};

/* "utils.pxd":1663
 *     return ts + (<double> dt.microsecond) / 1_000_000
 * 
 * cdef inline long long dt_as_epoch(datetime.datetime dt, str unit, bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert datetime to `EPOCH` integer according to the given unit resolution `<'int'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_dt_as_epoch {
  int __pyx_n;
  int utc;
};

/* "utils.pxd":1766
 *     raise ValueError("unsupported datetime unit '%s'." % unit)
 * 
 * cdef inline long long dt_as_epoch_iso_W(datetime.datetime dt, int weekday, bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert datetime to `EPOCH` integer under 'W' (weeks) resolution `<'int'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_dt_as_epoch_iso_W {
  int __pyx_n;
  int utc;
};

/* "utils.pxd":1784
 * 
 * # . conversion: from
 * cdef inline datetime.datetime dt_fr_us(long long val, object tz=None):             # <<<<<<<<<<<<<<
 *     """Create datetime from `EPOCH` microseconds (int) `<'datetime.datetime'>`."""
 *     # Compute ymd & hmsf
 */
struct __pyx_opt_args_7cytimes_5utils_dt_fr_us {
  int __pyx_n;
  PyObject *tz;
};

/* "utils.pxd":1798
 *     )
 * 
 * cdef inline datetime.datetime dt_fr_seconds(double val, object tz=None):             # <<<<<<<<<<<<<<
 *     """Create datetime from `EPOCH` seconds (float) `<'datetime.datetime'>`."""
 *     return dt_fr_us(<long long> int(val * US_SECOND), tz)
 */
struct __pyx_opt_args_7cytimes_5utils_dt_fr_seconds {
  int __pyx_n;
  PyObject *tz;
};

/* "utils.pxd":1802
 *     return dt_fr_us(<long long> int(val * US_SECOND), tz)
 * 
 * cdef inline datetime.datetime dt_fr_ordinal(int val, object tz=None):             # <<<<<<<<<<<<<<
 *     """Create datetime from Gregorian ordinal days (int) `<'datetime.datetime'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_dt_fr_ordinal {
  int __pyx_n;
  PyObject *tz;
};

/* "utils.pxd":1811
 *     return datetime.datetime_new(_ymd.year, _ymd.month, _ymd.day, 0, 0, 0, 0, tz, 0)
 * 
 * cdef inline datetime.datetime dt_fr_ts(double val, object tz=None):             # <<<<<<<<<<<<<<
 *     """Create datetime from `EPOCH` timestamp (float) `<'datetime.datetime'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_dt_fr_ts {
  int __pyx_n;
  PyObject *tz;
};

/* "utils.pxd":1819
 *     return datetime.datetime_from_timestamp(val, tz)
 * 
 * cdef inline datetime.datetime dt_combine(datetime.date date=None, datetime.time time=None, tz: object = None):             # <<<<<<<<<<<<<<
 *     """Create datetime by combining date & time `<'datetime.datetime'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_dt_combine {
  int __pyx_n;
  PyDateTime_Date *date;
  PyDateTime_Time *time;
  PyObject *tz;
};

/* "utils.pxd":1845
 *     return datetime.datetime_new(yy, mm, dd, hh, mi, ss, us, tz, fold)
 * 
 * cdef inline datetime.datetime dt_fr_date(datetime.date date, object tz=None):             # <<<<<<<<<<<<<<
 *     """Create datetime from date (include subclass) `<'datetime.datetime'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_dt_fr_date {
  int __pyx_n;
  PyObject *tz;
};

/* "utils.pxd":1872
 * 
 * # . manipulation
 * cdef inline datetime.datetime dt_add(datetime.datetime dt, int days=0, int seconds=0, int microseconds=0):             # <<<<<<<<<<<<<<
 *     """Add delta to datetime `<'datetime.datetime'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_dt_add {
  int __pyx_n;
  int days;
  int seconds;
  int microseconds;
};

/* "utils.pxd":1939
 *     )
 * 
 * cdef inline datetime.datetime dt_astimezone(datetime.datetime dt, object tz=None):             # <<<<<<<<<<<<<<
 *     """Convert the datetime timezone `<'datetime.datetime'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_dt_astimezone {
  int __pyx_n;
  PyObject *tz;
};

/* "utils.pxd":1980
 * # datetime.time ----------------------------------------------------------------------------------------
 * # . generate
 * cdef inline datetime.time time_new(             # <<<<<<<<<<<<<<
 *     int hour=0, int minute=0, int second=0,
 *     int microsecond=0, object tz=None, int fold=0,
 */
struct __pyx_opt_args_7cytimes_5utils_time_new {
  int __pyx_n;
  int hour;
  int minute;
  int second;
  int microsecond;
  PyObject *tz;
  int fold;
};

/* "utils.pxd":1998
 *     )
 * 
 * cdef inline datetime.time time_now(object tz=None):             # <<<<<<<<<<<<<<
 *     """Get the current time `<'datetime.time'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_time_now {
  int __pyx_n;
  PyObject *tz;
};

/* "utils.pxd":2059
 * 
 * # . conversion
 * cdef inline str time_to_isoformat(datetime.time time, bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert time to string in ISO format `<'str'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_time_to_isoformat {
  int __pyx_n;
  int utc;
};

/* "utils.pxd":2078
 *         return "%02d:%02d:%02d.%06d%s" % (time.hour, time.minute, time.second, us, utc_fmt)
 * 
 * cdef inline long long time_to_us(datetime.time time, bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert time to microseconds `<'int'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_time_to_us {
  int __pyx_n;
  int utc;
};

/* "utils.pxd":2097
 *     return us
 * 
 * cdef inline double time_to_seconds(datetime.time time, bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert time to seconds `<'float'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_time_to_seconds {
  int __pyx_n;
  int utc;
};

/* "utils.pxd":2116
 *     return ss
 * 
 * cdef inline datetime.time time_fr_us(long long val, object tz=None):             # <<<<<<<<<<<<<<
 *     """Create time from microseconds (int) `<'datetime.time'>`."""
 *     _hmsf = hmsf_fr_us(val)
 */
struct __pyx_opt_args_7cytimes_5utils_time_fr_us {
  int __pyx_n;
  PyObject *tz;
};

/* "utils.pxd":2123
 *     )
 * 
 * cdef inline datetime.time time_fr_seconds(double val, object tz=None):             # <<<<<<<<<<<<<<
 *     """Create time from seconds (float) `<'datetime.time'>`."""
 *     return time_fr_us(<long long> int(val * US_SECOND), tz)
 */
struct __pyx_opt_args_7cytimes_5utils_time_fr_seconds {
  int __pyx_n;
  PyObject *tz;
};

/* "utils.pxd":2143
 * # datetime.timedelta -----------------------------------------------------------------------------------
 * # . generate
 * cdef inline datetime.timedelta td_new(int days=0, int seconds=0, int microseconds=0):             # <<<<<<<<<<<<<<
 *     """Create a new timedelta `<'datetime.timedelta'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_td_new {
  int __pyx_n;
  int days;
  int seconds;
  int microseconds;
};

/* "utils.pxd":2277
 * # datetime.tzinfo --------------------------------------------------------------------------------------
 * # . generate
 * cdef inline object tz_new(int hours=0, int minites=0, int seconds=0):             # <<<<<<<<<<<<<<
 *     """Create a new timezone `<'datetime.timezone'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_tz_new {
  int __pyx_n;
  int hours;
  int minites;
  int seconds;
};

/* "utils.pxd":2291
 *     return datetime.timezone_new(datetime.timedelta_new(0, offset, 0), None)
 * 
 * cdef inline object tz_local(datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Get the local timezone `<'datetime.timezone'>`."""
 *     return _LOCAL_TZ
 */
struct __pyx_opt_args_7cytimes_5utils_tz_local {
  int __pyx_n;
  PyDateTime_DateTime *dt;
};

/* "utils.pxd":2295
 *     return _LOCAL_TZ
 * 
 * cdef inline int tz_local_seconds(datetime.datetime dt=None) except -200_000:             # <<<<<<<<<<<<<<
 *     """Get the local timezone offset in total seconds `<'int'>`."""
 *     # Convert to timestamp
 */
struct __pyx_opt_args_7cytimes_5utils_tz_local_seconds {
  int __pyx_n;
  PyDateTime_DateTime *dt;
};

/* "utils.pxd":2345
 * 
 * # . access
 * cdef inline str tz_name(object tz, datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Access the name of the tzinfo `<'str/None'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_tz_name {
  int __pyx_n;
  PyDateTime_DateTime *dt;
};

/* "utils.pxd":2360
 *         raise err
 * 
 * cdef inline datetime.timedelta tz_dst(object tz, datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Access the 'dst' of the tzinfo `<'datetime.timedelta'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_tz_dst {
  int __pyx_n;
  PyDateTime_DateTime *dt;
};

/* "utils.pxd":2375
 *         raise err
 * 
 * cdef inline datetime.timedelta tz_utcoffset(object tz, datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Access the 'utcoffset' of the tzinfo `<'datetime.timedelta'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset {
  int __pyx_n;
  PyDateTime_DateTime *dt;
};

/* "utils.pxd":2390
 *         raise err
 * 
 * cdef inline int tz_utcoffset_seconds(object tz, datetime.datetime dt=None) except -200_000:             # <<<<<<<<<<<<<<
 *     """Access the 'utcoffset' of the tzinfo in total seconds `<'int'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset_seconds {
  int __pyx_n;
  PyDateTime_DateTime *dt;
};

/* "utils.pxd":2403
 *     return datetime.timedelta_days(offset) * SS_DAY + datetime.timedelta_seconds(offset)
 * 
 * cdef inline str tz_utcformat(object tz, datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Access tzinfo as string in UTC format ('+/-HH:MM') `<'str/None'>`."""
 *     utc_off = tz_utcoffset(tz, dt)
 */
struct __pyx_opt_args_7cytimes_5utils_tz_utcformat {
  int __pyx_n;
  PyDateTime_DateTime *dt;
};

/* "utils.pxd":2567
 * 
 * # . conversion
 * cdef inline np.npy_int64 dt64_as_int64_us(object dt64, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.datetime64 to int64 under 'us' (microsecond) resolution `<'int'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_dt64_as_int64_us {
  int __pyx_n;
  npy_int64 offset;
};

/* "utils.pxd":2602
 *     _raise_dt64_as_int64_unit_error("us", unit)
 * 
 * cdef inline np.npy_int64 _dt64_Y_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Convert the value of np.datetime64[Y] to int64 under 'D' resolution `<'int'>`."""
 *     cdef:
 */
struct __pyx_opt_args_7cytimes_5utils__dt64_Y_as_int64_D {
  int __pyx_n;
  npy_int64 factor;
  npy_int64 offset;
};

/* "utils.pxd":2615
 *     return (val * 365 + leaps) * factor + offset
 * 
 * cdef inline np.npy_int64 _dt64_M_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Convert the value of np.datetime64[M] to int64 under 'D' resolution `<'int'>`."""
 *     cdef:
 */
struct __pyx_opt_args_7cytimes_5utils__dt64_M_as_int64_D {
  int __pyx_n;
  npy_int64 factor;
  npy_int64 offset;
};

/* "utils.pxd":2630
 *     return (year_ep * 365 + leaps + days_bf_month(year, month)) * factor + offset
 * 
 * cdef inline np.npy_int64 _dt64_W_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Convert the value of np.datetime64[W] to int64 under 'D' resolution `<'int'>`."""
 *     return val * 7 * factor + offset
 */
struct __pyx_opt_args_7cytimes_5utils__dt64_W_as_int64_D {
  int __pyx_n;
  npy_int64 factor;
  npy_int64 offset;
};

/* "utils.pxd":2634
 *     return val * 7 * factor + offset
 * 
 * cdef inline datetime.datetime dt64_to_dt(object dt64, tz: object=None):             # <<<<<<<<<<<<<<
 *     """Convert np.datetime64 to datetime `<'datetime.datetime'>`."""
 *     return dt_fr_us(dt64_as_int64_us(dt64, 0), tz)
 */
struct __pyx_opt_args_7cytimes_5utils_dt64_to_dt {
  int __pyx_n;
  PyObject *tz;
};

/* "utils.pxd":2639
 * 
 * # . errors: internal
 * cdef inline bint _raise_dt64_as_int64_unit_error(str reso, int unit, bint is_dt64=True) except -1:             # <<<<<<<<<<<<<<
 *     """(internal) Raise unsupported unit for dt/td_as_int*() function."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 */
struct __pyx_opt_args_7cytimes_5utils__raise_dt64_as_int64_unit_error {
  int __pyx_n;
  int is_dt64;
};

/* "utils.pxd":2675
 * 
 * # . conversion
 * cdef inline np.npy_int64 td64_as_int64_us(object td64, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.timedelta64 to int64 under 'us' (microsecond) resolution `<'int'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_td64_as_int64_us {
  int __pyx_n;
  npy_int64 offset;
};

/* "utils.pxd":2710
 *     _raise_dt64_as_int64_unit_error("us", unit, False)
 * 
 * cdef inline np.npy_int64 _td64_Y_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Convert the value of np.timedelta[Y] to int64 under 'D' resolution `<'int'>`."""
 *     # Average number of days in a year: 365.2425
 */
struct __pyx_opt_args_7cytimes_5utils__td64_Y_as_int64_D {
  int __pyx_n;
  npy_int64 factor;
  npy_int64 offset;
};

/* "utils.pxd":2732
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)
 * 
 * cdef inline np.npy_int64 _td64_M_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Convert the value of np.timedelta[M] to int64 under 'D' resolution `<'int'>`."""
 *     # Average number of days in a month: 30.436875 (365.2425 / 12)
 */
struct __pyx_opt_args_7cytimes_5utils__td64_M_as_int64_D {
  int __pyx_n;
  npy_int64 factor;
  npy_int64 offset;
};

/* "utils.pxd":2754
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)
 * 
 * cdef inline np.npy_int64 _td64_W_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Convert the value of np.timedelta[W] to int64 under 'D' resolution `<'int'>`."""
 *     return val * 7 * factor + offset
 */
struct __pyx_opt_args_7cytimes_5utils__td64_W_as_int64_D {
  int __pyx_n;
  npy_int64 factor;
  npy_int64 offset;
};

/* "utils.pxd":2850
 * 
 * # . range
 * cdef inline np.ndarray arr_clip(np.ndarray arr, np.npy_int64 minimum, np.npy_int64 maximum, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Clip the values of an ndarray between 'minimum' and 'maximum' value `<'ndarray[int64]'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_arr_clip {
  int __pyx_n;
  npy_int64 offset;
};

/* "utils.pxd":2879
 *     return res
 * 
 * cdef inline np.ndarray arr_min(np.ndarray arr, np.npy_int64 value, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the minimum values between the ndarray and the 'value `<'ndarray[int64]'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_arr_min {
  int __pyx_n;
  npy_int64 offset;
};

/* "utils.pxd":2903
 *     return res
 * 
 * cdef inline np.ndarray arr_max(np.ndarray arr, np.npy_int64 value, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the maximum values between the ndarray and the 'value' `<'ndarray[int64]'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_arr_max {
  int __pyx_n;
  npy_int64 offset;
};

/* "utils.pxd":2927
 *     return res
 * 
 * cdef inline np.ndarray arr_min_arr(np.ndarray arr1, np.ndarray arr2, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the minimum values between two ndarrays `<'ndarray[int64]'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_arr_min_arr {
  int __pyx_n;
  npy_int64 offset;
};

/* "utils.pxd":2955
 *     return res
 * 
 * cdef inline np.ndarray arr_max_arr(np.ndarray arr1, np.ndarray arr2, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the maxmimum values between two ndarrays `<'ndarray[int64]'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_arr_max_arr {
  int __pyx_n;
  npy_int64 offset;
};

/* "utils.pxd":2984
 * 
 * # . arithmetic
 * cdef inline np.ndarray arr_abs(np.ndarray arr, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Compute the absolute values of the ndarray `<'ndarray[int64]'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_arr_abs {
  int __pyx_n;
  npy_int64 offset;
};

/* "utils.pxd":3040
 *     return res
 * 
 * cdef inline np.ndarray arr_mul(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Multiply the values of the ndarray by the factor `<'ndarray[int64]'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_arr_mul {
  int __pyx_n;
  npy_int64 offset;
};

/* "utils.pxd":3068
 *     return res
 * 
 * cdef inline np.ndarray arr_div(np.ndarray arr, np.npy_float64 factor, np.npy_float64 offset=0):             # <<<<<<<<<<<<<<
 *     """Divides the values of the ndarray by the factor, handling negative
 *     numbers accoring to Python's division semantics `<'ndarray[float64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_arr_div {
  int __pyx_n;
  npy_float64 offset;
};

/* "utils.pxd":3098
 *     return res
 * 
 * cdef inline np.ndarray arr_mod(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Computes the modulo of the values of the ndarray by the
 *     factor, handling negative numbers according to Python's modulo
 */
struct __pyx_opt_args_7cytimes_5utils_arr_mod {
  int __pyx_n;
  npy_int64 offset;
};

/* "utils.pxd":3136
 *     return res
 * 
 * cdef inline np.ndarray arr_round_div(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Divides the values of the ndarray by the factor and rounds to the
 *     nearest integers (half away from zero), handling negative numbers
 */
struct __pyx_opt_args_7cytimes_5utils_arr_round_div {
  int __pyx_n;
  npy_int64 offset;
};

/* "utils.pxd":3180
 *     return res
 * 
 * cdef inline np.ndarray arr_ceil_div(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Divides the values of the ndarray by the factor and rounds
 *     up to the nearest integers, handling negative numbers accoring
 */
struct __pyx_opt_args_7cytimes_5utils_arr_ceil_div {
  int __pyx_n;
  npy_int64 offset;
};

/* "utils.pxd":3224
 *     return res
 * 
 * cdef inline np.ndarray arr_floor_div(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Divides the values of the ndarray by the factor and rounds down
 *     to the nearest integers, handling negative numbers accoring to
 */
struct __pyx_opt_args_7cytimes_5utils_arr_floor_div {
  int __pyx_n;
  npy_int64 offset;
};

/* "utils.pxd":3268
 *     return res
 * 
 * cdef inline np.ndarray arr_round_to_mul(np.ndarray arr, np.npy_int64 factor, np.npy_int64 multiple = 0, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Round to multiple. Divides the values of the ndarray by the factor and rounds
 *     to the nearest integers (half away from zero), handling negative numbers accoring
 */
struct __pyx_opt_args_7cytimes_5utils_arr_round_to_mul {
  int __pyx_n;
  npy_int64 multiple;
  npy_int64 offset;
};

/* "utils.pxd":3316
 *     return res
 * 
 * cdef inline np.ndarray arr_ceil_to_mul(np.ndarray arr, np.npy_int64 factor, np.npy_int64 multiple = 0, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Ceil to multiple. Divides the values of the ndarray by the factor and
 *     rounds up to the nearest integers, handling negative numbers accoring to
 */
struct __pyx_opt_args_7cytimes_5utils_arr_ceil_to_mul {
  int __pyx_n;
  npy_int64 multiple;
  npy_int64 offset;
};

/* "utils.pxd":3364
 *     return res
 * 
 * cdef inline np.ndarray arr_floor_to_mul(np.ndarray arr, np.npy_int64 factor, np.npy_int64 multiple = 0, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Floor to multiple. Divides the values of the ndarray by the factor and
 *     rounds down to the nearest integers, handling negative numbers accoring to
 */
struct __pyx_opt_args_7cytimes_5utils_arr_floor_to_mul {
  int __pyx_n;
  npy_int64 multiple;
  npy_int64 offset;
};

/* "utils.pxd":3412
 *     return res
 * 
 * cdef inline np.ndarray arr_add_arr(np.ndarray arr1, np.ndarray arr2, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Addition between two ndarrays `<'ndarray[int64]'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_arr_add_arr {
  int __pyx_n;
  npy_int64 offset;
};

/* "utils.pxd":3440
 *     return res
 * 
 * cdef inline np.ndarray arr_sub_arr(np.ndarray arr1, np.ndarray arr2, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Subtraction between two ndarrays `<'ndarray[int64]'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_arr_sub_arr {
  int __pyx_n;
  npy_int64 offset;
};

/* "utils.pxd":3585
 * 
 * # . range check
 * cdef inline bint is_dt64arr_ns_safe(np.ndarray arr, str arr_unit=None) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the ndarray[datetime64] is within
 *     nanoseconds conversion range `<'bool'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe {
  int __pyx_n;
  PyObject *arr_unit;
};

/* "utils.pxd":3653
 * 
 * # . access
 * cdef inline np.ndarray dt64arr_year(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the year values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[Y]
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_year {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":3670
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_quarter(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the quarter values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_quarter {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":3687
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_month(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the month values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_month {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":3704
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_weekday(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the weekday values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_weekday {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":3721
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_day(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the day values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_day {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":3764
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_hour(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the hour values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_hour {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":3781
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_minute(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the minute values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_minute {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":3798
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_second(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the second values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_second {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":3815
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_millisecond(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the millisecond values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_millisecond {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":3832
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_microsecond(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the microsecond values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_microsecond {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":3849
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_nanosecond(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the nanosecond values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_nanosecond {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":3866
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_times(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the times values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Empty array
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_times {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":3918
 * 
 * # . calendar
 * cdef inline np.ndarray dt64arr_isocalendar(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the ISO calendar values of the ndarray[datetime64] `<'ndarray[int64]'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_isocalendar {
  int __pyx_n;
  PyObject *arr_unit;
};

/* "utils.pxd":3952
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_is_leap_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Check if the ndarray[datetime64] are leap years `<'ndarray[bool]'>`."""
 *     # Cast to int64[Y]
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_is_leap_year {
  int __pyx_n;
  PyObject *arr_unit;
};

/* "utils.pxd":3969
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_is_long_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Check if the ndarray[datetime64] are long years
 *     (maximum ISO week number equal 53) `<'ndarray[bool]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_is_long_year {
  int __pyx_n;
  PyObject *arr_unit;
};

/* "utils.pxd":3988
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_leap_bt_year(np.ndarray arr, np.npy_int64 year, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Calcuate the number of leap years between the ndarray[datetime64]
 *     and the passed in 'year' value `<'ndarray[int64]'>`."""
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_leap_bt_year {
  int __pyx_n;
  PyObject *arr_unit;
};

/* "utils.pxd":4006
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_in_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the maximum days (365, 366) in the year
 *     of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_year {
  int __pyx_n;
  PyObject *arr_unit;
};

/* "utils.pxd":4024
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_bf_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the np.ndarray[datetime64]
 *     and the 1st day of the 1AD `<'ndarray[int64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_bf_year {
  int __pyx_n;
  PyObject *arr_unit;
};

/* "utils.pxd":4043
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_of_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the np.ndarray[datetime64]
 *     and the 1st day of the array years `<'ndarray[int64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_of_year {
  int __pyx_n;
  PyObject *arr_unit;
};

/* "utils.pxd":4063
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_in_quarter(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the maximum days in the quarter of the np.npdarray[datetime64] `<'int'>`."""
 *     # Cast to int64[D]
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_quarter {
  int __pyx_n;
  PyObject *arr_unit;
};

/* "utils.pxd":4081
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_bf_quarter(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the 1st day of the year
 *     of the np.ndarray[datetime64] and the 1st day of its quarter `<'int'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_bf_quarter {
  int __pyx_n;
  PyObject *arr_unit;
};

/* "utils.pxd":4101
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_of_quarter(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the 1st day of the quarter
 *     of the np.ndarray[datetime64] and the its date `<'int'>`."""
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_of_quarter {
  int __pyx_n;
  PyObject *arr_unit;
};

/* "utils.pxd":4120
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_in_month(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the maximum days in the month of the ndarray[datetime64] <'ndarray[int64]'>."""
 *     # Cast to int64[M]
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_month {
  int __pyx_n;
  PyObject *arr_unit;
};

/* "utils.pxd":4145
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_bf_month(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the 1st day of the
 *     np.ndarray[datetime64] and the 1st day of its month `<'int'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_bf_month {
  int __pyx_n;
  PyObject *arr_unit;
};

/* "utils.pxd":4197
 *     return arr.astype("datetime64[%s]" % unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64(np.ndarray arr, str unit, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 according to the given
 *     'unit' resolution `<'ndarray[int64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":4250
 *     )
 * 
 * cdef inline np.ndarray dt64arr_as_int64_Y(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'Y' (year)
 *     resolution `<'ndarray[int64]>`.
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":4331
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_as_int64_Q(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'Q' (quarter)
 *     resolution `<'ndarray[int64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Q {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":4351
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_as_int64_M(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'M' (month)
 *     resolution `<'ndarray[int64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":4437
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_as_int64_W(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'W' (week)
 *     resolution `<'ndarray[int64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_W {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":4460
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_as_int64_D(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'D' (day)
 *     resolution `<'ndarray[int64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":4509
 *     _raise_dt64arr_as_int64_unit_error("D", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_h(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'h' (hour)
 *     resolution `<'ndarray[int64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_h {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":4558
 *     _raise_dt64arr_as_int64_unit_error("h", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_m(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'm' (minute)
 *     resolution `<'ndarray[int64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_m {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":4607
 *     _raise_dt64arr_as_int64_unit_error("m", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_s(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 's' (second)
 *     resolution `<'ndarray[int64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_s {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":4656
 *     _raise_dt64arr_as_int64_unit_error("s", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_ms(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'ms' (millisecond)
 *     resolution `<'ndarray[int64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ms {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":4705
 *     _raise_dt64arr_as_int64_unit_error("ms", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_us(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'us' (microsecond)
 *     resolution `<'ndarray[int64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_us {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":4754
 *     _raise_dt64arr_as_int64_unit_error("us", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_ns(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'ns' (nanosecond)
 *     resolution `<'ndarray[int64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ns {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":4803
 *     _raise_dt64arr_as_int64_unit_error("ns", unit)
 * 
 * cdef inline np.ndarray _dt64arr_Y_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[datetime64[Y]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils__dt64arr_Y_as_int64_D {
  int __pyx_n;
  npy_int64 factor;
  npy_int64 offset;
};

/* "utils.pxd":4829
 *     return res
 * 
 * cdef inline np.ndarray _dt64arr_M_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[datetime64[M]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils__dt64arr_M_as_int64_D {
  int __pyx_n;
  npy_int64 factor;
  npy_int64 offset;
};

/* "utils.pxd":4859
 *     return res
 * 
 * cdef inline np.ndarray _dt64arr_W_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[datetime64[W]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils__dt64arr_W_as_int64_D {
  int __pyx_n;
  npy_int64 factor;
  npy_int64 offset;
};

/* "utils.pxd":4865
 *     return arr_mul(arr, 7 * factor, offset)
 * 
 * cdef inline np.ndarray dt64arr_as_iso_W(np.ndarray arr, int weekday, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 with 'W' (week)
 *     resolution, aligned to the specified ISO 'weekday' `<'ndarray[int64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_iso_W {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":4892
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_to_ordinal(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Convert np.ndarray[datetime64] to proleptic Gregorian
 *     ordinals `<'ndarray[int64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_to_ordinal {
  int __pyx_n;
  PyObject *arr_unit;
};

/* "utils.pxd":4901
 * 
 * # . conversion: float64
 * cdef inline np.ndarray dt64arr_to_ts(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Convert np.ndarray[datetime64] to timestamps `<'ndarray[float64]'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_to_ts {
  int __pyx_n;
  PyObject *arr_unit;
};

/* "utils.pxd":4915
 * 
 * # . conversion: unit
 * cdef inline np.ndarray dt64arr_as_unit(np.ndarray arr, str unit, str arr_unit=None, bint limit=False):             # <<<<<<<<<<<<<<
 *     """Convert np.ndarray[datetime64] to the specified unit `<'ndarray[datetime64]'>`.
 * 
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_unit {
  int __pyx_n;
  PyObject *arr_unit;
  int limit;
};

/* "utils.pxd":5116
 * 
 * # . arithmetic
 * cdef inline np.ndarray dt64arr_round(np.ndarray arr, str unit, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Perform round operation on the np.ndarray[datetime64] to the
 *     specified unit `<'ndarray[datetime64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_round {
  int __pyx_n;
  PyObject *arr_unit;
};

/* "utils.pxd":5305
 *     return arr.astype(to_dtype)
 * 
 * cdef inline np.ndarray dt64arr_ceil(np.ndarray arr, str unit, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Perform ceil operation on the np.ndarray[datetime64] to the
 *     specified unit `<'ndarray[datetime64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_ceil {
  int __pyx_n;
  PyObject *arr_unit;
};

/* "utils.pxd":5494
 *     return arr.astype(to_dtype)
 * 
 * cdef inline np.ndarray dt64arr_floor(np.ndarray arr, str unit, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Perform floor operation on the np.ndarray[datetime64] to the
 *     specified unit `<'ndarray[datetime64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_dt64arr_floor {
  int __pyx_n;
  PyObject *arr_unit;
};

/* "utils.pxd":5789
 * 
 * # . errors: internal
 * cdef inline bint _raise_dt64arr_as_int64_unit_error(str reso, int unit, bint is_dt64=True) except -1:             # <<<<<<<<<<<<<<
 *     """(internal) Raise unsupported unit for 'dt64arr_as_int64*()' functions."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 */
struct __pyx_opt_args_7cytimes_5utils__raise_dt64arr_as_int64_unit_error {
  int __pyx_n;
  int is_dt64;
};

/* "utils.pxd":5841
 * 
 * # . conversion
 * cdef inline np.ndarray td64arr_as_int64_us(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[timedelta64] to int64 under 'us' (microsecond)
 *     resolution `<'ndarray[int64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils_td64arr_as_int64_us {
  int __pyx_n;
  PyObject *arr_unit;
  npy_int64 offset;
};

/* "utils.pxd":5890
 *     _raise_dt64arr_as_int64_unit_error("us", unit, False)
 * 
 * cdef inline np.ndarray _td64arr_Y_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[timedelta64[Y]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils__td64arr_Y_as_int64_D {
  int __pyx_n;
  npy_int64 factor;
  npy_int64 offset;
};

/* "utils.pxd":5913
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)
 * 
 * cdef inline np.ndarray _td64arr_M_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[timedelta64[M]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils__td64arr_M_as_int64_D {
  int __pyx_n;
  npy_int64 factor;
  npy_int64 offset;
};

/* "utils.pxd":5936
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)
 * 
 * cdef inline np.ndarray _td64arr_W_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[timedelta64[W]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */
struct __pyx_opt_args_7cytimes_5utils__td64arr_W_as_int64_D {
  int __pyx_n;
  npy_int64 factor;
  npy_int64 offset;
};
struct __pyx_opt_args_7cytimes_4pddt_pddt_new;
struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple;
struct __pyx_opt_args_7cytimes_4pddt__pddt_new;
struct __pyx_opt_args_7cytimes_4pddt__pddt_new_cytimes;
struct __pyx_opt_args_7cytimes_4pddt__pddt_fr_dt;
struct __pyx_opt_args_7cytimes_4pddt__pddt_fr_us;
struct __pyx_opt_args_7cytimes_4pddt__parse_dtobj;
struct __pyx_opt_args_7cytimes_4pddt__raise_incomparable_error;

/* "cytimes/pddt.py":38
 * 
 * # Utils ---------------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def pddt_new(
 */
struct __pyx_opt_args_7cytimes_4pddt_pddt_new {
  int __pyx_n;
  PyObject *freq;
  PyObject *tz;
  PyObject *ambiguous;
  PyObject *year1st;
  PyObject *day1st;
  struct __pyx_obj_7cytimes_6parser_Configs *cfg;
  PyObject *unit;
  PyObject *name;
  PyObject *copy;
};

/* "cytimes/pddt.py":107
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def pddt_new_simple(
 */
struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple {
  int __pyx_n;
  PyObject *tz;
  PyObject *unit;
  PyObject *name;
};

/* "cytimes/pddt.py":137
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def _pddt_new(
 */
struct __pyx_opt_args_7cytimes_4pddt__pddt_new {
  int __pyx_n;
  PyObject *freq;
  PyObject *tz;
  PyObject *ambiguous;
  PyObject *year1st;
  PyObject *day1st;
  PyObject *name;
  PyObject *copy;
};

/* "cytimes/pddt.py":198
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def _pddt_new_cytimes(
 */
struct __pyx_opt_args_7cytimes_4pddt__pddt_new_cytimes {
  int __pyx_n;
  PyObject *freq;
  PyObject *tz;
  PyObject *ambiguous;
  PyObject *year1st;
  PyObject *day1st;
  struct __pyx_obj_7cytimes_6parser_Configs *cfg;
  PyObject *name;
};

/* "cytimes/pddt.py":253
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def _pddt_fr_dt(
 */
struct __pyx_opt_args_7cytimes_4pddt__pddt_fr_dt {
  int __pyx_n;
  PyObject *unit;
  PyObject *name;
};

/* "cytimes/pddt.py":268
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def _pddt_fr_us(
 */
struct __pyx_opt_args_7cytimes_4pddt__pddt_fr_us {
  int __pyx_n;
  PyObject *tz;
  PyObject *unit;
  PyObject *name;
};

/* "cytimes/pddt.py":284
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def _parse_dtobj(
 */
struct __pyx_opt_args_7cytimes_4pddt__parse_dtobj {
  int __pyx_n;
  PyObject *__pyx_default;
  PyObject *year1st;
  PyObject *day1st;
  int ignoretz;
  int isoformat;
  struct __pyx_obj_7cytimes_6parser_Configs *cfg;
};

/* "cytimes/pddt.py":445
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-2, check=False)
 */
struct __pyx_opt_args_7cytimes_4pddt__raise_incomparable_error {
  int __pyx_n;
  PyObject *desc;
};

/* "cytimes/parser.pxd":21
 * 
 * # Configs
 * cdef class Configs:             # <<<<<<<<<<<<<<
 *     cdef:
 *         # . settings
 */
struct __pyx_obj_7cytimes_6parser_Configs {
  PyObject_HEAD
  struct __pyx_vtabstruct_7cytimes_6parser_Configs *__pyx_vtab;
  int _year1st;
  int _day1st;
  PyObject *_pertain;
  PyObject *_jump;
  PyObject *_utc;
  PyObject *_tz;
  PyObject *_month;
  PyObject *_weekday;
  PyObject *_hms_flag;
  PyObject *_ampm_flag;
  PyObject *_words;
};


/* "cytimes/parser.pxd":47
 * 
 * # Parser
 * cdef class Result:             # <<<<<<<<<<<<<<
 *     cdef:
 *         # . Y/M/D
 */
struct __pyx_obj_7cytimes_6parser_Result {
  PyObject_HEAD
  struct __pyx_vtabstruct_7cytimes_6parser_Result *__pyx_vtab;
  int _ymd[3];
  int _idx;
  int _yidx;
  int _midx;
  int _didx;
  int year;
  int month;
  int day;
  int weekday;
  int hour;
  int minute;
  int second;
  int microsecond;
  int ampm;
  int tzoffset;
  int century_specified;
};


/* "cytimes/parser.pxd":79
 *     cdef inline bint reset(self) except -1
 * 
 * cdef class Parser:             # <<<<<<<<<<<<<<
 *     cdef:
 *         # . settings
 */
struct __pyx_obj_7cytimes_6parser_Parser {
  PyObject_HEAD
  struct __pyx_vtabstruct_7cytimes_6parser_Parser *__pyx_vtab;
  int _ignoretz;
  int _year1st;
  int _day1st;
  PyObject *_pertain;
  PyObject *_jump;
  PyObject *_utc;
  PyObject *_tz;
  PyObject *_month;
  PyObject *_weekday;
  PyObject *_hms_flag;
  PyObject *_ampm_flag;
  struct __pyx_obj_7cytimes_6parser_Result *_res;
  Py_ssize_t _idx;
  Py_ssize_t _size;
  PyObject *_tokens;
  PyObject *_tk1;
  PyObject *_tk2;
  PyObject *_tk3;
  PyObject *_tk4;
};


/* "cytimes/pddt.py":1206
 *         return pddt_new_simple(dtstr, None, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromisocalendar(
 *         cls,
 */
struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar {
  PyObject_HEAD
  PyObject *__pyx_v_tz;
  PyObject *__pyx_v_week;
  PyObject *__pyx_v_weekday;
  PyObject *__pyx_v_year;
};



/* "cytimes/parser.pxd":21
 * 
 * # Configs
 * cdef class Configs:             # <<<<<<<<<<<<<<
 *     cdef:
 *         # . settings
 */

struct __pyx_vtabstruct_7cytimes_6parser_Configs {
  int (*_construct)(struct __pyx_obj_7cytimes_6parser_Configs *);
  PyObject *(*_validate_word)(struct __pyx_obj_7cytimes_6parser_Configs *, PyObject *, PyObject *);
  PyObject *(*_validate_value)(struct __pyx_obj_7cytimes_6parser_Configs *, PyObject *, PyObject *, int, int);
  PyObject *(*_validate_value_month)(struct __pyx_obj_7cytimes_6parser_Configs *, PyObject *);
  PyObject *(*_validate_value_weekday)(struct __pyx_obj_7cytimes_6parser_Configs *, PyObject *);
  PyObject *(*_validate_value_hms_flag)(struct __pyx_obj_7cytimes_6parser_Configs *, PyObject *);
  PyObject *(*_validate_value_ampm_flag)(struct __pyx_obj_7cytimes_6parser_Configs *, PyObject *);
  PyObject *(*_validate_value_tzoffset)(struct __pyx_obj_7cytimes_6parser_Configs *, PyObject *);
};
static struct __pyx_vtabstruct_7cytimes_6parser_Configs *__pyx_vtabptr_7cytimes_6parser_Configs;


/* "cytimes/parser.pxd":47
 * 
 * # Parser
 * cdef class Result:             # <<<<<<<<<<<<<<
 *     cdef:
 *         # . Y/M/D
 */

struct __pyx_vtabstruct_7cytimes_6parser_Result {
  int (*set_ymd_int)(struct __pyx_obj_7cytimes_6parser_Result *, PY_LONG_LONG, int);
  int (*set_ymd_str)(struct __pyx_obj_7cytimes_6parser_Result *, PyObject *, int);
  int (*_set_ymd)(struct __pyx_obj_7cytimes_6parser_Result *, int, int);
  int (*ymd_populated)(struct __pyx_obj_7cytimes_6parser_Result *);
  int (*ymd_labeled)(struct __pyx_obj_7cytimes_6parser_Result *);
  int (*could_be_day)(struct __pyx_obj_7cytimes_6parser_Result *, PY_LONG_LONG);
  int (*prepare)(struct __pyx_obj_7cytimes_6parser_Result *, int, int);
  int (*valid)(struct __pyx_obj_7cytimes_6parser_Result *);
  int (*reset)(struct __pyx_obj_7cytimes_6parser_Result *);
};
static struct __pyx_vtabstruct_7cytimes_6parser_Result *__pyx_vtabptr_7cytimes_6parser_Result;


/* "cytimes/parser.pxd":79
 *     cdef inline bint reset(self) except -1
 * 
 * cdef class Parser:             # <<<<<<<<<<<<<<
 *     cdef:
 *         # . settings
 */

struct __pyx_vtabstruct_7cytimes_6parser_Parser {
  PyDateTime_DateTime *(*parse)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytimes_6parser_6Parser_parse *__pyx_optional_args);
  int (*_process)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *, int);
  PyDateTime_DateTime *(*_build)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *, PyObject *);
  PyDateTime_DateTime *(*_generate_dt)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *, PyObject *);
  int (*_process_iso_format)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *);
  int (*_parse_iso_date)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *);
  int (*_parse_iso_time)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *);
  int (*_parse_iso_extra)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *);
  int (*_process_timelex_tokens)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *);
  int (*_parse_token_numeric)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *);
  int (*_parse_token_month)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *);
  int (*_parse_token_weekday)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *);
  int (*_parse_token_hmsf)(struct __pyx_obj_7cytimes_6parser_Parser *, double);
  int (*_parse_token_ampm_flag)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *);
  int (*_parse_token_tzname)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *);
  int (*_parse_token_tzoffset)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *);
  PyObject *(*_token)(struct __pyx_obj_7cytimes_6parser_Parser *, Py_ssize_t);
  PyObject *(*_token1)(struct __pyx_obj_7cytimes_6parser_Parser *);
  PyObject *(*_token2)(struct __pyx_obj_7cytimes_6parser_Parser *);
  PyObject *(*_token3)(struct __pyx_obj_7cytimes_6parser_Parser *);
  PyObject *(*_token4)(struct __pyx_obj_7cytimes_6parser_Parser *);
  int (*_reset_tokens)(struct __pyx_obj_7cytimes_6parser_Parser *);
  int (*_set_hmsf)(struct __pyx_obj_7cytimes_6parser_Parser *, double, int);
  int (*_set_hhmm)(struct __pyx_obj_7cytimes_6parser_Parser *, double);
  int (*_set_mmss)(struct __pyx_obj_7cytimes_6parser_Parser *, double);
  int (*_set_ssff)(struct __pyx_obj_7cytimes_6parser_Parser *, double);
  int (*_adj_hour_ampm)(struct __pyx_obj_7cytimes_6parser_Parser *, int, int);
  int (*_is_token_pertain)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *);
  int (*_is_token_jump)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *);
  int (*_is_token_utc)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *);
  int (*_token_to_month)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *);
  int (*_token_to_weekday)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *);
  int (*_token_to_tzoffset)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *);
  int (*_token_to_hms_flag)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *);
  int (*_token_to_ampm_flag)(struct __pyx_obj_7cytimes_6parser_Parser *, PyObject *);
};
static struct __pyx_vtabstruct_7cytimes_6parser_Parser *__pyx_vtabptr_7cytimes_6parser_Parser;
/* #### Code section: utility_code_proto ### */

/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, Py_ssize_t);
    void (*DECREF)(void*, PyObject*, Py_ssize_t);
    void (*GOTREF)(void*, PyObject*, Py_ssize_t);
    void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
    void* (*SetupContext)(const char*, Py_ssize_t, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#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__));\
          }
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
  #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
#endif
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
  #define __Pyx_RefNannyFinishContext()\
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_XINCREF(r)  do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContextNogil()
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_Py_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; Py_XDECREF(tmp);\
    } while (0)
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

/* PyErrExceptionMatches.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
#endif

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#if PY_VERSION_HEX >= 0x030C00A6
#define __Pyx_PyErr_Occurred()  (__pyx_tstate->current_exception != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
#else
#define __Pyx_PyErr_Occurred()  (__pyx_tstate->curexc_type != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  (__pyx_tstate->curexc_type)
#endif
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  (PyErr_Occurred() != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  PyErr_Occurred()
#endif

/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
#else
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#endif
#else
#define __Pyx_PyErr_Clear() PyErr_Clear()
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
#endif

/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

/* PyObjectGetAttrStrNoError.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);

/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);

/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#endif

/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
#endif

/* 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

/* 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);

/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

/* ModInt[long].proto */
static CYTHON_INLINE long __Pyx_mod_long(long, long);

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#if !CYTHON_VECTORCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
    (sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
#if !CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x03080000
  #include "frameobject.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
  #define __Pxy_PyFrame_Initialize_Offsets()
  #define __Pyx_PyFrame_GetLocalsplus(frame)  ((frame)->f_localsplus)
#else
  static size_t __pyx_pyframe_localsplus_offset = 0;
  #include "frameobject.h"
  #define __Pxy_PyFrame_Initialize_Offsets()\
    ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
     (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  #define __Pyx_PyFrame_GetLocalsplus(frame)\
    (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif
#endif
#endif

/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectFastCall.proto */
#define __Pyx_PyObject_FastCall(func, args, nargs)  __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs);

/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* 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

/* DivInt[long].proto */
static CYTHON_INLINE long __Pyx_div_long(long, long);

/* GCCDiagnostics.proto */
#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#define __Pyx_HAS_GCC_DIAGNOSTIC
#endif

/* BuildPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
                                                int prepend_sign, char padding_char);

/* IncludeStringH.proto */
#include <string.h>

/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);

/* JoinPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char);

/* DivInt[PY_LONG_LONG].proto */
static CYTHON_INLINE PY_LONG_LONG __Pyx_div_PY_LONG_LONG(PY_LONG_LONG, PY_LONG_LONG);

/* ModInt[PY_LONG_LONG].proto */
static CYTHON_INLINE PY_LONG_LONG __Pyx_mod_PY_LONG_LONG(PY_LONG_LONG, PY_LONG_LONG);

/* ListAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
        L->ob_item[len] = x;
        #else
        PyList_SET_ITEM(list, len, x);
        #endif
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

/* RaiseUnexpectedTypeError.proto */
static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);

/* PyUnicode_Unicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj);

/* 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);

/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_PY_LONG_LONG(PY_LONG_LONG value, Py_ssize_t width, char padding_char, char format_char);

/* 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

/* DivInt[npy_int64].proto */
static CYTHON_INLINE npy_int64 __Pyx_div_npy_int64(npy_int64, npy_int64);

/* ModInt[npy_int64].proto */
static CYTHON_INLINE npy_int64 __Pyx_mod_npy_int64(npy_int64, npy_int64);

/* PyObjectFormatAndDecref.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);

/* RaiseUnboundLocalError.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);

/* PyDictVersioning.proto */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
#define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
    (version_var) = __PYX_GET_DICT_VERSION(dict);\
    (cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
        (VAR) = __pyx_dict_cached_value;\
    } else {\
        (VAR) = __pyx_dict_cached_value = (LOOKUP);\
        __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
    }\
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
#else
#define __PYX_GET_DICT_VERSION(dict)  (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
#endif

/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name)  do {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
        (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
        __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  do {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
#endif
#define __Pyx_PyErr_ExceptionMatches2(err1, err2)  __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)

/* PyObject_Unicode.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyObject_Unicode(obj)\
    (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
#else
#define __Pyx_PyObject_Unicode(obj)\
    (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
#endif

/* PyUnicodeContains.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_ContainsTF(PyObject* substring, PyObject* text, int eq) {
    int result = PyUnicode_Contains(text, substring);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* 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

/* AssertionsEnabled.proto */
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define __Pyx_init_assertions_enabled()  (0)
  #define __pyx_assertions_enabled()  (1)
#elif CYTHON_COMPILING_IN_LIMITED_API  ||  (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000)
  static int __pyx_assertions_enabled_flag;
  #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
  static int __Pyx_init_assertions_enabled(void) {
    PyObject *builtins, *debug, *debug_str;
    int flag;
    builtins = PyEval_GetBuiltins();
    if (!builtins) goto bad;
    debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
    if (!debug_str) goto bad;
    debug = PyObject_GetItem(builtins, debug_str);
    Py_DECREF(debug_str);
    if (!debug) goto bad;
    flag = PyObject_IsTrue(debug);
    Py_DECREF(debug);
    if (flag == -1) goto bad;
    __pyx_assertions_enabled_flag = flag;
    return 0;
  bad:
    __pyx_assertions_enabled_flag = 1;
    return -1;
  }
#else
  #define __Pyx_init_assertions_enabled()  (0)
  #define __pyx_assertions_enabled()  (!Py_OptimizeFlag)
#endif

/* TupleAndListFromArray.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
#endif

/* fastcall.proto */
#if CYTHON_AVOID_BORROWED_REFS
    #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i)
#elif CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i)
#else
    #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i)
#endif
#if CYTHON_AVOID_BORROWED_REFS
    #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg)
    #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg)
#else
    #define __Pyx_Arg_NewRef_VARARGS(arg) arg
    #define __Pyx_Arg_XDECREF_VARARGS(arg)
#endif
#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
#define __Pyx_KwValues_VARARGS(args, nargs) NULL
#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
#if CYTHON_METH_FASTCALL
    #define __Pyx_Arg_FASTCALL(args, i) args[i]
    #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
    #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
    static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
    CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
  #else
    #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
  #endif
    #define __Pyx_Arg_NewRef_FASTCALL(arg) arg  /* no-op, __Pyx_Arg_FASTCALL is direct and this needs
                                                   to have the same reference counting */
    #define __Pyx_Arg_XDECREF_FASTCALL(arg)
#else
    #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
    #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
    #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
    #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
    #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
    #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg)
    #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start)
#else
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
#endif

/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

/* ParseKeywords.proto */
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues,
    PyObject **argnames[],
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,
    const char* function_name);

/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
    ((likely(__Pyx_IS_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);

/* pybytes_as_double.proto */
static double __Pyx_SlowPyString_AsDouble(PyObject *obj);
static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length);
static CYTHON_INLINE double __Pyx_PyBytes_AsDouble(PyObject *obj) {
    char* as_c_string;
    Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS
    as_c_string = PyBytes_AS_STRING(obj);
    size = PyBytes_GET_SIZE(obj);
#else
    if (PyBytes_AsStringAndSize(obj, &as_c_string, &size) < 0) {
        return (double)-1;
    }
#endif
    return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
}
static CYTHON_INLINE double __Pyx_PyByteArray_AsDouble(PyObject *obj) {
    char* as_c_string;
    Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS
    as_c_string = PyByteArray_AS_STRING(obj);
    size = PyByteArray_GET_SIZE(obj);
#else
    as_c_string = PyByteArray_AsString(obj);
    if (as_c_string == NULL) {
        return (double)-1;
    }
    size = PyByteArray_Size(obj);
#endif
    return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
}

/* pyunicode_as_double.proto */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
static const char* __Pyx__PyUnicode_AsDouble_Copy(const void* data, const int kind, char* buffer, Py_ssize_t start, Py_ssize_t end) {
    int last_was_punctuation;
    Py_ssize_t i;
    last_was_punctuation = 1;
    for (i=start; i <= end; i++) {
        Py_UCS4 chr = PyUnicode_READ(kind, data, i);
        int is_punctuation = (chr == '_') | (chr == '.');
        *buffer = (char)chr;
        buffer += (chr != '_');
        if (unlikely(chr > 127)) goto parse_failure;
        if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure;
        last_was_punctuation = is_punctuation;
    }
    if (unlikely(last_was_punctuation)) goto parse_failure;
    *buffer = '\0';
    return buffer;
parse_failure:
    return NULL;
}
static double __Pyx__PyUnicode_AsDouble_inf_nan(const void* data, int kind, Py_ssize_t start, Py_ssize_t length) {
    int matches = 1;
    Py_UCS4 chr;
    Py_UCS4 sign = PyUnicode_READ(kind, data, start);
    int is_signed = (sign == '-') | (sign == '+');
    start += is_signed;
    length -= is_signed;
    switch (PyUnicode_READ(kind, data, start)) {
        #ifdef Py_NAN
        case 'n':
        case 'N':
            if (unlikely(length != 3)) goto parse_failure;
            chr = PyUnicode_READ(kind, data, start+1);
            matches &= (chr == 'a') | (chr == 'A');
            chr = PyUnicode_READ(kind, data, start+2);
            matches &= (chr == 'n') | (chr == 'N');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_NAN : Py_NAN;
        #endif
        case 'i':
        case 'I':
            if (unlikely(length < 3)) goto parse_failure;
            chr = PyUnicode_READ(kind, data, start+1);
            matches &= (chr == 'n') | (chr == 'N');
            chr = PyUnicode_READ(kind, data, start+2);
            matches &= (chr == 'f') | (chr == 'F');
            if (likely(length == 3 && matches))
                return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
            if (unlikely(length != 8)) goto parse_failure;
            chr = PyUnicode_READ(kind, data, start+3);
            matches &= (chr == 'i') | (chr == 'I');
            chr = PyUnicode_READ(kind, data, start+4);
            matches &= (chr == 'n') | (chr == 'N');
            chr = PyUnicode_READ(kind, data, start+5);
            matches &= (chr == 'i') | (chr == 'I');
            chr = PyUnicode_READ(kind, data, start+6);
            matches &= (chr == 't') | (chr == 'T');
            chr = PyUnicode_READ(kind, data, start+7);
            matches &= (chr == 'y') | (chr == 'Y');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
        case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
            break;
        default:
            goto parse_failure;
    }
    return 0.0;
parse_failure:
    return -1.0;
}
static double __Pyx_PyUnicode_AsDouble_WithSpaces(PyObject *obj) {
    double value;
    const char *last;
    char *end;
    Py_ssize_t start, length = PyUnicode_GET_LENGTH(obj);
    const int kind = PyUnicode_KIND(obj);
    const void* data = PyUnicode_DATA(obj);
    start = 0;
    while (Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, start)))
        start++;
    while (start < length - 1 && Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, length - 1)))
        length--;
    length -= start;
    if (unlikely(length <= 0)) goto fallback;
    value = __Pyx__PyUnicode_AsDouble_inf_nan(data, kind, start, length);
    if (unlikely(value == -1.0)) goto fallback;
    if (value != 0.0) return value;
    if (length < 40) {
        char number[40];
        last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length);
        if (unlikely(!last)) goto fallback;
        value = PyOS_string_to_double(number, &end, NULL);
    } else {
        char *number = (char*) PyMem_Malloc((length + 1) * sizeof(char));
        if (unlikely(!number)) goto fallback;
        last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length);
        if (unlikely(!last)) {
            PyMem_Free(number);
            goto fallback;
        }
        value = PyOS_string_to_double(number, &end, NULL);
        PyMem_Free(number);
    }
    if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) {
        return value;
    }
fallback:
    return __Pyx_SlowPyString_AsDouble(obj);
}
#endif
static CYTHON_INLINE double __Pyx_PyUnicode_AsDouble(PyObject *obj) {
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(__Pyx_PyUnicode_READY(obj) == -1))
        return (double)-1;
    if (likely(PyUnicode_IS_ASCII(obj))) {
        const char *s;
        Py_ssize_t length;
        s = PyUnicode_AsUTF8AndSize(obj, &length);
        return __Pyx__PyBytes_AsDouble(obj, s, length);
    }
    return __Pyx_PyUnicode_AsDouble_WithSpaces(obj);
#else
    return __Pyx_SlowPyString_AsDouble(obj);
#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) :\
 likely(PyLong_CheckExact(obj)) ?\
 PyLong_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
#endif

/* dict_getitem_default.proto */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);

/* 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

/* RaiseClosureNameError.proto */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);

/* IncludeStructmemberH.proto */
#include <structmember.h>

/* FixUpExtensionType.proto */
#if CYTHON_USE_TYPE_SPECS
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
#endif

/* FetchSharedCythonModule.proto */
static PyObject *__Pyx_FetchSharedCythonABIModule(void);

/* FetchCommonType.proto */
#if !CYTHON_USE_TYPE_SPECS
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
#else
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
#endif

/* PyMethodNew.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    PyObject *typesModule=NULL, *methodType=NULL, *result=NULL;
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    typesModule = PyImport_ImportModule("types");
    if (!typesModule) return NULL;
    methodType = PyObject_GetAttrString(typesModule, "MethodType");
    Py_DECREF(typesModule);
    if (!methodType) return NULL;
    result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL);
    Py_DECREF(methodType);
    return result;
}
#elif PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    return PyMethod_New(func, self);
}
#else
    #define __Pyx_PyMethod_New PyMethod_New
#endif

/* PyVectorcallFastCallDict.proto */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
#endif

/* CythonFunctionShared.proto */
#define __Pyx_CyFunction_USED
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CYFUNCTION_COROUTINE     0x08
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_CyFunction_GetClassObj(f)\
      (((__pyx_CyFunctionObject *) (f))->func_classobj)
#else
  #define __Pyx_CyFunction_GetClassObj(f)\
      ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
#endif
#define __Pyx_CyFunction_SetClassObj(f, classobj)\
    __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject_HEAD
    PyObject *func;
#elif PY_VERSION_HEX < 0x030900B1
    PyCFunctionObject func;
#else
    PyCMethodObject func;
#endif
#if CYTHON_BACKPORT_VECTORCALL
    __pyx_vectorcallfunc func_vectorcall;
#endif
#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_classobj;
#endif
    void *defaults;
    int defaults_pyobjects;
    size_t defaults_size;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
    PyObject *func_is_coroutine;
} __pyx_CyFunctionObject;
#undef __Pyx_CyOrPyCFunction_Check
#define __Pyx_CyFunction_Check(obj)  __Pyx_TypeCheck(obj, __pyx_CyFunctionType)
#define __Pyx_CyOrPyCFunction_Check(obj)  __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type)
#define __Pyx_CyFunction_CheckExact(obj)  __Pyx_IS_TYPE(obj, __pyx_CyFunctionType)
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc);
#undef __Pyx_IsSameCFunction
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCyOrCFunction(func, cfunc)
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
static CYTHON_INLINE 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(PyObject *module);
#if CYTHON_METH_FASTCALL
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#if CYTHON_BACKPORT_VECTORCALL
#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
#else
#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
#endif
#endif

/* CythonFunction.proto */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);

/* ListCompAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
        L->ob_item[len] = x;
        #else
        PyList_SET_ITEM(list, len, x);
        #endif
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);

/* PyObjectCallNoArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);

/* PyObjectGetMethod.proto */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);

/* PyObjectCallMethod0.proto */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

/* ValidateBasesTuple.proto */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
#endif

/* PyType_Ready.proto */
CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);

/* 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

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_12
#define __PYX_HAVE_RT_ImportType_proto_3_0_12
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#include <stdalign.h>
#endif
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
#define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_0_12 {
   __Pyx_ImportType_CheckSize_Error_3_0_12 = 0,
   __Pyx_ImportType_CheckSize_Warn_3_0_12 = 1,
   __Pyx_ImportType_CheckSize_Ignore_3_0_12 = 2
};
static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size);
#endif

/* GetVTable.proto */
static void* __Pyx_GetVtable(PyTypeObject *type);

/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

/* ImportDottedModule.proto */
static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);
#endif

/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* Py3UpdateBases.proto */
static PyObject* __Pyx_PEP560_update_bases(PyObject *bases);

/* CalculateMetaclass.proto */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

/* SetNameInClass.proto */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
#elif CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
#else
#define __Pyx_SetNameInClass(ns, name, value)  PyObject_SetItem(ns, name, value)
#endif

/* SetNewInClass.proto */
static int __Pyx_SetNewInClass(PyObject *ns, PyObject *name, PyObject *value);

/* ClassMethod.proto */
#include "descrobject.h"
CYTHON_UNUSED static PyObject* __Pyx_Method_ClassMethod(PyObject *method);

/* PyObjectCall2Args.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* PyObjectLookupSpecial.proto */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name)  __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
#define __Pyx_PyObject_LookupSpecial(obj, attr_name)  __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error);
#else
#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#endif

/* Py3ClassCreate.proto */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
                                           PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

/* 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 */
#if !CYTHON_COMPILING_IN_LIMITED_API
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);
#endif

/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

/* RealImag.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #define __Pyx_CREAL(z) ((z).real())
    #define __Pyx_CIMAG(z) ((z).imag())
  #else
    #define __Pyx_CREAL(z) (__real__(z))
    #define __Pyx_CIMAG(z) (__imag__(z))
  #endif
#else
    #define __Pyx_CREAL(z) ((z).real)
    #define __Pyx_CIMAG(z) ((z).imag)
#endif
#if defined(__cplusplus) && CYTHON_CCOMPLEX\
        && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
    #define __Pyx_SET_CREAL(z,x) ((z).real(x))
    #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
    #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
    #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
#endif

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
    #define __Pyx_c_eq_float(a, b)   ((a)==(b))
    #define __Pyx_c_sum_float(a, b)  ((a)+(b))
    #define __Pyx_c_diff_float(a, b) ((a)-(b))
    #define __Pyx_c_prod_float(a, b) ((a)*(b))
    #define __Pyx_c_quot_float(a, b) ((a)/(b))
    #define __Pyx_c_neg_float(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
    #define __Pyx_c_conj_float(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_float(z)     (::std::abs(z))
        #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_float(z) ((z)==0)
    #define __Pyx_c_conj_float(z)    (conjf(z))
    #if 1
        #define __Pyx_c_abs_float(z)     (cabsf(z))
        #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
    #if 1
        static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
    #endif
#endif

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
    #define __Pyx_c_eq_double(a, b)   ((a)==(b))
    #define __Pyx_c_sum_double(a, b)  ((a)+(b))
    #define __Pyx_c_diff_double(a, b) ((a)-(b))
    #define __Pyx_c_prod_double(a, b) ((a)*(b))
    #define __Pyx_c_quot_double(a, b) ((a)/(b))
    #define __Pyx_c_neg_double(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
    #define __Pyx_c_conj_double(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (::std::abs(z))
        #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_double(z) ((z)==0)
    #define __Pyx_c_conj_double(z)    (conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (cabs(z))
        #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
    #endif
#endif

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
    #define __Pyx_c_eq_long__double(a, b)   ((a)==(b))
    #define __Pyx_c_sum_long__double(a, b)  ((a)+(b))
    #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
    #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
    #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
    #define __Pyx_c_neg_long__double(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
    #define __Pyx_c_conj_long__double(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_long__double(z)     (::std::abs(z))
        #define __Pyx_c_pow_long__double(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_long__double(z) ((z)==0)
    #define __Pyx_c_conj_long__double(z)    (conjl(z))
    #if 1
        #define __Pyx_c_abs_long__double(z)     (cabsl(z))
        #define __Pyx_c_pow_long__double(a, b)  (cpowl(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
    #if 1
        static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
        static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
    #endif
#endif

/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

/* CIntFromPy.proto */
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_intp(npy_intp value);

/* CIntFromPy.proto */
static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value);

/* FormatTypeName.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%U"
static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
#else
typedef const char *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%.200s"
#define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
#define __Pyx_DECREF_TypeName(obj)
#endif

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

/* CheckBinaryVersion.proto */
static unsigned long __Pyx_get_runtime_version(void);
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);

/* VoidPtrImport.proto */
static int __Pyx_ImportVoidPtr_3_0_12(PyObject *module, const char *name, void **p, const char *sig);

/* FunctionImport.proto */
static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig);

/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);

/* #### Code section: module_declarations ### */
static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_4year_year(PyDateTime_Date *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_5month_month(PyDateTime_Date *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_3day_day(PyDateTime_Date *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4hour_hour(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6minute_minute(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6second_second(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4fold_fold(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4year_year(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_5month_month(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_3day_day(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4hour_hour(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_6minute_minute(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_6second_second(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4fold_fold(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_3day_day(PyDateTime_Delta *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_6second_second(PyDateTime_Delta *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(PyDateTime_Delta *__pyx_v_self); /* proto*/

/* Module declarations from "cython" */

/* Module declarations from "libc.string" */

/* Module declarations from "libc.stdio" */

/* Module declarations from "__builtin__" */

/* Module declarations from "cpython.type" */

/* Module declarations from "cpython.version" */

/* Module declarations from "cpython.exc" */

/* Module declarations from "cpython.module" */

/* Module declarations from "cpython.mem" */

/* Module declarations from "cpython.tuple" */

/* Module declarations from "cpython.list" */

/* Module declarations from "cpython.sequence" */

/* Module declarations from "cpython.mapping" */

/* Module declarations from "cpython.iterator" */

/* Module declarations from "cpython.number" */

/* Module declarations from "cpython.int" */

/* Module declarations from "__builtin__" */

/* Module declarations from "cpython.bool" */

/* Module declarations from "cpython.long" */

/* Module declarations from "cpython.float" */

/* Module declarations from "__builtin__" */

/* Module declarations from "cpython.complex" */

/* Module declarations from "cpython.string" */

/* Module declarations from "libc.stddef" */

/* Module declarations from "cpython.unicode" */

/* Module declarations from "cpython.pyport" */

/* Module declarations from "cpython.dict" */

/* Module declarations from "cpython.instance" */

/* Module declarations from "cpython.function" */

/* Module declarations from "cpython.method" */

/* Module declarations from "cpython.weakref" */

/* Module declarations from "cpython.getargs" */

/* Module declarations from "cpython.pythread" */

/* Module declarations from "cpython.pystate" */

/* Module declarations from "cpython.cobject" */

/* Module declarations from "cpython.oldbuffer" */

/* Module declarations from "cpython.set" */

/* Module declarations from "cpython.buffer" */

/* Module declarations from "cpython.bytes" */

/* Module declarations from "cpython.pycapsule" */

/* Module declarations from "cpython.contextvars" */

/* Module declarations from "cpython" */

/* Module declarations from "cpython.object" */

/* Module declarations from "cpython.ref" */

/* Module declarations from "numpy" */

/* Module declarations from "numpy" */
static CYTHON_INLINE int __pyx_f_5numpy_import_array(void); /*proto*/
static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void); /*proto*/
static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *); /*proto*/
static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *); /*proto*/
static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *); /*proto*/
static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *); /*proto*/

/* Module declarations from "datetime" */

/* Module declarations from "cpython.datetime" */
static CYTHON_INLINE void __pyx_f_7cpython_8datetime_import_datetime(void); /*proto*/
static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cpython_8datetime_date_new(int, int, int); /*proto*/
static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cpython_8datetime_time_new(int, int, int, int, PyObject *, struct __pyx_opt_args_7cpython_8datetime_time_new *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cpython_8datetime_datetime_new(int, int, int, int, int, int, int, PyObject *, struct __pyx_opt_args_7cpython_8datetime_datetime_new *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cpython_8datetime_timedelta_new(int, int, int); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_timezone_new(PyObject *, struct __pyx_opt_args_7cpython_8datetime_timezone_new *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cpython_8datetime_datetime_from_timestamp(PyObject *, struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cpython_8datetime_date_from_timestamp(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_datetime_tzinfo(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_days(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_seconds(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_microseconds(PyObject *); /*proto*/

/* Module declarations from "cytimes.parser" */
static PyObject **__pyx_vp_7cytimes_6parser_CONFIG_PERTAIN = 0;
#define __pyx_v_7cytimes_6parser_CONFIG_PERTAIN (*__pyx_vp_7cytimes_6parser_CONFIG_PERTAIN)
static PyObject **__pyx_vp_7cytimes_6parser_CONFIG_JUMP = 0;
#define __pyx_v_7cytimes_6parser_CONFIG_JUMP (*__pyx_vp_7cytimes_6parser_CONFIG_JUMP)
static PyObject **__pyx_vp_7cytimes_6parser_CONFIG_UTC = 0;
#define __pyx_v_7cytimes_6parser_CONFIG_UTC (*__pyx_vp_7cytimes_6parser_CONFIG_UTC)
static PyObject **__pyx_vp_7cytimes_6parser_CONFIG_TZ = 0;
#define __pyx_v_7cytimes_6parser_CONFIG_TZ (*__pyx_vp_7cytimes_6parser_CONFIG_TZ)
static PyObject **__pyx_vp_7cytimes_6parser_CONFIG_MONTH = 0;
#define __pyx_v_7cytimes_6parser_CONFIG_MONTH (*__pyx_vp_7cytimes_6parser_CONFIG_MONTH)
static PyObject **__pyx_vp_7cytimes_6parser_CONFIG_WEEKDAY = 0;
#define __pyx_v_7cytimes_6parser_CONFIG_WEEKDAY (*__pyx_vp_7cytimes_6parser_CONFIG_WEEKDAY)
static PyObject **__pyx_vp_7cytimes_6parser_CONFIG_HMS_FLAG = 0;
#define __pyx_v_7cytimes_6parser_CONFIG_HMS_FLAG (*__pyx_vp_7cytimes_6parser_CONFIG_HMS_FLAG)
static PyObject **__pyx_vp_7cytimes_6parser_CONFIG_AMPM_FLAG = 0;
#define __pyx_v_7cytimes_6parser_CONFIG_AMPM_FLAG (*__pyx_vp_7cytimes_6parser_CONFIG_AMPM_FLAG)
static struct __pyx_obj_7cytimes_6parser_Parser **__pyx_vp_7cytimes_6parser__default_parser = 0;
#define __pyx_v_7cytimes_6parser__default_parser (*__pyx_vp_7cytimes_6parser__default_parser)
static PyDateTime_DateTime *(*__pyx_f_7cytimes_6parser_parse_dtobj)(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytimes_6parser_parse_dtobj *__pyx_optional_args); /*proto*/

/* Module declarations from "cytimes" */

/* Module declarations from "libc.stdlib" */

/* Module declarations from "libc.time" */

/* Module declarations from "libc.stdint" */

/* Module declarations from "cpython.time" */
static CYTHON_INLINE double __pyx_f_7cpython_4time_time(void); /*proto*/
static CYTHON_INLINE int __pyx_f_7cpython_4time__raise_from_errno(void); /*proto*/

/* Module declarations from "cytimes.utils" */
static int (*__pyx_vp_7cytimes_5utils_DAYS_BR_MONTH)[13] = 0;
#define __pyx_v_7cytimes_5utils_DAYS_BR_MONTH (*__pyx_vp_7cytimes_5utils_DAYS_BR_MONTH)
static int (*__pyx_vp_7cytimes_5utils_DAYS_IN_MONTH)[13] = 0;
#define __pyx_v_7cytimes_5utils_DAYS_IN_MONTH (*__pyx_vp_7cytimes_5utils_DAYS_IN_MONTH)
static int (*__pyx_vp_7cytimes_5utils_DAYS_BR_QUARTER)[5] = 0;
#define __pyx_v_7cytimes_5utils_DAYS_BR_QUARTER (*__pyx_vp_7cytimes_5utils_DAYS_BR_QUARTER)
static int (*__pyx_vp_7cytimes_5utils_DAYS_IN_QUARTER)[5] = 0;
#define __pyx_v_7cytimes_5utils_DAYS_IN_QUARTER (*__pyx_vp_7cytimes_5utils_DAYS_IN_QUARTER)
static int *__pyx_vp_7cytimes_5utils_ORDINAL_MAX = 0;
#define __pyx_v_7cytimes_5utils_ORDINAL_MAX (*__pyx_vp_7cytimes_5utils_ORDINAL_MAX)
static PyDateTime_DateTime **__pyx_vp_7cytimes_5utils_EPOCH_DT = 0;
#define __pyx_v_7cytimes_5utils_EPOCH_DT (*__pyx_vp_7cytimes_5utils_EPOCH_DT)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_EPOCH_YEAR = 0;
#define __pyx_v_7cytimes_5utils_EPOCH_YEAR (*__pyx_vp_7cytimes_5utils_EPOCH_YEAR)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_EPOCH_MONTH = 0;
#define __pyx_v_7cytimes_5utils_EPOCH_MONTH (*__pyx_vp_7cytimes_5utils_EPOCH_MONTH)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_EPOCH_DAY = 0;
#define __pyx_v_7cytimes_5utils_EPOCH_DAY (*__pyx_vp_7cytimes_5utils_EPOCH_DAY)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_EPOCH_HOUR = 0;
#define __pyx_v_7cytimes_5utils_EPOCH_HOUR (*__pyx_vp_7cytimes_5utils_EPOCH_HOUR)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_EPOCH_MINUTE = 0;
#define __pyx_v_7cytimes_5utils_EPOCH_MINUTE (*__pyx_vp_7cytimes_5utils_EPOCH_MINUTE)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_EPOCH_SECOND = 0;
#define __pyx_v_7cytimes_5utils_EPOCH_SECOND (*__pyx_vp_7cytimes_5utils_EPOCH_SECOND)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_EPOCH_MILLISECOND = 0;
#define __pyx_v_7cytimes_5utils_EPOCH_MILLISECOND (*__pyx_vp_7cytimes_5utils_EPOCH_MILLISECOND)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_EPOCH_MICROSECOND = 0;
#define __pyx_v_7cytimes_5utils_EPOCH_MICROSECOND (*__pyx_vp_7cytimes_5utils_EPOCH_MICROSECOND)
static PyDateTime_TZInfo **__pyx_vp_7cytimes_5utils_UTC = 0;
#define __pyx_v_7cytimes_5utils_UTC (*__pyx_vp_7cytimes_5utils_UTC)
static PyObject **__pyx_vp_7cytimes_5utils__LOCAL_TZ = 0;
#define __pyx_v_7cytimes_5utils__LOCAL_TZ (*__pyx_vp_7cytimes_5utils__LOCAL_TZ)
static PyObject **__pyx_vp_7cytimes_5utils__TIMEZONE_MAP = 0;
#define __pyx_v_7cytimes_5utils__TIMEZONE_MAP (*__pyx_vp_7cytimes_5utils__TIMEZONE_MAP)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_SS_MINUTE = 0;
#define __pyx_v_7cytimes_5utils_SS_MINUTE (*__pyx_vp_7cytimes_5utils_SS_MINUTE)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_SS_HOUR = 0;
#define __pyx_v_7cytimes_5utils_SS_HOUR (*__pyx_vp_7cytimes_5utils_SS_HOUR)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_SS_DAY = 0;
#define __pyx_v_7cytimes_5utils_SS_DAY (*__pyx_vp_7cytimes_5utils_SS_DAY)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_MS_SECOND = 0;
#define __pyx_v_7cytimes_5utils_MS_SECOND (*__pyx_vp_7cytimes_5utils_MS_SECOND)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_MS_MINUTE = 0;
#define __pyx_v_7cytimes_5utils_MS_MINUTE (*__pyx_vp_7cytimes_5utils_MS_MINUTE)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_MS_HOUR = 0;
#define __pyx_v_7cytimes_5utils_MS_HOUR (*__pyx_vp_7cytimes_5utils_MS_HOUR)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_MS_DAY = 0;
#define __pyx_v_7cytimes_5utils_MS_DAY (*__pyx_vp_7cytimes_5utils_MS_DAY)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_US_MILLISECOND = 0;
#define __pyx_v_7cytimes_5utils_US_MILLISECOND (*__pyx_vp_7cytimes_5utils_US_MILLISECOND)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_US_SECOND = 0;
#define __pyx_v_7cytimes_5utils_US_SECOND (*__pyx_vp_7cytimes_5utils_US_SECOND)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_US_MINUTE = 0;
#define __pyx_v_7cytimes_5utils_US_MINUTE (*__pyx_vp_7cytimes_5utils_US_MINUTE)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_US_HOUR = 0;
#define __pyx_v_7cytimes_5utils_US_HOUR (*__pyx_vp_7cytimes_5utils_US_HOUR)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_US_DAY = 0;
#define __pyx_v_7cytimes_5utils_US_DAY (*__pyx_vp_7cytimes_5utils_US_DAY)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_NS_MICROSECOND = 0;
#define __pyx_v_7cytimes_5utils_NS_MICROSECOND (*__pyx_vp_7cytimes_5utils_NS_MICROSECOND)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_NS_MILLISECOND = 0;
#define __pyx_v_7cytimes_5utils_NS_MILLISECOND (*__pyx_vp_7cytimes_5utils_NS_MILLISECOND)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_NS_SECOND = 0;
#define __pyx_v_7cytimes_5utils_NS_SECOND (*__pyx_vp_7cytimes_5utils_NS_SECOND)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_NS_MINUTE = 0;
#define __pyx_v_7cytimes_5utils_NS_MINUTE (*__pyx_vp_7cytimes_5utils_NS_MINUTE)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_NS_HOUR = 0;
#define __pyx_v_7cytimes_5utils_NS_HOUR (*__pyx_vp_7cytimes_5utils_NS_HOUR)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_NS_DAY = 0;
#define __pyx_v_7cytimes_5utils_NS_DAY (*__pyx_vp_7cytimes_5utils_NS_DAY)
static double *__pyx_vp_7cytimes_5utils_TD64_YY_DAY = 0;
#define __pyx_v_7cytimes_5utils_TD64_YY_DAY (*__pyx_vp_7cytimes_5utils_TD64_YY_DAY)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_TD64_YY_SECOND = 0;
#define __pyx_v_7cytimes_5utils_TD64_YY_SECOND (*__pyx_vp_7cytimes_5utils_TD64_YY_SECOND)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_TD64_YY_MILLISECOND = 0;
#define __pyx_v_7cytimes_5utils_TD64_YY_MILLISECOND (*__pyx_vp_7cytimes_5utils_TD64_YY_MILLISECOND)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_TD64_YY_MICROSECOND = 0;
#define __pyx_v_7cytimes_5utils_TD64_YY_MICROSECOND (*__pyx_vp_7cytimes_5utils_TD64_YY_MICROSECOND)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_TD64_YY_NANOSECOND = 0;
#define __pyx_v_7cytimes_5utils_TD64_YY_NANOSECOND (*__pyx_vp_7cytimes_5utils_TD64_YY_NANOSECOND)
static double *__pyx_vp_7cytimes_5utils_TD64_MM_DAY = 0;
#define __pyx_v_7cytimes_5utils_TD64_MM_DAY (*__pyx_vp_7cytimes_5utils_TD64_MM_DAY)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_TD64_MM_SECOND = 0;
#define __pyx_v_7cytimes_5utils_TD64_MM_SECOND (*__pyx_vp_7cytimes_5utils_TD64_MM_SECOND)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_TD64_MM_MILLISECOND = 0;
#define __pyx_v_7cytimes_5utils_TD64_MM_MILLISECOND (*__pyx_vp_7cytimes_5utils_TD64_MM_MILLISECOND)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_TD64_MM_MICROSECOND = 0;
#define __pyx_v_7cytimes_5utils_TD64_MM_MICROSECOND (*__pyx_vp_7cytimes_5utils_TD64_MM_MICROSECOND)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_TD64_MM_NANOSECOND = 0;
#define __pyx_v_7cytimes_5utils_TD64_MM_NANOSECOND (*__pyx_vp_7cytimes_5utils_TD64_MM_NANOSECOND)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_DT64_NS_YY_MIN = 0;
#define __pyx_v_7cytimes_5utils_DT64_NS_YY_MIN (*__pyx_vp_7cytimes_5utils_DT64_NS_YY_MIN)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_DT64_NS_MM_MIN = 0;
#define __pyx_v_7cytimes_5utils_DT64_NS_MM_MIN (*__pyx_vp_7cytimes_5utils_DT64_NS_MM_MIN)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_DT64_NS_WW_MIN = 0;
#define __pyx_v_7cytimes_5utils_DT64_NS_WW_MIN (*__pyx_vp_7cytimes_5utils_DT64_NS_WW_MIN)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_DT64_NS_DD_MIN = 0;
#define __pyx_v_7cytimes_5utils_DT64_NS_DD_MIN (*__pyx_vp_7cytimes_5utils_DT64_NS_DD_MIN)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_DT64_NS_HH_MIN = 0;
#define __pyx_v_7cytimes_5utils_DT64_NS_HH_MIN (*__pyx_vp_7cytimes_5utils_DT64_NS_HH_MIN)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_DT64_NS_MI_MIN = 0;
#define __pyx_v_7cytimes_5utils_DT64_NS_MI_MIN (*__pyx_vp_7cytimes_5utils_DT64_NS_MI_MIN)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_DT64_NS_SS_MIN = 0;
#define __pyx_v_7cytimes_5utils_DT64_NS_SS_MIN (*__pyx_vp_7cytimes_5utils_DT64_NS_SS_MIN)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_DT64_NS_MS_MIN = 0;
#define __pyx_v_7cytimes_5utils_DT64_NS_MS_MIN (*__pyx_vp_7cytimes_5utils_DT64_NS_MS_MIN)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_DT64_NS_US_MIN = 0;
#define __pyx_v_7cytimes_5utils_DT64_NS_US_MIN (*__pyx_vp_7cytimes_5utils_DT64_NS_US_MIN)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_DT64_NS_NS_MIN = 0;
#define __pyx_v_7cytimes_5utils_DT64_NS_NS_MIN (*__pyx_vp_7cytimes_5utils_DT64_NS_NS_MIN)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_DT64_NS_YY_MAX = 0;
#define __pyx_v_7cytimes_5utils_DT64_NS_YY_MAX (*__pyx_vp_7cytimes_5utils_DT64_NS_YY_MAX)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_DT64_NS_MM_MAX = 0;
#define __pyx_v_7cytimes_5utils_DT64_NS_MM_MAX (*__pyx_vp_7cytimes_5utils_DT64_NS_MM_MAX)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_DT64_NS_WW_MAX = 0;
#define __pyx_v_7cytimes_5utils_DT64_NS_WW_MAX (*__pyx_vp_7cytimes_5utils_DT64_NS_WW_MAX)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_DT64_NS_DD_MAX = 0;
#define __pyx_v_7cytimes_5utils_DT64_NS_DD_MAX (*__pyx_vp_7cytimes_5utils_DT64_NS_DD_MAX)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_DT64_NS_HH_MAX = 0;
#define __pyx_v_7cytimes_5utils_DT64_NS_HH_MAX (*__pyx_vp_7cytimes_5utils_DT64_NS_HH_MAX)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_DT64_NS_MI_MAX = 0;
#define __pyx_v_7cytimes_5utils_DT64_NS_MI_MAX (*__pyx_vp_7cytimes_5utils_DT64_NS_MI_MAX)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_DT64_NS_SS_MAX = 0;
#define __pyx_v_7cytimes_5utils_DT64_NS_SS_MAX (*__pyx_vp_7cytimes_5utils_DT64_NS_SS_MAX)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_DT64_NS_MS_MAX = 0;
#define __pyx_v_7cytimes_5utils_DT64_NS_MS_MAX (*__pyx_vp_7cytimes_5utils_DT64_NS_MS_MAX)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_DT64_NS_US_MAX = 0;
#define __pyx_v_7cytimes_5utils_DT64_NS_US_MAX (*__pyx_vp_7cytimes_5utils_DT64_NS_US_MAX)
static PY_LONG_LONG *__pyx_vp_7cytimes_5utils_DT64_NS_NS_MAX = 0;
#define __pyx_v_7cytimes_5utils_DT64_NS_NS_MAX (*__pyx_vp_7cytimes_5utils_DT64_NS_NS_MAX)
static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_math_mod(PY_LONG_LONG, PY_LONG_LONG, struct __pyx_opt_args_7cytimes_5utils_math_mod *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_math_round_div(PY_LONG_LONG, PY_LONG_LONG, struct __pyx_opt_args_7cytimes_5utils_math_round_div *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_math_floor_div(PY_LONG_LONG, PY_LONG_LONG, struct __pyx_opt_args_7cytimes_5utils_math_floor_div *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_ascii_digit(Py_UCS4); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_ascii_alpha_upper(Py_UCS4); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_ascii_alpha_lower(Py_UCS4); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isominute(PyObject *, Py_ssize_t, Py_ssize_t); /*proto*/
static CYTHON_INLINE struct tm __pyx_f_7cytimes_5utils_tm_gmtime(double); /*proto*/
static CYTHON_INLINE struct tm __pyx_f_7cytimes_5utils_tm_localtime(double); /*proto*/
static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_ts_localtime(double); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils__raise_from_errno(void); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_tm_strftime(struct tm, PyObject *); /*proto*/
static CYTHON_INLINE struct tm __pyx_f_7cytimes_5utils_tm_fr_us(PY_LONG_LONG); /*proto*/
static CYTHON_INLINE __pyx_t_7cytimes_5utils_hmsf __pyx_f_7cytimes_5utils_hmsf_fr_us(PY_LONG_LONG); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_leap_year(int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_long_year(int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_leap_bt_year(int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_in_year(int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_bf_year(int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_of_year(int, int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_quarter_of_month(int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_in_quarter(int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_bf_quarter(int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_of_quarter(int, int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_in_month(int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_bf_month(int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_ymd_weekday(int, int, int); /*proto*/
static CYTHON_INLINE __pyx_t_7cytimes_5utils_iso __pyx_f_7cytimes_5utils_ymd_isocalendar(int, int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_ymd_isoweek(int, int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_ymd_to_ordinal(int, int, int); /*proto*/
static CYTHON_INLINE __pyx_t_7cytimes_5utils_ymd __pyx_f_7cytimes_5utils_ymd_fr_ordinal(int); /*proto*/
static CYTHON_INLINE __pyx_t_7cytimes_5utils_ymd __pyx_f_7cytimes_5utils_ymd_fr_isocalendar(int, int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils__iso_1st_monday(int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_date(PyObject *); /*proto*/
static CYTHON_INLINE struct tm __pyx_f_7cytimes_5utils_date_to_tm(PyDateTime_Date *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_date_to_ordinal(PyDateTime_Date *); /*proto*/
static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_fr_ordinal(int); /*proto*/
static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_fr_dt(PyDateTime_DateTime *); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_now(struct __pyx_opt_args_7cytimes_5utils_dt_now *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_dt(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_dt_tzname(PyDateTime_DateTime *); /*proto*/
static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_dt_utcoffset(PyDateTime_DateTime *); /*proto*/
static CYTHON_INLINE struct tm __pyx_f_7cytimes_5utils_dt_to_tm(PyDateTime_DateTime *, struct __pyx_opt_args_7cytimes_5utils_dt_to_tm *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_dt_to_us(PyDateTime_DateTime *, struct __pyx_opt_args_7cytimes_5utils_dt_to_us *__pyx_optional_args); /*proto*/
static CYTHON_INLINE double __pyx_f_7cytimes_5utils_dt_to_seconds(PyDateTime_DateTime *, struct __pyx_opt_args_7cytimes_5utils_dt_to_seconds *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_dt_to_ordinal(PyDateTime_DateTime *, struct __pyx_opt_args_7cytimes_5utils_dt_to_ordinal *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_dt_to_posix(PyDateTime_DateTime *); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_fr_us(PY_LONG_LONG, struct __pyx_opt_args_7cytimes_5utils_dt_fr_us *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_fr_ts(double, struct __pyx_opt_args_7cytimes_5utils_dt_fr_ts *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_combine(struct __pyx_opt_args_7cytimes_5utils_dt_combine *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_fr_date(PyDateTime_Date *, struct __pyx_opt_args_7cytimes_5utils_dt_fr_date *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_add(PyDateTime_DateTime *, struct __pyx_opt_args_7cytimes_5utils_dt_add *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_replace_tz(PyDateTime_DateTime *, PyObject *); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_replace_fold(PyDateTime_DateTime *, int); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_astimezone(PyDateTime_DateTime *, struct __pyx_opt_args_7cytimes_5utils_dt_astimezone *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_time(PyObject *); /*proto*/
static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_time_utcoffset(PyDateTime_Time *); /*proto*/
static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cytimes_5utils_time_fr_us(PY_LONG_LONG, struct __pyx_opt_args_7cytimes_5utils_time_fr_us *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cytimes_5utils_time_fr_dt(PyDateTime_DateTime *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_td_to_utcformat(PyDateTime_Delta *); /*proto*/
static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_td_to_us(PyDateTime_Delta *); /*proto*/
static CYTHON_INLINE double __pyx_f_7cytimes_5utils_td_to_seconds(PyDateTime_Delta *); /*proto*/
static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_td_fr_us(PY_LONG_LONG); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_tz_local(struct __pyx_opt_args_7cytimes_5utils_tz_local *__pyx_optional_args); /*proto*/
static PyObject *(*__pyx_f_7cytimes_5utils_tz_parse)(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_tz(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_tz_name(PyObject *, struct __pyx_opt_args_7cytimes_5utils_tz_name *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_tz_dst(PyObject *, struct __pyx_opt_args_7cytimes_5utils_tz_dst *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_tz_utcoffset(PyObject *, struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_tz_utcoffset_seconds(PyObject *, struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset_seconds *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_tz_utcformat(PyObject *, struct __pyx_opt_args_7cytimes_5utils_tz_utcformat *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_map_nptime_unit_int2str(int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_get_arr_nptime_unit(PyArrayObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_arr_nptime_unit(PyArrayObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_dt64(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_validate_dt64(PyObject *); /*proto*/
static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils_dt64_as_int64_us(PyObject *, struct __pyx_opt_args_7cytimes_5utils_dt64_as_int64_us *__pyx_optional_args); /*proto*/
static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__dt64_Y_as_int64_D(npy_int64, struct __pyx_opt_args_7cytimes_5utils__dt64_Y_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__dt64_M_as_int64_D(npy_int64, struct __pyx_opt_args_7cytimes_5utils__dt64_M_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__dt64_W_as_int64_D(npy_int64, struct __pyx_opt_args_7cytimes_5utils__dt64_W_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils__raise_dt64_as_int64_unit_error(PyObject *, int, struct __pyx_opt_args_7cytimes_5utils__raise_dt64_as_int64_unit_error *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_validate_td64(PyObject *); /*proto*/
static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils_td64_as_int64_us(PyObject *, struct __pyx_opt_args_7cytimes_5utils_td64_as_int64_us *__pyx_optional_args); /*proto*/
static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__td64_Y_as_int64_D(npy_int64, struct __pyx_opt_args_7cytimes_5utils__td64_Y_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__td64_M_as_int64_D(npy_int64, struct __pyx_opt_args_7cytimes_5utils__td64_M_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__td64_W_as_int64_D(npy_int64, struct __pyx_opt_args_7cytimes_5utils__td64_W_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_assure_int64(PyArrayObject *); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_assure_int64_like(PyArrayObject *); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_assure_float64(PyArrayObject *); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_zero_int64(npy_int64); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_full_int64(npy_int64, npy_int64); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_clip(PyArrayObject *, npy_int64, npy_int64, struct __pyx_opt_args_7cytimes_5utils_arr_clip *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_min(PyArrayObject *, npy_int64, struct __pyx_opt_args_7cytimes_5utils_arr_min *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_min_arr(PyArrayObject *, PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_arr_min_arr *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_abs(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_arr_abs *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_add(PyArrayObject *, npy_int64); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_mul(PyArrayObject *, npy_int64, struct __pyx_opt_args_7cytimes_5utils_arr_mul *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_div(PyArrayObject *, npy_float64, struct __pyx_opt_args_7cytimes_5utils_arr_div *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_mod(PyArrayObject *, npy_int64, struct __pyx_opt_args_7cytimes_5utils_arr_mod *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_round_div(PyArrayObject *, npy_int64, struct __pyx_opt_args_7cytimes_5utils_arr_round_div *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_ceil_div(PyArrayObject *, npy_int64, struct __pyx_opt_args_7cytimes_5utils_arr_ceil_div *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_floor_div(PyArrayObject *, npy_int64, struct __pyx_opt_args_7cytimes_5utils_arr_floor_div *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_round_to_mul(PyArrayObject *, npy_int64, struct __pyx_opt_args_7cytimes_5utils_arr_round_to_mul *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_ceil_to_mul(PyArrayObject *, npy_int64, struct __pyx_opt_args_7cytimes_5utils_arr_ceil_to_mul *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_floor_to_mul(PyArrayObject *, npy_int64, struct __pyx_opt_args_7cytimes_5utils_arr_floor_to_mul *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_add_arr(PyArrayObject *, PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_arr_add_arr *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_sub_arr(PyArrayObject *, PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_arr_sub_arr *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_equal_to(PyArrayObject *, npy_int64); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_greater_than(PyArrayObject *, npy_int64); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_less_than(PyArrayObject *, npy_int64); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_equal_to_arr(PyArrayObject *, PyArrayObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_dt64arr(PyArrayObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_year(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_year *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_quarter(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_quarter *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_month(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_month *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_weekday(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_weekday *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_day(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_day *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_hour(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_hour *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_minute(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_minute *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_second(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_second *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_millisecond(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_millisecond *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_microsecond(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_microsecond *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_nanosecond(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_nanosecond *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_times(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_times *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_isocalendar(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_isocalendar *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_is_leap_year(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_is_leap_year *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_is_long_year(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_is_long_year *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_leap_bt_year(PyArrayObject *, npy_int64, struct __pyx_opt_args_7cytimes_5utils_dt64arr_leap_bt_year *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_in_year(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_year *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_bf_year(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_bf_year *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_of_year(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_of_year *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_in_quarter(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_quarter *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_bf_quarter(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_bf_quarter *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_of_quarter(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_of_quarter *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_in_month(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_month *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_bf_month(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_bf_month *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_fr_int64(npy_int64, PyObject *, npy_int64); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64(PyArrayObject *, PyObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_Q(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Q *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_W(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_W *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_h(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_h *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_m(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_m *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_s(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_s *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_ms(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ms *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_us(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_us *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_ns(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ns *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__dt64arr_Y_as_int64_D(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils__dt64arr_Y_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__dt64arr_M_as_int64_D(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils__dt64arr_M_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__dt64arr_W_as_int64_D(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils__dt64arr_W_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_iso_W(PyArrayObject *, int, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_iso_W *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_to_ordinal(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_to_ordinal *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_to_ts(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_to_ts *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_unit(PyArrayObject *, PyObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_unit *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_round(PyArrayObject *, PyObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_round *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_ceil(PyArrayObject *, PyObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_ceil *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_floor(PyArrayObject *, PyObject *, struct __pyx_opt_args_7cytimes_5utils_dt64arr_floor *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_find_closest(PyArrayObject *, PyArrayObject *); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_find_farthest(PyArrayObject *, PyArrayObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(PyObject *, int, struct __pyx_opt_args_7cytimes_5utils__raise_dt64arr_as_int64_unit_error *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(PyObject *, int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(PyArrayObject *, PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_td64arr(PyArrayObject *); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__td64arr_Y_as_int64_D(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils__td64arr_Y_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__td64arr_M_as_int64_D(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils__td64arr_M_as_int64_D *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__td64arr_W_as_int64_D(PyArrayObject *, struct __pyx_opt_args_7cytimes_5utils__td64arr_W_as_int64_D *__pyx_optional_args); /*proto*/

/* Module declarations from "cytimes.pddt" */
static PyObject *__pyx_f_7cytimes_4pddt_pddt_new(PyObject *, struct __pyx_opt_args_7cytimes_4pddt_pddt_new *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_7cytimes_4pddt_pddt_new_simple(PyObject *, struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_7cytimes_4pddt__pddt_new(PyObject *, struct __pyx_opt_args_7cytimes_4pddt__pddt_new *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_7cytimes_4pddt__pddt_new_cytimes(PyObject *, struct __pyx_opt_args_7cytimes_4pddt__pddt_new_cytimes *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_7cytimes_4pddt__pddt_fr_dt(PyDateTime_DateTime *, Py_ssize_t, struct __pyx_opt_args_7cytimes_4pddt__pddt_fr_dt *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_7cytimes_4pddt__pddt_fr_us(PY_LONG_LONG, Py_ssize_t, struct __pyx_opt_args_7cytimes_4pddt__pddt_fr_us *__pyx_optional_args); /*proto*/
static PyDateTime_DateTime *__pyx_f_7cytimes_4pddt__parse_dtobj(PyObject *, struct __pyx_opt_args_7cytimes_4pddt__parse_dtobj *__pyx_optional_args); /*proto*/
static int __pyx_f_7cytimes_4pddt__parse_month(PyObject *, int); /*proto*/
static int __pyx_f_7cytimes_4pddt__parse_weekday(PyObject *, int); /*proto*/
static Py_ssize_t __pyx_f_7cytimes_4pddt__parse_arr_size(PyObject *); /*proto*/
static int __pyx_f_7cytimes_4pddt__raise_incomparable_error(PyObject *, PyObject *, struct __pyx_opt_args_7cytimes_4pddt__raise_incomparable_error *__pyx_optional_args); /*proto*/
/* #### Code section: typeinfo ### */
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "cytimes.pddt"
extern int __pyx_module_is_main_cytimes__pddt;
int __pyx_module_is_main_cytimes__pddt = 0;

/* Implementation of "cytimes.pddt" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_property;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_AssertionError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_ZeroDivisionError;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_OverflowError;
/* #### Code section: string_decls ### */
static const char __pyx_k_D[] = "D";
static const char __pyx_k_M[] = "M";
static const char __pyx_k_Q[] = "Q";
static const char __pyx_k_S[] = "S";
static const char __pyx_k_T[] = "T";
static const char __pyx_k_W[] = "W";
static const char __pyx_k_Y[] = "Y";
static const char __pyx_k_d[] = "d";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_h[] = "h";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_m[] = "m";
static const char __pyx_k_s[] = "s";
static const char __pyx_k_00[] = "-00:";
static const char __pyx_k_2d[] = "2d";
static const char __pyx_k__9[] = "-";
static const char __pyx_k_as[] = "as";
static const char __pyx_k_dd[] = "dd";
static const char __pyx_k_dt[] = "dt";
static const char __pyx_k_fs[] = "fs";
static const char __pyx_k_gc[] = "gc";
static const char __pyx_k_mm[] = "mm";
static const char __pyx_k_ms[] = "ms";
static const char __pyx_k_np[] = "np";
static const char __pyx_k_ns[] = "ns";
static const char __pyx_k_ps[] = "ps";
static const char __pyx_k_pt[] = "pt";
static const char __pyx_k_to[] = "]]'> to '";
static const char __pyx_k_ts[] = "ts";
static const char __pyx_k_tz[] = "tz";
static const char __pyx_k_us[] = "us";
static const char __pyx_k_vs[] = "' vs '";
static const char __pyx_k_wd[] = "wd";
static const char __pyx_k_ww[] = "ww";
static const char __pyx_k_yy[] = "yy";
static const char __pyx_k_02d[] = "02d";
static const char __pyx_k_04d[] = "04d";
static const char __pyx_k_06d[] = "%06d";
static const char __pyx_k_Apr[] = "Apr";
static const char __pyx_k_Aug[] = "Aug";
static const char __pyx_k_Dec[] = "Dec";
static const char __pyx_k_Feb[] = "Feb";
static const char __pyx_k_Fri[] = "Fri";
static const char __pyx_k_Jan[] = "Jan";
static const char __pyx_k_Jul[] = "Jul";
static const char __pyx_k_Jun[] = "Jun";
static const char __pyx_k_Mar[] = "Mar";
static const char __pyx_k_May[] = "May";
static const char __pyx_k_Mon[] = "Mon";
static const char __pyx_k_NaT[] = "NaT";
static const char __pyx_k_Nov[] = "Nov";
static const char __pyx_k_Oct[] = "Oct";
static const char __pyx_k_Sat[] = "Sat";
static const char __pyx_k_Sep[] = "Sep";
static const char __pyx_k_Sun[] = "Sun";
static const char __pyx_k_Thu[] = "Thu";
static const char __pyx_k_Tue[] = "Tue";
static const char __pyx_k_Wed[] = "Wed";
static const char __pyx_k__10[] = " ";
static const char __pyx_k__11[] = ":";
static const char __pyx_k__12[] = "";
static const char __pyx_k__13[] = "%";
static const char __pyx_k__14[] = ".";
static const char __pyx_k__15[] = "+";
static const char __pyx_k__19[] = "[";
static const char __pyx_k__43[] = "'].";
static const char __pyx_k__44[] = "*";
static const char __pyx_k__79[] = "_";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_all[] = "__all__";
static const char __pyx_k_arr[] = "arr";
static const char __pyx_k_cfg[] = "cfg";
static const char __pyx_k_cls[] = "cls";
static const char __pyx_k_day[] = "day";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_dst[] = "dst";
static const char __pyx_k_dts[] = "dts";
static const char __pyx_k_end[] = "end";
static const char __pyx_k_err[] = "err";
static const char __pyx_k_fac[] = "fac";
static const char __pyx_k_fmt[] = "fmt";
static const char __pyx_k_fsp[] = "fsp";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_iso[] = "iso";
static const char __pyx_k_lib[] = "lib";
static const char __pyx_k_min[] = "min";
static const char __pyx_k_mul[] = "mul";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_now[] = "now";
static const char __pyx_k_off[] = "off";
static const char __pyx_k_one[] = "one";
static const char __pyx_k_res[] = "res";
static const char __pyx_k_sec[] = "sec";
static const char __pyx_k_sep[] = "sep";
static const char __pyx_k_str[] = "str";
static const char __pyx_k_sub[] = "sub";
static const char __pyx_k_utc[] = "utc";
static const char __pyx_k_val[] = "val";
static const char __pyx_k_wkd[] = "wkd";
static const char __pyx_k_ymd[] = "_ymd";
static const char __pyx_k_None[] = "None";
static const char __pyx_k_Pddt[] = "Pddt";
static const char __pyx_k_Self[] = "Self";
static const char __pyx_k__242[] = "?";
static const char __pyx_k_bool[] = "bool";
static const char __pyx_k_both[] = "both";
static const char __pyx_k_ceil[] = "ceil";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_date[] = "date";
static const char __pyx_k_days[] = "days";
static const char __pyx_k_dict[] = "dict";
static const char __pyx_k_diff[] = "diff";
static const char __pyx_k_dt64[] = "dt64";
static const char __pyx_k_freq[] = "freq";
static const char __pyx_k_hour[] = "hour";
static const char __pyx_k_item[] = "item";
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_pytz[] = "pytz";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_snap[] = "snap";
static const char __pyx_k_spec[] = "__spec__";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_time[] = "time";
static const char __pyx_k_to_2[] = "]'> to ";
static const char __pyx_k_unit[] = "unit";
static const char __pyx_k_week[] = "week";
static const char __pyx_k_year[] = "year";
static const char __pyx_k_00_00[] = "-00:00:";
static const char __pyx_k_06d_2[] = "06d";
static const char __pyx_k_Index[] = "Index";
static const char __pyx_k_Y_m_d[] = "%Y-%m-%d";
static const char __pyx_k_ctime[] = "ctime";
static const char __pyx_k_dates[] = "dates";
static const char __pyx_k_delta[] = "delta";
static const char __pyx_k_dtstr[] = "dtstr";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_floor[] = "floor";
static const char __pyx_k_hours[] = "hours";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_infer[] = "infer";
static const char __pyx_k_int64[] = "int64";
static const char __pyx_k_iso_2[] = "_iso";
static const char __pyx_k_lower[] = "lower";
static const char __pyx_k_month[] = "month";
static const char __pyx_k_my_tz[] = "my_tz";
static const char __pyx_k_naive[] = "naive";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_parse[] = "parse";
static const char __pyx_k_pt_tz[] = "pt_tz";
static const char __pyx_k_raise[] = "raise";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_round[] = "round";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_times[] = "times";
static const char __pyx_k_today[] = "today";
static const char __pyx_k_utils[] = "utils";
static const char __pyx_k_weeks[] = "weeks";
static const char __pyx_k_years[] = "years";
static const char __pyx_k_Series[] = "Series";
static const char __pyx_k_astype[] = "astype";
static const char __pyx_k_cannot[] = "cannot ";
static const char __pyx_k_datesD[] = "datesD";
static const char __pyx_k_datesM[] = "datesM";
static const char __pyx_k_datesQ[] = "datesQ";
static const char __pyx_k_datesY[] = "datesY";
static const char __pyx_k_day1st[] = "day1st";
static const char __pyx_k_dict_2[] = "__dict__";
static const char __pyx_k_dt_val[] = "dt_val";
static const char __pyx_k_dtobjs[] = "dtobjs";
static const char __pyx_k_enable[] = "enable";
static const char __pyx_k_errors[] = "errors";
static const char __pyx_k_hh_fac[] = "hh_fac";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_is_day[] = "is_day";
static const char __pyx_k_is_utc[] = "is_utc";
static const char __pyx_k_mi_fac[] = "mi_fac";
static const char __pyx_k_minute[] = "minute";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_months[] = "months";
static const char __pyx_k_my_arr[] = "my_arr";
static const char __pyx_k_name_2[] = "__name__";
static const char __pyx_k_object[] = "object";
static const char __pyx_k_offset[] = "offset";
static const char __pyx_k_pandas[] = "pandas";
static const char __pyx_k_pd_err[] = "pd_err";
static const char __pyx_k_pt_1st[] = "pt_1st";
static const char __pyx_k_pt_arr[] = "pt_arr";
static const char __pyx_k_pt_end[] = "pt_end";
static const char __pyx_k_pt_lst[] = "pt_lst";
static const char __pyx_k_pt_stt[] = "pt_stt";
static const char __pyx_k_return[] = "return";
static const char __pyx_k_second[] = "second";
static const char __pyx_k_ss_fac[] = "ss_fac";
static const char __pyx_k_timedf[] = "timedf";
static const char __pyx_k_timetz[] = "timetz";
static const char __pyx_k_tm_min[] = "tm_min";
static const char __pyx_k_tm_mon[] = "tm_mon";
static const char __pyx_k_tm_sec[] = "tm_sec";
static const char __pyx_k_to_day[] = "to_day";
static const char __pyx_k_typing[] = "typing";
static const char __pyx_k_tzinfo[] = "tzinfo";
static const char __pyx_k_tzname[] = "tzname";
static const char __pyx_k_us_fac[] = "us_fac";
static const char __pyx_k_utcnow[] = "utcnow";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_Configs[] = "Configs";
static const char __pyx_k_Literal[] = "Literal";
static const char __pyx_k_arr_ptr[] = "arr_ptr";
static const char __pyx_k_as_unit[] = "as_unit";
static const char __pyx_k_base_tz[] = "base_tz";
static const char __pyx_k_closest[] = "closest";
static const char __pyx_k_columns[] = "columns";
static const char __pyx_k_combine[] = "combine";
static const char __pyx_k_compare[] = "compare";
static const char __pyx_k_cytimes[] = "cytimes";
static const char __pyx_k_disable[] = "disable";
static const char __pyx_k_fromutc[] = "fromutc";
static const char __pyx_k_int_str[] = "int | str";
static const char __pyx_k_is_past[] = "is_past";
static const char __pyx_k_is_year[] = "is_year";
static const char __pyx_k_isoweek[] = "isoweek";
static const char __pyx_k_isoyear[] = "isoyear";
static const char __pyx_k_minutes[] = "minutes";
static const char __pyx_k_my_unit[] = "my_unit";
static const char __pyx_k_neither[] = "neither";
static const char __pyx_k_ordinal[] = "ordinal";
static const char __pyx_k_periods[] = "periods";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_pt_unit[] = "pt_unit";
static const char __pyx_k_quarter[] = "quarter";
static const char __pyx_k_replace[] = "replace";
static const char __pyx_k_seconds[] = "seconds";
static const char __pyx_k_set_str[] = "set[str]";
static const char __pyx_k_str_int[] = "str | int";
static const char __pyx_k_targ_tz[] = "targ_tz";
static const char __pyx_k_tm_hour[] = "tm_hour";
static const char __pyx_k_tm_mday[] = "tm_mday";
static const char __pyx_k_tm_wday[] = "tm_wday";
static const char __pyx_k_tm_yday[] = "tm_yday";
static const char __pyx_k_tm_year[] = "tm_year";
static const char __pyx_k_to_date[] = "to_date";
static const char __pyx_k_to_time[] = "to_time";
static const char __pyx_k_to_year[] = "to_year";
static const char __pyx_k_weekday[] = "weekday";
static const char __pyx_k_year1st[] = "year1st";
static const char __pyx_k_Hashable[] = "Hashable";
static const char __pyx_k_Pddt_add[] = "Pddt.add";
static const char __pyx_k_Pddt_day[] = "Pddt.day";
static const char __pyx_k_Pddt_fsp[] = "Pddt.fsp";
static const char __pyx_k_Pddt_now[] = "Pddt.now";
static const char __pyx_k_Pddt_sub[] = "Pddt.sub";
static const char __pyx_k_absolute[] = "absolute";
static const char __pyx_k_arr_size[] = "arr_size";
static const char __pyx_k_datetime[] = "datetime";
static const char __pyx_k_dayfirst[] = "dayfirst";
static const char __pyx_k_farthest[] = "farthest";
static const char __pyx_k_fromdate[] = "fromdate";
static const char __pyx_k_incl_off[] = "incl_off";
static const char __pyx_k_int_None[] = "int | None";
static const char __pyx_k_is_local[] = "is_local";
static const char __pyx_k_is_month[] = "is_month";
static const char __pyx_k_property[] = "property";
static const char __pyx_k_pytz_err[] = "pytz_err";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_quarters[] = "quarters";
static const char __pyx_k_set_name[] = "__set_name__";
static const char __pyx_k_strftime[] = "strftime";
static const char __pyx_k_strptime[] = "strptime";
static const char __pyx_k_tm_isdst[] = "tm_isdst";
static const char __pyx_k_to_month[] = "to_month";
static const char __pyx_k_zoneinfo[] = "zoneinfo";
static const char __pyx_k_00_00_02d[] = "-00:00:%02d";
static const char __pyx_k_DataFrame[] = "DataFrame";
static const char __pyx_k_H_M_S_f_z[] = "%H:%M:%S.%f%z";
static const char __pyx_k_Index_str[] = "Index[str]";
static const char __pyx_k_Pddt_ceil[] = "Pddt.ceil";
static const char __pyx_k_Pddt_date[] = "Pddt.date";
static const char __pyx_k_Pddt_diff[] = "Pddt.diff";
static const char __pyx_k_Pddt_hour[] = "Pddt.hour";
static const char __pyx_k_Pddt_snap[] = "Pddt.snap";
static const char __pyx_k_Pddt_time[] = "Pddt.time";
static const char __pyx_k_Pddt_year[] = "Pddt.year";
static const char __pyx_k_Timestamp[] = "Timestamp";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_ambiguous[] = "ambiguous";
static const char __pyx_k_bool_None[] = "bool | None";
static const char __pyx_k_inclusive[] = "inclusive";
static const char __pyx_k_is_end_of[] = "is_end_of";
static const char __pyx_k_is_future[] = "is_future";
static const char __pyx_k_isenabled[] = "isenabled";
static const char __pyx_k_isoformat[] = "isoformat";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_normalize[] = "normalize";
static const char __pyx_k_precision[] = "precision";
static const char __pyx_k_timestamp[] = "timestamp";
static const char __pyx_k_to_end_of[] = "to_end_of";
static const char __pyx_k_to_friday[] = "to_friday";
static const char __pyx_k_to_monday[] = "to_monday";
static const char __pyx_k_to_sunday[] = "to_sunday";
static const char __pyx_k_toordinal[] = "toordinal";
static const char __pyx_k_tz_switch[] = "tz_switch";
static const char __pyx_k_utcoffset[] = "utcoffset";
static const char __pyx_k_utctimedf[] = "utctimedf";
static const char __pyx_k_yearfirst[] = "yearfirst";
static const char __pyx_k_Index_bool[] = "Index[bool]";
static const char __pyx_k_Pddt___new[] = "Pddt.__new__";
static const char __pyx_k_Pddt_ctime[] = "Pddt.ctime";
static const char __pyx_k_Pddt_floor[] = "Pddt.floor";
static const char __pyx_k_Pddt_month[] = "Pddt.month";
static const char __pyx_k_Pddt_parse[] = "Pddt.parse";
static const char __pyx_k_Pddt_round[] = "Pddt.round";
static const char __pyx_k_Pddt_today[] = "Pddt.today";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_astimezone[] = "astimezone";
static const char __pyx_k_cython_int[] = "cython.int";
static const char __pyx_k_date_range[] = "date_range";
static const char __pyx_k_datesD_1st[] = "datesD_1st";
static const char __pyx_k_datesD_lst[] = "datesD_lst";
static const char __pyx_k_datetime64[] = "datetime64";
static const char __pyx_k_exceptions[] = "exceptions";
static const char __pyx_k_int_object[] = "int | object";
static const char __pyx_k_is_last_of[] = "is_last_of";
static const char __pyx_k_is_quarter[] = "is_quarter";
static const char __pyx_k_is_weekday[] = "is_weekday";
static const char __pyx_k_isoweekday[] = "isoweekday";
static const char __pyx_k_itertuples[] = "itertuples";
static const char __pyx_k_my_unit_ch[] = "my_unit_ch";
static const char __pyx_k_my_unit_ns[] = "my_unit_ns";
static const char __pyx_k_nanosecond[] = "nanosecond";
static const char __pyx_k_no_default[] = "no_default";
static const char __pyx_k_parse_dict[] = "_parse_dict";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_resolution[] = "' resolution.\n";
static const char __pyx_k_str_object[] = "str | object";
static const char __pyx_k_to_last_of[] = "to_last_of";
static const char __pyx_k_to_quarter[] = "to_quarter";
static const char __pyx_k_to_tuesday[] = "to_tuesday";
static const char __pyx_k_to_weekday[] = "to_weekday";
static const char __pyx_k_tz_convert[] = "tz_convert";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_MemoryError[] = "MemoryError";
static const char __pyx_k_ParserError[] = "ParserError";
static const char __pyx_k_Pddt_is_day[] = "Pddt.is_day";
static const char __pyx_k_Pddt_is_utc[] = "Pddt.is_utc";
static const char __pyx_k_Pddt_minute[] = "Pddt.minute";
static const char __pyx_k_Pddt_second[] = "Pddt.second";
static const char __pyx_k_Pddt_timedf[] = "Pddt.timedf";
static const char __pyx_k_Pddt_timetz[] = "Pddt.timetz";
static const char __pyx_k_Pddt_to_day[] = "Pddt.to_day";
static const char __pyx_k_Pddt_tzname[] = "Pddt.tzname";
static const char __pyx_k_Pddt_utcnow[] = "Pddt.utcnow";
static const char __pyx_k_cannot_cast[] = "cannot cast ";
static const char __pyx_k_cython_bint[] = "cython.bint";
static const char __pyx_k_fromordinal[] = "fromordinal";
static const char __pyx_k_fromseconds[] = "fromseconds";
static const char __pyx_k_is_end_of_s[] = "is_end_of[%s]";
static const char __pyx_k_is_first_of[] = "is_first_of";
static const char __pyx_k_is_start_of[] = "is_start_of";
static const char __pyx_k_isocalendar[] = "isocalendar";
static const char __pyx_k_microsecond[] = "microsecond";
static const char __pyx_k_millisecond[] = "millisecond";
static const char __pyx_k_mro_entries[] = "__mro_entries__";
static const char __pyx_k_my_unit_adj[] = "my_unit_adj";
static const char __pyx_k_my_unit_int[] = "my_unit_int";
static const char __pyx_k_nanoseconds[] = "nanoseconds";
static const char __pyx_k_nonexistent[] = "nonexistent";
static const char __pyx_k_object_None[] = "object | None";
static const char __pyx_k_parse_dtobj[] = "parse_dtobj";
static const char __pyx_k_pt_end_unit[] = "pt_end_unit";
static const char __pyx_k_pt_stt_unit[] = "pt_stt_unit";
static const char __pyx_k_pt_unit_int[] = "pt_unit_int";
static const char __pyx_k_timedelta64[] = "timedelta64";
static const char __pyx_k_to_datetime[] = "to_datetime";
static const char __pyx_k_to_first_of[] = "to_first_of";
static const char __pyx_k_to_saturday[] = "to_saturday";
static const char __pyx_k_to_start_of[] = "to_start_of";
static const char __pyx_k_to_thursday[] = "to_thursday";
static const char __pyx_k_to_tomorrow[] = "to_tomorrow";
static const char __pyx_k_tz_localize[] = "tz_localize";
static const char __pyx_k_00_00_00_06d[] = "-00:00:00.%06d";
static const char __pyx_k_Pddt_as_unit[] = "Pddt.as_unit";
static const char __pyx_k_Pddt_closest[] = "Pddt.closest";
static const char __pyx_k_Pddt_combine[] = "Pddt.combine";
static const char __pyx_k_Pddt_is_past[] = "Pddt.is_past";
static const char __pyx_k_Pddt_is_year[] = "Pddt.is_year";
static const char __pyx_k_Pddt_isoweek[] = "Pddt.isoweek";
static const char __pyx_k_Pddt_isoyear[] = "Pddt.isoyear";
static const char __pyx_k_Pddt_quarter[] = "Pddt.quarter";
static const char __pyx_k_Pddt_replace[] = "Pddt.replace";
static const char __pyx_k_Pddt_seconds[] = "Pddt.seconds";
static const char __pyx_k_Pddt_to_date[] = "Pddt.to_date";
static const char __pyx_k_Pddt_to_time[] = "Pddt.to_time";
static const char __pyx_k_Pddt_to_year[] = "Pddt.to_year";
static const char __pyx_k_Pddt_weekday[] = "Pddt.weekday";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_cytimes_pddt[] = "cytimes.pddt";
static const char __pyx_k_datetime64_D[] = "datetime64[D]";
static const char __pyx_k_datetime64_M[] = "datetime64[M]";
static const char __pyx_k_datetime64_W[] = "datetime64[W]";
static const char __pyx_k_datetime64_Y[] = "datetime64[Y]";
static const char __pyx_k_datetime64_h[] = "datetime64[h]";
static const char __pyx_k_datetime64_m[] = "datetime64[m]";
static const char __pyx_k_datetime64_s[] = "datetime64[%s]";
static const char __pyx_k_days_bf_year[] = "days_bf_year";
static const char __pyx_k_days_in_year[] = "days_in_year";
static const char __pyx_k_days_of_year[] = "days_of_year";
static const char __pyx_k_find_closest[] = "find closest";
static const char __pyx_k_fromdatetime[] = "fromdatetime";
static const char __pyx_k_initializing[] = "_initializing";
static const char __pyx_k_int_str_None[] = "int | str | None";
static const char __pyx_k_is_coroutine[] = "_is_coroutine";
static const char __pyx_k_is_last_of_s[] = "is_last_of[%s]";
static const char __pyx_k_is_leap_year[] = "is_leap_year";
static const char __pyx_k_is_long_year[] = "is_long_year";
static const char __pyx_k_leap_bt_year[] = "leap_bt_year";
static const char __pyx_k_microseconds[] = "microseconds";
static const char __pyx_k_milliseconds[] = "milliseconds";
static const char __pyx_k_pandas__libs[] = "pandas._libs";
static const char __pyx_k_to_curr_year[] = "to_curr_year";
static const char __pyx_k_to_next_year[] = "to_next_year";
static const char __pyx_k_to_prev_year[] = "to_prev_year";
static const char __pyx_k_to_wednesday[] = "to_wednesday";
static const char __pyx_k_to_yesterday[] = "to_yesterday";
static const char __pyx_k_tz_available[] = "tz_available";
static const char __pyx_k_values_naive[] = "values_naive";
static const char __pyx_k_DatetimeArray[] = "DatetimeArray";
static const char __pyx_k_DatetimeIndex[] = "DatetimeIndex";
static const char __pyx_k_Hashable_None[] = "Hashable | None";
static const char __pyx_k_OverflowError[] = "OverflowError";
static const char __pyx_k_Pddt_datetime[] = "Pddt.datetime";
static const char __pyx_k_Pddt_farthest[] = "Pddt.farthest";
static const char __pyx_k_Pddt_fromdate[] = "Pddt.fromdate";
static const char __pyx_k_Pddt_is_local[] = "Pddt.is_local";
static const char __pyx_k_Pddt_is_month[] = "Pddt.is_month";
static const char __pyx_k_Pddt_strptime[] = "Pddt.strptime";
static const char __pyx_k_Pddt_to_month[] = "Pddt.to_month";
static const char __pyx_k_a_b_d_H_M_S_Y[] = "%a %b %d %H:%M:%S %Y";
static const char __pyx_k_class_getitem[] = "__class_getitem__";
static const char __pyx_k_datetime64_ms[] = "datetime64[ms]";
static const char __pyx_k_datetime64_ns[] = "datetime64[ns]";
static const char __pyx_k_datetime64_us[] = "datetime64[us]";
static const char __pyx_k_days_bf_month[] = "days_bf_month";
static const char __pyx_k_days_in_month[] = "days_in_month";
static const char __pyx_k_days_of_month[] = "days_of_month";
static const char __pyx_k_find_farthest[] = "find farthest";
static const char __pyx_k_fromisoformat[] = "fromisoformat";
static const char __pyx_k_fromtimestamp[] = "fromtimestamp";
static const char __pyx_k_init_subclass[] = "__init_subclass__";
static const char __pyx_k_is_first_of_s[] = "is_first_of[%s]";
static const char __pyx_k_is_start_of_s[] = "is_start_of[%s]";
static const char __pyx_k_shift_forward[] = "shift_forward";
static const char __pyx_k_to_curr_month[] = "to_curr_month";
static const char __pyx_k_to_datetime64[] = "] to datetime64[";
static const char __pyx_k_to_next_month[] = "to_next_month";
static const char __pyx_k_to_prev_month[] = "to_prev_month";
static const char __pyx_k_to_pydatetime[] = "to_pydatetime";
static const char __pyx_k_AssertionError[] = "AssertionError";
static const char __pyx_k_DateParseError[] = "DateParseError";
static const char __pyx_k_Index_np_int64[] = "Index[np.int64]";
static const char __pyx_k_Pddt_is_end_of[] = "Pddt.is_end_of";
static const char __pyx_k_Pddt_is_future[] = "Pddt.is_future";
static const char __pyx_k_Pddt_isoformat[] = "Pddt.isoformat";
static const char __pyx_k_Pddt_timestamp[] = "Pddt.timestamp";
static const char __pyx_k_Pddt_to_end_of[] = "Pddt.to_end_of";
static const char __pyx_k_Pddt_to_friday[] = "Pddt.to_friday";
static const char __pyx_k_Pddt_to_monday[] = "Pddt.to_monday";
static const char __pyx_k_Pddt_to_sunday[] = "Pddt.to_sunday";
static const char __pyx_k_Pddt_toordinal[] = "Pddt.toordinal";
static const char __pyx_k_Pddt_tz_switch[] = "Pddt.tz_switch";
static const char __pyx_k_Pddt_utctimedf[] = "Pddt.utctimedf";
static const char __pyx_k_Timezone_aware[] = "\nTimezone-aware ";
static const char __pyx_k_Timezone_naive[] = "\nTimezone-naive ";
static const char __pyx_k_cytimes_parser[] = "cytimes.parser";
static const char __pyx_k_datetime64_s_2[] = "datetime64[s]";
static const char __pyx_k_fromdatetime64[] = "fromdatetime64";
static const char __pyx_k_generate_range[] = "_generate_range";
static const char __pyx_k_parse_sequence[] = "_parse_sequence";
static const char __pyx_k_to_int64_under[] = "]'> to int64 under '";
static const char __pyx_k_InvalidFspError[] = "InvalidFspError";
static const char __pyx_k_Pddt_astimezone[] = "Pddt.astimezone";
static const char __pyx_k_Pddt_date_range[] = "Pddt.date_range";
static const char __pyx_k_Pddt_is_last_of[] = "Pddt.is_last_of";
static const char __pyx_k_Pddt_is_quarter[] = "Pddt.is_quarter";
static const char __pyx_k_Pddt_is_weekday[] = "Pddt.is_weekday";
static const char __pyx_k_Pddt_isoweekday[] = "Pddt.isoweekday";
static const char __pyx_k_Pddt_nanosecond[] = "Pddt.nanosecond";
static const char __pyx_k_Pddt_to_last_of[] = "Pddt.to_last_of";
static const char __pyx_k_Pddt_to_quarter[] = "Pddt.to_quarter";
static const char __pyx_k_Pddt_to_tuesday[] = "Pddt.to_tuesday";
static const char __pyx_k_Pddt_to_weekday[] = "Pddt.to_weekday";
static const char __pyx_k_Pddt_tz_convert[] = "Pddt.tz_convert";
static const char __pyx_k_days_bf_quarter[] = "days_bf_quarter";
static const char __pyx_k_days_in_quarter[] = "days_in_quarter";
static const char __pyx_k_days_of_quarter[] = "days_of_quarter";
static const char __pyx_k_fromicroseconds[] = "fromicroseconds";
static const char __pyx_k_fromisocalendar[] = "fromisocalendar";
static const char __pyx_k_mixed_timezones[] = "mixed timezones";
static const char __pyx_k_to_curr_quarter[] = "to_curr_quarter";
static const char __pyx_k_to_curr_weekday[] = "_to_curr_weekday";
static const char __pyx_k_to_next_quarter[] = "to_next_quarter";
static const char __pyx_k_to_next_weekday[] = "to_next_weekday";
static const char __pyx_k_to_prev_quarter[] = "to_prev_quarter";
static const char __pyx_k_to_prev_weekday[] = "to_prev_weekday";
static const char __pyx_k_unless_utc_True[] = "unless utc=True";
static const char __pyx_k_Index_np_float64[] = "Index[np.float64]";
static const char __pyx_k_InvalidTypeError[] = "InvalidTypeError";
static const char __pyx_k_Pddt_fromordinal[] = "Pddt.fromordinal";
static const char __pyx_k_Pddt_fromseconds[] = "Pddt.fromseconds";
static const char __pyx_k_Pddt_is_first_of[] = "Pddt.is_first_of";
static const char __pyx_k_Pddt_is_start_of[] = "Pddt.is_start_of";
static const char __pyx_k_Pddt_isocalendar[] = "Pddt.isocalendar";
static const char __pyx_k_Pddt_microsecond[] = "Pddt.microsecond";
static const char __pyx_k_Pddt_millisecond[] = "Pddt.millisecond";
static const char __pyx_k_Pddt_to_datetime[] = "Pddt.to_datetime";
static const char __pyx_k_Pddt_to_first_of[] = "Pddt.to_first_of";
static const char __pyx_k_Pddt_to_saturday[] = "Pddt.to_saturday";
static const char __pyx_k_Pddt_to_start_of[] = "Pddt.to_start_of";
static const char __pyx_k_Pddt_to_thursday[] = "Pddt.to_thursday";
static const char __pyx_k_Pddt_to_tomorrow[] = "Pddt.to_tomorrow";
static const char __pyx_k_Pddt_tz_localize[] = "Pddt.tz_localize";
static const char __pyx_k_calcuate_average[] = "calcuate average";
static const char __pyx_k_int_float_object[] = "int | float | object";
static const char __pyx_k_is_not_supported[] = "' is not supported.";
static const char __pyx_k_to_int64_under_2[] = "]] to int64 under '";
static const char __pyx_k_to_int64_under_3[] = "] to int64 under '";
static const char __pyx_k_utcfromtimestamp[] = "utcfromtimestamp";
static const char __pyx_k_IncomparableError[] = "IncomparableError";
static const char __pyx_k_InvalidMonthError[] = "InvalidMonthError";
static const char __pyx_k_Pddt_days_bf_year[] = "Pddt.days_bf_year";
static const char __pyx_k_Pddt_days_in_year[] = "Pddt.days_in_year";
static const char __pyx_k_Pddt_days_of_year[] = "Pddt.days_of_year";
static const char __pyx_k_Pddt_fromdatetime[] = "Pddt.fromdatetime";
static const char __pyx_k_Pddt_is_leap_year[] = "Pddt.is_leap_year";
static const char __pyx_k_Pddt_is_long_year[] = "Pddt.is_long_year";
static const char __pyx_k_Pddt_leap_bt_year[] = "Pddt.leap_bt_year";
static const char __pyx_k_Pddt_microseconds[] = "Pddt.microseconds";
static const char __pyx_k_Pddt_to_curr_year[] = "Pddt.to_curr_year";
static const char __pyx_k_Pddt_to_next_year[] = "Pddt.to_next_year";
static const char __pyx_k_Pddt_to_prev_year[] = "Pddt.to_prev_year";
static const char __pyx_k_Pddt_to_wednesday[] = "Pddt.to_wednesday";
static const char __pyx_k_Pddt_to_yesterday[] = "Pddt.to_yesterday";
static const char __pyx_k_Pddt_tz_available[] = "Pddt.tz_available";
static const char __pyx_k_Pddt_values_naive[] = "Pddt.values_naive";
static const char __pyx_k_ZeroDivisionError[] = "ZeroDivisionError";
static const char __pyx_k_to_curr_weekday_2[] = "to_curr_weekday";
static const char __pyx_k_typing_extensions[] = "typing_extensions";
static const char __pyx_k_AmbiguousTimeError[] = "AmbiguousTimeError";
static const char __pyx_k_Pddt_days_bf_month[] = "Pddt.days_bf_month";
static const char __pyx_k_Pddt_days_in_month[] = "Pddt.days_in_month";
static const char __pyx_k_Pddt_days_of_month[] = "Pddt.days_of_month";
static const char __pyx_k_Pddt_fromisoformat[] = "Pddt.fromisoformat";
static const char __pyx_k_Pddt_fromtimestamp[] = "Pddt.fromtimestamp";
static const char __pyx_k_Pddt_to_curr_month[] = "Pddt.to_curr_month";
static const char __pyx_k_Pddt_to_next_month[] = "Pddt.to_next_month";
static const char __pyx_k_Pddt_to_prev_month[] = "Pddt.to_prev_month";
static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_is_not_supported_2[] = "]' is not supported";
static const char __pyx_k_is_not_supported_3[] = "]' is not supported.";
static const char __pyx_k_with_datetime_unit[] = " with datetime unit '";
static const char __pyx_k_InvalidWeekdayError[] = "InvalidWeekdayError";
static const char __pyx_k_OutOfBoundsDatetime[] = "OutOfBoundsDatetime";
static const char __pyx_k_Pddt_fromdatetime64[] = "Pddt.fromdatetime64";
static const char __pyx_k_Pddt_snap_line_2367[] = "Pddt.snap (line 2367)";
static const char __pyx_k_available_timezones[] = "_available_timezones";
static const char __pyx_k_cannot_cast_ndarray[] = "cannot cast <'ndarray[";
static const char __pyx_k_np_ndarray_np_int64[] = "np.ndarray[np.int64]";
static const char __pyx_k_src_cytimes_pddt_py[] = "src/cytimes/pddt.py";
static const char __pyx_k_to_an_integer_under[] = "] to an integer under '";
static const char __pyx_k_InvalidArgumentError[] = "InvalidArgumentError";
static const char __pyx_k_InvalidTimeUnitError[] = "InvalidTimeUnitError";
static const char __pyx_k_InvalidTimezoneError[] = "InvalidTimezoneError";
static const char __pyx_k_Pddt_days_bf_quarter[] = "Pddt.days_bf_quarter";
static const char __pyx_k_Pddt_days_in_quarter[] = "Pddt.days_in_quarter";
static const char __pyx_k_Pddt_days_of_quarter[] = "Pddt.days_of_quarter";
static const char __pyx_k_Pddt_fromicroseconds[] = "Pddt.fromicroseconds";
static const char __pyx_k_Pddt_fromisocalendar[] = "Pddt.fromisocalendar";
static const char __pyx_k_Pddt_to_curr_quarter[] = "Pddt.to_curr_quarter";
static const char __pyx_k_Pddt_to_curr_weekday[] = "Pddt.to_curr_weekday";
static const char __pyx_k_Pddt_to_next_quarter[] = "Pddt.to_next_quarter";
static const char __pyx_k_Pddt_to_next_weekday[] = "Pddt.to_next_weekday";
static const char __pyx_k_Pddt_to_prev_quarter[] = "Pddt.to_prev_quarter";
static const char __pyx_k_Pddt_to_prev_weekday[] = "Pddt.to_prev_weekday";
static const char __pyx_k_cannot_check_ndarray[] = "cannot check <'ndarray[";
static const char __pyx_k_datetime_date_object[] = "datetime.date | object";
static const char __pyx_k_invalid_month_name_s[] = "invalid month name '%s'.";
static const char __pyx_k_np_datetime64_object[] = "np.datetime64 | object";
static const char __pyx_k_Pddt__to_curr_weekday[] = "Pddt._to_curr_weekday";
static const char __pyx_k_Pddt_utcfromtimestamp[] = "Pddt.utcfromtimestamp";
static const char __pyx_k_available_timezones_2[] = "available_timezones";
static const char __pyx_k_cannot_cast_ndarray_2[] = "cannot cast ndarray[";
static const char __pyx_k_to_an_integer_under_2[] = " to an integer under '";
static const char __pyx_k_Pddt_to_date_line_2527[] = "Pddt.to_date (line 2527)";
static const char __pyx_k_Pddt_to_time_line_2588[] = "Pddt.to_time (line 2588)";
static const char __pyx_k_Pddt_to_year_line_1771[] = "Pddt.to_year (line 1771)";
static const char __pyx_k_cannot_convert_ndarray[] = "cannot convert <'ndarray[";
static const char __pyx_k_datetime_date_str_None[] = "datetime.date | str | None";
static const char __pyx_k_datetime_time_str_None[] = "datetime.time | str | None";
static const char __pyx_k_invalid_weekday_name_s[] = "invalid weekday name '%s'.";
static const char __pyx_k_Pddt_to_month_line_2109[] = "Pddt.to_month (line 2109)";
static const char __pyx_k_datetime_s_is_ambiguous[] = "datetime '%s' is ambiguous.";
static const char __pyx_k_unknown_datetime_unit_d[] = "unknown datetime unit '%d'.";
static const char __pyx_k_unknown_datetime_unit_s[] = "unknown datetime unit '%s'.";
static const char __pyx_k_OutOfBoundsDatetimeError[] = "OutOfBoundsDatetimeError";
static const char __pyx_k_datetime_datetime_object[] = "datetime.datetime | object";
static const char __pyx_k_datetime_tzinfo_str_None[] = "datetime.tzinfo | str | None";
static const char __pyx_k_int64_under_D_resolution[] = "int64 under 'D' resolution";
static const char __pyx_k_int64_under_M_resolution[] = "int64 under 'M' resolution";
static const char __pyx_k_int64_under_Y_resolution[] = "int64 under 'Y' resolution";
static const char __pyx_k_int64_under_h_resolution[] = "int64 under 'h' resolution";
static const char __pyx_k_int64_under_m_resolution[] = "int64 under 'm' resolution";
static const char __pyx_k_int64_under_s_resolution[] = "int64 under 's' resolution";
static const char __pyx_k_np_ndarray_datetime_date[] = "np.ndarray[datetime.date]";
static const char __pyx_k_np_ndarray_datetime_time[] = "np.ndarray[datetime.time]";
static const char __pyx_k_np_ndarray_np_datetime64[] = "np.ndarray[np.datetime64]";
static const char __pyx_k_Pddt_to_quarter_line_1952[] = "Pddt.to_quarter (line 1952)";
static const char __pyx_k_Pddt_to_weekday_line_2242[] = "Pddt.to_weekday (line 2242)";
static const char __pyx_k_cannot_ceil_to_multiple_0[] = "cannot ceil to multiple 0.";
static const char __pyx_k_int64_under_ms_resolution[] = "int64 under 'ms' resolution";
static const char __pyx_k_int64_under_ns_resolution[] = "int64 under 'ns' resolution";
static const char __pyx_k_int64_under_us_resolution[] = "int64 under 'us' resolution";
static const char __pyx_k_Pddt_to_datetime_line_2383[] = "Pddt.to_datetime (line 2383)";
static const char __pyx_k_cannot_floor_to_multiple_0[] = "cannot floor to multiple 0.";
static const char __pyx_k_cannot_round_to_multiple_0[] = "cannot round to multiple 0.";
static const char __pyx_k_sequence_must_have_3_items[] = "sequence must have 3 items.";
static const char __pyx_k_Pddt_to_curr_year_line_1652[] = "Pddt.to_curr_year (line 1652)";
static const char __pyx_k_Pddt_to_next_year_line_1748[] = "Pddt.to_next_year (line 1748)";
static const char __pyx_k_Pddt_to_prev_year_line_1725[] = "Pddt.to_prev_year (line 1725)";
static const char __pyx_k_Pddt_tz_available_line_3574[] = "Pddt.tz_available (line 3574)";
static const char __pyx_k_division_by_zero_in_arr_mod[] = "division by zero in 'arr_mod()'.";
static const char __pyx_k_expects_np_datetime64_got_s[] = "expects 'np.datetime64', got %s.";
static const char __pyx_k_pandas__libs_tslibs_parsing[] = "pandas._libs.tslibs.parsing";
static const char __pyx_k_resolution_is_not_supported[] = "' resolution is not supported.";
static const char __pyx_k_unsupported_datetime_unit_s[] = "unsupported datetime unit '%s'.";
static const char __pyx_k_Pddt_days_of_month_line_3389[] = "Pddt.days_of_month (line 3389)";
static const char __pyx_k_Pddt_to_curr_month_line_2028[] = "Pddt.to_curr_month (line 2028)";
static const char __pyx_k_Pddt_to_next_month_line_2096[] = "Pddt.to_next_month (line 2096)";
static const char __pyx_k_Pddt_to_prev_month_line_2083[] = "Pddt.to_prev_month (line 2083)";
static const char __pyx_k_expects_np_timedelta64_got_s[] = "expects 'np.timedelta64', got %s.";
static const char __pyx_k_np_ndarray_datetime_datetime[] = "np.ndarray[datetime.datetime]";
static const char __pyx_k_pandas_core_arrays_datetimes[] = "pandas.core.arrays.datetimes";
static const char __pyx_k_expects_datetime_tzinfo_got_s[] = "expects 'datetime.tzinfo', got %s.";
static const char __pyx_k_strftime_format_is_too_long_s[] = "strftime format is too long:\n'%s'";
static const char __pyx_k_Array_with_dtype_of_datetime64[] = "]].\nArray with dtype of 'datetime64[";
static const char __pyx_k_Pddt_to_curr_quarter_line_1853[] = "Pddt.to_curr_quarter (line 1853)";
static const char __pyx_k_Pddt_to_curr_weekday_line_2200[] = "Pddt.to_curr_weekday (line 2200)";
static const char __pyx_k_Pddt_to_next_quarter_line_1935[] = "Pddt.to_next_quarter (line 1935)";
static const char __pyx_k_Pddt_to_next_weekday_line_2228[] = "Pddt.to_next_weekday (line 2228)";
static const char __pyx_k_Pddt_to_prev_quarter_line_1918[] = "Pddt.to_prev_quarter (line 1918)";
static const char __pyx_k_Pddt_to_prev_weekday_line_2214[] = "Pddt.to_prev_weekday (line 2214)";
static const char __pyx_k_ambiguous_NaT_is_not_supported[] = "ambiguous='NaT' is not supported.";
static const char __pyx_k_resolution_Array_with_datetime[] = "' resolution.\nArray with datetime unit '";
static const char __pyx_k_resolution_Array_with_dtype_of[] = "' resolution.\nArray with dtype of '";
static const char __pyx_k_Adjust_the_date_and_time_fields[] = "Adjust the date and time fields with new values `<'Pddt'>`.\n\n        #### Fields set to `-1` means retaining the original values.\n\n        :param year `<'int'>`: Year value, defaults to `-1`.\n        :param month `<'int'>`: Yonth value (1-12), defaults to `-1`.\n        :param day `<'int'>`: Day value (1-31), automacially clamped to the maximum days in the month, defaults to `-1`.\n        :param hour `<'int'>`: Hour value (0-23), defaults to `-1`.\n        :param minute `<'int'>`: Minute value (0-59), defaults to `-1`.\n        :param second `<'int'>`: Second value (0-59), defaults to `-1`.\n        :param microsecond `<'int'>`: Microsecond value (0-999999), defaults to `-1`.\n\n        ### Equivalent to:\n        >>> pt.replace(\n                year=year,\n                month=month,\n                day=day,\n                hour=hour,\n                minute=minute,\n                second=second,\n                microsecond=microsecond,\n            )\n        ";
static const char __pyx_k_Adjust_the_date_to_the_specific[] = "Adjust the date to the specific weekday of the current week `<'Pddt'>`.\n\n        :param weekday `<'int/str/None'>`: Weekday value, defaults to `None`.\n            - `<'int'>` Weekday number (0=Mon...6=Sun).\n            - `<'str'>` Weekday name (case-insensitive), e.g., 'Mon', 'dienstag', '\346\230\237\346\234\237\344\270\211'.\n            - `<'None'>` Retains the original weekdays.\n\n        ### Example:\n        >>> pt.to_curr_weekday(0)      # The Monday of the current week\n        >>> pt.to_curr_weekday(\"Tue\")  # The Tuesday of the current week\n        ";
static const char __pyx_k_Adjust_the_date_with_new_values[] = "Adjust the date with new values `<'Pddt'>`.\n\n        #### Fields set to `-1` means retaining the original values.\n\n        :param year `<'int'>`: Year value, defaults to `-1`.\n        :param month `<'int'>`: Yonth value (1-12), defaults to `-1`.\n        :param day `<'int'>`: Day value (1-31), automacially clamped to the maximum days in the month, defaults to `-1`.\n\n        ### Equivalent to:\n        >>> pt.replace(year=year, month=month, day=day)\n        ";
static const char __pyx_k_Adjust_the_time_fields_with_new[] = "Adjust the time fields with new values `<'Pddt'>`.\n\n        #### Fields set to `-1` means retaining the original values.\n\n        :param hour `<'int'>`: Hour value (0-23), defaults to `-1`.\n        :param minute `<'int'>`: Minute value (0-59), defaults to `-1`.\n        :param second `<'int'>`: Second value (0-59), defaults to `-1`.\n        :param microsecond `<'int'>`: Microsecond value (0-999999), defaults to `-1`.\n\n        ### Equivalent to:\n        >>> pt.replace(\n                hour=hour,\n                minute=minute,\n                second=second,\n                microsecond=microsecond,\n            )\n        ";
static const char __pyx_k_Conversion_limits_to_datetime_u[] = "].\nConversion limits to datetime units between ['s', 'ms', 'us', 'ns'].";
static const char __pyx_k_For_comparision_array_size_must[] = "For comparision, array size must be > 0.";
static const char __pyx_k_array_size_must_be_greater_than[] = "array size must be greater than 0.";
static const char __pyx_k_between_naive_aware_datetimes_T[] = " between naive & aware datetimes:\nTimezone-naive ";
static const char __pyx_k_cannot_unpack_s_to_iso_calendar[] = "cannot unpack '%s' to iso calendar values (year, week, day).";
static const char __pyx_k_division_by_zero_for_utils_math[] = "division by zero for 'utils.math_mod()'.";
static const char __pyx_k_invalid_last_of_datetime_unit_s[] = "invalid 'last of' datetime unit '%s'.\nSupports: ['Y', 'Q', 'M', 'W'] or Month name.";
static const char __pyx_k_nanosecond_conversion_range_dat[] = "]'> nanosecond conversion range, datetime unit '";
static const char __pyx_k_ndarray_size_must_be_an_integer[] = "ndarray size must be an integer greater than 0.";
static const char __pyx_k_operation_on_ndarray_datetime64[] = " operation on <'ndarray[datetime64[";
static const char __pyx_k_resolution_Supported_resolution[] = "' resolution.\nSupported resolutions: ['Y', 'M', 'D', 'h', 'm', 's', 'ms', 'us', 'ns'].";
static const char __pyx_k_unsupported_type_s_for_argument[] = "unsupported type %s for argument 'ordinal'.";
static const char __pyx_k_without_specifying_the_array_da[] = " without specifying the array datetime unit.";
static const char __pyx_k_A_drop_in_replacement_for_Pandas[] = "A drop-in replacement for Pandas `<'DatetimeIndex'>`\n    class, providing additional functionalities for more\n    convenient datetime operations.\n    ";
static const char __pyx_k_Adjust_the_date_to_the_specified[] = "Adjust the date to the specified month and day in the current year `<'Pddt'>`.\n\n        :param month `<'int/str/None'>`: Month value, defaults to `None`.\n            - `<'int'>` Month number (1=Jan...12=Dec).\n            - `<'str'>` Month name (case-insensitive), e.g., 'Jan', 'februar', '\344\270\211\346\234\210'.\n            - `<'None'>` Retains the original months.\n\n        :param day `<'int'>`: Day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_curr_year(\"Feb\", 31)  # The last day of February in the current year\n        >>> pt.to_curr_year(11)         # The same day of November in the current year\n        >>> pt.to_curr_year(day=1)      # The first day of the current month\n        ";
static const char __pyx_k_Pddt_fromisocalendar_locals__par[] = "Pddt.fromisocalendar.<locals>._parse_dict";
static const char __pyx_k_Return_the_number_of_days_1_31_s[] = "Return the number of days (1-31) since the start\n        of the instance's months `<'Index[int64]'>`.\n\n        ### Equivalent to:\n        >>> pt.day\n        ";
static const char __pyx_k_Snap_to_nearest_occurring_freque[] = "Snap to nearest occurring frequency `<'Pddt'>`.\n\n        Examples\n        --------\n        >>> idx = pd.DatetimeIndex(['2023-01-01', '2023-01-02',\n        ...                        '2023-02-01', '2023-02-02'])\n        >>> idx\n        DatetimeIndex(['2023-01-01', '2023-01-02', '2023-02-01', '2023-02-02'],\n        dtype='datetime64[ns]', freq=None)\n        >>> idx.snap('MS')\n        DatetimeIndex(['2023-01-01', '2023-01-01', '2023-02-01', '2023-02-01'],\n        dtype='datetime64[ns]', freq=None)\n        ";
static const char __pyx_k_The_available_timezone_names_set[] = "The available timezone names `<'set[str]'>`.\n\n        ### Equivalent to:\n        >>> zoneinfo.available_timezones()\n        ";
static const char __pyx_k_Time_zones_are_not_available_fro[] = "Time zones are not available from the C-API.";
static const char __pyx_k_array_size_must_be_and_integer_0[] = "array size must be and integer > 0, instead got '%d'.";
static const char __pyx_k_cannot_access_the_time_value_fro[] = "cannot access the time value from ndarray[datetime64[";
static const char __pyx_k_cannot_check_if_ndarray_s_is_wit[] = "cannot check if <'ndarray[%s]'> is within nanosecond conversion range without specifying the array datetime unit.";
static const char __pyx_k_cannot_compare_between_arrays_wi[] = "cannot compare between arrays with different shapes ['";
static const char __pyx_k_cannot_compare_ndarrays_with_dif[] = "cannot compare ndarrays with different shapes.";
static const char __pyx_k_cannot_convert_ndarray_from_date[] = "cannot convert ndarray from datetime64[";
static const char __pyx_k_cannot_convert_s_to_an_integer_t[] = "cannot convert '%s' to an integer to represent the array size.";
static const char __pyx_k_cannot_convert_s_to_float_to_rep[] = "cannot convert '%s' to float to represent the timestamp value.";
static const char __pyx_k_cannot_covnert_s_to_an_integer_t[] = "cannot covnert '%s' to an integer to represent the microseconds value.";
static const char __pyx_k_cannot_covnert_s_to_float_to_rep[] = "cannot covnert '%s' to float to represent the seconds value.";
static const char __pyx_k_cannot_get_the_length_of_s_to_re[] = "cannot get the length of %s to represent the array size.";
static const char __pyx_k_cannot_perform_addition_on_ndarr[] = "cannot perform addition on ndarrays with different shapes.";
static const char __pyx_k_cannot_perform_comparison_on_nda[] = "cannot perform comparison on ndarrays with different shapes.";
static const char __pyx_k_cannot_perform_subtraction_on_nd[] = "cannot perform subtraction on ndarrays with different shapes.";
static const char __pyx_k_division_by_zero_for_utils_arr_c[] = "division by zero for 'utils.arr_ceil_div()'.";
static const char __pyx_k_division_by_zero_for_utils_arr_f[] = "division by zero for 'utils.arr_floor_div()'.";
static const char __pyx_k_division_by_zero_for_utils_arr_r[] = "division by zero for 'utils.arr_round_div()'.";
static const char __pyx_k_expects_np_ndarray_datetime64_go[] = "expects np.ndarray[datetime64], got '%s'.";
static const char __pyx_k_expects_np_ndarray_datetime64_ti[] = "expects np.ndarray[datetime64/timedelta64], got '%s'.";
static const char __pyx_k_expects_np_ndarray_timedelta64_g[] = "expects np.ndarray[timedelta64], got '%s'.";
static const char __pyx_k_failed_to_allocate_memory_for_st[] = "failed to allocate memory for string slice.";
static const char __pyx_k_instance_is_already_timezone_awa[] = "instance is already timezone-aware.\nUse 'tz_convert()' or 'tz_switch()' method to move to another timezone.";
static const char __pyx_k_instance_is_timezone_naive_Canno[] = "instance is timezone-naive.\nCannot switch timezone-naive instance to the target timezone without providing a 'base_tz'.";
static const char __pyx_k_instance_is_timezone_naive_Use_t[] = "instance is timezone-naive.\nUse 'tz_localize()' method instead to localize to a timezone.\nUse 'tz_switch()' method to convert to the timezone by providing a base timezone for the instance.";
static const char __pyx_k_invalid_character_s_as_an_intege[] = "invalid character '%s' as an integer.";
static const char __pyx_k_invalid_end_of_datetime_unit_s_S[] = "invalid 'end of' datetime unit '%s'.\nSupports: ['Y', 'Q', 'M', 'W', 'D', 'h', 'm', 's', 'ms', 'us', 'ns'] or Month/Weekday name.";
static const char __pyx_k_invalid_first_of_datetime_unit_s[] = "invalid 'first of' datetime unit '%s'.\nSupports: ['Y', 'Q', 'M', 'W'] or Month name.";
static const char __pyx_k_invalid_fractional_seconds_preci[] = "invalid fractional seconds precision '%d'.\nMust be between 0 and 6.";
static const char __pyx_k_invalid_input_s_for_inclusive_Su[] = "invalid input '%s' for inclusive.\nSupports: ['one', 'both', 'neither'].";
static const char __pyx_k_invalid_month_number_d_must_betw[] = "invalid month number '%d', must betweem 1(Jan)...12(Dec).";
static const char __pyx_k_invalid_start_of_time_unit_s_Sup[] = "invalid 'start of' time unit '%s'.\nSupports: ['Y', 'Q', 'M', 'W', 'D', 'h', 'm', 's', 'ms', 'us', 'ns'] or Month/Weekday name.";
static const char __pyx_k_invalid_weekday_number_d_must_be[] = "invalid weekday number '%d', must betweem 0(Mon)...6(Sun).";
static const char __pyx_k_must_be_an_1_dimensional_ndarray[] = "must be an 1-dimensional ndarray, instead of %d-dim.";
static const char __pyx_k_nonexistent_NaT_is_not_supported[] = "nonexistent='NaT' is not supported.";
static const char __pyx_k_numpy__core_multiarray_failed_to[] = "numpy._core.multiarray failed to import";
static const char __pyx_k_numpy__core_umath_failed_to_impo[] = "numpy._core.umath failed to import";
static const char __pyx_k_support_ndarray_with_1_4_dimensi[] = "support <'ndarray'> with 1-4 dimensions, got ndim '%d'.";
static const char __pyx_k_timezone_offset_s_seconds_out_of[] = "timezone offset '%s' (seconds) out of range, must between -86340 and 86340.";
static const char __pyx_k_unable_to_parse_datetime_unit_fr[] = "unable to parse datetime unit from '%s'.";
static const char __pyx_k_unsupported_factor_d_for_timedel[] = "unsupported factor '%d' for timedelta unit 'Y' conversion.";
static const char __pyx_k_unsupported_month_value_type_s_e[] = "unsupported month value type %s, expects <'str/int'>.";
static const char __pyx_k_unsupported_weekday_value_type_s[] = "unsupported weekday value type %s, expects <'str/int'>.";
static const char __pyx_k_Adjust_the_date_to_the_specific_2[] = "Adjust the date to the specific weekday of the previous week `<'Pddt'>`.\n\n        :param weekday `<'int/str/None'>`: Weekday value, defaults to `None`.\n            - `<'int'>` Weekday number (0=Mon...6=Sun).\n            - `<'str'>` Weekday name (case-insensitive), e.g., 'Mon', 'dienstag', '\346\230\237\346\234\237\344\270\211'.\n            - `<'None'>` Retains the original weekdays.\n\n        ### Example:\n        >>> pt.to_prev_weekday(0)      # The Monday of the previous week\n        >>> pt.to_prev_weekday(\"Tue\")  # The Tuesday of the previous week\n        ";
static const char __pyx_k_Adjust_the_date_to_the_specific_3[] = "Adjust the date to the specific weekday of the next week `<'Pddt'>`.\n\n        :param weekday `<'int/str/None'>`: Weekday value, defaults to `None`.\n            - `<'int'>` Weekday number (0=Mon...6=Sun).\n            - `<'str'>` Weekday name (case-insensitive), e.g., 'Mon', 'dienstag', '\346\230\237\346\234\237\344\270\211'.\n            - `<'None'>` Retains the original weekdays.\n\n        ### Example:\n        >>> pt.to_next_weekday(0)      # The Monday of the next week\n        >>> pt.to_next_weekday(\"Tue\")  # The Tuesday of the next week\n        ";
static const char __pyx_k_Adjust_the_date_to_the_specific_4[] = "Adjust the date to the specific weekday of the week (+/-) offset `<'Pddt'>`.\n\n        :param offset `<'int'>`: The week offset (+/-).\n        :param weekday `<'int/str/None'>`: Weekday value, defaults to `None`.\n            - `<'int'>` Weekday number (0=Mon...6=Sun).\n            - `<'str'>` Weekday name (case-insensitive), e.g., 'Mon', 'dienstag', '\346\230\237\346\234\237\344\270\211'.\n            - `<'None'>` Retains the original weekdays.\n\n        ### Example:\n        >>> pt.to_weekday(-2, 0)     # The Monday of the week, two weeks ago\n        >>> pt.to_weekday(2, \"Tue\")  # The Tuesday of the week, two weeks later\n        >>> pt.to_weekday(2)         # The same weekday of the week, two weeks later\n        ";
static const char __pyx_k_between_naive_aware_datetimes_T_2[] = " between naive & aware datetimes:\nTimezone-aware ";
static const char __pyx_k_division_by_zero_for_utils_math_2[] = "division by zero for 'utils.math_round_div()'.";
static const char __pyx_k_division_by_zero_for_utils_math_3[] = "division by zero for 'utils.math_ceil_div()'.";
static const char __pyx_k_division_by_zero_for_utils_math_4[] = "division by zero for 'utils.math_floor_div()'.";
static const char __pyx_k_unsupported_type_s_for_argument_2[] = "unsupported type %s for argument 'seconds'.";
static const char __pyx_k_unsupported_type_s_for_argument_3[] = "unsupported type %s for argument 'us'.";
static const char __pyx_k_unsupported_type_s_for_argument_4[] = "unsupported type %s for argument 'ts'.";
static const char __pyx_k_unsupported_type_s_for_argument_5[] = "unsupported type %s for argument 'iso'.";
static const char __pyx_k_unsupported_type_s_for_argument_6[] = "unsupported type %s for argument 'dtstr'.";
static const char __pyx_k_Adjust_the_date_to_the_specified_2[] = "Adjust the date to the specified month and day in the previous year `<'Pddt'>`.\n\n        :param month `<'int/str/None'>`: Month value, defaults to `None`.\n            - `<'int'>` Month number (1=Jan...12=Dec).\n            - `<'str'>` Month name (case-insensitive), e.g., 'Jan', 'februar', '\344\270\211\346\234\210'.\n            - `<'None'>` Retains the original months.\n\n        :param day `<'int'>`: Day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_prev_year(\"Feb\", 31)  # The last day of February in the previous year\n        >>> pt.to_prev_year(11)         # The same day of November in the previous year\n        >>> pt.to_prev_year(day=1)      # The first day of the current month in the previous year\n        ";
static const char __pyx_k_Adjust_the_date_to_the_specified_3[] = "Adjust the date to the specified month and day in the next year `<'Pddt'>`.\n\n        :param month `<'int/str/None'>`: Month value, defaults to `None`.\n            - `<'int'>` Month number (1=Jan...12=Dec).\n            - `<'str'>` Month name (case-insensitive), e.g., 'Jan', 'februar', '\344\270\211\346\234\210'.\n            - `<'None'>` Retains the original months.\n\n        :param day `<'int'>`: Day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_next_year(\"Feb\", 31)  # The last day of February in the next year\n        >>> pt.to_next_year(11)         # The same day of November in the next year\n        >>> pt.to_next_year(day=1)      # The first day of the current month in the next year\n        ";
static const char __pyx_k_Adjust_the_date_to_the_specified_4[] = "Adjust the date to the specified month and day in the year (+/-) offset `<'Pddt'>`.\n\n        :param offset `<'int'>`: The year offset (+/-).\n\n        :param month `<'int/str/None'>`: Month value, defaults to `None`.\n            - `<'int'>` Month number (1=Jan...12=Dec).\n            - `<'str'>` Month name (case-insensitive), e.g., 'Jan', 'februar', '\344\270\211\346\234\210'.\n            - `<'None'>` Retains the original months.\n\n        :param day `<'int'>`: Day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_year(-2, \"Feb\", 31)  # The last day of February, two years ago\n        >>> pt.to_year(2, 11)          # The same day of November, two years later\n        >>> pt.to_year(2, day=1)       # The first day of the current month, two years later\n        ";
static const char __pyx_k_Adjust_the_date_to_the_specified_5[] = "Adjust the date to the specified month and day in the current quarter. `<'Pddt'>`.\n\n        :param month `<'int'>`: Month (1-3) of the quarter, defaults to `-1`.\n            If `-1`, retains the original months of the quarter.\n\n        :param day `<'int'>`: Day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_curr_quarter(1, 31)  # The last day of the first quarter month in the current quarter\n        >>> pt.to_curr_quarter(2)      # The same day of the second quarter month in the current quarter\n        >>> pt.to_curr_quarter(day=1)  # The first day of the current quarter month in the current quarter\n        ";
static const char __pyx_k_Adjust_the_date_to_the_specified_6[] = "Adjust the date to the specified month and day in the previous quarter. `<'Pddt'>`.\n\n        :param month `<'int'>`: Month (1-3) of the quarter, defaults to `-1`.\n            If `-1`, retains the original months of the quarter.\n\n        :param day `<'int'>`: Day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_prev_quarter(1, 31)  # The last day of the first quarter month in the previous quarter\n        >>> pt.to_prev_quarter(2)      # The same day of the second quarter month in the previous quarter\n        >>> pt.to_prev_quarter(day=1)  # The first day of the current quarter month in the previous quarter\n        ";
static const char __pyx_k_Adjust_the_date_to_the_specified_7[] = "Adjust the date to the specified month and day in the next quarter. `<'Pddt'>`.\n\n        :param month `<'int'>`: Month (1-3) of the quarter, defaults to `-1`.\n            If `-1`, retains the original months of the quarter.\n\n        :param day `<'int'>`: Day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_next_quarter(1, 31)  # The last day of the first quarter month in the next quarter\n        >>> pt.to_next_quarter(2)      # The same day of the second quarter month in the next quarter\n        >>> pt.to_next_quarter(day=1)  # The first day of the current quarter month in the next quarter\n        ";
static const char __pyx_k_Adjust_the_date_to_the_specified_8[] = "Adjust the date to the specified month and day in the quarter (+/-) 'offset'. `<'Pddt'>`.\n\n        :param offset `<'int'>`: The quarter offset (+/-).\n\n        :param month `<'int'>`: Month (1-3) of the quarter, defaults to `-1`.\n            If `-1`, retains the original months of the quarter.\n\n        :param day `<'int'>`: Day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_quarter(-2, 1, 31)  # The last day of the first quarter month, two quarters ago\n        >>> pt.to_quarter(2, 2)       # The same day of the second quarter month, two quarters later\n        >>> pt.to_quarter(2, day=1)   # The first day of the current quarter month, two quarters later\n        ";
static const char __pyx_k_Adjust_the_date_to_the_specified_9[] = "Adjust the date to the specified day of the current month `<'Pddt'>`.\n\n        :param day `<'int'>`: The day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_curr_month(31)  # The last day of the current month\n        >>> pt.to_curr_month(1)   # The first day of the current month\n        ";
static const char __pyx_k_Pddt_fromisocalendar_locals__par_2[] = "Pddt.fromisocalendar.<locals>._parse_sequence";
static const char __pyx_k_cannot_convert_s_to_an_integer_t_2[] = "cannot convert '%s' to an integer to represent the ordinal value.";
static const char __pyx_k_expects_np_ndarray_datetime64_ti_2[] = "expects 'np.ndarray[datetime64/timedelta64]', got '%s'.";
static const char __pyx_k_unsupported_factor_d_for_timedel_2[] = "unsupported factor '%d' for timedelta unit 'M' conversion.";
static const char __pyx_k_Adjust_the_date_to_the_specified_10[] = "Adjust the date to the specified day of the previous month `<'Pddt'>`.\n\n        :param day `<'int'>`: The day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_prev_month(31)  # The last day of the previous month\n        >>> pt.to_prev_month(1)   # The first day of the previous month\n        ";
static const char __pyx_k_Adjust_the_date_to_the_specified_11[] = "Adjust the date to the specified day of the next month `<'Pddt'>`.\n\n        :param day `<'int'>`: The day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_next_month(31)  # The last day of the next month\n        >>> pt.to_next_month(1)   # The first day of the next month\n        ";
static const char __pyx_k_Adjust_the_date_to_the_specified_12[] = "Adjust the date to the specified day of the month (+/-) offest `<'Pddt'>`.\n\n        :param offset `<'int'>`: The month offset (+/-).\n        :param day `<'int'>`: The day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_month(-2, 31)  # The last day of the month, two months ago\n        >>> pt.to_month(2, 1)    # The first day of the month, two months later\n        ";
/* #### Code section: decls ### */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt___new__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_data, PyObject *__pyx_v_freq, PyObject *__pyx_v_tz, PyObject *__pyx_v_ambiguous, PyObject *__pyx_v_year1st, PyObject *__pyx_v_day1st, struct __pyx_obj_7cytimes_6parser_Configs *__pyx_v_cfg, PyObject *__pyx_v_unit, PyObject *__pyx_v_name, PyObject *__pyx_v_copy); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_2date_range(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_periods, PyObject *__pyx_v_freq, PyObject *__pyx_v_tz, PyObject *__pyx_v_normalize, PyObject *__pyx_v_inclusive, PyObject *__pyx_v_unit, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_4parse(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_data, PyObject *__pyx_v_freq, PyObject *__pyx_v_tz, PyObject *__pyx_v_ambiguous, PyObject *__pyx_v_year1st, PyObject *__pyx_v_day1st, struct __pyx_obj_7cytimes_6parser_Configs *__pyx_v_cfg, PyObject *__pyx_v_unit, PyObject *__pyx_v_name, PyObject *__pyx_v_copy); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_6now(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_tz, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_8utcnow(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_10today(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_12combine(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_date, PyObject *__pyx_v_time, PyObject *__pyx_v_tz, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_14fromordinal(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_ordinal, PyObject *__pyx_v_tz, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_16fromseconds(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_seconds, PyObject *__pyx_v_tz, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_18fromicroseconds(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_us, PyObject *__pyx_v_tz, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_20fromtimestamp(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_ts, PyObject *__pyx_v_tz, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_22utcfromtimestamp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_ts, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_24fromisoformat(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_dtstr, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_15fromisocalendar__parse_dict(PyObject *__pyx_self, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_15fromisocalendar_2_parse_sequence(PyObject *__pyx_self, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_26fromisocalendar(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_iso, PyObject *__pyx_v_year, PyObject *__pyx_v_week, PyObject *__pyx_v_weekday, PyObject *__pyx_v_tz, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_28fromdate(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_date, PyObject *__pyx_v_tz, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_30fromdatetime(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_dt, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_32fromdatetime64(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_dt64, PyObject *__pyx_v_tz, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_34strptime(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_dtstr, PyObject *__pyx_v_fmt, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_36ctime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_38isoformat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_sep); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_40timedf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_42utctimedf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_44toordinal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_46seconds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_utc); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_48microseconds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_utc); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_50timestamp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_52datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_54date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_56time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_58timetz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_60replace(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_year, int __pyx_v_month, int __pyx_v_day, int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, int __pyx_v_nanosecond, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_62to_curr_year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_month, int __pyx_v_day); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_64to_prev_year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_month, int __pyx_v_day); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_66to_next_year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_month, int __pyx_v_day); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_68to_year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_offset, PyObject *__pyx_v_month, int __pyx_v_day); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_70to_curr_quarter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_month, int __pyx_v_day); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_72to_prev_quarter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_month, int __pyx_v_day); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_74to_next_quarter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_month, int __pyx_v_day); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_76to_quarter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_offset, int __pyx_v_month, int __pyx_v_day); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_78to_curr_month(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_day); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_80to_prev_month(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_day); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_82to_next_month(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_day); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_84to_month(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_offset, int __pyx_v_day); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_86to_monday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_88to_tuesday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_90to_wednesday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_92to_thursday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_94to_friday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_96to_saturday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_98to_sunday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_100to_curr_weekday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_weekday); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_102to_prev_weekday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_weekday); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_104to_next_weekday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_weekday); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_106to_weekday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_offset, PyObject *__pyx_v_weekday); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_108_to_curr_weekday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_weekday); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_110to_yesterday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_112to_tomorrow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_114to_day(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_offset); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_116snap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_freq); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_118to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_year, int __pyx_v_month, int __pyx_v_day, int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, int __pyx_v_nanosecond); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_120to_date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_year, int __pyx_v_month, int __pyx_v_day); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_122to_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, int __pyx_v_nanosecond); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_124to_first_of(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_126to_last_of(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_128to_start_of(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_130to_end_of(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_132round(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_134ceil(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_136floor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_138fsp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_precision); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_140isocalendar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_142isoyear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_144isoweek(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_146isoweekday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_148year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_150is_leap_year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_152is_long_year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_154leap_bt_year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_year); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_156days_in_year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_158days_bf_year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_160days_of_year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_162is_year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_year); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_164quarter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_166days_in_quarter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_168days_bf_quarter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_170days_of_quarter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_172is_quarter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_quarter); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_174month(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_176days_in_month(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_178days_bf_month(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_180days_of_month(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_182is_month(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_month); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_184weekday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_186is_weekday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_weekday); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_188day(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_190is_day(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_day); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_192hour(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_194minute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_196second(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_198millisecond(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_200microsecond(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_202nanosecond(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_204is_first_of(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_206is_last_of(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_208is_start_of(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_210is_end_of(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_212tz_available(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_214is_local(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_216is_utc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_218tzname(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_220astimezone(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_tz, PyObject *__pyx_v_ambiguous, PyObject *__pyx_v_nonexistent); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_222tz_localize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_tz, PyObject *__pyx_v_ambiguous, PyObject *__pyx_v_nonexistent); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_224tz_convert(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_tz); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_226tz_switch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_targ_tz, PyObject *__pyx_v_base_tz, int __pyx_v_naive, PyObject *__pyx_v_ambiguous, PyObject *__pyx_v_nonexistent); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_228values_naive(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_230as_unit(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_232add(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_years, int __pyx_v_quarters, int __pyx_v_months, int __pyx_v_weeks, int __pyx_v_days, int __pyx_v_hours, int __pyx_v_minutes, int __pyx_v_seconds, int __pyx_v_milliseconds, int __pyx_v_microseconds, int __pyx_v_nanoseconds); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_234sub(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_years, int __pyx_v_quarters, int __pyx_v_months, int __pyx_v_weeks, int __pyx_v_days, int __pyx_v_hours, int __pyx_v_minutes, int __pyx_v_seconds, int __pyx_v_milliseconds, int __pyx_v_microseconds, int __pyx_v_nanoseconds); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_236diff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_unit, int __pyx_v_absolute, PyObject *__pyx_v_inclusive); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_238is_past(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_240is_future(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_242closest(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_244farthest(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_dtobjs); /* proto */
static PyObject *__pyx_tp_new_7cytimes_4pddt___pyx_scope_struct__fromisocalendar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, 0, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyUnicode_Type_lower = {0, 0, 0, 0, 0};
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
typedef struct {
  PyObject *__pyx_d;
  PyObject *__pyx_b;
  PyObject *__pyx_cython_runtime;
  PyObject *__pyx_empty_tuple;
  PyObject *__pyx_empty_bytes;
  PyObject *__pyx_empty_unicode;
  #ifdef __Pyx_CyFunction_USED
  PyTypeObject *__pyx_CyFunctionType;
  #endif
  #ifdef __Pyx_FusedFunction_USED
  PyTypeObject *__pyx_FusedFunctionType;
  #endif
  #ifdef __Pyx_Generator_USED
  PyTypeObject *__pyx_GeneratorType;
  #endif
  #ifdef __Pyx_IterableCoroutine_USED
  PyTypeObject *__pyx_IterableCoroutineType;
  #endif
  #ifdef __Pyx_Coroutine_USED
  PyTypeObject *__pyx_CoroutineAwaitType;
  #endif
  #ifdef __Pyx_Coroutine_USED
  PyTypeObject *__pyx_CoroutineType;
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_7cpython_4type_type;
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_7cpython_4bool_bool;
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_7cpython_7complex_complex;
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_5numpy_dtype;
  PyTypeObject *__pyx_ptype_5numpy_flatiter;
  PyTypeObject *__pyx_ptype_5numpy_broadcast;
  PyTypeObject *__pyx_ptype_5numpy_ndarray;
  PyTypeObject *__pyx_ptype_5numpy_generic;
  PyTypeObject *__pyx_ptype_5numpy_number;
  PyTypeObject *__pyx_ptype_5numpy_integer;
  PyTypeObject *__pyx_ptype_5numpy_signedinteger;
  PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
  PyTypeObject *__pyx_ptype_5numpy_inexact;
  PyTypeObject *__pyx_ptype_5numpy_floating;
  PyTypeObject *__pyx_ptype_5numpy_complexfloating;
  PyTypeObject *__pyx_ptype_5numpy_flexible;
  PyTypeObject *__pyx_ptype_5numpy_character;
  PyTypeObject *__pyx_ptype_5numpy_ufunc;
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_7cpython_8datetime_date;
  PyTypeObject *__pyx_ptype_7cpython_8datetime_time;
  PyTypeObject *__pyx_ptype_7cpython_8datetime_datetime;
  PyTypeObject *__pyx_ptype_7cpython_8datetime_timedelta;
  PyTypeObject *__pyx_ptype_7cpython_8datetime_tzinfo;
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_7cytimes_6parser_Configs;
  PyTypeObject *__pyx_ptype_7cytimes_6parser_Result;
  PyTypeObject *__pyx_ptype_7cytimes_6parser_Parser;
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  PyObject *__pyx_type_7cytimes_4pddt___pyx_scope_struct__fromisocalendar;
  #endif
  PyTypeObject *__pyx_ptype_7cytimes_4pddt___pyx_scope_struct__fromisocalendar;
  PyObject *__pyx_kp_u_00;
  PyObject *__pyx_kp_u_00_00;
  PyObject *__pyx_kp_u_00_00_00_06d;
  PyObject *__pyx_kp_u_00_00_02d;
  PyObject *__pyx_kp_u_02d;
  PyObject *__pyx_kp_u_04d;
  PyObject *__pyx_kp_u_06d;
  PyObject *__pyx_kp_u_06d_2;
  PyObject *__pyx_kp_u_2d;
  PyObject *__pyx_kp_s_A_drop_in_replacement_for_Pandas;
  PyObject *__pyx_kp_u_Adjust_the_date_and_time_fields;
  PyObject *__pyx_kp_u_Adjust_the_date_to_the_specific;
  PyObject *__pyx_kp_u_Adjust_the_date_to_the_specific_2;
  PyObject *__pyx_kp_u_Adjust_the_date_to_the_specific_3;
  PyObject *__pyx_kp_u_Adjust_the_date_to_the_specific_4;
  PyObject *__pyx_kp_u_Adjust_the_date_to_the_specified;
  PyObject *__pyx_kp_u_Adjust_the_date_to_the_specified_10;
  PyObject *__pyx_kp_u_Adjust_the_date_to_the_specified_11;
  PyObject *__pyx_kp_u_Adjust_the_date_to_the_specified_12;
  PyObject *__pyx_kp_u_Adjust_the_date_to_the_specified_2;
  PyObject *__pyx_kp_u_Adjust_the_date_to_the_specified_3;
  PyObject *__pyx_kp_u_Adjust_the_date_to_the_specified_4;
  PyObject *__pyx_kp_u_Adjust_the_date_to_the_specified_5;
  PyObject *__pyx_kp_u_Adjust_the_date_to_the_specified_6;
  PyObject *__pyx_kp_u_Adjust_the_date_to_the_specified_7;
  PyObject *__pyx_kp_u_Adjust_the_date_to_the_specified_8;
  PyObject *__pyx_kp_u_Adjust_the_date_to_the_specified_9;
  PyObject *__pyx_kp_u_Adjust_the_date_with_new_values;
  PyObject *__pyx_kp_u_Adjust_the_time_fields_with_new;
  PyObject *__pyx_n_s_AmbiguousTimeError;
  PyObject *__pyx_n_u_Apr;
  PyObject *__pyx_kp_u_Array_with_dtype_of_datetime64;
  PyObject *__pyx_n_s_AssertionError;
  PyObject *__pyx_n_u_Aug;
  PyObject *__pyx_n_s_Configs;
  PyObject *__pyx_kp_u_Conversion_limits_to_datetime_u;
  PyObject *__pyx_n_u_D;
  PyObject *__pyx_n_s_DataFrame;
  PyObject *__pyx_n_s_DateParseError;
  PyObject *__pyx_n_s_DatetimeArray;
  PyObject *__pyx_n_s_DatetimeIndex;
  PyObject *__pyx_n_u_Dec;
  PyObject *__pyx_n_u_Feb;
  PyObject *__pyx_kp_u_For_comparision_array_size_must;
  PyObject *__pyx_n_u_Fri;
  PyObject *__pyx_kp_u_H_M_S_f_z;
  PyObject *__pyx_n_s_Hashable;
  PyObject *__pyx_kp_s_Hashable_None;
  PyObject *__pyx_n_s_ImportError;
  PyObject *__pyx_n_s_IncomparableError;
  PyObject *__pyx_n_s_Index;
  PyObject *__pyx_kp_s_Index_bool;
  PyObject *__pyx_kp_s_Index_np_float64;
  PyObject *__pyx_kp_s_Index_np_int64;
  PyObject *__pyx_kp_s_Index_str;
  PyObject *__pyx_n_s_InvalidArgumentError;
  PyObject *__pyx_n_s_InvalidFspError;
  PyObject *__pyx_n_s_InvalidMonthError;
  PyObject *__pyx_n_s_InvalidTimeUnitError;
  PyObject *__pyx_n_s_InvalidTimezoneError;
  PyObject *__pyx_n_s_InvalidTypeError;
  PyObject *__pyx_n_s_InvalidWeekdayError;
  PyObject *__pyx_n_u_Jan;
  PyObject *__pyx_n_u_Jul;
  PyObject *__pyx_n_u_Jun;
  PyObject *__pyx_n_s_Literal;
  PyObject *__pyx_n_u_M;
  PyObject *__pyx_n_u_Mar;
  PyObject *__pyx_n_u_May;
  PyObject *__pyx_n_s_MemoryError;
  PyObject *__pyx_n_u_Mon;
  PyObject *__pyx_n_u_NaT;
  PyObject *__pyx_kp_u_None;
  PyObject *__pyx_n_u_Nov;
  PyObject *__pyx_n_u_Oct;
  PyObject *__pyx_n_s_OutOfBoundsDatetime;
  PyObject *__pyx_n_s_OutOfBoundsDatetimeError;
  PyObject *__pyx_n_s_OverflowError;
  PyObject *__pyx_n_s_ParserError;
  PyObject *__pyx_n_s_Pddt;
  PyObject *__pyx_n_u_Pddt;
  PyObject *__pyx_n_s_Pddt___new;
  PyObject *__pyx_n_s_Pddt__to_curr_weekday;
  PyObject *__pyx_n_s_Pddt_add;
  PyObject *__pyx_n_s_Pddt_as_unit;
  PyObject *__pyx_n_s_Pddt_astimezone;
  PyObject *__pyx_n_s_Pddt_ceil;
  PyObject *__pyx_n_s_Pddt_closest;
  PyObject *__pyx_n_s_Pddt_combine;
  PyObject *__pyx_n_s_Pddt_ctime;
  PyObject *__pyx_n_s_Pddt_date;
  PyObject *__pyx_n_s_Pddt_date_range;
  PyObject *__pyx_n_s_Pddt_datetime;
  PyObject *__pyx_n_s_Pddt_day;
  PyObject *__pyx_n_s_Pddt_days_bf_month;
  PyObject *__pyx_n_s_Pddt_days_bf_quarter;
  PyObject *__pyx_n_s_Pddt_days_bf_year;
  PyObject *__pyx_n_s_Pddt_days_in_month;
  PyObject *__pyx_n_s_Pddt_days_in_quarter;
  PyObject *__pyx_n_s_Pddt_days_in_year;
  PyObject *__pyx_n_s_Pddt_days_of_month;
  PyObject *__pyx_kp_u_Pddt_days_of_month_line_3389;
  PyObject *__pyx_n_s_Pddt_days_of_quarter;
  PyObject *__pyx_n_s_Pddt_days_of_year;
  PyObject *__pyx_n_s_Pddt_diff;
  PyObject *__pyx_n_s_Pddt_farthest;
  PyObject *__pyx_n_s_Pddt_floor;
  PyObject *__pyx_n_s_Pddt_fromdate;
  PyObject *__pyx_n_s_Pddt_fromdatetime;
  PyObject *__pyx_n_s_Pddt_fromdatetime64;
  PyObject *__pyx_n_s_Pddt_fromicroseconds;
  PyObject *__pyx_n_s_Pddt_fromisocalendar;
  PyObject *__pyx_n_s_Pddt_fromisocalendar_locals__par;
  PyObject *__pyx_n_s_Pddt_fromisocalendar_locals__par_2;
  PyObject *__pyx_n_s_Pddt_fromisoformat;
  PyObject *__pyx_n_s_Pddt_fromordinal;
  PyObject *__pyx_n_s_Pddt_fromseconds;
  PyObject *__pyx_n_s_Pddt_fromtimestamp;
  PyObject *__pyx_n_s_Pddt_fsp;
  PyObject *__pyx_n_s_Pddt_hour;
  PyObject *__pyx_n_s_Pddt_is_day;
  PyObject *__pyx_n_s_Pddt_is_end_of;
  PyObject *__pyx_n_s_Pddt_is_first_of;
  PyObject *__pyx_n_s_Pddt_is_future;
  PyObject *__pyx_n_s_Pddt_is_last_of;
  PyObject *__pyx_n_s_Pddt_is_leap_year;
  PyObject *__pyx_n_s_Pddt_is_local;
  PyObject *__pyx_n_s_Pddt_is_long_year;
  PyObject *__pyx_n_s_Pddt_is_month;
  PyObject *__pyx_n_s_Pddt_is_past;
  PyObject *__pyx_n_s_Pddt_is_quarter;
  PyObject *__pyx_n_s_Pddt_is_start_of;
  PyObject *__pyx_n_s_Pddt_is_utc;
  PyObject *__pyx_n_s_Pddt_is_weekday;
  PyObject *__pyx_n_s_Pddt_is_year;
  PyObject *__pyx_n_s_Pddt_isocalendar;
  PyObject *__pyx_n_s_Pddt_isoformat;
  PyObject *__pyx_n_s_Pddt_isoweek;
  PyObject *__pyx_n_s_Pddt_isoweekday;
  PyObject *__pyx_n_s_Pddt_isoyear;
  PyObject *__pyx_n_s_Pddt_leap_bt_year;
  PyObject *__pyx_n_s_Pddt_microsecond;
  PyObject *__pyx_n_s_Pddt_microseconds;
  PyObject *__pyx_n_s_Pddt_millisecond;
  PyObject *__pyx_n_s_Pddt_minute;
  PyObject *__pyx_n_s_Pddt_month;
  PyObject *__pyx_n_s_Pddt_nanosecond;
  PyObject *__pyx_n_s_Pddt_now;
  PyObject *__pyx_n_s_Pddt_parse;
  PyObject *__pyx_n_s_Pddt_quarter;
  PyObject *__pyx_n_s_Pddt_replace;
  PyObject *__pyx_n_s_Pddt_round;
  PyObject *__pyx_n_s_Pddt_second;
  PyObject *__pyx_n_s_Pddt_seconds;
  PyObject *__pyx_n_s_Pddt_snap;
  PyObject *__pyx_kp_u_Pddt_snap_line_2367;
  PyObject *__pyx_n_s_Pddt_strptime;
  PyObject *__pyx_n_s_Pddt_sub;
  PyObject *__pyx_n_s_Pddt_time;
  PyObject *__pyx_n_s_Pddt_timedf;
  PyObject *__pyx_n_s_Pddt_timestamp;
  PyObject *__pyx_n_s_Pddt_timetz;
  PyObject *__pyx_n_s_Pddt_to_curr_month;
  PyObject *__pyx_kp_u_Pddt_to_curr_month_line_2028;
  PyObject *__pyx_n_s_Pddt_to_curr_quarter;
  PyObject *__pyx_kp_u_Pddt_to_curr_quarter_line_1853;
  PyObject *__pyx_n_s_Pddt_to_curr_weekday;
  PyObject *__pyx_kp_u_Pddt_to_curr_weekday_line_2200;
  PyObject *__pyx_n_s_Pddt_to_curr_year;
  PyObject *__pyx_kp_u_Pddt_to_curr_year_line_1652;
  PyObject *__pyx_n_s_Pddt_to_date;
  PyObject *__pyx_kp_u_Pddt_to_date_line_2527;
  PyObject *__pyx_n_s_Pddt_to_datetime;
  PyObject *__pyx_kp_u_Pddt_to_datetime_line_2383;
  PyObject *__pyx_n_s_Pddt_to_day;
  PyObject *__pyx_n_s_Pddt_to_end_of;
  PyObject *__pyx_n_s_Pddt_to_first_of;
  PyObject *__pyx_n_s_Pddt_to_friday;
  PyObject *__pyx_n_s_Pddt_to_last_of;
  PyObject *__pyx_n_s_Pddt_to_monday;
  PyObject *__pyx_n_s_Pddt_to_month;
  PyObject *__pyx_kp_u_Pddt_to_month_line_2109;
  PyObject *__pyx_n_s_Pddt_to_next_month;
  PyObject *__pyx_kp_u_Pddt_to_next_month_line_2096;
  PyObject *__pyx_n_s_Pddt_to_next_quarter;
  PyObject *__pyx_kp_u_Pddt_to_next_quarter_line_1935;
  PyObject *__pyx_n_s_Pddt_to_next_weekday;
  PyObject *__pyx_kp_u_Pddt_to_next_weekday_line_2228;
  PyObject *__pyx_n_s_Pddt_to_next_year;
  PyObject *__pyx_kp_u_Pddt_to_next_year_line_1748;
  PyObject *__pyx_n_s_Pddt_to_prev_month;
  PyObject *__pyx_kp_u_Pddt_to_prev_month_line_2083;
  PyObject *__pyx_n_s_Pddt_to_prev_quarter;
  PyObject *__pyx_kp_u_Pddt_to_prev_quarter_line_1918;
  PyObject *__pyx_n_s_Pddt_to_prev_weekday;
  PyObject *__pyx_kp_u_Pddt_to_prev_weekday_line_2214;
  PyObject *__pyx_n_s_Pddt_to_prev_year;
  PyObject *__pyx_kp_u_Pddt_to_prev_year_line_1725;
  PyObject *__pyx_n_s_Pddt_to_quarter;
  PyObject *__pyx_kp_u_Pddt_to_quarter_line_1952;
  PyObject *__pyx_n_s_Pddt_to_saturday;
  PyObject *__pyx_n_s_Pddt_to_start_of;
  PyObject *__pyx_n_s_Pddt_to_sunday;
  PyObject *__pyx_n_s_Pddt_to_thursday;
  PyObject *__pyx_n_s_Pddt_to_time;
  PyObject *__pyx_kp_u_Pddt_to_time_line_2588;
  PyObject *__pyx_n_s_Pddt_to_tomorrow;
  PyObject *__pyx_n_s_Pddt_to_tuesday;
  PyObject *__pyx_n_s_Pddt_to_wednesday;
  PyObject *__pyx_n_s_Pddt_to_weekday;
  PyObject *__pyx_kp_u_Pddt_to_weekday_line_2242;
  PyObject *__pyx_n_s_Pddt_to_year;
  PyObject *__pyx_kp_u_Pddt_to_year_line_1771;
  PyObject *__pyx_n_s_Pddt_to_yesterday;
  PyObject *__pyx_n_s_Pddt_today;
  PyObject *__pyx_n_s_Pddt_toordinal;
  PyObject *__pyx_n_s_Pddt_tz_available;
  PyObject *__pyx_kp_u_Pddt_tz_available_line_3574;
  PyObject *__pyx_n_s_Pddt_tz_convert;
  PyObject *__pyx_n_s_Pddt_tz_localize;
  PyObject *__pyx_n_s_Pddt_tz_switch;
  PyObject *__pyx_n_s_Pddt_tzname;
  PyObject *__pyx_n_s_Pddt_utcfromtimestamp;
  PyObject *__pyx_n_s_Pddt_utcnow;
  PyObject *__pyx_n_s_Pddt_utctimedf;
  PyObject *__pyx_n_s_Pddt_values_naive;
  PyObject *__pyx_n_s_Pddt_weekday;
  PyObject *__pyx_n_s_Pddt_year;
  PyObject *__pyx_n_u_Q;
  PyObject *__pyx_kp_u_Return_the_number_of_days_1_31_s;
  PyObject *__pyx_n_s_RuntimeError;
  PyObject *__pyx_n_u_S;
  PyObject *__pyx_n_u_Sat;
  PyObject *__pyx_n_s_Self;
  PyObject *__pyx_n_u_Sep;
  PyObject *__pyx_n_s_Series;
  PyObject *__pyx_kp_u_Snap_to_nearest_occurring_freque;
  PyObject *__pyx_n_u_Sun;
  PyObject *__pyx_n_u_T;
  PyObject *__pyx_kp_u_The_available_timezone_names_set;
  PyObject *__pyx_n_u_Thu;
  PyObject *__pyx_kp_u_Time_zones_are_not_available_fro;
  PyObject *__pyx_n_s_Timestamp;
  PyObject *__pyx_kp_u_Timezone_aware;
  PyObject *__pyx_kp_u_Timezone_naive;
  PyObject *__pyx_n_u_Tue;
  PyObject *__pyx_n_s_TypeError;
  PyObject *__pyx_n_s_ValueError;
  PyObject *__pyx_n_u_W;
  PyObject *__pyx_n_u_Wed;
  PyObject *__pyx_n_u_Y;
  PyObject *__pyx_kp_u_Y_m_d;
  PyObject *__pyx_n_s_ZeroDivisionError;
  PyObject *__pyx_kp_u__10;
  PyObject *__pyx_kp_u__11;
  PyObject *__pyx_kp_u__12;
  PyObject *__pyx_kp_u__13;
  PyObject *__pyx_kp_u__14;
  PyObject *__pyx_kp_u__15;
  PyObject *__pyx_kp_u__19;
  PyObject *__pyx_n_s__242;
  PyObject *__pyx_kp_u__43;
  PyObject *__pyx_n_s__44;
  PyObject *__pyx_n_s__79;
  PyObject *__pyx_kp_u__9;
  PyObject *__pyx_kp_u_a_b_d_H_M_S_Y;
  PyObject *__pyx_n_s_absolute;
  PyObject *__pyx_n_s_add;
  PyObject *__pyx_n_s_all;
  PyObject *__pyx_n_s_ambiguous;
  PyObject *__pyx_kp_u_ambiguous_NaT_is_not_supported;
  PyObject *__pyx_n_s_arr;
  PyObject *__pyx_n_s_arr_ptr;
  PyObject *__pyx_n_s_arr_size;
  PyObject *__pyx_kp_u_array_size_must_be_and_integer_0;
  PyObject *__pyx_kp_u_array_size_must_be_greater_than;
  PyObject *__pyx_n_u_as;
  PyObject *__pyx_n_s_as_unit;
  PyObject *__pyx_n_s_astimezone;
  PyObject *__pyx_n_s_astype;
  PyObject *__pyx_n_s_asyncio_coroutines;
  PyObject *__pyx_n_s_available_timezones;
  PyObject *__pyx_n_s_available_timezones_2;
  PyObject *__pyx_n_s_base_tz;
  PyObject *__pyx_kp_u_between_naive_aware_datetimes_T;
  PyObject *__pyx_kp_u_between_naive_aware_datetimes_T_2;
  PyObject *__pyx_n_s_bool;
  PyObject *__pyx_kp_s_bool_None;
  PyObject *__pyx_n_u_both;
  PyObject *__pyx_kp_u_calcuate_average;
  PyObject *__pyx_kp_u_cannot;
  PyObject *__pyx_kp_u_cannot_access_the_time_value_fro;
  PyObject *__pyx_kp_u_cannot_cast;
  PyObject *__pyx_kp_u_cannot_cast_ndarray;
  PyObject *__pyx_kp_u_cannot_cast_ndarray_2;
  PyObject *__pyx_kp_u_cannot_ceil_to_multiple_0;
  PyObject *__pyx_kp_u_cannot_check_if_ndarray_s_is_wit;
  PyObject *__pyx_kp_u_cannot_check_ndarray;
  PyObject *__pyx_kp_u_cannot_compare_between_arrays_wi;
  PyObject *__pyx_kp_u_cannot_compare_ndarrays_with_dif;
  PyObject *__pyx_kp_u_cannot_convert_ndarray;
  PyObject *__pyx_kp_u_cannot_convert_ndarray_from_date;
  PyObject *__pyx_kp_u_cannot_convert_s_to_an_integer_t;
  PyObject *__pyx_kp_u_cannot_convert_s_to_an_integer_t_2;
  PyObject *__pyx_kp_u_cannot_convert_s_to_float_to_rep;
  PyObject *__pyx_kp_u_cannot_covnert_s_to_an_integer_t;
  PyObject *__pyx_kp_u_cannot_covnert_s_to_float_to_rep;
  PyObject *__pyx_kp_u_cannot_floor_to_multiple_0;
  PyObject *__pyx_kp_u_cannot_get_the_length_of_s_to_re;
  PyObject *__pyx_kp_u_cannot_perform_addition_on_ndarr;
  PyObject *__pyx_kp_u_cannot_perform_comparison_on_nda;
  PyObject *__pyx_kp_u_cannot_perform_subtraction_on_nd;
  PyObject *__pyx_kp_u_cannot_round_to_multiple_0;
  PyObject *__pyx_kp_u_cannot_unpack_s_to_iso_calendar;
  PyObject *__pyx_n_s_ceil;
  PyObject *__pyx_n_u_ceil;
  PyObject *__pyx_n_s_cfg;
  PyObject *__pyx_n_s_class_getitem;
  PyObject *__pyx_n_s_cline_in_traceback;
  PyObject *__pyx_n_s_closest;
  PyObject *__pyx_n_u_closest;
  PyObject *__pyx_n_s_cls;
  PyObject *__pyx_n_s_columns;
  PyObject *__pyx_n_s_combine;
  PyObject *__pyx_n_u_compare;
  PyObject *__pyx_n_s_copy;
  PyObject *__pyx_n_s_ctime;
  PyObject *__pyx_kp_s_cython_bint;
  PyObject *__pyx_kp_s_cython_int;
  PyObject *__pyx_n_s_cytimes;
  PyObject *__pyx_n_s_cytimes_parser;
  PyObject *__pyx_n_s_cytimes_pddt;
  PyObject *__pyx_n_u_d;
  PyObject *__pyx_n_s_data;
  PyObject *__pyx_n_s_date;
  PyObject *__pyx_n_s_date_range;
  PyObject *__pyx_n_s_dates;
  PyObject *__pyx_n_s_datesD;
  PyObject *__pyx_n_s_datesD_1st;
  PyObject *__pyx_n_s_datesD_lst;
  PyObject *__pyx_n_s_datesM;
  PyObject *__pyx_n_s_datesQ;
  PyObject *__pyx_n_s_datesY;
  PyObject *__pyx_n_s_datetime;
  PyObject *__pyx_n_s_datetime64;
  PyObject *__pyx_n_u_datetime64;
  PyObject *__pyx_kp_u_datetime64_D;
  PyObject *__pyx_kp_u_datetime64_M;
  PyObject *__pyx_kp_u_datetime64_W;
  PyObject *__pyx_kp_u_datetime64_Y;
  PyObject *__pyx_kp_u_datetime64_h;
  PyObject *__pyx_kp_u_datetime64_m;
  PyObject *__pyx_kp_u_datetime64_ms;
  PyObject *__pyx_kp_u_datetime64_ns;
  PyObject *__pyx_kp_u_datetime64_s;
  PyObject *__pyx_kp_u_datetime64_s_2;
  PyObject *__pyx_kp_u_datetime64_us;
  PyObject *__pyx_kp_s_datetime_date_object;
  PyObject *__pyx_kp_s_datetime_date_str_None;
  PyObject *__pyx_kp_s_datetime_datetime_object;
  PyObject *__pyx_kp_u_datetime_s_is_ambiguous;
  PyObject *__pyx_kp_s_datetime_time_str_None;
  PyObject *__pyx_kp_s_datetime_tzinfo_str_None;
  PyObject *__pyx_n_s_day;
  PyObject *__pyx_n_u_day;
  PyObject *__pyx_n_s_day1st;
  PyObject *__pyx_n_s_dayfirst;
  PyObject *__pyx_n_s_days;
  PyObject *__pyx_n_s_days_bf_month;
  PyObject *__pyx_n_u_days_bf_month;
  PyObject *__pyx_n_s_days_bf_quarter;
  PyObject *__pyx_n_u_days_bf_quarter;
  PyObject *__pyx_n_s_days_bf_year;
  PyObject *__pyx_n_u_days_bf_year;
  PyObject *__pyx_n_s_days_in_month;
  PyObject *__pyx_n_u_days_in_month;
  PyObject *__pyx_n_s_days_in_quarter;
  PyObject *__pyx_n_u_days_in_quarter;
  PyObject *__pyx_n_s_days_in_year;
  PyObject *__pyx_n_u_days_in_year;
  PyObject *__pyx_n_s_days_of_month;
  PyObject *__pyx_n_u_days_of_month;
  PyObject *__pyx_n_s_days_of_quarter;
  PyObject *__pyx_n_u_days_of_quarter;
  PyObject *__pyx_n_s_days_of_year;
  PyObject *__pyx_n_u_days_of_year;
  PyObject *__pyx_n_s_dd;
  PyObject *__pyx_n_s_delta;
  PyObject *__pyx_n_s_dict;
  PyObject *__pyx_n_s_dict_2;
  PyObject *__pyx_n_s_diff;
  PyObject *__pyx_n_u_diff;
  PyObject *__pyx_kp_u_disable;
  PyObject *__pyx_kp_u_division_by_zero_for_utils_arr_c;
  PyObject *__pyx_kp_u_division_by_zero_for_utils_arr_f;
  PyObject *__pyx_kp_u_division_by_zero_for_utils_arr_r;
  PyObject *__pyx_kp_u_division_by_zero_for_utils_math;
  PyObject *__pyx_kp_u_division_by_zero_for_utils_math_2;
  PyObject *__pyx_kp_u_division_by_zero_for_utils_math_3;
  PyObject *__pyx_kp_u_division_by_zero_for_utils_math_4;
  PyObject *__pyx_kp_u_division_by_zero_in_arr_mod;
  PyObject *__pyx_n_s_doc;
  PyObject *__pyx_n_s_dst;
  PyObject *__pyx_n_s_dt;
  PyObject *__pyx_n_s_dt64;
  PyObject *__pyx_n_s_dt_val;
  PyObject *__pyx_n_s_dtobjs;
  PyObject *__pyx_n_s_dts;
  PyObject *__pyx_n_s_dtstr;
  PyObject *__pyx_n_s_dtype;
  PyObject *__pyx_kp_u_enable;
  PyObject *__pyx_n_s_end;
  PyObject *__pyx_n_s_err;
  PyObject *__pyx_n_s_errors;
  PyObject *__pyx_n_s_exceptions;
  PyObject *__pyx_kp_u_expects_datetime_tzinfo_got_s;
  PyObject *__pyx_kp_u_expects_np_datetime64_got_s;
  PyObject *__pyx_kp_u_expects_np_ndarray_datetime64_go;
  PyObject *__pyx_kp_u_expects_np_ndarray_datetime64_ti;
  PyObject *__pyx_kp_u_expects_np_ndarray_datetime64_ti_2;
  PyObject *__pyx_kp_u_expects_np_ndarray_timedelta64_g;
  PyObject *__pyx_kp_u_expects_np_timedelta64_got_s;
  PyObject *__pyx_n_s_f;
  PyObject *__pyx_n_s_fac;
  PyObject *__pyx_kp_u_failed_to_allocate_memory_for_st;
  PyObject *__pyx_n_s_farthest;
  PyObject *__pyx_n_u_farthest;
  PyObject *__pyx_kp_u_find_closest;
  PyObject *__pyx_kp_u_find_farthest;
  PyObject *__pyx_n_s_floor;
  PyObject *__pyx_n_u_floor;
  PyObject *__pyx_n_s_fmt;
  PyObject *__pyx_n_s_freq;
  PyObject *__pyx_n_s_fromdate;
  PyObject *__pyx_n_s_fromdatetime;
  PyObject *__pyx_n_s_fromdatetime64;
  PyObject *__pyx_n_s_fromicroseconds;
  PyObject *__pyx_n_s_fromisocalendar;
  PyObject *__pyx_n_s_fromisoformat;
  PyObject *__pyx_n_s_fromordinal;
  PyObject *__pyx_n_s_fromseconds;
  PyObject *__pyx_n_s_fromtimestamp;
  PyObject *__pyx_n_s_fromutc;
  PyObject *__pyx_n_u_fs;
  PyObject *__pyx_n_s_fsp;
  PyObject *__pyx_kp_u_gc;
  PyObject *__pyx_n_s_generate_range;
  PyObject *__pyx_n_s_get;
  PyObject *__pyx_n_u_h;
  PyObject *__pyx_n_s_hh_fac;
  PyObject *__pyx_n_s_hour;
  PyObject *__pyx_n_u_hour;
  PyObject *__pyx_n_s_hours;
  PyObject *__pyx_n_s_i;
  PyObject *__pyx_n_s_import;
  PyObject *__pyx_n_s_incl_off;
  PyObject *__pyx_n_s_inclusive;
  PyObject *__pyx_n_s_index;
  PyObject *__pyx_n_u_infer;
  PyObject *__pyx_n_s_init_subclass;
  PyObject *__pyx_n_s_initializing;
  PyObject *__pyx_kp_u_instance_is_already_timezone_awa;
  PyObject *__pyx_kp_u_instance_is_timezone_naive_Canno;
  PyObject *__pyx_kp_u_instance_is_timezone_naive_Use_t;
  PyObject *__pyx_n_u_int64;
  PyObject *__pyx_kp_u_int64_under_D_resolution;
  PyObject *__pyx_kp_u_int64_under_M_resolution;
  PyObject *__pyx_kp_u_int64_under_Y_resolution;
  PyObject *__pyx_kp_u_int64_under_h_resolution;
  PyObject *__pyx_kp_u_int64_under_m_resolution;
  PyObject *__pyx_kp_u_int64_under_ms_resolution;
  PyObject *__pyx_kp_u_int64_under_ns_resolution;
  PyObject *__pyx_kp_u_int64_under_s_resolution;
  PyObject *__pyx_kp_u_int64_under_us_resolution;
  PyObject *__pyx_kp_s_int_None;
  PyObject *__pyx_kp_s_int_float_object;
  PyObject *__pyx_kp_s_int_object;
  PyObject *__pyx_kp_s_int_str;
  PyObject *__pyx_kp_s_int_str_None;
  PyObject *__pyx_kp_u_invalid_character_s_as_an_intege;
  PyObject *__pyx_kp_u_invalid_end_of_datetime_unit_s_S;
  PyObject *__pyx_kp_u_invalid_first_of_datetime_unit_s;
  PyObject *__pyx_kp_u_invalid_fractional_seconds_preci;
  PyObject *__pyx_kp_u_invalid_input_s_for_inclusive_Su;
  PyObject *__pyx_kp_u_invalid_last_of_datetime_unit_s;
  PyObject *__pyx_kp_u_invalid_month_name_s;
  PyObject *__pyx_kp_u_invalid_month_number_d_must_betw;
  PyObject *__pyx_kp_u_invalid_start_of_time_unit_s_Sup;
  PyObject *__pyx_kp_u_invalid_weekday_name_s;
  PyObject *__pyx_kp_u_invalid_weekday_number_d_must_be;
  PyObject *__pyx_n_s_is_coroutine;
  PyObject *__pyx_n_s_is_day;
  PyObject *__pyx_n_u_is_day;
  PyObject *__pyx_n_s_is_end_of;
  PyObject *__pyx_kp_u_is_end_of_s;
  PyObject *__pyx_n_s_is_first_of;
  PyObject *__pyx_kp_u_is_first_of_s;
  PyObject *__pyx_n_s_is_future;
  PyObject *__pyx_n_u_is_future;
  PyObject *__pyx_n_s_is_last_of;
  PyObject *__pyx_kp_u_is_last_of_s;
  PyObject *__pyx_n_s_is_leap_year;
  PyObject *__pyx_n_u_is_leap_year;
  PyObject *__pyx_n_s_is_local;
  PyObject *__pyx_n_s_is_long_year;
  PyObject *__pyx_n_u_is_long_year;
  PyObject *__pyx_n_s_is_month;
  PyObject *__pyx_n_u_is_month;
  PyObject *__pyx_kp_u_is_not_supported;
  PyObject *__pyx_kp_u_is_not_supported_2;
  PyObject *__pyx_kp_u_is_not_supported_3;
  PyObject *__pyx_n_s_is_past;
  PyObject *__pyx_n_u_is_past;
  PyObject *__pyx_n_s_is_quarter;
  PyObject *__pyx_n_u_is_quarter;
  PyObject *__pyx_n_s_is_start_of;
  PyObject *__pyx_kp_u_is_start_of_s;
  PyObject *__pyx_n_s_is_utc;
  PyObject *__pyx_n_s_is_weekday;
  PyObject *__pyx_n_u_is_weekday;
  PyObject *__pyx_n_s_is_year;
  PyObject *__pyx_n_u_is_year;
  PyObject *__pyx_kp_u_isenabled;
  PyObject *__pyx_n_s_iso;
  PyObject *__pyx_n_s_iso_2;
  PyObject *__pyx_n_s_isocalendar;
  PyObject *__pyx_n_s_isoformat;
  PyObject *__pyx_n_s_isoweek;
  PyObject *__pyx_n_u_isoweek;
  PyObject *__pyx_n_s_isoweekday;
  PyObject *__pyx_n_u_isoweekday;
  PyObject *__pyx_n_s_isoyear;
  PyObject *__pyx_n_u_isoyear;
  PyObject *__pyx_n_s_item;
  PyObject *__pyx_n_s_itertuples;
  PyObject *__pyx_n_s_kind;
  PyObject *__pyx_n_s_leap_bt_year;
  PyObject *__pyx_n_u_leap_bt_year;
  PyObject *__pyx_n_s_lib;
  PyObject *__pyx_n_s_lower;
  PyObject *__pyx_n_u_m;
  PyObject *__pyx_n_s_main;
  PyObject *__pyx_n_s_metaclass;
  PyObject *__pyx_n_s_mi_fac;
  PyObject *__pyx_n_s_microsecond;
  PyObject *__pyx_n_u_microsecond;
  PyObject *__pyx_n_s_microseconds;
  PyObject *__pyx_n_u_microseconds;
  PyObject *__pyx_n_s_millisecond;
  PyObject *__pyx_n_u_millisecond;
  PyObject *__pyx_n_s_milliseconds;
  PyObject *__pyx_n_u_min;
  PyObject *__pyx_n_s_minute;
  PyObject *__pyx_n_u_minute;
  PyObject *__pyx_n_s_minutes;
  PyObject *__pyx_kp_u_mixed_timezones;
  PyObject *__pyx_n_s_mm;
  PyObject *__pyx_n_s_module;
  PyObject *__pyx_n_s_month;
  PyObject *__pyx_n_u_month;
  PyObject *__pyx_n_s_months;
  PyObject *__pyx_n_s_mro_entries;
  PyObject *__pyx_n_u_ms;
  PyObject *__pyx_n_s_mul;
  PyObject *__pyx_kp_u_must_be_an_1_dimensional_ndarray;
  PyObject *__pyx_n_s_my_arr;
  PyObject *__pyx_n_s_my_tz;
  PyObject *__pyx_n_s_my_unit;
  PyObject *__pyx_n_s_my_unit_adj;
  PyObject *__pyx_n_s_my_unit_ch;
  PyObject *__pyx_n_s_my_unit_int;
  PyObject *__pyx_n_s_my_unit_ns;
  PyObject *__pyx_n_s_naive;
  PyObject *__pyx_n_s_name;
  PyObject *__pyx_n_s_name_2;
  PyObject *__pyx_n_s_nanosecond;
  PyObject *__pyx_n_u_nanosecond;
  PyObject *__pyx_kp_u_nanosecond_conversion_range_dat;
  PyObject *__pyx_n_s_nanoseconds;
  PyObject *__pyx_kp_u_ndarray_size_must_be_an_integer;
  PyObject *__pyx_n_u_neither;
  PyObject *__pyx_n_s_new;
  PyObject *__pyx_n_s_no_default;
  PyObject *__pyx_n_s_nonexistent;
  PyObject *__pyx_kp_u_nonexistent_NaT_is_not_supported;
  PyObject *__pyx_n_s_normalize;
  PyObject *__pyx_n_s_now;
  PyObject *__pyx_n_s_np;
  PyObject *__pyx_kp_s_np_datetime64_object;
  PyObject *__pyx_kp_s_np_ndarray_datetime_date;
  PyObject *__pyx_kp_s_np_ndarray_datetime_datetime;
  PyObject *__pyx_kp_s_np_ndarray_datetime_time;
  PyObject *__pyx_kp_s_np_ndarray_np_datetime64;
  PyObject *__pyx_kp_s_np_ndarray_np_int64;
  PyObject *__pyx_n_u_ns;
  PyObject *__pyx_n_s_numpy;
  PyObject *__pyx_kp_u_numpy__core_multiarray_failed_to;
  PyObject *__pyx_kp_u_numpy__core_umath_failed_to_impo;
  PyObject *__pyx_n_s_object;
  PyObject *__pyx_kp_s_object_None;
  PyObject *__pyx_n_s_off;
  PyObject *__pyx_n_s_offset;
  PyObject *__pyx_n_u_one;
  PyObject *__pyx_kp_u_operation_on_ndarray_datetime64;
  PyObject *__pyx_n_s_ordinal;
  PyObject *__pyx_n_u_ordinal;
  PyObject *__pyx_n_s_pandas;
  PyObject *__pyx_n_s_pandas__libs;
  PyObject *__pyx_n_s_pandas__libs_tslibs_parsing;
  PyObject *__pyx_n_s_pandas_core_arrays_datetimes;
  PyObject *__pyx_n_s_parse;
  PyObject *__pyx_n_s_parse_dict;
  PyObject *__pyx_n_s_parse_dtobj;
  PyObject *__pyx_n_s_parse_sequence;
  PyObject *__pyx_n_s_pd_err;
  PyObject *__pyx_n_s_periods;
  PyObject *__pyx_n_s_precision;
  PyObject *__pyx_n_s_prepare;
  PyObject *__pyx_n_s_property;
  PyObject *__pyx_n_u_ps;
  PyObject *__pyx_n_s_pt;
  PyObject *__pyx_n_s_pt_1st;
  PyObject *__pyx_n_s_pt_arr;
  PyObject *__pyx_n_s_pt_end;
  PyObject *__pyx_n_s_pt_end_unit;
  PyObject *__pyx_n_s_pt_lst;
  PyObject *__pyx_n_s_pt_stt;
  PyObject *__pyx_n_s_pt_stt_unit;
  PyObject *__pyx_n_s_pt_tz;
  PyObject *__pyx_n_s_pt_unit;
  PyObject *__pyx_n_s_pt_unit_int;
  PyObject *__pyx_n_s_pytz;
  PyObject *__pyx_n_s_pytz_err;
  PyObject *__pyx_n_s_pyx_vtable;
  PyObject *__pyx_n_s_qualname;
  PyObject *__pyx_n_s_quarter;
  PyObject *__pyx_n_u_quarter;
  PyObject *__pyx_n_s_quarters;
  PyObject *__pyx_n_u_raise;
  PyObject *__pyx_n_s_range;
  PyObject *__pyx_n_s_replace;
  PyObject *__pyx_n_s_res;
  PyObject *__pyx_kp_u_resolution;
  PyObject *__pyx_kp_u_resolution_Array_with_datetime;
  PyObject *__pyx_kp_u_resolution_Array_with_dtype_of;
  PyObject *__pyx_kp_u_resolution_Supported_resolution;
  PyObject *__pyx_kp_u_resolution_is_not_supported;
  PyObject *__pyx_n_s_return;
  PyObject *__pyx_n_s_round;
  PyObject *__pyx_n_u_round;
  PyObject *__pyx_n_u_s;
  PyObject *__pyx_n_s_sec;
  PyObject *__pyx_n_s_second;
  PyObject *__pyx_n_u_second;
  PyObject *__pyx_n_s_seconds;
  PyObject *__pyx_n_u_seconds;
  PyObject *__pyx_n_s_self;
  PyObject *__pyx_n_s_sep;
  PyObject *__pyx_kp_u_sequence_must_have_3_items;
  PyObject *__pyx_n_s_set_name;
  PyObject *__pyx_kp_s_set_str;
  PyObject *__pyx_n_u_shift_forward;
  PyObject *__pyx_n_s_size;
  PyObject *__pyx_n_s_snap;
  PyObject *__pyx_n_s_spec;
  PyObject *__pyx_kp_s_src_cytimes_pddt_py;
  PyObject *__pyx_n_s_ss_fac;
  PyObject *__pyx_n_s_start;
  PyObject *__pyx_n_s_str;
  PyObject *__pyx_kp_s_str_int;
  PyObject *__pyx_kp_s_str_object;
  PyObject *__pyx_n_s_strftime;
  PyObject *__pyx_kp_u_strftime_format_is_too_long_s;
  PyObject *__pyx_n_s_strptime;
  PyObject *__pyx_n_s_sub;
  PyObject *__pyx_n_s_super;
  PyObject *__pyx_kp_u_support_ndarray_with_1_4_dimensi;
  PyObject *__pyx_n_s_targ_tz;
  PyObject *__pyx_n_s_test;
  PyObject *__pyx_n_s_time;
  PyObject *__pyx_n_u_timedelta64;
  PyObject *__pyx_n_s_timedf;
  PyObject *__pyx_n_s_times;
  PyObject *__pyx_n_s_timestamp;
  PyObject *__pyx_n_u_timestamp;
  PyObject *__pyx_n_s_timetz;
  PyObject *__pyx_kp_u_timezone_offset_s_seconds_out_of;
  PyObject *__pyx_n_s_tm_hour;
  PyObject *__pyx_n_u_tm_hour;
  PyObject *__pyx_n_s_tm_isdst;
  PyObject *__pyx_n_s_tm_mday;
  PyObject *__pyx_n_u_tm_mday;
  PyObject *__pyx_n_s_tm_min;
  PyObject *__pyx_n_u_tm_min;
  PyObject *__pyx_n_s_tm_mon;
  PyObject *__pyx_n_u_tm_mon;
  PyObject *__pyx_n_s_tm_sec;
  PyObject *__pyx_n_u_tm_sec;
  PyObject *__pyx_n_s_tm_wday;
  PyObject *__pyx_n_u_tm_wday;
  PyObject *__pyx_n_s_tm_yday;
  PyObject *__pyx_n_u_tm_yday;
  PyObject *__pyx_n_s_tm_year;
  PyObject *__pyx_n_u_tm_year;
  PyObject *__pyx_kp_u_to;
  PyObject *__pyx_kp_u_to_2;
  PyObject *__pyx_kp_u_to_an_integer_under;
  PyObject *__pyx_kp_u_to_an_integer_under_2;
  PyObject *__pyx_n_s_to_curr_month;
  PyObject *__pyx_n_s_to_curr_quarter;
  PyObject *__pyx_n_s_to_curr_weekday;
  PyObject *__pyx_n_s_to_curr_weekday_2;
  PyObject *__pyx_n_s_to_curr_year;
  PyObject *__pyx_n_s_to_date;
  PyObject *__pyx_n_s_to_datetime;
  PyObject *__pyx_kp_u_to_datetime64;
  PyObject *__pyx_n_s_to_day;
  PyObject *__pyx_n_s_to_end_of;
  PyObject *__pyx_n_s_to_first_of;
  PyObject *__pyx_n_s_to_friday;
  PyObject *__pyx_kp_u_to_int64_under;
  PyObject *__pyx_kp_u_to_int64_under_2;
  PyObject *__pyx_kp_u_to_int64_under_3;
  PyObject *__pyx_n_s_to_last_of;
  PyObject *__pyx_n_s_to_monday;
  PyObject *__pyx_n_s_to_month;
  PyObject *__pyx_n_s_to_next_month;
  PyObject *__pyx_n_s_to_next_quarter;
  PyObject *__pyx_n_s_to_next_weekday;
  PyObject *__pyx_n_s_to_next_year;
  PyObject *__pyx_n_s_to_prev_month;
  PyObject *__pyx_n_s_to_prev_quarter;
  PyObject *__pyx_n_s_to_prev_weekday;
  PyObject *__pyx_n_s_to_prev_year;
  PyObject *__pyx_n_s_to_pydatetime;
  PyObject *__pyx_n_s_to_quarter;
  PyObject *__pyx_n_s_to_saturday;
  PyObject *__pyx_n_s_to_start_of;
  PyObject *__pyx_n_s_to_sunday;
  PyObject *__pyx_n_s_to_thursday;
  PyObject *__pyx_n_s_to_time;
  PyObject *__pyx_n_s_to_tomorrow;
  PyObject *__pyx_n_s_to_tuesday;
  PyObject *__pyx_n_s_to_wednesday;
  PyObject *__pyx_n_s_to_weekday;
  PyObject *__pyx_n_s_to_year;
  PyObject *__pyx_n_s_to_yesterday;
  PyObject *__pyx_n_s_today;
  PyObject *__pyx_n_s_toordinal;
  PyObject *__pyx_n_s_ts;
  PyObject *__pyx_n_s_typing;
  PyObject *__pyx_n_s_typing_extensions;
  PyObject *__pyx_n_s_tz;
  PyObject *__pyx_n_s_tz_available;
  PyObject *__pyx_n_s_tz_convert;
  PyObject *__pyx_n_s_tz_localize;
  PyObject *__pyx_n_s_tz_switch;
  PyObject *__pyx_n_s_tzinfo;
  PyObject *__pyx_n_s_tzname;
  PyObject *__pyx_kp_u_unable_to_parse_datetime_unit_fr;
  PyObject *__pyx_n_s_unit;
  PyObject *__pyx_kp_u_unknown_datetime_unit_d;
  PyObject *__pyx_kp_u_unknown_datetime_unit_s;
  PyObject *__pyx_kp_u_unless_utc_True;
  PyObject *__pyx_kp_u_unsupported_datetime_unit_s;
  PyObject *__pyx_kp_u_unsupported_factor_d_for_timedel;
  PyObject *__pyx_kp_u_unsupported_factor_d_for_timedel_2;
  PyObject *__pyx_kp_u_unsupported_month_value_type_s_e;
  PyObject *__pyx_kp_u_unsupported_type_s_for_argument;
  PyObject *__pyx_kp_u_unsupported_type_s_for_argument_2;
  PyObject *__pyx_kp_u_unsupported_type_s_for_argument_3;
  PyObject *__pyx_kp_u_unsupported_type_s_for_argument_4;
  PyObject *__pyx_kp_u_unsupported_type_s_for_argument_5;
  PyObject *__pyx_kp_u_unsupported_type_s_for_argument_6;
  PyObject *__pyx_kp_u_unsupported_weekday_value_type_s;
  PyObject *__pyx_n_s_us;
  PyObject *__pyx_n_u_us;
  PyObject *__pyx_n_s_us_fac;
  PyObject *__pyx_n_s_utc;
  PyObject *__pyx_n_s_utcfromtimestamp;
  PyObject *__pyx_n_s_utcnow;
  PyObject *__pyx_n_s_utcoffset;
  PyObject *__pyx_n_s_utctimedf;
  PyObject *__pyx_n_s_utils;
  PyObject *__pyx_n_s_val;
  PyObject *__pyx_n_s_values;
  PyObject *__pyx_n_s_values_naive;
  PyObject *__pyx_kp_u_vs;
  PyObject *__pyx_n_s_wd;
  PyObject *__pyx_n_s_week;
  PyObject *__pyx_n_u_week;
  PyObject *__pyx_n_s_weekday;
  PyObject *__pyx_n_u_weekday;
  PyObject *__pyx_n_s_weeks;
  PyObject *__pyx_kp_u_with_datetime_unit;
  PyObject *__pyx_kp_u_without_specifying_the_array_da;
  PyObject *__pyx_n_s_wkd;
  PyObject *__pyx_n_s_ww;
  PyObject *__pyx_n_s_year;
  PyObject *__pyx_n_u_year;
  PyObject *__pyx_n_s_year1st;
  PyObject *__pyx_n_s_yearfirst;
  PyObject *__pyx_n_s_years;
  PyObject *__pyx_n_s_ymd;
  PyObject *__pyx_n_s_yy;
  PyObject *__pyx_n_s_zoneinfo;
  PyObject *__pyx_int_0;
  PyObject *__pyx_int_1;
  PyObject *__pyx_int_2;
  PyObject *__pyx_int_3;
  PyObject *__pyx_int_4;
  PyObject *__pyx_int_5;
  PyObject *__pyx_int_6;
  PyObject *__pyx_int_neg_1;
  PyObject *__pyx_tuple_;
  PyObject *__pyx_tuple__2;
  PyObject *__pyx_tuple__3;
  PyObject *__pyx_tuple__4;
  PyObject *__pyx_tuple__5;
  PyObject *__pyx_tuple__6;
  PyObject *__pyx_tuple__7;
  PyObject *__pyx_tuple__8;
  PyObject *__pyx_slice__39;
  PyObject *__pyx_tuple__16;
  PyObject *__pyx_tuple__17;
  PyObject *__pyx_tuple__18;
  PyObject *__pyx_tuple__20;
  PyObject *__pyx_tuple__21;
  PyObject *__pyx_tuple__22;
  PyObject *__pyx_tuple__23;
  PyObject *__pyx_tuple__24;
  PyObject *__pyx_tuple__25;
  PyObject *__pyx_tuple__26;
  PyObject *__pyx_tuple__27;
  PyObject *__pyx_tuple__28;
  PyObject *__pyx_tuple__29;
  PyObject *__pyx_tuple__30;
  PyObject *__pyx_tuple__31;
  PyObject *__pyx_tuple__32;
  PyObject *__pyx_tuple__33;
  PyObject *__pyx_tuple__34;
  PyObject *__pyx_tuple__35;
  PyObject *__pyx_tuple__37;
  PyObject *__pyx_tuple__40;
  PyObject *__pyx_tuple__41;
  PyObject *__pyx_tuple__42;
  PyObject *__pyx_tuple__45;
  PyObject *__pyx_tuple__47;
  PyObject *__pyx_tuple__48;
  PyObject *__pyx_tuple__50;
  PyObject *__pyx_tuple__52;
  PyObject *__pyx_tuple__54;
  PyObject *__pyx_tuple__55;
  PyObject *__pyx_tuple__57;
  PyObject *__pyx_tuple__59;
  PyObject *__pyx_tuple__61;
  PyObject *__pyx_tuple__62;
  PyObject *__pyx_tuple__64;
  PyObject *__pyx_tuple__66;
  PyObject *__pyx_tuple__68;
  PyObject *__pyx_tuple__70;
  PyObject *__pyx_tuple__72;
  PyObject *__pyx_tuple__74;
  PyObject *__pyx_tuple__76;
  PyObject *__pyx_tuple__77;
  PyObject *__pyx_tuple__80;
  PyObject *__pyx_tuple__82;
  PyObject *__pyx_tuple__84;
  PyObject *__pyx_tuple__86;
  PyObject *__pyx_tuple__88;
  PyObject *__pyx_tuple__90;
  PyObject *__pyx_tuple__91;
  PyObject *__pyx_tuple__93;
  PyObject *__pyx_tuple__96;
  PyObject *__pyx_tuple__104;
  PyObject *__pyx_tuple__106;
  PyObject *__pyx_tuple__108;
  PyObject *__pyx_tuple__111;
  PyObject *__pyx_tuple__113;
  PyObject *__pyx_tuple__117;
  PyObject *__pyx_tuple__119;
  PyObject *__pyx_tuple__121;
  PyObject *__pyx_tuple__124;
  PyObject *__pyx_tuple__133;
  PyObject *__pyx_tuple__135;
  PyObject *__pyx_tuple__138;
  PyObject *__pyx_tuple__140;
  PyObject *__pyx_tuple__144;
  PyObject *__pyx_tuple__146;
  PyObject *__pyx_tuple__148;
  PyObject *__pyx_tuple__149;
  PyObject *__pyx_tuple__151;
  PyObject *__pyx_tuple__153;
  PyObject *__pyx_tuple__155;
  PyObject *__pyx_tuple__158;
  PyObject *__pyx_tuple__160;
  PyObject *__pyx_tuple__162;
  PyObject *__pyx_tuple__166;
  PyObject *__pyx_tuple__168;
  PyObject *__pyx_tuple__176;
  PyObject *__pyx_tuple__186;
  PyObject *__pyx_tuple__192;
  PyObject *__pyx_tuple__195;
  PyObject *__pyx_tuple__205;
  PyObject *__pyx_tuple__207;
  PyObject *__pyx_tuple__209;
  PyObject *__pyx_tuple__211;
  PyObject *__pyx_tuple__217;
  PyObject *__pyx_tuple__219;
  PyObject *__pyx_tuple__220;
  PyObject *__pyx_tuple__222;
  PyObject *__pyx_tuple__223;
  PyObject *__pyx_tuple__225;
  PyObject *__pyx_tuple__229;
  PyObject *__pyx_tuple__231;
  PyObject *__pyx_tuple__233;
  PyObject *__pyx_tuple__235;
  PyObject *__pyx_tuple__238;
  PyObject *__pyx_tuple__240;
  PyObject *__pyx_codeobj__36;
  PyObject *__pyx_codeobj__38;
  PyObject *__pyx_codeobj__46;
  PyObject *__pyx_codeobj__49;
  PyObject *__pyx_codeobj__51;
  PyObject *__pyx_codeobj__53;
  PyObject *__pyx_codeobj__56;
  PyObject *__pyx_codeobj__58;
  PyObject *__pyx_codeobj__60;
  PyObject *__pyx_codeobj__63;
  PyObject *__pyx_codeobj__65;
  PyObject *__pyx_codeobj__67;
  PyObject *__pyx_codeobj__69;
  PyObject *__pyx_codeobj__71;
  PyObject *__pyx_codeobj__73;
  PyObject *__pyx_codeobj__75;
  PyObject *__pyx_codeobj__78;
  PyObject *__pyx_codeobj__81;
  PyObject *__pyx_codeobj__83;
  PyObject *__pyx_codeobj__85;
  PyObject *__pyx_codeobj__87;
  PyObject *__pyx_codeobj__89;
  PyObject *__pyx_codeobj__92;
  PyObject *__pyx_codeobj__94;
  PyObject *__pyx_codeobj__95;
  PyObject *__pyx_codeobj__97;
  PyObject *__pyx_codeobj__98;
  PyObject *__pyx_codeobj__99;
  PyObject *__pyx_codeobj__100;
  PyObject *__pyx_codeobj__101;
  PyObject *__pyx_codeobj__102;
  PyObject *__pyx_codeobj__103;
  PyObject *__pyx_codeobj__105;
  PyObject *__pyx_codeobj__107;
  PyObject *__pyx_codeobj__109;
  PyObject *__pyx_codeobj__110;
  PyObject *__pyx_codeobj__112;
  PyObject *__pyx_codeobj__114;
  PyObject *__pyx_codeobj__115;
  PyObject *__pyx_codeobj__116;
  PyObject *__pyx_codeobj__118;
  PyObject *__pyx_codeobj__120;
  PyObject *__pyx_codeobj__122;
  PyObject *__pyx_codeobj__123;
  PyObject *__pyx_codeobj__125;
  PyObject *__pyx_codeobj__126;
  PyObject *__pyx_codeobj__127;
  PyObject *__pyx_codeobj__128;
  PyObject *__pyx_codeobj__129;
  PyObject *__pyx_codeobj__130;
  PyObject *__pyx_codeobj__131;
  PyObject *__pyx_codeobj__132;
  PyObject *__pyx_codeobj__134;
  PyObject *__pyx_codeobj__136;
  PyObject *__pyx_codeobj__137;
  PyObject *__pyx_codeobj__139;
  PyObject *__pyx_codeobj__141;
  PyObject *__pyx_codeobj__142;
  PyObject *__pyx_codeobj__143;
  PyObject *__pyx_codeobj__145;
  PyObject *__pyx_codeobj__147;
  PyObject *__pyx_codeobj__150;
  PyObject *__pyx_codeobj__152;
  PyObject *__pyx_codeobj__154;
  PyObject *__pyx_codeobj__156;
  PyObject *__pyx_codeobj__157;
  PyObject *__pyx_codeobj__159;
  PyObject *__pyx_codeobj__161;
  PyObject *__pyx_codeobj__163;
  PyObject *__pyx_codeobj__164;
  PyObject *__pyx_codeobj__165;
  PyObject *__pyx_codeobj__167;
  PyObject *__pyx_codeobj__169;
  PyObject *__pyx_codeobj__170;
  PyObject *__pyx_codeobj__171;
  PyObject *__pyx_codeobj__172;
  PyObject *__pyx_codeobj__173;
  PyObject *__pyx_codeobj__174;
  PyObject *__pyx_codeobj__175;
  PyObject *__pyx_codeobj__177;
  PyObject *__pyx_codeobj__178;
  PyObject *__pyx_codeobj__179;
  PyObject *__pyx_codeobj__180;
  PyObject *__pyx_codeobj__181;
  PyObject *__pyx_codeobj__182;
  PyObject *__pyx_codeobj__183;
  PyObject *__pyx_codeobj__184;
  PyObject *__pyx_codeobj__185;
  PyObject *__pyx_codeobj__187;
  PyObject *__pyx_codeobj__188;
  PyObject *__pyx_codeobj__189;
  PyObject *__pyx_codeobj__190;
  PyObject *__pyx_codeobj__191;
  PyObject *__pyx_codeobj__193;
  PyObject *__pyx_codeobj__194;
  PyObject *__pyx_codeobj__196;
  PyObject *__pyx_codeobj__197;
  PyObject *__pyx_codeobj__198;
  PyObject *__pyx_codeobj__199;
  PyObject *__pyx_codeobj__200;
  PyObject *__pyx_codeobj__201;
  PyObject *__pyx_codeobj__202;
  PyObject *__pyx_codeobj__203;
  PyObject *__pyx_codeobj__204;
  PyObject *__pyx_codeobj__206;
  PyObject *__pyx_codeobj__208;
  PyObject *__pyx_codeobj__210;
  PyObject *__pyx_codeobj__212;
  PyObject *__pyx_codeobj__213;
  PyObject *__pyx_codeobj__214;
  PyObject *__pyx_codeobj__215;
  PyObject *__pyx_codeobj__216;
  PyObject *__pyx_codeobj__218;
  PyObject *__pyx_codeobj__221;
  PyObject *__pyx_codeobj__224;
  PyObject *__pyx_codeobj__226;
  PyObject *__pyx_codeobj__227;
  PyObject *__pyx_codeobj__228;
  PyObject *__pyx_codeobj__230;
  PyObject *__pyx_codeobj__232;
  PyObject *__pyx_codeobj__234;
  PyObject *__pyx_codeobj__236;
  PyObject *__pyx_codeobj__237;
  PyObject *__pyx_codeobj__239;
  PyObject *__pyx_codeobj__241;
} __pyx_mstate;

#if CYTHON_USE_MODULE_STATE
#ifdef __cplusplus
namespace {
  extern struct PyModuleDef __pyx_moduledef;
} /* anonymous namespace */
#else
static struct PyModuleDef __pyx_moduledef;
#endif

#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))

#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))

#define __pyx_m (PyState_FindModule(&__pyx_moduledef))
#else
static __pyx_mstate __pyx_mstate_global_static =
#ifdef __cplusplus
    {};
#else
    {0};
#endif
static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
#endif
/* #### Code section: module_state_clear ### */
#if CYTHON_USE_MODULE_STATE
static int __pyx_m_clear(PyObject *m) {
  __pyx_mstate *clear_module_state = __pyx_mstate(m);
  if (!clear_module_state) return 0;
  Py_CLEAR(clear_module_state->__pyx_d);
  Py_CLEAR(clear_module_state->__pyx_b);
  Py_CLEAR(clear_module_state->__pyx_cython_runtime);
  Py_CLEAR(clear_module_state->__pyx_empty_tuple);
  Py_CLEAR(clear_module_state->__pyx_empty_bytes);
  Py_CLEAR(clear_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
  #endif
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
  Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_date);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_time);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_datetime);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_timedelta);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_tzinfo);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cytimes_6parser_Configs);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cytimes_6parser_Result);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cytimes_6parser_Parser);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cytimes_4pddt___pyx_scope_struct__fromisocalendar);
  Py_CLEAR(clear_module_state->__pyx_type_7cytimes_4pddt___pyx_scope_struct__fromisocalendar);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00_00);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00_00_00_06d);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00_00_02d);
  Py_CLEAR(clear_module_state->__pyx_kp_u_02d);
  Py_CLEAR(clear_module_state->__pyx_kp_u_04d);
  Py_CLEAR(clear_module_state->__pyx_kp_u_06d);
  Py_CLEAR(clear_module_state->__pyx_kp_u_06d_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_2d);
  Py_CLEAR(clear_module_state->__pyx_kp_s_A_drop_in_replacement_for_Pandas);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Adjust_the_date_and_time_fields);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Adjust_the_date_to_the_specific);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Adjust_the_date_to_the_specific_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Adjust_the_date_to_the_specific_3);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Adjust_the_date_to_the_specific_4);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified_10);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified_11);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified_12);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified_3);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified_4);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified_5);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified_6);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified_7);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified_8);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified_9);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Adjust_the_date_with_new_values);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Adjust_the_time_fields_with_new);
  Py_CLEAR(clear_module_state->__pyx_n_s_AmbiguousTimeError);
  Py_CLEAR(clear_module_state->__pyx_n_u_Apr);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Array_with_dtype_of_datetime64);
  Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError);
  Py_CLEAR(clear_module_state->__pyx_n_u_Aug);
  Py_CLEAR(clear_module_state->__pyx_n_s_Configs);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Conversion_limits_to_datetime_u);
  Py_CLEAR(clear_module_state->__pyx_n_u_D);
  Py_CLEAR(clear_module_state->__pyx_n_s_DataFrame);
  Py_CLEAR(clear_module_state->__pyx_n_s_DateParseError);
  Py_CLEAR(clear_module_state->__pyx_n_s_DatetimeArray);
  Py_CLEAR(clear_module_state->__pyx_n_s_DatetimeIndex);
  Py_CLEAR(clear_module_state->__pyx_n_u_Dec);
  Py_CLEAR(clear_module_state->__pyx_n_u_Feb);
  Py_CLEAR(clear_module_state->__pyx_kp_u_For_comparision_array_size_must);
  Py_CLEAR(clear_module_state->__pyx_n_u_Fri);
  Py_CLEAR(clear_module_state->__pyx_kp_u_H_M_S_f_z);
  Py_CLEAR(clear_module_state->__pyx_n_s_Hashable);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Hashable_None);
  Py_CLEAR(clear_module_state->__pyx_n_s_ImportError);
  Py_CLEAR(clear_module_state->__pyx_n_s_IncomparableError);
  Py_CLEAR(clear_module_state->__pyx_n_s_Index);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Index_bool);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Index_np_float64);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Index_np_int64);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Index_str);
  Py_CLEAR(clear_module_state->__pyx_n_s_InvalidArgumentError);
  Py_CLEAR(clear_module_state->__pyx_n_s_InvalidFspError);
  Py_CLEAR(clear_module_state->__pyx_n_s_InvalidMonthError);
  Py_CLEAR(clear_module_state->__pyx_n_s_InvalidTimeUnitError);
  Py_CLEAR(clear_module_state->__pyx_n_s_InvalidTimezoneError);
  Py_CLEAR(clear_module_state->__pyx_n_s_InvalidTypeError);
  Py_CLEAR(clear_module_state->__pyx_n_s_InvalidWeekdayError);
  Py_CLEAR(clear_module_state->__pyx_n_u_Jan);
  Py_CLEAR(clear_module_state->__pyx_n_u_Jul);
  Py_CLEAR(clear_module_state->__pyx_n_u_Jun);
  Py_CLEAR(clear_module_state->__pyx_n_s_Literal);
  Py_CLEAR(clear_module_state->__pyx_n_u_M);
  Py_CLEAR(clear_module_state->__pyx_n_u_Mar);
  Py_CLEAR(clear_module_state->__pyx_n_u_May);
  Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError);
  Py_CLEAR(clear_module_state->__pyx_n_u_Mon);
  Py_CLEAR(clear_module_state->__pyx_n_u_NaT);
  Py_CLEAR(clear_module_state->__pyx_kp_u_None);
  Py_CLEAR(clear_module_state->__pyx_n_u_Nov);
  Py_CLEAR(clear_module_state->__pyx_n_u_Oct);
  Py_CLEAR(clear_module_state->__pyx_n_s_OutOfBoundsDatetime);
  Py_CLEAR(clear_module_state->__pyx_n_s_OutOfBoundsDatetimeError);
  Py_CLEAR(clear_module_state->__pyx_n_s_OverflowError);
  Py_CLEAR(clear_module_state->__pyx_n_s_ParserError);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt);
  Py_CLEAR(clear_module_state->__pyx_n_u_Pddt);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt___new);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt__to_curr_weekday);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_add);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_as_unit);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_astimezone);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_ceil);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_closest);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_combine);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_ctime);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_date);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_date_range);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_datetime);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_day);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_days_bf_month);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_days_bf_quarter);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_days_bf_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_days_in_month);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_days_in_quarter);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_days_in_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_days_of_month);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Pddt_days_of_month_line_3389);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_days_of_quarter);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_days_of_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_diff);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_farthest);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_floor);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_fromdate);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_fromdatetime);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_fromdatetime64);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_fromicroseconds);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_fromisocalendar);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_fromisocalendar_locals__par);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_fromisocalendar_locals__par_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_fromisoformat);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_fromordinal);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_fromseconds);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_fromtimestamp);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_fsp);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_hour);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_is_day);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_is_end_of);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_is_first_of);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_is_future);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_is_last_of);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_is_leap_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_is_local);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_is_long_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_is_month);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_is_past);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_is_quarter);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_is_start_of);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_is_utc);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_is_weekday);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_is_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_isocalendar);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_isoformat);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_isoweek);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_isoweekday);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_isoyear);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_leap_bt_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_microsecond);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_microseconds);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_millisecond);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_minute);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_month);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_nanosecond);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_now);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_parse);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_quarter);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_replace);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_round);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_second);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_seconds);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_snap);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Pddt_snap_line_2367);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_strptime);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_sub);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_time);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_timedf);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_timestamp);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_timetz);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_curr_month);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Pddt_to_curr_month_line_2028);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_curr_quarter);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Pddt_to_curr_quarter_line_1853);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_curr_weekday);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Pddt_to_curr_weekday_line_2200);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_curr_year);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Pddt_to_curr_year_line_1652);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_date);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Pddt_to_date_line_2527);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_datetime);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Pddt_to_datetime_line_2383);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_day);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_end_of);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_first_of);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_friday);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_last_of);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_monday);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_month);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Pddt_to_month_line_2109);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_next_month);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Pddt_to_next_month_line_2096);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_next_quarter);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Pddt_to_next_quarter_line_1935);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_next_weekday);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Pddt_to_next_weekday_line_2228);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_next_year);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Pddt_to_next_year_line_1748);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_prev_month);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Pddt_to_prev_month_line_2083);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_prev_quarter);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Pddt_to_prev_quarter_line_1918);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_prev_weekday);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Pddt_to_prev_weekday_line_2214);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_prev_year);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Pddt_to_prev_year_line_1725);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_quarter);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Pddt_to_quarter_line_1952);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_saturday);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_start_of);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_sunday);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_thursday);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_time);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Pddt_to_time_line_2588);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_tomorrow);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_tuesday);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_wednesday);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_weekday);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Pddt_to_weekday_line_2242);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_year);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Pddt_to_year_line_1771);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_to_yesterday);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_today);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_toordinal);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_tz_available);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Pddt_tz_available_line_3574);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_tz_convert);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_tz_localize);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_tz_switch);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_tzname);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_utcfromtimestamp);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_utcnow);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_utctimedf);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_values_naive);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_weekday);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pddt_year);
  Py_CLEAR(clear_module_state->__pyx_n_u_Q);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Return_the_number_of_days_1_31_s);
  Py_CLEAR(clear_module_state->__pyx_n_s_RuntimeError);
  Py_CLEAR(clear_module_state->__pyx_n_u_S);
  Py_CLEAR(clear_module_state->__pyx_n_u_Sat);
  Py_CLEAR(clear_module_state->__pyx_n_s_Self);
  Py_CLEAR(clear_module_state->__pyx_n_u_Sep);
  Py_CLEAR(clear_module_state->__pyx_n_s_Series);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Snap_to_nearest_occurring_freque);
  Py_CLEAR(clear_module_state->__pyx_n_u_Sun);
  Py_CLEAR(clear_module_state->__pyx_n_u_T);
  Py_CLEAR(clear_module_state->__pyx_kp_u_The_available_timezone_names_set);
  Py_CLEAR(clear_module_state->__pyx_n_u_Thu);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Time_zones_are_not_available_fro);
  Py_CLEAR(clear_module_state->__pyx_n_s_Timestamp);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Timezone_aware);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Timezone_naive);
  Py_CLEAR(clear_module_state->__pyx_n_u_Tue);
  Py_CLEAR(clear_module_state->__pyx_n_s_TypeError);
  Py_CLEAR(clear_module_state->__pyx_n_s_ValueError);
  Py_CLEAR(clear_module_state->__pyx_n_u_W);
  Py_CLEAR(clear_module_state->__pyx_n_u_Wed);
  Py_CLEAR(clear_module_state->__pyx_n_u_Y);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Y_m_d);
  Py_CLEAR(clear_module_state->__pyx_n_s_ZeroDivisionError);
  Py_CLEAR(clear_module_state->__pyx_kp_u__10);
  Py_CLEAR(clear_module_state->__pyx_kp_u__11);
  Py_CLEAR(clear_module_state->__pyx_kp_u__12);
  Py_CLEAR(clear_module_state->__pyx_kp_u__13);
  Py_CLEAR(clear_module_state->__pyx_kp_u__14);
  Py_CLEAR(clear_module_state->__pyx_kp_u__15);
  Py_CLEAR(clear_module_state->__pyx_kp_u__19);
  Py_CLEAR(clear_module_state->__pyx_n_s__242);
  Py_CLEAR(clear_module_state->__pyx_kp_u__43);
  Py_CLEAR(clear_module_state->__pyx_n_s__44);
  Py_CLEAR(clear_module_state->__pyx_n_s__79);
  Py_CLEAR(clear_module_state->__pyx_kp_u__9);
  Py_CLEAR(clear_module_state->__pyx_kp_u_a_b_d_H_M_S_Y);
  Py_CLEAR(clear_module_state->__pyx_n_s_absolute);
  Py_CLEAR(clear_module_state->__pyx_n_s_add);
  Py_CLEAR(clear_module_state->__pyx_n_s_all);
  Py_CLEAR(clear_module_state->__pyx_n_s_ambiguous);
  Py_CLEAR(clear_module_state->__pyx_kp_u_ambiguous_NaT_is_not_supported);
  Py_CLEAR(clear_module_state->__pyx_n_s_arr);
  Py_CLEAR(clear_module_state->__pyx_n_s_arr_ptr);
  Py_CLEAR(clear_module_state->__pyx_n_s_arr_size);
  Py_CLEAR(clear_module_state->__pyx_kp_u_array_size_must_be_and_integer_0);
  Py_CLEAR(clear_module_state->__pyx_kp_u_array_size_must_be_greater_than);
  Py_CLEAR(clear_module_state->__pyx_n_u_as);
  Py_CLEAR(clear_module_state->__pyx_n_s_as_unit);
  Py_CLEAR(clear_module_state->__pyx_n_s_astimezone);
  Py_CLEAR(clear_module_state->__pyx_n_s_astype);
  Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
  Py_CLEAR(clear_module_state->__pyx_n_s_available_timezones);
  Py_CLEAR(clear_module_state->__pyx_n_s_available_timezones_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_base_tz);
  Py_CLEAR(clear_module_state->__pyx_kp_u_between_naive_aware_datetimes_T);
  Py_CLEAR(clear_module_state->__pyx_kp_u_between_naive_aware_datetimes_T_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_bool);
  Py_CLEAR(clear_module_state->__pyx_kp_s_bool_None);
  Py_CLEAR(clear_module_state->__pyx_n_u_both);
  Py_CLEAR(clear_module_state->__pyx_kp_u_calcuate_average);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_access_the_time_value_fro);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_cast);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_cast_ndarray);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_cast_ndarray_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_ceil_to_multiple_0);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_check_if_ndarray_s_is_wit);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_check_ndarray);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_compare_between_arrays_wi);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_compare_ndarrays_with_dif);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_convert_ndarray);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_convert_ndarray_from_date);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_convert_s_to_an_integer_t);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_convert_s_to_an_integer_t_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_convert_s_to_float_to_rep);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_covnert_s_to_an_integer_t);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_covnert_s_to_float_to_rep);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_floor_to_multiple_0);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_get_the_length_of_s_to_re);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_perform_addition_on_ndarr);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_perform_comparison_on_nda);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_perform_subtraction_on_nd);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_round_to_multiple_0);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_unpack_s_to_iso_calendar);
  Py_CLEAR(clear_module_state->__pyx_n_s_ceil);
  Py_CLEAR(clear_module_state->__pyx_n_u_ceil);
  Py_CLEAR(clear_module_state->__pyx_n_s_cfg);
  Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem);
  Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
  Py_CLEAR(clear_module_state->__pyx_n_s_closest);
  Py_CLEAR(clear_module_state->__pyx_n_u_closest);
  Py_CLEAR(clear_module_state->__pyx_n_s_cls);
  Py_CLEAR(clear_module_state->__pyx_n_s_columns);
  Py_CLEAR(clear_module_state->__pyx_n_s_combine);
  Py_CLEAR(clear_module_state->__pyx_n_u_compare);
  Py_CLEAR(clear_module_state->__pyx_n_s_copy);
  Py_CLEAR(clear_module_state->__pyx_n_s_ctime);
  Py_CLEAR(clear_module_state->__pyx_kp_s_cython_bint);
  Py_CLEAR(clear_module_state->__pyx_kp_s_cython_int);
  Py_CLEAR(clear_module_state->__pyx_n_s_cytimes);
  Py_CLEAR(clear_module_state->__pyx_n_s_cytimes_parser);
  Py_CLEAR(clear_module_state->__pyx_n_s_cytimes_pddt);
  Py_CLEAR(clear_module_state->__pyx_n_u_d);
  Py_CLEAR(clear_module_state->__pyx_n_s_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_date);
  Py_CLEAR(clear_module_state->__pyx_n_s_date_range);
  Py_CLEAR(clear_module_state->__pyx_n_s_dates);
  Py_CLEAR(clear_module_state->__pyx_n_s_datesD);
  Py_CLEAR(clear_module_state->__pyx_n_s_datesD_1st);
  Py_CLEAR(clear_module_state->__pyx_n_s_datesD_lst);
  Py_CLEAR(clear_module_state->__pyx_n_s_datesM);
  Py_CLEAR(clear_module_state->__pyx_n_s_datesQ);
  Py_CLEAR(clear_module_state->__pyx_n_s_datesY);
  Py_CLEAR(clear_module_state->__pyx_n_s_datetime);
  Py_CLEAR(clear_module_state->__pyx_n_s_datetime64);
  Py_CLEAR(clear_module_state->__pyx_n_u_datetime64);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_D);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_M);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_W);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_Y);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_h);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_m);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_ms);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_ns);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_s);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_s_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime64_us);
  Py_CLEAR(clear_module_state->__pyx_kp_s_datetime_date_object);
  Py_CLEAR(clear_module_state->__pyx_kp_s_datetime_date_str_None);
  Py_CLEAR(clear_module_state->__pyx_kp_s_datetime_datetime_object);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime_s_is_ambiguous);
  Py_CLEAR(clear_module_state->__pyx_kp_s_datetime_time_str_None);
  Py_CLEAR(clear_module_state->__pyx_kp_s_datetime_tzinfo_str_None);
  Py_CLEAR(clear_module_state->__pyx_n_s_day);
  Py_CLEAR(clear_module_state->__pyx_n_u_day);
  Py_CLEAR(clear_module_state->__pyx_n_s_day1st);
  Py_CLEAR(clear_module_state->__pyx_n_s_dayfirst);
  Py_CLEAR(clear_module_state->__pyx_n_s_days);
  Py_CLEAR(clear_module_state->__pyx_n_s_days_bf_month);
  Py_CLEAR(clear_module_state->__pyx_n_u_days_bf_month);
  Py_CLEAR(clear_module_state->__pyx_n_s_days_bf_quarter);
  Py_CLEAR(clear_module_state->__pyx_n_u_days_bf_quarter);
  Py_CLEAR(clear_module_state->__pyx_n_s_days_bf_year);
  Py_CLEAR(clear_module_state->__pyx_n_u_days_bf_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_days_in_month);
  Py_CLEAR(clear_module_state->__pyx_n_u_days_in_month);
  Py_CLEAR(clear_module_state->__pyx_n_s_days_in_quarter);
  Py_CLEAR(clear_module_state->__pyx_n_u_days_in_quarter);
  Py_CLEAR(clear_module_state->__pyx_n_s_days_in_year);
  Py_CLEAR(clear_module_state->__pyx_n_u_days_in_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_days_of_month);
  Py_CLEAR(clear_module_state->__pyx_n_u_days_of_month);
  Py_CLEAR(clear_module_state->__pyx_n_s_days_of_quarter);
  Py_CLEAR(clear_module_state->__pyx_n_u_days_of_quarter);
  Py_CLEAR(clear_module_state->__pyx_n_s_days_of_year);
  Py_CLEAR(clear_module_state->__pyx_n_u_days_of_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_dd);
  Py_CLEAR(clear_module_state->__pyx_n_s_delta);
  Py_CLEAR(clear_module_state->__pyx_n_s_dict);
  Py_CLEAR(clear_module_state->__pyx_n_s_dict_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_diff);
  Py_CLEAR(clear_module_state->__pyx_n_u_diff);
  Py_CLEAR(clear_module_state->__pyx_kp_u_disable);
  Py_CLEAR(clear_module_state->__pyx_kp_u_division_by_zero_for_utils_arr_c);
  Py_CLEAR(clear_module_state->__pyx_kp_u_division_by_zero_for_utils_arr_f);
  Py_CLEAR(clear_module_state->__pyx_kp_u_division_by_zero_for_utils_arr_r);
  Py_CLEAR(clear_module_state->__pyx_kp_u_division_by_zero_for_utils_math);
  Py_CLEAR(clear_module_state->__pyx_kp_u_division_by_zero_for_utils_math_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_division_by_zero_for_utils_math_3);
  Py_CLEAR(clear_module_state->__pyx_kp_u_division_by_zero_for_utils_math_4);
  Py_CLEAR(clear_module_state->__pyx_kp_u_division_by_zero_in_arr_mod);
  Py_CLEAR(clear_module_state->__pyx_n_s_doc);
  Py_CLEAR(clear_module_state->__pyx_n_s_dst);
  Py_CLEAR(clear_module_state->__pyx_n_s_dt);
  Py_CLEAR(clear_module_state->__pyx_n_s_dt64);
  Py_CLEAR(clear_module_state->__pyx_n_s_dt_val);
  Py_CLEAR(clear_module_state->__pyx_n_s_dtobjs);
  Py_CLEAR(clear_module_state->__pyx_n_s_dts);
  Py_CLEAR(clear_module_state->__pyx_n_s_dtstr);
  Py_CLEAR(clear_module_state->__pyx_n_s_dtype);
  Py_CLEAR(clear_module_state->__pyx_kp_u_enable);
  Py_CLEAR(clear_module_state->__pyx_n_s_end);
  Py_CLEAR(clear_module_state->__pyx_n_s_err);
  Py_CLEAR(clear_module_state->__pyx_n_s_errors);
  Py_CLEAR(clear_module_state->__pyx_n_s_exceptions);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expects_datetime_tzinfo_got_s);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expects_np_datetime64_got_s);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expects_np_ndarray_datetime64_go);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expects_np_ndarray_datetime64_ti);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expects_np_ndarray_datetime64_ti_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expects_np_ndarray_timedelta64_g);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expects_np_timedelta64_got_s);
  Py_CLEAR(clear_module_state->__pyx_n_s_f);
  Py_CLEAR(clear_module_state->__pyx_n_s_fac);
  Py_CLEAR(clear_module_state->__pyx_kp_u_failed_to_allocate_memory_for_st);
  Py_CLEAR(clear_module_state->__pyx_n_s_farthest);
  Py_CLEAR(clear_module_state->__pyx_n_u_farthest);
  Py_CLEAR(clear_module_state->__pyx_kp_u_find_closest);
  Py_CLEAR(clear_module_state->__pyx_kp_u_find_farthest);
  Py_CLEAR(clear_module_state->__pyx_n_s_floor);
  Py_CLEAR(clear_module_state->__pyx_n_u_floor);
  Py_CLEAR(clear_module_state->__pyx_n_s_fmt);
  Py_CLEAR(clear_module_state->__pyx_n_s_freq);
  Py_CLEAR(clear_module_state->__pyx_n_s_fromdate);
  Py_CLEAR(clear_module_state->__pyx_n_s_fromdatetime);
  Py_CLEAR(clear_module_state->__pyx_n_s_fromdatetime64);
  Py_CLEAR(clear_module_state->__pyx_n_s_fromicroseconds);
  Py_CLEAR(clear_module_state->__pyx_n_s_fromisocalendar);
  Py_CLEAR(clear_module_state->__pyx_n_s_fromisoformat);
  Py_CLEAR(clear_module_state->__pyx_n_s_fromordinal);
  Py_CLEAR(clear_module_state->__pyx_n_s_fromseconds);
  Py_CLEAR(clear_module_state->__pyx_n_s_fromtimestamp);
  Py_CLEAR(clear_module_state->__pyx_n_s_fromutc);
  Py_CLEAR(clear_module_state->__pyx_n_u_fs);
  Py_CLEAR(clear_module_state->__pyx_n_s_fsp);
  Py_CLEAR(clear_module_state->__pyx_kp_u_gc);
  Py_CLEAR(clear_module_state->__pyx_n_s_generate_range);
  Py_CLEAR(clear_module_state->__pyx_n_s_get);
  Py_CLEAR(clear_module_state->__pyx_n_u_h);
  Py_CLEAR(clear_module_state->__pyx_n_s_hh_fac);
  Py_CLEAR(clear_module_state->__pyx_n_s_hour);
  Py_CLEAR(clear_module_state->__pyx_n_u_hour);
  Py_CLEAR(clear_module_state->__pyx_n_s_hours);
  Py_CLEAR(clear_module_state->__pyx_n_s_i);
  Py_CLEAR(clear_module_state->__pyx_n_s_import);
  Py_CLEAR(clear_module_state->__pyx_n_s_incl_off);
  Py_CLEAR(clear_module_state->__pyx_n_s_inclusive);
  Py_CLEAR(clear_module_state->__pyx_n_s_index);
  Py_CLEAR(clear_module_state->__pyx_n_u_infer);
  Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass);
  Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
  Py_CLEAR(clear_module_state->__pyx_kp_u_instance_is_already_timezone_awa);
  Py_CLEAR(clear_module_state->__pyx_kp_u_instance_is_timezone_naive_Canno);
  Py_CLEAR(clear_module_state->__pyx_kp_u_instance_is_timezone_naive_Use_t);
  Py_CLEAR(clear_module_state->__pyx_n_u_int64);
  Py_CLEAR(clear_module_state->__pyx_kp_u_int64_under_D_resolution);
  Py_CLEAR(clear_module_state->__pyx_kp_u_int64_under_M_resolution);
  Py_CLEAR(clear_module_state->__pyx_kp_u_int64_under_Y_resolution);
  Py_CLEAR(clear_module_state->__pyx_kp_u_int64_under_h_resolution);
  Py_CLEAR(clear_module_state->__pyx_kp_u_int64_under_m_resolution);
  Py_CLEAR(clear_module_state->__pyx_kp_u_int64_under_ms_resolution);
  Py_CLEAR(clear_module_state->__pyx_kp_u_int64_under_ns_resolution);
  Py_CLEAR(clear_module_state->__pyx_kp_u_int64_under_s_resolution);
  Py_CLEAR(clear_module_state->__pyx_kp_u_int64_under_us_resolution);
  Py_CLEAR(clear_module_state->__pyx_kp_s_int_None);
  Py_CLEAR(clear_module_state->__pyx_kp_s_int_float_object);
  Py_CLEAR(clear_module_state->__pyx_kp_s_int_object);
  Py_CLEAR(clear_module_state->__pyx_kp_s_int_str);
  Py_CLEAR(clear_module_state->__pyx_kp_s_int_str_None);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_character_s_as_an_intege);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_end_of_datetime_unit_s_S);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_first_of_datetime_unit_s);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_fractional_seconds_preci);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_input_s_for_inclusive_Su);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_last_of_datetime_unit_s);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_month_name_s);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_month_number_d_must_betw);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_start_of_time_unit_s_Sup);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_weekday_name_s);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_weekday_number_d_must_be);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_day);
  Py_CLEAR(clear_module_state->__pyx_n_u_is_day);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_end_of);
  Py_CLEAR(clear_module_state->__pyx_kp_u_is_end_of_s);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_first_of);
  Py_CLEAR(clear_module_state->__pyx_kp_u_is_first_of_s);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_future);
  Py_CLEAR(clear_module_state->__pyx_n_u_is_future);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_last_of);
  Py_CLEAR(clear_module_state->__pyx_kp_u_is_last_of_s);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_leap_year);
  Py_CLEAR(clear_module_state->__pyx_n_u_is_leap_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_local);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_long_year);
  Py_CLEAR(clear_module_state->__pyx_n_u_is_long_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_month);
  Py_CLEAR(clear_module_state->__pyx_n_u_is_month);
  Py_CLEAR(clear_module_state->__pyx_kp_u_is_not_supported);
  Py_CLEAR(clear_module_state->__pyx_kp_u_is_not_supported_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_is_not_supported_3);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_past);
  Py_CLEAR(clear_module_state->__pyx_n_u_is_past);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_quarter);
  Py_CLEAR(clear_module_state->__pyx_n_u_is_quarter);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_start_of);
  Py_CLEAR(clear_module_state->__pyx_kp_u_is_start_of_s);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_utc);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_weekday);
  Py_CLEAR(clear_module_state->__pyx_n_u_is_weekday);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_year);
  Py_CLEAR(clear_module_state->__pyx_n_u_is_year);
  Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled);
  Py_CLEAR(clear_module_state->__pyx_n_s_iso);
  Py_CLEAR(clear_module_state->__pyx_n_s_iso_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_isocalendar);
  Py_CLEAR(clear_module_state->__pyx_n_s_isoformat);
  Py_CLEAR(clear_module_state->__pyx_n_s_isoweek);
  Py_CLEAR(clear_module_state->__pyx_n_u_isoweek);
  Py_CLEAR(clear_module_state->__pyx_n_s_isoweekday);
  Py_CLEAR(clear_module_state->__pyx_n_u_isoweekday);
  Py_CLEAR(clear_module_state->__pyx_n_s_isoyear);
  Py_CLEAR(clear_module_state->__pyx_n_u_isoyear);
  Py_CLEAR(clear_module_state->__pyx_n_s_item);
  Py_CLEAR(clear_module_state->__pyx_n_s_itertuples);
  Py_CLEAR(clear_module_state->__pyx_n_s_kind);
  Py_CLEAR(clear_module_state->__pyx_n_s_leap_bt_year);
  Py_CLEAR(clear_module_state->__pyx_n_u_leap_bt_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_lib);
  Py_CLEAR(clear_module_state->__pyx_n_s_lower);
  Py_CLEAR(clear_module_state->__pyx_n_u_m);
  Py_CLEAR(clear_module_state->__pyx_n_s_main);
  Py_CLEAR(clear_module_state->__pyx_n_s_metaclass);
  Py_CLEAR(clear_module_state->__pyx_n_s_mi_fac);
  Py_CLEAR(clear_module_state->__pyx_n_s_microsecond);
  Py_CLEAR(clear_module_state->__pyx_n_u_microsecond);
  Py_CLEAR(clear_module_state->__pyx_n_s_microseconds);
  Py_CLEAR(clear_module_state->__pyx_n_u_microseconds);
  Py_CLEAR(clear_module_state->__pyx_n_s_millisecond);
  Py_CLEAR(clear_module_state->__pyx_n_u_millisecond);
  Py_CLEAR(clear_module_state->__pyx_n_s_milliseconds);
  Py_CLEAR(clear_module_state->__pyx_n_u_min);
  Py_CLEAR(clear_module_state->__pyx_n_s_minute);
  Py_CLEAR(clear_module_state->__pyx_n_u_minute);
  Py_CLEAR(clear_module_state->__pyx_n_s_minutes);
  Py_CLEAR(clear_module_state->__pyx_kp_u_mixed_timezones);
  Py_CLEAR(clear_module_state->__pyx_n_s_mm);
  Py_CLEAR(clear_module_state->__pyx_n_s_module);
  Py_CLEAR(clear_module_state->__pyx_n_s_month);
  Py_CLEAR(clear_module_state->__pyx_n_u_month);
  Py_CLEAR(clear_module_state->__pyx_n_s_months);
  Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries);
  Py_CLEAR(clear_module_state->__pyx_n_u_ms);
  Py_CLEAR(clear_module_state->__pyx_n_s_mul);
  Py_CLEAR(clear_module_state->__pyx_kp_u_must_be_an_1_dimensional_ndarray);
  Py_CLEAR(clear_module_state->__pyx_n_s_my_arr);
  Py_CLEAR(clear_module_state->__pyx_n_s_my_tz);
  Py_CLEAR(clear_module_state->__pyx_n_s_my_unit);
  Py_CLEAR(clear_module_state->__pyx_n_s_my_unit_adj);
  Py_CLEAR(clear_module_state->__pyx_n_s_my_unit_ch);
  Py_CLEAR(clear_module_state->__pyx_n_s_my_unit_int);
  Py_CLEAR(clear_module_state->__pyx_n_s_my_unit_ns);
  Py_CLEAR(clear_module_state->__pyx_n_s_naive);
  Py_CLEAR(clear_module_state->__pyx_n_s_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_name_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_nanosecond);
  Py_CLEAR(clear_module_state->__pyx_n_u_nanosecond);
  Py_CLEAR(clear_module_state->__pyx_kp_u_nanosecond_conversion_range_dat);
  Py_CLEAR(clear_module_state->__pyx_n_s_nanoseconds);
  Py_CLEAR(clear_module_state->__pyx_kp_u_ndarray_size_must_be_an_integer);
  Py_CLEAR(clear_module_state->__pyx_n_u_neither);
  Py_CLEAR(clear_module_state->__pyx_n_s_new);
  Py_CLEAR(clear_module_state->__pyx_n_s_no_default);
  Py_CLEAR(clear_module_state->__pyx_n_s_nonexistent);
  Py_CLEAR(clear_module_state->__pyx_kp_u_nonexistent_NaT_is_not_supported);
  Py_CLEAR(clear_module_state->__pyx_n_s_normalize);
  Py_CLEAR(clear_module_state->__pyx_n_s_now);
  Py_CLEAR(clear_module_state->__pyx_n_s_np);
  Py_CLEAR(clear_module_state->__pyx_kp_s_np_datetime64_object);
  Py_CLEAR(clear_module_state->__pyx_kp_s_np_ndarray_datetime_date);
  Py_CLEAR(clear_module_state->__pyx_kp_s_np_ndarray_datetime_datetime);
  Py_CLEAR(clear_module_state->__pyx_kp_s_np_ndarray_datetime_time);
  Py_CLEAR(clear_module_state->__pyx_kp_s_np_ndarray_np_datetime64);
  Py_CLEAR(clear_module_state->__pyx_kp_s_np_ndarray_np_int64);
  Py_CLEAR(clear_module_state->__pyx_n_u_ns);
  Py_CLEAR(clear_module_state->__pyx_n_s_numpy);
  Py_CLEAR(clear_module_state->__pyx_kp_u_numpy__core_multiarray_failed_to);
  Py_CLEAR(clear_module_state->__pyx_kp_u_numpy__core_umath_failed_to_impo);
  Py_CLEAR(clear_module_state->__pyx_n_s_object);
  Py_CLEAR(clear_module_state->__pyx_kp_s_object_None);
  Py_CLEAR(clear_module_state->__pyx_n_s_off);
  Py_CLEAR(clear_module_state->__pyx_n_s_offset);
  Py_CLEAR(clear_module_state->__pyx_n_u_one);
  Py_CLEAR(clear_module_state->__pyx_kp_u_operation_on_ndarray_datetime64);
  Py_CLEAR(clear_module_state->__pyx_n_s_ordinal);
  Py_CLEAR(clear_module_state->__pyx_n_u_ordinal);
  Py_CLEAR(clear_module_state->__pyx_n_s_pandas);
  Py_CLEAR(clear_module_state->__pyx_n_s_pandas__libs);
  Py_CLEAR(clear_module_state->__pyx_n_s_pandas__libs_tslibs_parsing);
  Py_CLEAR(clear_module_state->__pyx_n_s_pandas_core_arrays_datetimes);
  Py_CLEAR(clear_module_state->__pyx_n_s_parse);
  Py_CLEAR(clear_module_state->__pyx_n_s_parse_dict);
  Py_CLEAR(clear_module_state->__pyx_n_s_parse_dtobj);
  Py_CLEAR(clear_module_state->__pyx_n_s_parse_sequence);
  Py_CLEAR(clear_module_state->__pyx_n_s_pd_err);
  Py_CLEAR(clear_module_state->__pyx_n_s_periods);
  Py_CLEAR(clear_module_state->__pyx_n_s_precision);
  Py_CLEAR(clear_module_state->__pyx_n_s_prepare);
  Py_CLEAR(clear_module_state->__pyx_n_s_property);
  Py_CLEAR(clear_module_state->__pyx_n_u_ps);
  Py_CLEAR(clear_module_state->__pyx_n_s_pt);
  Py_CLEAR(clear_module_state->__pyx_n_s_pt_1st);
  Py_CLEAR(clear_module_state->__pyx_n_s_pt_arr);
  Py_CLEAR(clear_module_state->__pyx_n_s_pt_end);
  Py_CLEAR(clear_module_state->__pyx_n_s_pt_end_unit);
  Py_CLEAR(clear_module_state->__pyx_n_s_pt_lst);
  Py_CLEAR(clear_module_state->__pyx_n_s_pt_stt);
  Py_CLEAR(clear_module_state->__pyx_n_s_pt_stt_unit);
  Py_CLEAR(clear_module_state->__pyx_n_s_pt_tz);
  Py_CLEAR(clear_module_state->__pyx_n_s_pt_unit);
  Py_CLEAR(clear_module_state->__pyx_n_s_pt_unit_int);
  Py_CLEAR(clear_module_state->__pyx_n_s_pytz);
  Py_CLEAR(clear_module_state->__pyx_n_s_pytz_err);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable);
  Py_CLEAR(clear_module_state->__pyx_n_s_qualname);
  Py_CLEAR(clear_module_state->__pyx_n_s_quarter);
  Py_CLEAR(clear_module_state->__pyx_n_u_quarter);
  Py_CLEAR(clear_module_state->__pyx_n_s_quarters);
  Py_CLEAR(clear_module_state->__pyx_n_u_raise);
  Py_CLEAR(clear_module_state->__pyx_n_s_range);
  Py_CLEAR(clear_module_state->__pyx_n_s_replace);
  Py_CLEAR(clear_module_state->__pyx_n_s_res);
  Py_CLEAR(clear_module_state->__pyx_kp_u_resolution);
  Py_CLEAR(clear_module_state->__pyx_kp_u_resolution_Array_with_datetime);
  Py_CLEAR(clear_module_state->__pyx_kp_u_resolution_Array_with_dtype_of);
  Py_CLEAR(clear_module_state->__pyx_kp_u_resolution_Supported_resolution);
  Py_CLEAR(clear_module_state->__pyx_kp_u_resolution_is_not_supported);
  Py_CLEAR(clear_module_state->__pyx_n_s_return);
  Py_CLEAR(clear_module_state->__pyx_n_s_round);
  Py_CLEAR(clear_module_state->__pyx_n_u_round);
  Py_CLEAR(clear_module_state->__pyx_n_u_s);
  Py_CLEAR(clear_module_state->__pyx_n_s_sec);
  Py_CLEAR(clear_module_state->__pyx_n_s_second);
  Py_CLEAR(clear_module_state->__pyx_n_u_second);
  Py_CLEAR(clear_module_state->__pyx_n_s_seconds);
  Py_CLEAR(clear_module_state->__pyx_n_u_seconds);
  Py_CLEAR(clear_module_state->__pyx_n_s_self);
  Py_CLEAR(clear_module_state->__pyx_n_s_sep);
  Py_CLEAR(clear_module_state->__pyx_kp_u_sequence_must_have_3_items);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_name);
  Py_CLEAR(clear_module_state->__pyx_kp_s_set_str);
  Py_CLEAR(clear_module_state->__pyx_n_u_shift_forward);
  Py_CLEAR(clear_module_state->__pyx_n_s_size);
  Py_CLEAR(clear_module_state->__pyx_n_s_snap);
  Py_CLEAR(clear_module_state->__pyx_n_s_spec);
  Py_CLEAR(clear_module_state->__pyx_kp_s_src_cytimes_pddt_py);
  Py_CLEAR(clear_module_state->__pyx_n_s_ss_fac);
  Py_CLEAR(clear_module_state->__pyx_n_s_start);
  Py_CLEAR(clear_module_state->__pyx_n_s_str);
  Py_CLEAR(clear_module_state->__pyx_kp_s_str_int);
  Py_CLEAR(clear_module_state->__pyx_kp_s_str_object);
  Py_CLEAR(clear_module_state->__pyx_n_s_strftime);
  Py_CLEAR(clear_module_state->__pyx_kp_u_strftime_format_is_too_long_s);
  Py_CLEAR(clear_module_state->__pyx_n_s_strptime);
  Py_CLEAR(clear_module_state->__pyx_n_s_sub);
  Py_CLEAR(clear_module_state->__pyx_n_s_super);
  Py_CLEAR(clear_module_state->__pyx_kp_u_support_ndarray_with_1_4_dimensi);
  Py_CLEAR(clear_module_state->__pyx_n_s_targ_tz);
  Py_CLEAR(clear_module_state->__pyx_n_s_test);
  Py_CLEAR(clear_module_state->__pyx_n_s_time);
  Py_CLEAR(clear_module_state->__pyx_n_u_timedelta64);
  Py_CLEAR(clear_module_state->__pyx_n_s_timedf);
  Py_CLEAR(clear_module_state->__pyx_n_s_times);
  Py_CLEAR(clear_module_state->__pyx_n_s_timestamp);
  Py_CLEAR(clear_module_state->__pyx_n_u_timestamp);
  Py_CLEAR(clear_module_state->__pyx_n_s_timetz);
  Py_CLEAR(clear_module_state->__pyx_kp_u_timezone_offset_s_seconds_out_of);
  Py_CLEAR(clear_module_state->__pyx_n_s_tm_hour);
  Py_CLEAR(clear_module_state->__pyx_n_u_tm_hour);
  Py_CLEAR(clear_module_state->__pyx_n_s_tm_isdst);
  Py_CLEAR(clear_module_state->__pyx_n_s_tm_mday);
  Py_CLEAR(clear_module_state->__pyx_n_u_tm_mday);
  Py_CLEAR(clear_module_state->__pyx_n_s_tm_min);
  Py_CLEAR(clear_module_state->__pyx_n_u_tm_min);
  Py_CLEAR(clear_module_state->__pyx_n_s_tm_mon);
  Py_CLEAR(clear_module_state->__pyx_n_u_tm_mon);
  Py_CLEAR(clear_module_state->__pyx_n_s_tm_sec);
  Py_CLEAR(clear_module_state->__pyx_n_u_tm_sec);
  Py_CLEAR(clear_module_state->__pyx_n_s_tm_wday);
  Py_CLEAR(clear_module_state->__pyx_n_u_tm_wday);
  Py_CLEAR(clear_module_state->__pyx_n_s_tm_yday);
  Py_CLEAR(clear_module_state->__pyx_n_u_tm_yday);
  Py_CLEAR(clear_module_state->__pyx_n_s_tm_year);
  Py_CLEAR(clear_module_state->__pyx_n_u_tm_year);
  Py_CLEAR(clear_module_state->__pyx_kp_u_to);
  Py_CLEAR(clear_module_state->__pyx_kp_u_to_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_to_an_integer_under);
  Py_CLEAR(clear_module_state->__pyx_kp_u_to_an_integer_under_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_curr_month);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_curr_quarter);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_curr_weekday);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_curr_weekday_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_curr_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_date);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_datetime);
  Py_CLEAR(clear_module_state->__pyx_kp_u_to_datetime64);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_day);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_end_of);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_first_of);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_friday);
  Py_CLEAR(clear_module_state->__pyx_kp_u_to_int64_under);
  Py_CLEAR(clear_module_state->__pyx_kp_u_to_int64_under_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_to_int64_under_3);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_last_of);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_monday);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_month);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_next_month);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_next_quarter);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_next_weekday);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_next_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_prev_month);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_prev_quarter);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_prev_weekday);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_prev_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_pydatetime);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_quarter);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_saturday);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_start_of);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_sunday);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_thursday);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_time);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_tomorrow);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_tuesday);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_wednesday);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_weekday);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_yesterday);
  Py_CLEAR(clear_module_state->__pyx_n_s_today);
  Py_CLEAR(clear_module_state->__pyx_n_s_toordinal);
  Py_CLEAR(clear_module_state->__pyx_n_s_ts);
  Py_CLEAR(clear_module_state->__pyx_n_s_typing);
  Py_CLEAR(clear_module_state->__pyx_n_s_typing_extensions);
  Py_CLEAR(clear_module_state->__pyx_n_s_tz);
  Py_CLEAR(clear_module_state->__pyx_n_s_tz_available);
  Py_CLEAR(clear_module_state->__pyx_n_s_tz_convert);
  Py_CLEAR(clear_module_state->__pyx_n_s_tz_localize);
  Py_CLEAR(clear_module_state->__pyx_n_s_tz_switch);
  Py_CLEAR(clear_module_state->__pyx_n_s_tzinfo);
  Py_CLEAR(clear_module_state->__pyx_n_s_tzname);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unable_to_parse_datetime_unit_fr);
  Py_CLEAR(clear_module_state->__pyx_n_s_unit);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unknown_datetime_unit_d);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unknown_datetime_unit_s);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unless_utc_True);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unsupported_datetime_unit_s);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unsupported_factor_d_for_timedel);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unsupported_factor_d_for_timedel_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unsupported_month_value_type_s_e);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unsupported_type_s_for_argument);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unsupported_type_s_for_argument_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unsupported_type_s_for_argument_3);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unsupported_type_s_for_argument_4);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unsupported_type_s_for_argument_5);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unsupported_type_s_for_argument_6);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unsupported_weekday_value_type_s);
  Py_CLEAR(clear_module_state->__pyx_n_s_us);
  Py_CLEAR(clear_module_state->__pyx_n_u_us);
  Py_CLEAR(clear_module_state->__pyx_n_s_us_fac);
  Py_CLEAR(clear_module_state->__pyx_n_s_utc);
  Py_CLEAR(clear_module_state->__pyx_n_s_utcfromtimestamp);
  Py_CLEAR(clear_module_state->__pyx_n_s_utcnow);
  Py_CLEAR(clear_module_state->__pyx_n_s_utcoffset);
  Py_CLEAR(clear_module_state->__pyx_n_s_utctimedf);
  Py_CLEAR(clear_module_state->__pyx_n_s_utils);
  Py_CLEAR(clear_module_state->__pyx_n_s_val);
  Py_CLEAR(clear_module_state->__pyx_n_s_values);
  Py_CLEAR(clear_module_state->__pyx_n_s_values_naive);
  Py_CLEAR(clear_module_state->__pyx_kp_u_vs);
  Py_CLEAR(clear_module_state->__pyx_n_s_wd);
  Py_CLEAR(clear_module_state->__pyx_n_s_week);
  Py_CLEAR(clear_module_state->__pyx_n_u_week);
  Py_CLEAR(clear_module_state->__pyx_n_s_weekday);
  Py_CLEAR(clear_module_state->__pyx_n_u_weekday);
  Py_CLEAR(clear_module_state->__pyx_n_s_weeks);
  Py_CLEAR(clear_module_state->__pyx_kp_u_with_datetime_unit);
  Py_CLEAR(clear_module_state->__pyx_kp_u_without_specifying_the_array_da);
  Py_CLEAR(clear_module_state->__pyx_n_s_wkd);
  Py_CLEAR(clear_module_state->__pyx_n_s_ww);
  Py_CLEAR(clear_module_state->__pyx_n_s_year);
  Py_CLEAR(clear_module_state->__pyx_n_u_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_year1st);
  Py_CLEAR(clear_module_state->__pyx_n_s_yearfirst);
  Py_CLEAR(clear_module_state->__pyx_n_s_years);
  Py_CLEAR(clear_module_state->__pyx_n_s_ymd);
  Py_CLEAR(clear_module_state->__pyx_n_s_yy);
  Py_CLEAR(clear_module_state->__pyx_n_s_zoneinfo);
  Py_CLEAR(clear_module_state->__pyx_int_0);
  Py_CLEAR(clear_module_state->__pyx_int_1);
  Py_CLEAR(clear_module_state->__pyx_int_2);
  Py_CLEAR(clear_module_state->__pyx_int_3);
  Py_CLEAR(clear_module_state->__pyx_int_4);
  Py_CLEAR(clear_module_state->__pyx_int_5);
  Py_CLEAR(clear_module_state->__pyx_int_6);
  Py_CLEAR(clear_module_state->__pyx_int_neg_1);
  Py_CLEAR(clear_module_state->__pyx_tuple_);
  Py_CLEAR(clear_module_state->__pyx_tuple__2);
  Py_CLEAR(clear_module_state->__pyx_tuple__3);
  Py_CLEAR(clear_module_state->__pyx_tuple__4);
  Py_CLEAR(clear_module_state->__pyx_tuple__5);
  Py_CLEAR(clear_module_state->__pyx_tuple__6);
  Py_CLEAR(clear_module_state->__pyx_tuple__7);
  Py_CLEAR(clear_module_state->__pyx_tuple__8);
  Py_CLEAR(clear_module_state->__pyx_slice__39);
  Py_CLEAR(clear_module_state->__pyx_tuple__16);
  Py_CLEAR(clear_module_state->__pyx_tuple__17);
  Py_CLEAR(clear_module_state->__pyx_tuple__18);
  Py_CLEAR(clear_module_state->__pyx_tuple__20);
  Py_CLEAR(clear_module_state->__pyx_tuple__21);
  Py_CLEAR(clear_module_state->__pyx_tuple__22);
  Py_CLEAR(clear_module_state->__pyx_tuple__23);
  Py_CLEAR(clear_module_state->__pyx_tuple__24);
  Py_CLEAR(clear_module_state->__pyx_tuple__25);
  Py_CLEAR(clear_module_state->__pyx_tuple__26);
  Py_CLEAR(clear_module_state->__pyx_tuple__27);
  Py_CLEAR(clear_module_state->__pyx_tuple__28);
  Py_CLEAR(clear_module_state->__pyx_tuple__29);
  Py_CLEAR(clear_module_state->__pyx_tuple__30);
  Py_CLEAR(clear_module_state->__pyx_tuple__31);
  Py_CLEAR(clear_module_state->__pyx_tuple__32);
  Py_CLEAR(clear_module_state->__pyx_tuple__33);
  Py_CLEAR(clear_module_state->__pyx_tuple__34);
  Py_CLEAR(clear_module_state->__pyx_tuple__35);
  Py_CLEAR(clear_module_state->__pyx_tuple__37);
  Py_CLEAR(clear_module_state->__pyx_tuple__40);
  Py_CLEAR(clear_module_state->__pyx_tuple__41);
  Py_CLEAR(clear_module_state->__pyx_tuple__42);
  Py_CLEAR(clear_module_state->__pyx_tuple__45);
  Py_CLEAR(clear_module_state->__pyx_tuple__47);
  Py_CLEAR(clear_module_state->__pyx_tuple__48);
  Py_CLEAR(clear_module_state->__pyx_tuple__50);
  Py_CLEAR(clear_module_state->__pyx_tuple__52);
  Py_CLEAR(clear_module_state->__pyx_tuple__54);
  Py_CLEAR(clear_module_state->__pyx_tuple__55);
  Py_CLEAR(clear_module_state->__pyx_tuple__57);
  Py_CLEAR(clear_module_state->__pyx_tuple__59);
  Py_CLEAR(clear_module_state->__pyx_tuple__61);
  Py_CLEAR(clear_module_state->__pyx_tuple__62);
  Py_CLEAR(clear_module_state->__pyx_tuple__64);
  Py_CLEAR(clear_module_state->__pyx_tuple__66);
  Py_CLEAR(clear_module_state->__pyx_tuple__68);
  Py_CLEAR(clear_module_state->__pyx_tuple__70);
  Py_CLEAR(clear_module_state->__pyx_tuple__72);
  Py_CLEAR(clear_module_state->__pyx_tuple__74);
  Py_CLEAR(clear_module_state->__pyx_tuple__76);
  Py_CLEAR(clear_module_state->__pyx_tuple__77);
  Py_CLEAR(clear_module_state->__pyx_tuple__80);
  Py_CLEAR(clear_module_state->__pyx_tuple__82);
  Py_CLEAR(clear_module_state->__pyx_tuple__84);
  Py_CLEAR(clear_module_state->__pyx_tuple__86);
  Py_CLEAR(clear_module_state->__pyx_tuple__88);
  Py_CLEAR(clear_module_state->__pyx_tuple__90);
  Py_CLEAR(clear_module_state->__pyx_tuple__91);
  Py_CLEAR(clear_module_state->__pyx_tuple__93);
  Py_CLEAR(clear_module_state->__pyx_tuple__96);
  Py_CLEAR(clear_module_state->__pyx_tuple__104);
  Py_CLEAR(clear_module_state->__pyx_tuple__106);
  Py_CLEAR(clear_module_state->__pyx_tuple__108);
  Py_CLEAR(clear_module_state->__pyx_tuple__111);
  Py_CLEAR(clear_module_state->__pyx_tuple__113);
  Py_CLEAR(clear_module_state->__pyx_tuple__117);
  Py_CLEAR(clear_module_state->__pyx_tuple__119);
  Py_CLEAR(clear_module_state->__pyx_tuple__121);
  Py_CLEAR(clear_module_state->__pyx_tuple__124);
  Py_CLEAR(clear_module_state->__pyx_tuple__133);
  Py_CLEAR(clear_module_state->__pyx_tuple__135);
  Py_CLEAR(clear_module_state->__pyx_tuple__138);
  Py_CLEAR(clear_module_state->__pyx_tuple__140);
  Py_CLEAR(clear_module_state->__pyx_tuple__144);
  Py_CLEAR(clear_module_state->__pyx_tuple__146);
  Py_CLEAR(clear_module_state->__pyx_tuple__148);
  Py_CLEAR(clear_module_state->__pyx_tuple__149);
  Py_CLEAR(clear_module_state->__pyx_tuple__151);
  Py_CLEAR(clear_module_state->__pyx_tuple__153);
  Py_CLEAR(clear_module_state->__pyx_tuple__155);
  Py_CLEAR(clear_module_state->__pyx_tuple__158);
  Py_CLEAR(clear_module_state->__pyx_tuple__160);
  Py_CLEAR(clear_module_state->__pyx_tuple__162);
  Py_CLEAR(clear_module_state->__pyx_tuple__166);
  Py_CLEAR(clear_module_state->__pyx_tuple__168);
  Py_CLEAR(clear_module_state->__pyx_tuple__176);
  Py_CLEAR(clear_module_state->__pyx_tuple__186);
  Py_CLEAR(clear_module_state->__pyx_tuple__192);
  Py_CLEAR(clear_module_state->__pyx_tuple__195);
  Py_CLEAR(clear_module_state->__pyx_tuple__205);
  Py_CLEAR(clear_module_state->__pyx_tuple__207);
  Py_CLEAR(clear_module_state->__pyx_tuple__209);
  Py_CLEAR(clear_module_state->__pyx_tuple__211);
  Py_CLEAR(clear_module_state->__pyx_tuple__217);
  Py_CLEAR(clear_module_state->__pyx_tuple__219);
  Py_CLEAR(clear_module_state->__pyx_tuple__220);
  Py_CLEAR(clear_module_state->__pyx_tuple__222);
  Py_CLEAR(clear_module_state->__pyx_tuple__223);
  Py_CLEAR(clear_module_state->__pyx_tuple__225);
  Py_CLEAR(clear_module_state->__pyx_tuple__229);
  Py_CLEAR(clear_module_state->__pyx_tuple__231);
  Py_CLEAR(clear_module_state->__pyx_tuple__233);
  Py_CLEAR(clear_module_state->__pyx_tuple__235);
  Py_CLEAR(clear_module_state->__pyx_tuple__238);
  Py_CLEAR(clear_module_state->__pyx_tuple__240);
  Py_CLEAR(clear_module_state->__pyx_codeobj__36);
  Py_CLEAR(clear_module_state->__pyx_codeobj__38);
  Py_CLEAR(clear_module_state->__pyx_codeobj__46);
  Py_CLEAR(clear_module_state->__pyx_codeobj__49);
  Py_CLEAR(clear_module_state->__pyx_codeobj__51);
  Py_CLEAR(clear_module_state->__pyx_codeobj__53);
  Py_CLEAR(clear_module_state->__pyx_codeobj__56);
  Py_CLEAR(clear_module_state->__pyx_codeobj__58);
  Py_CLEAR(clear_module_state->__pyx_codeobj__60);
  Py_CLEAR(clear_module_state->__pyx_codeobj__63);
  Py_CLEAR(clear_module_state->__pyx_codeobj__65);
  Py_CLEAR(clear_module_state->__pyx_codeobj__67);
  Py_CLEAR(clear_module_state->__pyx_codeobj__69);
  Py_CLEAR(clear_module_state->__pyx_codeobj__71);
  Py_CLEAR(clear_module_state->__pyx_codeobj__73);
  Py_CLEAR(clear_module_state->__pyx_codeobj__75);
  Py_CLEAR(clear_module_state->__pyx_codeobj__78);
  Py_CLEAR(clear_module_state->__pyx_codeobj__81);
  Py_CLEAR(clear_module_state->__pyx_codeobj__83);
  Py_CLEAR(clear_module_state->__pyx_codeobj__85);
  Py_CLEAR(clear_module_state->__pyx_codeobj__87);
  Py_CLEAR(clear_module_state->__pyx_codeobj__89);
  Py_CLEAR(clear_module_state->__pyx_codeobj__92);
  Py_CLEAR(clear_module_state->__pyx_codeobj__94);
  Py_CLEAR(clear_module_state->__pyx_codeobj__95);
  Py_CLEAR(clear_module_state->__pyx_codeobj__97);
  Py_CLEAR(clear_module_state->__pyx_codeobj__98);
  Py_CLEAR(clear_module_state->__pyx_codeobj__99);
  Py_CLEAR(clear_module_state->__pyx_codeobj__100);
  Py_CLEAR(clear_module_state->__pyx_codeobj__101);
  Py_CLEAR(clear_module_state->__pyx_codeobj__102);
  Py_CLEAR(clear_module_state->__pyx_codeobj__103);
  Py_CLEAR(clear_module_state->__pyx_codeobj__105);
  Py_CLEAR(clear_module_state->__pyx_codeobj__107);
  Py_CLEAR(clear_module_state->__pyx_codeobj__109);
  Py_CLEAR(clear_module_state->__pyx_codeobj__110);
  Py_CLEAR(clear_module_state->__pyx_codeobj__112);
  Py_CLEAR(clear_module_state->__pyx_codeobj__114);
  Py_CLEAR(clear_module_state->__pyx_codeobj__115);
  Py_CLEAR(clear_module_state->__pyx_codeobj__116);
  Py_CLEAR(clear_module_state->__pyx_codeobj__118);
  Py_CLEAR(clear_module_state->__pyx_codeobj__120);
  Py_CLEAR(clear_module_state->__pyx_codeobj__122);
  Py_CLEAR(clear_module_state->__pyx_codeobj__123);
  Py_CLEAR(clear_module_state->__pyx_codeobj__125);
  Py_CLEAR(clear_module_state->__pyx_codeobj__126);
  Py_CLEAR(clear_module_state->__pyx_codeobj__127);
  Py_CLEAR(clear_module_state->__pyx_codeobj__128);
  Py_CLEAR(clear_module_state->__pyx_codeobj__129);
  Py_CLEAR(clear_module_state->__pyx_codeobj__130);
  Py_CLEAR(clear_module_state->__pyx_codeobj__131);
  Py_CLEAR(clear_module_state->__pyx_codeobj__132);
  Py_CLEAR(clear_module_state->__pyx_codeobj__134);
  Py_CLEAR(clear_module_state->__pyx_codeobj__136);
  Py_CLEAR(clear_module_state->__pyx_codeobj__137);
  Py_CLEAR(clear_module_state->__pyx_codeobj__139);
  Py_CLEAR(clear_module_state->__pyx_codeobj__141);
  Py_CLEAR(clear_module_state->__pyx_codeobj__142);
  Py_CLEAR(clear_module_state->__pyx_codeobj__143);
  Py_CLEAR(clear_module_state->__pyx_codeobj__145);
  Py_CLEAR(clear_module_state->__pyx_codeobj__147);
  Py_CLEAR(clear_module_state->__pyx_codeobj__150);
  Py_CLEAR(clear_module_state->__pyx_codeobj__152);
  Py_CLEAR(clear_module_state->__pyx_codeobj__154);
  Py_CLEAR(clear_module_state->__pyx_codeobj__156);
  Py_CLEAR(clear_module_state->__pyx_codeobj__157);
  Py_CLEAR(clear_module_state->__pyx_codeobj__159);
  Py_CLEAR(clear_module_state->__pyx_codeobj__161);
  Py_CLEAR(clear_module_state->__pyx_codeobj__163);
  Py_CLEAR(clear_module_state->__pyx_codeobj__164);
  Py_CLEAR(clear_module_state->__pyx_codeobj__165);
  Py_CLEAR(clear_module_state->__pyx_codeobj__167);
  Py_CLEAR(clear_module_state->__pyx_codeobj__169);
  Py_CLEAR(clear_module_state->__pyx_codeobj__170);
  Py_CLEAR(clear_module_state->__pyx_codeobj__171);
  Py_CLEAR(clear_module_state->__pyx_codeobj__172);
  Py_CLEAR(clear_module_state->__pyx_codeobj__173);
  Py_CLEAR(clear_module_state->__pyx_codeobj__174);
  Py_CLEAR(clear_module_state->__pyx_codeobj__175);
  Py_CLEAR(clear_module_state->__pyx_codeobj__177);
  Py_CLEAR(clear_module_state->__pyx_codeobj__178);
  Py_CLEAR(clear_module_state->__pyx_codeobj__179);
  Py_CLEAR(clear_module_state->__pyx_codeobj__180);
  Py_CLEAR(clear_module_state->__pyx_codeobj__181);
  Py_CLEAR(clear_module_state->__pyx_codeobj__182);
  Py_CLEAR(clear_module_state->__pyx_codeobj__183);
  Py_CLEAR(clear_module_state->__pyx_codeobj__184);
  Py_CLEAR(clear_module_state->__pyx_codeobj__185);
  Py_CLEAR(clear_module_state->__pyx_codeobj__187);
  Py_CLEAR(clear_module_state->__pyx_codeobj__188);
  Py_CLEAR(clear_module_state->__pyx_codeobj__189);
  Py_CLEAR(clear_module_state->__pyx_codeobj__190);
  Py_CLEAR(clear_module_state->__pyx_codeobj__191);
  Py_CLEAR(clear_module_state->__pyx_codeobj__193);
  Py_CLEAR(clear_module_state->__pyx_codeobj__194);
  Py_CLEAR(clear_module_state->__pyx_codeobj__196);
  Py_CLEAR(clear_module_state->__pyx_codeobj__197);
  Py_CLEAR(clear_module_state->__pyx_codeobj__198);
  Py_CLEAR(clear_module_state->__pyx_codeobj__199);
  Py_CLEAR(clear_module_state->__pyx_codeobj__200);
  Py_CLEAR(clear_module_state->__pyx_codeobj__201);
  Py_CLEAR(clear_module_state->__pyx_codeobj__202);
  Py_CLEAR(clear_module_state->__pyx_codeobj__203);
  Py_CLEAR(clear_module_state->__pyx_codeobj__204);
  Py_CLEAR(clear_module_state->__pyx_codeobj__206);
  Py_CLEAR(clear_module_state->__pyx_codeobj__208);
  Py_CLEAR(clear_module_state->__pyx_codeobj__210);
  Py_CLEAR(clear_module_state->__pyx_codeobj__212);
  Py_CLEAR(clear_module_state->__pyx_codeobj__213);
  Py_CLEAR(clear_module_state->__pyx_codeobj__214);
  Py_CLEAR(clear_module_state->__pyx_codeobj__215);
  Py_CLEAR(clear_module_state->__pyx_codeobj__216);
  Py_CLEAR(clear_module_state->__pyx_codeobj__218);
  Py_CLEAR(clear_module_state->__pyx_codeobj__221);
  Py_CLEAR(clear_module_state->__pyx_codeobj__224);
  Py_CLEAR(clear_module_state->__pyx_codeobj__226);
  Py_CLEAR(clear_module_state->__pyx_codeobj__227);
  Py_CLEAR(clear_module_state->__pyx_codeobj__228);
  Py_CLEAR(clear_module_state->__pyx_codeobj__230);
  Py_CLEAR(clear_module_state->__pyx_codeobj__232);
  Py_CLEAR(clear_module_state->__pyx_codeobj__234);
  Py_CLEAR(clear_module_state->__pyx_codeobj__236);
  Py_CLEAR(clear_module_state->__pyx_codeobj__237);
  Py_CLEAR(clear_module_state->__pyx_codeobj__239);
  Py_CLEAR(clear_module_state->__pyx_codeobj__241);
  return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_USE_MODULE_STATE
static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  __pyx_mstate *traverse_module_state = __pyx_mstate(m);
  if (!traverse_module_state) return 0;
  Py_VISIT(traverse_module_state->__pyx_d);
  Py_VISIT(traverse_module_state->__pyx_b);
  Py_VISIT(traverse_module_state->__pyx_cython_runtime);
  Py_VISIT(traverse_module_state->__pyx_empty_tuple);
  Py_VISIT(traverse_module_state->__pyx_empty_bytes);
  Py_VISIT(traverse_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
  #endif
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
  Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_date);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_time);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_datetime);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_timedelta);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_tzinfo);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cytimes_6parser_Configs);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cytimes_6parser_Result);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cytimes_6parser_Parser);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cytimes_4pddt___pyx_scope_struct__fromisocalendar);
  Py_VISIT(traverse_module_state->__pyx_type_7cytimes_4pddt___pyx_scope_struct__fromisocalendar);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00_00);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00_00_00_06d);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00_00_02d);
  Py_VISIT(traverse_module_state->__pyx_kp_u_02d);
  Py_VISIT(traverse_module_state->__pyx_kp_u_04d);
  Py_VISIT(traverse_module_state->__pyx_kp_u_06d);
  Py_VISIT(traverse_module_state->__pyx_kp_u_06d_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_2d);
  Py_VISIT(traverse_module_state->__pyx_kp_s_A_drop_in_replacement_for_Pandas);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Adjust_the_date_and_time_fields);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Adjust_the_date_to_the_specific);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Adjust_the_date_to_the_specific_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Adjust_the_date_to_the_specific_3);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Adjust_the_date_to_the_specific_4);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified_10);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified_11);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified_12);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified_3);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified_4);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified_5);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified_6);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified_7);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified_8);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Adjust_the_date_to_the_specified_9);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Adjust_the_date_with_new_values);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Adjust_the_time_fields_with_new);
  Py_VISIT(traverse_module_state->__pyx_n_s_AmbiguousTimeError);
  Py_VISIT(traverse_module_state->__pyx_n_u_Apr);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Array_with_dtype_of_datetime64);
  Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError);
  Py_VISIT(traverse_module_state->__pyx_n_u_Aug);
  Py_VISIT(traverse_module_state->__pyx_n_s_Configs);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Conversion_limits_to_datetime_u);
  Py_VISIT(traverse_module_state->__pyx_n_u_D);
  Py_VISIT(traverse_module_state->__pyx_n_s_DataFrame);
  Py_VISIT(traverse_module_state->__pyx_n_s_DateParseError);
  Py_VISIT(traverse_module_state->__pyx_n_s_DatetimeArray);
  Py_VISIT(traverse_module_state->__pyx_n_s_DatetimeIndex);
  Py_VISIT(traverse_module_state->__pyx_n_u_Dec);
  Py_VISIT(traverse_module_state->__pyx_n_u_Feb);
  Py_VISIT(traverse_module_state->__pyx_kp_u_For_comparision_array_size_must);
  Py_VISIT(traverse_module_state->__pyx_n_u_Fri);
  Py_VISIT(traverse_module_state->__pyx_kp_u_H_M_S_f_z);
  Py_VISIT(traverse_module_state->__pyx_n_s_Hashable);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Hashable_None);
  Py_VISIT(traverse_module_state->__pyx_n_s_ImportError);
  Py_VISIT(traverse_module_state->__pyx_n_s_IncomparableError);
  Py_VISIT(traverse_module_state->__pyx_n_s_Index);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Index_bool);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Index_np_float64);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Index_np_int64);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Index_str);
  Py_VISIT(traverse_module_state->__pyx_n_s_InvalidArgumentError);
  Py_VISIT(traverse_module_state->__pyx_n_s_InvalidFspError);
  Py_VISIT(traverse_module_state->__pyx_n_s_InvalidMonthError);
  Py_VISIT(traverse_module_state->__pyx_n_s_InvalidTimeUnitError);
  Py_VISIT(traverse_module_state->__pyx_n_s_InvalidTimezoneError);
  Py_VISIT(traverse_module_state->__pyx_n_s_InvalidTypeError);
  Py_VISIT(traverse_module_state->__pyx_n_s_InvalidWeekdayError);
  Py_VISIT(traverse_module_state->__pyx_n_u_Jan);
  Py_VISIT(traverse_module_state->__pyx_n_u_Jul);
  Py_VISIT(traverse_module_state->__pyx_n_u_Jun);
  Py_VISIT(traverse_module_state->__pyx_n_s_Literal);
  Py_VISIT(traverse_module_state->__pyx_n_u_M);
  Py_VISIT(traverse_module_state->__pyx_n_u_Mar);
  Py_VISIT(traverse_module_state->__pyx_n_u_May);
  Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError);
  Py_VISIT(traverse_module_state->__pyx_n_u_Mon);
  Py_VISIT(traverse_module_state->__pyx_n_u_NaT);
  Py_VISIT(traverse_module_state->__pyx_kp_u_None);
  Py_VISIT(traverse_module_state->__pyx_n_u_Nov);
  Py_VISIT(traverse_module_state->__pyx_n_u_Oct);
  Py_VISIT(traverse_module_state->__pyx_n_s_OutOfBoundsDatetime);
  Py_VISIT(traverse_module_state->__pyx_n_s_OutOfBoundsDatetimeError);
  Py_VISIT(traverse_module_state->__pyx_n_s_OverflowError);
  Py_VISIT(traverse_module_state->__pyx_n_s_ParserError);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt);
  Py_VISIT(traverse_module_state->__pyx_n_u_Pddt);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt___new);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt__to_curr_weekday);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_add);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_as_unit);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_astimezone);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_ceil);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_closest);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_combine);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_ctime);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_date);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_date_range);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_datetime);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_day);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_days_bf_month);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_days_bf_quarter);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_days_bf_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_days_in_month);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_days_in_quarter);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_days_in_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_days_of_month);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Pddt_days_of_month_line_3389);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_days_of_quarter);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_days_of_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_diff);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_farthest);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_floor);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_fromdate);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_fromdatetime);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_fromdatetime64);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_fromicroseconds);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_fromisocalendar);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_fromisocalendar_locals__par);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_fromisocalendar_locals__par_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_fromisoformat);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_fromordinal);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_fromseconds);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_fromtimestamp);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_fsp);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_hour);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_is_day);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_is_end_of);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_is_first_of);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_is_future);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_is_last_of);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_is_leap_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_is_local);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_is_long_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_is_month);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_is_past);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_is_quarter);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_is_start_of);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_is_utc);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_is_weekday);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_is_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_isocalendar);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_isoformat);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_isoweek);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_isoweekday);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_isoyear);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_leap_bt_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_microsecond);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_microseconds);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_millisecond);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_minute);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_month);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_nanosecond);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_now);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_parse);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_quarter);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_replace);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_round);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_second);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_seconds);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_snap);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Pddt_snap_line_2367);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_strptime);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_sub);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_time);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_timedf);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_timestamp);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_timetz);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_curr_month);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Pddt_to_curr_month_line_2028);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_curr_quarter);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Pddt_to_curr_quarter_line_1853);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_curr_weekday);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Pddt_to_curr_weekday_line_2200);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_curr_year);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Pddt_to_curr_year_line_1652);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_date);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Pddt_to_date_line_2527);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_datetime);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Pddt_to_datetime_line_2383);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_day);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_end_of);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_first_of);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_friday);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_last_of);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_monday);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_month);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Pddt_to_month_line_2109);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_next_month);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Pddt_to_next_month_line_2096);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_next_quarter);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Pddt_to_next_quarter_line_1935);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_next_weekday);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Pddt_to_next_weekday_line_2228);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_next_year);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Pddt_to_next_year_line_1748);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_prev_month);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Pddt_to_prev_month_line_2083);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_prev_quarter);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Pddt_to_prev_quarter_line_1918);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_prev_weekday);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Pddt_to_prev_weekday_line_2214);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_prev_year);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Pddt_to_prev_year_line_1725);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_quarter);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Pddt_to_quarter_line_1952);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_saturday);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_start_of);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_sunday);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_thursday);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_time);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Pddt_to_time_line_2588);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_tomorrow);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_tuesday);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_wednesday);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_weekday);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Pddt_to_weekday_line_2242);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_year);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Pddt_to_year_line_1771);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_to_yesterday);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_today);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_toordinal);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_tz_available);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Pddt_tz_available_line_3574);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_tz_convert);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_tz_localize);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_tz_switch);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_tzname);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_utcfromtimestamp);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_utcnow);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_utctimedf);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_values_naive);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_weekday);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pddt_year);
  Py_VISIT(traverse_module_state->__pyx_n_u_Q);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Return_the_number_of_days_1_31_s);
  Py_VISIT(traverse_module_state->__pyx_n_s_RuntimeError);
  Py_VISIT(traverse_module_state->__pyx_n_u_S);
  Py_VISIT(traverse_module_state->__pyx_n_u_Sat);
  Py_VISIT(traverse_module_state->__pyx_n_s_Self);
  Py_VISIT(traverse_module_state->__pyx_n_u_Sep);
  Py_VISIT(traverse_module_state->__pyx_n_s_Series);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Snap_to_nearest_occurring_freque);
  Py_VISIT(traverse_module_state->__pyx_n_u_Sun);
  Py_VISIT(traverse_module_state->__pyx_n_u_T);
  Py_VISIT(traverse_module_state->__pyx_kp_u_The_available_timezone_names_set);
  Py_VISIT(traverse_module_state->__pyx_n_u_Thu);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Time_zones_are_not_available_fro);
  Py_VISIT(traverse_module_state->__pyx_n_s_Timestamp);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Timezone_aware);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Timezone_naive);
  Py_VISIT(traverse_module_state->__pyx_n_u_Tue);
  Py_VISIT(traverse_module_state->__pyx_n_s_TypeError);
  Py_VISIT(traverse_module_state->__pyx_n_s_ValueError);
  Py_VISIT(traverse_module_state->__pyx_n_u_W);
  Py_VISIT(traverse_module_state->__pyx_n_u_Wed);
  Py_VISIT(traverse_module_state->__pyx_n_u_Y);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Y_m_d);
  Py_VISIT(traverse_module_state->__pyx_n_s_ZeroDivisionError);
  Py_VISIT(traverse_module_state->__pyx_kp_u__10);
  Py_VISIT(traverse_module_state->__pyx_kp_u__11);
  Py_VISIT(traverse_module_state->__pyx_kp_u__12);
  Py_VISIT(traverse_module_state->__pyx_kp_u__13);
  Py_VISIT(traverse_module_state->__pyx_kp_u__14);
  Py_VISIT(traverse_module_state->__pyx_kp_u__15);
  Py_VISIT(traverse_module_state->__pyx_kp_u__19);
  Py_VISIT(traverse_module_state->__pyx_n_s__242);
  Py_VISIT(traverse_module_state->__pyx_kp_u__43);
  Py_VISIT(traverse_module_state->__pyx_n_s__44);
  Py_VISIT(traverse_module_state->__pyx_n_s__79);
  Py_VISIT(traverse_module_state->__pyx_kp_u__9);
  Py_VISIT(traverse_module_state->__pyx_kp_u_a_b_d_H_M_S_Y);
  Py_VISIT(traverse_module_state->__pyx_n_s_absolute);
  Py_VISIT(traverse_module_state->__pyx_n_s_add);
  Py_VISIT(traverse_module_state->__pyx_n_s_all);
  Py_VISIT(traverse_module_state->__pyx_n_s_ambiguous);
  Py_VISIT(traverse_module_state->__pyx_kp_u_ambiguous_NaT_is_not_supported);
  Py_VISIT(traverse_module_state->__pyx_n_s_arr);
  Py_VISIT(traverse_module_state->__pyx_n_s_arr_ptr);
  Py_VISIT(traverse_module_state->__pyx_n_s_arr_size);
  Py_VISIT(traverse_module_state->__pyx_kp_u_array_size_must_be_and_integer_0);
  Py_VISIT(traverse_module_state->__pyx_kp_u_array_size_must_be_greater_than);
  Py_VISIT(traverse_module_state->__pyx_n_u_as);
  Py_VISIT(traverse_module_state->__pyx_n_s_as_unit);
  Py_VISIT(traverse_module_state->__pyx_n_s_astimezone);
  Py_VISIT(traverse_module_state->__pyx_n_s_astype);
  Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
  Py_VISIT(traverse_module_state->__pyx_n_s_available_timezones);
  Py_VISIT(traverse_module_state->__pyx_n_s_available_timezones_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_base_tz);
  Py_VISIT(traverse_module_state->__pyx_kp_u_between_naive_aware_datetimes_T);
  Py_VISIT(traverse_module_state->__pyx_kp_u_between_naive_aware_datetimes_T_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_bool);
  Py_VISIT(traverse_module_state->__pyx_kp_s_bool_None);
  Py_VISIT(traverse_module_state->__pyx_n_u_both);
  Py_VISIT(traverse_module_state->__pyx_kp_u_calcuate_average);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_access_the_time_value_fro);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_cast);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_cast_ndarray);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_cast_ndarray_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_ceil_to_multiple_0);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_check_if_ndarray_s_is_wit);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_check_ndarray);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_compare_between_arrays_wi);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_compare_ndarrays_with_dif);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_convert_ndarray);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_convert_ndarray_from_date);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_convert_s_to_an_integer_t);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_convert_s_to_an_integer_t_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_convert_s_to_float_to_rep);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_covnert_s_to_an_integer_t);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_covnert_s_to_float_to_rep);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_floor_to_multiple_0);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_get_the_length_of_s_to_re);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_perform_addition_on_ndarr);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_perform_comparison_on_nda);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_perform_subtraction_on_nd);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_round_to_multiple_0);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_unpack_s_to_iso_calendar);
  Py_VISIT(traverse_module_state->__pyx_n_s_ceil);
  Py_VISIT(traverse_module_state->__pyx_n_u_ceil);
  Py_VISIT(traverse_module_state->__pyx_n_s_cfg);
  Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem);
  Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
  Py_VISIT(traverse_module_state->__pyx_n_s_closest);
  Py_VISIT(traverse_module_state->__pyx_n_u_closest);
  Py_VISIT(traverse_module_state->__pyx_n_s_cls);
  Py_VISIT(traverse_module_state->__pyx_n_s_columns);
  Py_VISIT(traverse_module_state->__pyx_n_s_combine);
  Py_VISIT(traverse_module_state->__pyx_n_u_compare);
  Py_VISIT(traverse_module_state->__pyx_n_s_copy);
  Py_VISIT(traverse_module_state->__pyx_n_s_ctime);
  Py_VISIT(traverse_module_state->__pyx_kp_s_cython_bint);
  Py_VISIT(traverse_module_state->__pyx_kp_s_cython_int);
  Py_VISIT(traverse_module_state->__pyx_n_s_cytimes);
  Py_VISIT(traverse_module_state->__pyx_n_s_cytimes_parser);
  Py_VISIT(traverse_module_state->__pyx_n_s_cytimes_pddt);
  Py_VISIT(traverse_module_state->__pyx_n_u_d);
  Py_VISIT(traverse_module_state->__pyx_n_s_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_date);
  Py_VISIT(traverse_module_state->__pyx_n_s_date_range);
  Py_VISIT(traverse_module_state->__pyx_n_s_dates);
  Py_VISIT(traverse_module_state->__pyx_n_s_datesD);
  Py_VISIT(traverse_module_state->__pyx_n_s_datesD_1st);
  Py_VISIT(traverse_module_state->__pyx_n_s_datesD_lst);
  Py_VISIT(traverse_module_state->__pyx_n_s_datesM);
  Py_VISIT(traverse_module_state->__pyx_n_s_datesQ);
  Py_VISIT(traverse_module_state->__pyx_n_s_datesY);
  Py_VISIT(traverse_module_state->__pyx_n_s_datetime);
  Py_VISIT(traverse_module_state->__pyx_n_s_datetime64);
  Py_VISIT(traverse_module_state->__pyx_n_u_datetime64);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_D);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_M);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_W);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_Y);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_h);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_m);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_ms);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_ns);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_s);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_s_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime64_us);
  Py_VISIT(traverse_module_state->__pyx_kp_s_datetime_date_object);
  Py_VISIT(traverse_module_state->__pyx_kp_s_datetime_date_str_None);
  Py_VISIT(traverse_module_state->__pyx_kp_s_datetime_datetime_object);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime_s_is_ambiguous);
  Py_VISIT(traverse_module_state->__pyx_kp_s_datetime_time_str_None);
  Py_VISIT(traverse_module_state->__pyx_kp_s_datetime_tzinfo_str_None);
  Py_VISIT(traverse_module_state->__pyx_n_s_day);
  Py_VISIT(traverse_module_state->__pyx_n_u_day);
  Py_VISIT(traverse_module_state->__pyx_n_s_day1st);
  Py_VISIT(traverse_module_state->__pyx_n_s_dayfirst);
  Py_VISIT(traverse_module_state->__pyx_n_s_days);
  Py_VISIT(traverse_module_state->__pyx_n_s_days_bf_month);
  Py_VISIT(traverse_module_state->__pyx_n_u_days_bf_month);
  Py_VISIT(traverse_module_state->__pyx_n_s_days_bf_quarter);
  Py_VISIT(traverse_module_state->__pyx_n_u_days_bf_quarter);
  Py_VISIT(traverse_module_state->__pyx_n_s_days_bf_year);
  Py_VISIT(traverse_module_state->__pyx_n_u_days_bf_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_days_in_month);
  Py_VISIT(traverse_module_state->__pyx_n_u_days_in_month);
  Py_VISIT(traverse_module_state->__pyx_n_s_days_in_quarter);
  Py_VISIT(traverse_module_state->__pyx_n_u_days_in_quarter);
  Py_VISIT(traverse_module_state->__pyx_n_s_days_in_year);
  Py_VISIT(traverse_module_state->__pyx_n_u_days_in_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_days_of_month);
  Py_VISIT(traverse_module_state->__pyx_n_u_days_of_month);
  Py_VISIT(traverse_module_state->__pyx_n_s_days_of_quarter);
  Py_VISIT(traverse_module_state->__pyx_n_u_days_of_quarter);
  Py_VISIT(traverse_module_state->__pyx_n_s_days_of_year);
  Py_VISIT(traverse_module_state->__pyx_n_u_days_of_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_dd);
  Py_VISIT(traverse_module_state->__pyx_n_s_delta);
  Py_VISIT(traverse_module_state->__pyx_n_s_dict);
  Py_VISIT(traverse_module_state->__pyx_n_s_dict_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_diff);
  Py_VISIT(traverse_module_state->__pyx_n_u_diff);
  Py_VISIT(traverse_module_state->__pyx_kp_u_disable);
  Py_VISIT(traverse_module_state->__pyx_kp_u_division_by_zero_for_utils_arr_c);
  Py_VISIT(traverse_module_state->__pyx_kp_u_division_by_zero_for_utils_arr_f);
  Py_VISIT(traverse_module_state->__pyx_kp_u_division_by_zero_for_utils_arr_r);
  Py_VISIT(traverse_module_state->__pyx_kp_u_division_by_zero_for_utils_math);
  Py_VISIT(traverse_module_state->__pyx_kp_u_division_by_zero_for_utils_math_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_division_by_zero_for_utils_math_3);
  Py_VISIT(traverse_module_state->__pyx_kp_u_division_by_zero_for_utils_math_4);
  Py_VISIT(traverse_module_state->__pyx_kp_u_division_by_zero_in_arr_mod);
  Py_VISIT(traverse_module_state->__pyx_n_s_doc);
  Py_VISIT(traverse_module_state->__pyx_n_s_dst);
  Py_VISIT(traverse_module_state->__pyx_n_s_dt);
  Py_VISIT(traverse_module_state->__pyx_n_s_dt64);
  Py_VISIT(traverse_module_state->__pyx_n_s_dt_val);
  Py_VISIT(traverse_module_state->__pyx_n_s_dtobjs);
  Py_VISIT(traverse_module_state->__pyx_n_s_dts);
  Py_VISIT(traverse_module_state->__pyx_n_s_dtstr);
  Py_VISIT(traverse_module_state->__pyx_n_s_dtype);
  Py_VISIT(traverse_module_state->__pyx_kp_u_enable);
  Py_VISIT(traverse_module_state->__pyx_n_s_end);
  Py_VISIT(traverse_module_state->__pyx_n_s_err);
  Py_VISIT(traverse_module_state->__pyx_n_s_errors);
  Py_VISIT(traverse_module_state->__pyx_n_s_exceptions);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expects_datetime_tzinfo_got_s);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expects_np_datetime64_got_s);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expects_np_ndarray_datetime64_go);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expects_np_ndarray_datetime64_ti);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expects_np_ndarray_datetime64_ti_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expects_np_ndarray_timedelta64_g);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expects_np_timedelta64_got_s);
  Py_VISIT(traverse_module_state->__pyx_n_s_f);
  Py_VISIT(traverse_module_state->__pyx_n_s_fac);
  Py_VISIT(traverse_module_state->__pyx_kp_u_failed_to_allocate_memory_for_st);
  Py_VISIT(traverse_module_state->__pyx_n_s_farthest);
  Py_VISIT(traverse_module_state->__pyx_n_u_farthest);
  Py_VISIT(traverse_module_state->__pyx_kp_u_find_closest);
  Py_VISIT(traverse_module_state->__pyx_kp_u_find_farthest);
  Py_VISIT(traverse_module_state->__pyx_n_s_floor);
  Py_VISIT(traverse_module_state->__pyx_n_u_floor);
  Py_VISIT(traverse_module_state->__pyx_n_s_fmt);
  Py_VISIT(traverse_module_state->__pyx_n_s_freq);
  Py_VISIT(traverse_module_state->__pyx_n_s_fromdate);
  Py_VISIT(traverse_module_state->__pyx_n_s_fromdatetime);
  Py_VISIT(traverse_module_state->__pyx_n_s_fromdatetime64);
  Py_VISIT(traverse_module_state->__pyx_n_s_fromicroseconds);
  Py_VISIT(traverse_module_state->__pyx_n_s_fromisocalendar);
  Py_VISIT(traverse_module_state->__pyx_n_s_fromisoformat);
  Py_VISIT(traverse_module_state->__pyx_n_s_fromordinal);
  Py_VISIT(traverse_module_state->__pyx_n_s_fromseconds);
  Py_VISIT(traverse_module_state->__pyx_n_s_fromtimestamp);
  Py_VISIT(traverse_module_state->__pyx_n_s_fromutc);
  Py_VISIT(traverse_module_state->__pyx_n_u_fs);
  Py_VISIT(traverse_module_state->__pyx_n_s_fsp);
  Py_VISIT(traverse_module_state->__pyx_kp_u_gc);
  Py_VISIT(traverse_module_state->__pyx_n_s_generate_range);
  Py_VISIT(traverse_module_state->__pyx_n_s_get);
  Py_VISIT(traverse_module_state->__pyx_n_u_h);
  Py_VISIT(traverse_module_state->__pyx_n_s_hh_fac);
  Py_VISIT(traverse_module_state->__pyx_n_s_hour);
  Py_VISIT(traverse_module_state->__pyx_n_u_hour);
  Py_VISIT(traverse_module_state->__pyx_n_s_hours);
  Py_VISIT(traverse_module_state->__pyx_n_s_i);
  Py_VISIT(traverse_module_state->__pyx_n_s_import);
  Py_VISIT(traverse_module_state->__pyx_n_s_incl_off);
  Py_VISIT(traverse_module_state->__pyx_n_s_inclusive);
  Py_VISIT(traverse_module_state->__pyx_n_s_index);
  Py_VISIT(traverse_module_state->__pyx_n_u_infer);
  Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass);
  Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
  Py_VISIT(traverse_module_state->__pyx_kp_u_instance_is_already_timezone_awa);
  Py_VISIT(traverse_module_state->__pyx_kp_u_instance_is_timezone_naive_Canno);
  Py_VISIT(traverse_module_state->__pyx_kp_u_instance_is_timezone_naive_Use_t);
  Py_VISIT(traverse_module_state->__pyx_n_u_int64);
  Py_VISIT(traverse_module_state->__pyx_kp_u_int64_under_D_resolution);
  Py_VISIT(traverse_module_state->__pyx_kp_u_int64_under_M_resolution);
  Py_VISIT(traverse_module_state->__pyx_kp_u_int64_under_Y_resolution);
  Py_VISIT(traverse_module_state->__pyx_kp_u_int64_under_h_resolution);
  Py_VISIT(traverse_module_state->__pyx_kp_u_int64_under_m_resolution);
  Py_VISIT(traverse_module_state->__pyx_kp_u_int64_under_ms_resolution);
  Py_VISIT(traverse_module_state->__pyx_kp_u_int64_under_ns_resolution);
  Py_VISIT(traverse_module_state->__pyx_kp_u_int64_under_s_resolution);
  Py_VISIT(traverse_module_state->__pyx_kp_u_int64_under_us_resolution);
  Py_VISIT(traverse_module_state->__pyx_kp_s_int_None);
  Py_VISIT(traverse_module_state->__pyx_kp_s_int_float_object);
  Py_VISIT(traverse_module_state->__pyx_kp_s_int_object);
  Py_VISIT(traverse_module_state->__pyx_kp_s_int_str);
  Py_VISIT(traverse_module_state->__pyx_kp_s_int_str_None);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_character_s_as_an_intege);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_end_of_datetime_unit_s_S);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_first_of_datetime_unit_s);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_fractional_seconds_preci);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_input_s_for_inclusive_Su);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_last_of_datetime_unit_s);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_month_name_s);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_month_number_d_must_betw);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_start_of_time_unit_s_Sup);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_weekday_name_s);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_weekday_number_d_must_be);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_day);
  Py_VISIT(traverse_module_state->__pyx_n_u_is_day);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_end_of);
  Py_VISIT(traverse_module_state->__pyx_kp_u_is_end_of_s);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_first_of);
  Py_VISIT(traverse_module_state->__pyx_kp_u_is_first_of_s);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_future);
  Py_VISIT(traverse_module_state->__pyx_n_u_is_future);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_last_of);
  Py_VISIT(traverse_module_state->__pyx_kp_u_is_last_of_s);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_leap_year);
  Py_VISIT(traverse_module_state->__pyx_n_u_is_leap_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_local);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_long_year);
  Py_VISIT(traverse_module_state->__pyx_n_u_is_long_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_month);
  Py_VISIT(traverse_module_state->__pyx_n_u_is_month);
  Py_VISIT(traverse_module_state->__pyx_kp_u_is_not_supported);
  Py_VISIT(traverse_module_state->__pyx_kp_u_is_not_supported_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_is_not_supported_3);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_past);
  Py_VISIT(traverse_module_state->__pyx_n_u_is_past);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_quarter);
  Py_VISIT(traverse_module_state->__pyx_n_u_is_quarter);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_start_of);
  Py_VISIT(traverse_module_state->__pyx_kp_u_is_start_of_s);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_utc);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_weekday);
  Py_VISIT(traverse_module_state->__pyx_n_u_is_weekday);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_year);
  Py_VISIT(traverse_module_state->__pyx_n_u_is_year);
  Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled);
  Py_VISIT(traverse_module_state->__pyx_n_s_iso);
  Py_VISIT(traverse_module_state->__pyx_n_s_iso_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_isocalendar);
  Py_VISIT(traverse_module_state->__pyx_n_s_isoformat);
  Py_VISIT(traverse_module_state->__pyx_n_s_isoweek);
  Py_VISIT(traverse_module_state->__pyx_n_u_isoweek);
  Py_VISIT(traverse_module_state->__pyx_n_s_isoweekday);
  Py_VISIT(traverse_module_state->__pyx_n_u_isoweekday);
  Py_VISIT(traverse_module_state->__pyx_n_s_isoyear);
  Py_VISIT(traverse_module_state->__pyx_n_u_isoyear);
  Py_VISIT(traverse_module_state->__pyx_n_s_item);
  Py_VISIT(traverse_module_state->__pyx_n_s_itertuples);
  Py_VISIT(traverse_module_state->__pyx_n_s_kind);
  Py_VISIT(traverse_module_state->__pyx_n_s_leap_bt_year);
  Py_VISIT(traverse_module_state->__pyx_n_u_leap_bt_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_lib);
  Py_VISIT(traverse_module_state->__pyx_n_s_lower);
  Py_VISIT(traverse_module_state->__pyx_n_u_m);
  Py_VISIT(traverse_module_state->__pyx_n_s_main);
  Py_VISIT(traverse_module_state->__pyx_n_s_metaclass);
  Py_VISIT(traverse_module_state->__pyx_n_s_mi_fac);
  Py_VISIT(traverse_module_state->__pyx_n_s_microsecond);
  Py_VISIT(traverse_module_state->__pyx_n_u_microsecond);
  Py_VISIT(traverse_module_state->__pyx_n_s_microseconds);
  Py_VISIT(traverse_module_state->__pyx_n_u_microseconds);
  Py_VISIT(traverse_module_state->__pyx_n_s_millisecond);
  Py_VISIT(traverse_module_state->__pyx_n_u_millisecond);
  Py_VISIT(traverse_module_state->__pyx_n_s_milliseconds);
  Py_VISIT(traverse_module_state->__pyx_n_u_min);
  Py_VISIT(traverse_module_state->__pyx_n_s_minute);
  Py_VISIT(traverse_module_state->__pyx_n_u_minute);
  Py_VISIT(traverse_module_state->__pyx_n_s_minutes);
  Py_VISIT(traverse_module_state->__pyx_kp_u_mixed_timezones);
  Py_VISIT(traverse_module_state->__pyx_n_s_mm);
  Py_VISIT(traverse_module_state->__pyx_n_s_module);
  Py_VISIT(traverse_module_state->__pyx_n_s_month);
  Py_VISIT(traverse_module_state->__pyx_n_u_month);
  Py_VISIT(traverse_module_state->__pyx_n_s_months);
  Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries);
  Py_VISIT(traverse_module_state->__pyx_n_u_ms);
  Py_VISIT(traverse_module_state->__pyx_n_s_mul);
  Py_VISIT(traverse_module_state->__pyx_kp_u_must_be_an_1_dimensional_ndarray);
  Py_VISIT(traverse_module_state->__pyx_n_s_my_arr);
  Py_VISIT(traverse_module_state->__pyx_n_s_my_tz);
  Py_VISIT(traverse_module_state->__pyx_n_s_my_unit);
  Py_VISIT(traverse_module_state->__pyx_n_s_my_unit_adj);
  Py_VISIT(traverse_module_state->__pyx_n_s_my_unit_ch);
  Py_VISIT(traverse_module_state->__pyx_n_s_my_unit_int);
  Py_VISIT(traverse_module_state->__pyx_n_s_my_unit_ns);
  Py_VISIT(traverse_module_state->__pyx_n_s_naive);
  Py_VISIT(traverse_module_state->__pyx_n_s_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_name_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_nanosecond);
  Py_VISIT(traverse_module_state->__pyx_n_u_nanosecond);
  Py_VISIT(traverse_module_state->__pyx_kp_u_nanosecond_conversion_range_dat);
  Py_VISIT(traverse_module_state->__pyx_n_s_nanoseconds);
  Py_VISIT(traverse_module_state->__pyx_kp_u_ndarray_size_must_be_an_integer);
  Py_VISIT(traverse_module_state->__pyx_n_u_neither);
  Py_VISIT(traverse_module_state->__pyx_n_s_new);
  Py_VISIT(traverse_module_state->__pyx_n_s_no_default);
  Py_VISIT(traverse_module_state->__pyx_n_s_nonexistent);
  Py_VISIT(traverse_module_state->__pyx_kp_u_nonexistent_NaT_is_not_supported);
  Py_VISIT(traverse_module_state->__pyx_n_s_normalize);
  Py_VISIT(traverse_module_state->__pyx_n_s_now);
  Py_VISIT(traverse_module_state->__pyx_n_s_np);
  Py_VISIT(traverse_module_state->__pyx_kp_s_np_datetime64_object);
  Py_VISIT(traverse_module_state->__pyx_kp_s_np_ndarray_datetime_date);
  Py_VISIT(traverse_module_state->__pyx_kp_s_np_ndarray_datetime_datetime);
  Py_VISIT(traverse_module_state->__pyx_kp_s_np_ndarray_datetime_time);
  Py_VISIT(traverse_module_state->__pyx_kp_s_np_ndarray_np_datetime64);
  Py_VISIT(traverse_module_state->__pyx_kp_s_np_ndarray_np_int64);
  Py_VISIT(traverse_module_state->__pyx_n_u_ns);
  Py_VISIT(traverse_module_state->__pyx_n_s_numpy);
  Py_VISIT(traverse_module_state->__pyx_kp_u_numpy__core_multiarray_failed_to);
  Py_VISIT(traverse_module_state->__pyx_kp_u_numpy__core_umath_failed_to_impo);
  Py_VISIT(traverse_module_state->__pyx_n_s_object);
  Py_VISIT(traverse_module_state->__pyx_kp_s_object_None);
  Py_VISIT(traverse_module_state->__pyx_n_s_off);
  Py_VISIT(traverse_module_state->__pyx_n_s_offset);
  Py_VISIT(traverse_module_state->__pyx_n_u_one);
  Py_VISIT(traverse_module_state->__pyx_kp_u_operation_on_ndarray_datetime64);
  Py_VISIT(traverse_module_state->__pyx_n_s_ordinal);
  Py_VISIT(traverse_module_state->__pyx_n_u_ordinal);
  Py_VISIT(traverse_module_state->__pyx_n_s_pandas);
  Py_VISIT(traverse_module_state->__pyx_n_s_pandas__libs);
  Py_VISIT(traverse_module_state->__pyx_n_s_pandas__libs_tslibs_parsing);
  Py_VISIT(traverse_module_state->__pyx_n_s_pandas_core_arrays_datetimes);
  Py_VISIT(traverse_module_state->__pyx_n_s_parse);
  Py_VISIT(traverse_module_state->__pyx_n_s_parse_dict);
  Py_VISIT(traverse_module_state->__pyx_n_s_parse_dtobj);
  Py_VISIT(traverse_module_state->__pyx_n_s_parse_sequence);
  Py_VISIT(traverse_module_state->__pyx_n_s_pd_err);
  Py_VISIT(traverse_module_state->__pyx_n_s_periods);
  Py_VISIT(traverse_module_state->__pyx_n_s_precision);
  Py_VISIT(traverse_module_state->__pyx_n_s_prepare);
  Py_VISIT(traverse_module_state->__pyx_n_s_property);
  Py_VISIT(traverse_module_state->__pyx_n_u_ps);
  Py_VISIT(traverse_module_state->__pyx_n_s_pt);
  Py_VISIT(traverse_module_state->__pyx_n_s_pt_1st);
  Py_VISIT(traverse_module_state->__pyx_n_s_pt_arr);
  Py_VISIT(traverse_module_state->__pyx_n_s_pt_end);
  Py_VISIT(traverse_module_state->__pyx_n_s_pt_end_unit);
  Py_VISIT(traverse_module_state->__pyx_n_s_pt_lst);
  Py_VISIT(traverse_module_state->__pyx_n_s_pt_stt);
  Py_VISIT(traverse_module_state->__pyx_n_s_pt_stt_unit);
  Py_VISIT(traverse_module_state->__pyx_n_s_pt_tz);
  Py_VISIT(traverse_module_state->__pyx_n_s_pt_unit);
  Py_VISIT(traverse_module_state->__pyx_n_s_pt_unit_int);
  Py_VISIT(traverse_module_state->__pyx_n_s_pytz);
  Py_VISIT(traverse_module_state->__pyx_n_s_pytz_err);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable);
  Py_VISIT(traverse_module_state->__pyx_n_s_qualname);
  Py_VISIT(traverse_module_state->__pyx_n_s_quarter);
  Py_VISIT(traverse_module_state->__pyx_n_u_quarter);
  Py_VISIT(traverse_module_state->__pyx_n_s_quarters);
  Py_VISIT(traverse_module_state->__pyx_n_u_raise);
  Py_VISIT(traverse_module_state->__pyx_n_s_range);
  Py_VISIT(traverse_module_state->__pyx_n_s_replace);
  Py_VISIT(traverse_module_state->__pyx_n_s_res);
  Py_VISIT(traverse_module_state->__pyx_kp_u_resolution);
  Py_VISIT(traverse_module_state->__pyx_kp_u_resolution_Array_with_datetime);
  Py_VISIT(traverse_module_state->__pyx_kp_u_resolution_Array_with_dtype_of);
  Py_VISIT(traverse_module_state->__pyx_kp_u_resolution_Supported_resolution);
  Py_VISIT(traverse_module_state->__pyx_kp_u_resolution_is_not_supported);
  Py_VISIT(traverse_module_state->__pyx_n_s_return);
  Py_VISIT(traverse_module_state->__pyx_n_s_round);
  Py_VISIT(traverse_module_state->__pyx_n_u_round);
  Py_VISIT(traverse_module_state->__pyx_n_u_s);
  Py_VISIT(traverse_module_state->__pyx_n_s_sec);
  Py_VISIT(traverse_module_state->__pyx_n_s_second);
  Py_VISIT(traverse_module_state->__pyx_n_u_second);
  Py_VISIT(traverse_module_state->__pyx_n_s_seconds);
  Py_VISIT(traverse_module_state->__pyx_n_u_seconds);
  Py_VISIT(traverse_module_state->__pyx_n_s_self);
  Py_VISIT(traverse_module_state->__pyx_n_s_sep);
  Py_VISIT(traverse_module_state->__pyx_kp_u_sequence_must_have_3_items);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_name);
  Py_VISIT(traverse_module_state->__pyx_kp_s_set_str);
  Py_VISIT(traverse_module_state->__pyx_n_u_shift_forward);
  Py_VISIT(traverse_module_state->__pyx_n_s_size);
  Py_VISIT(traverse_module_state->__pyx_n_s_snap);
  Py_VISIT(traverse_module_state->__pyx_n_s_spec);
  Py_VISIT(traverse_module_state->__pyx_kp_s_src_cytimes_pddt_py);
  Py_VISIT(traverse_module_state->__pyx_n_s_ss_fac);
  Py_VISIT(traverse_module_state->__pyx_n_s_start);
  Py_VISIT(traverse_module_state->__pyx_n_s_str);
  Py_VISIT(traverse_module_state->__pyx_kp_s_str_int);
  Py_VISIT(traverse_module_state->__pyx_kp_s_str_object);
  Py_VISIT(traverse_module_state->__pyx_n_s_strftime);
  Py_VISIT(traverse_module_state->__pyx_kp_u_strftime_format_is_too_long_s);
  Py_VISIT(traverse_module_state->__pyx_n_s_strptime);
  Py_VISIT(traverse_module_state->__pyx_n_s_sub);
  Py_VISIT(traverse_module_state->__pyx_n_s_super);
  Py_VISIT(traverse_module_state->__pyx_kp_u_support_ndarray_with_1_4_dimensi);
  Py_VISIT(traverse_module_state->__pyx_n_s_targ_tz);
  Py_VISIT(traverse_module_state->__pyx_n_s_test);
  Py_VISIT(traverse_module_state->__pyx_n_s_time);
  Py_VISIT(traverse_module_state->__pyx_n_u_timedelta64);
  Py_VISIT(traverse_module_state->__pyx_n_s_timedf);
  Py_VISIT(traverse_module_state->__pyx_n_s_times);
  Py_VISIT(traverse_module_state->__pyx_n_s_timestamp);
  Py_VISIT(traverse_module_state->__pyx_n_u_timestamp);
  Py_VISIT(traverse_module_state->__pyx_n_s_timetz);
  Py_VISIT(traverse_module_state->__pyx_kp_u_timezone_offset_s_seconds_out_of);
  Py_VISIT(traverse_module_state->__pyx_n_s_tm_hour);
  Py_VISIT(traverse_module_state->__pyx_n_u_tm_hour);
  Py_VISIT(traverse_module_state->__pyx_n_s_tm_isdst);
  Py_VISIT(traverse_module_state->__pyx_n_s_tm_mday);
  Py_VISIT(traverse_module_state->__pyx_n_u_tm_mday);
  Py_VISIT(traverse_module_state->__pyx_n_s_tm_min);
  Py_VISIT(traverse_module_state->__pyx_n_u_tm_min);
  Py_VISIT(traverse_module_state->__pyx_n_s_tm_mon);
  Py_VISIT(traverse_module_state->__pyx_n_u_tm_mon);
  Py_VISIT(traverse_module_state->__pyx_n_s_tm_sec);
  Py_VISIT(traverse_module_state->__pyx_n_u_tm_sec);
  Py_VISIT(traverse_module_state->__pyx_n_s_tm_wday);
  Py_VISIT(traverse_module_state->__pyx_n_u_tm_wday);
  Py_VISIT(traverse_module_state->__pyx_n_s_tm_yday);
  Py_VISIT(traverse_module_state->__pyx_n_u_tm_yday);
  Py_VISIT(traverse_module_state->__pyx_n_s_tm_year);
  Py_VISIT(traverse_module_state->__pyx_n_u_tm_year);
  Py_VISIT(traverse_module_state->__pyx_kp_u_to);
  Py_VISIT(traverse_module_state->__pyx_kp_u_to_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_to_an_integer_under);
  Py_VISIT(traverse_module_state->__pyx_kp_u_to_an_integer_under_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_curr_month);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_curr_quarter);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_curr_weekday);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_curr_weekday_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_curr_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_date);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_datetime);
  Py_VISIT(traverse_module_state->__pyx_kp_u_to_datetime64);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_day);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_end_of);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_first_of);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_friday);
  Py_VISIT(traverse_module_state->__pyx_kp_u_to_int64_under);
  Py_VISIT(traverse_module_state->__pyx_kp_u_to_int64_under_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_to_int64_under_3);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_last_of);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_monday);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_month);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_next_month);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_next_quarter);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_next_weekday);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_next_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_prev_month);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_prev_quarter);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_prev_weekday);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_prev_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_pydatetime);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_quarter);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_saturday);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_start_of);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_sunday);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_thursday);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_time);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_tomorrow);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_tuesday);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_wednesday);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_weekday);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_yesterday);
  Py_VISIT(traverse_module_state->__pyx_n_s_today);
  Py_VISIT(traverse_module_state->__pyx_n_s_toordinal);
  Py_VISIT(traverse_module_state->__pyx_n_s_ts);
  Py_VISIT(traverse_module_state->__pyx_n_s_typing);
  Py_VISIT(traverse_module_state->__pyx_n_s_typing_extensions);
  Py_VISIT(traverse_module_state->__pyx_n_s_tz);
  Py_VISIT(traverse_module_state->__pyx_n_s_tz_available);
  Py_VISIT(traverse_module_state->__pyx_n_s_tz_convert);
  Py_VISIT(traverse_module_state->__pyx_n_s_tz_localize);
  Py_VISIT(traverse_module_state->__pyx_n_s_tz_switch);
  Py_VISIT(traverse_module_state->__pyx_n_s_tzinfo);
  Py_VISIT(traverse_module_state->__pyx_n_s_tzname);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unable_to_parse_datetime_unit_fr);
  Py_VISIT(traverse_module_state->__pyx_n_s_unit);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unknown_datetime_unit_d);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unknown_datetime_unit_s);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unless_utc_True);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unsupported_datetime_unit_s);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unsupported_factor_d_for_timedel);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unsupported_factor_d_for_timedel_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unsupported_month_value_type_s_e);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unsupported_type_s_for_argument);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unsupported_type_s_for_argument_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unsupported_type_s_for_argument_3);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unsupported_type_s_for_argument_4);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unsupported_type_s_for_argument_5);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unsupported_type_s_for_argument_6);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unsupported_weekday_value_type_s);
  Py_VISIT(traverse_module_state->__pyx_n_s_us);
  Py_VISIT(traverse_module_state->__pyx_n_u_us);
  Py_VISIT(traverse_module_state->__pyx_n_s_us_fac);
  Py_VISIT(traverse_module_state->__pyx_n_s_utc);
  Py_VISIT(traverse_module_state->__pyx_n_s_utcfromtimestamp);
  Py_VISIT(traverse_module_state->__pyx_n_s_utcnow);
  Py_VISIT(traverse_module_state->__pyx_n_s_utcoffset);
  Py_VISIT(traverse_module_state->__pyx_n_s_utctimedf);
  Py_VISIT(traverse_module_state->__pyx_n_s_utils);
  Py_VISIT(traverse_module_state->__pyx_n_s_val);
  Py_VISIT(traverse_module_state->__pyx_n_s_values);
  Py_VISIT(traverse_module_state->__pyx_n_s_values_naive);
  Py_VISIT(traverse_module_state->__pyx_kp_u_vs);
  Py_VISIT(traverse_module_state->__pyx_n_s_wd);
  Py_VISIT(traverse_module_state->__pyx_n_s_week);
  Py_VISIT(traverse_module_state->__pyx_n_u_week);
  Py_VISIT(traverse_module_state->__pyx_n_s_weekday);
  Py_VISIT(traverse_module_state->__pyx_n_u_weekday);
  Py_VISIT(traverse_module_state->__pyx_n_s_weeks);
  Py_VISIT(traverse_module_state->__pyx_kp_u_with_datetime_unit);
  Py_VISIT(traverse_module_state->__pyx_kp_u_without_specifying_the_array_da);
  Py_VISIT(traverse_module_state->__pyx_n_s_wkd);
  Py_VISIT(traverse_module_state->__pyx_n_s_ww);
  Py_VISIT(traverse_module_state->__pyx_n_s_year);
  Py_VISIT(traverse_module_state->__pyx_n_u_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_year1st);
  Py_VISIT(traverse_module_state->__pyx_n_s_yearfirst);
  Py_VISIT(traverse_module_state->__pyx_n_s_years);
  Py_VISIT(traverse_module_state->__pyx_n_s_ymd);
  Py_VISIT(traverse_module_state->__pyx_n_s_yy);
  Py_VISIT(traverse_module_state->__pyx_n_s_zoneinfo);
  Py_VISIT(traverse_module_state->__pyx_int_0);
  Py_VISIT(traverse_module_state->__pyx_int_1);
  Py_VISIT(traverse_module_state->__pyx_int_2);
  Py_VISIT(traverse_module_state->__pyx_int_3);
  Py_VISIT(traverse_module_state->__pyx_int_4);
  Py_VISIT(traverse_module_state->__pyx_int_5);
  Py_VISIT(traverse_module_state->__pyx_int_6);
  Py_VISIT(traverse_module_state->__pyx_int_neg_1);
  Py_VISIT(traverse_module_state->__pyx_tuple_);
  Py_VISIT(traverse_module_state->__pyx_tuple__2);
  Py_VISIT(traverse_module_state->__pyx_tuple__3);
  Py_VISIT(traverse_module_state->__pyx_tuple__4);
  Py_VISIT(traverse_module_state->__pyx_tuple__5);
  Py_VISIT(traverse_module_state->__pyx_tuple__6);
  Py_VISIT(traverse_module_state->__pyx_tuple__7);
  Py_VISIT(traverse_module_state->__pyx_tuple__8);
  Py_VISIT(traverse_module_state->__pyx_slice__39);
  Py_VISIT(traverse_module_state->__pyx_tuple__16);
  Py_VISIT(traverse_module_state->__pyx_tuple__17);
  Py_VISIT(traverse_module_state->__pyx_tuple__18);
  Py_VISIT(traverse_module_state->__pyx_tuple__20);
  Py_VISIT(traverse_module_state->__pyx_tuple__21);
  Py_VISIT(traverse_module_state->__pyx_tuple__22);
  Py_VISIT(traverse_module_state->__pyx_tuple__23);
  Py_VISIT(traverse_module_state->__pyx_tuple__24);
  Py_VISIT(traverse_module_state->__pyx_tuple__25);
  Py_VISIT(traverse_module_state->__pyx_tuple__26);
  Py_VISIT(traverse_module_state->__pyx_tuple__27);
  Py_VISIT(traverse_module_state->__pyx_tuple__28);
  Py_VISIT(traverse_module_state->__pyx_tuple__29);
  Py_VISIT(traverse_module_state->__pyx_tuple__30);
  Py_VISIT(traverse_module_state->__pyx_tuple__31);
  Py_VISIT(traverse_module_state->__pyx_tuple__32);
  Py_VISIT(traverse_module_state->__pyx_tuple__33);
  Py_VISIT(traverse_module_state->__pyx_tuple__34);
  Py_VISIT(traverse_module_state->__pyx_tuple__35);
  Py_VISIT(traverse_module_state->__pyx_tuple__37);
  Py_VISIT(traverse_module_state->__pyx_tuple__40);
  Py_VISIT(traverse_module_state->__pyx_tuple__41);
  Py_VISIT(traverse_module_state->__pyx_tuple__42);
  Py_VISIT(traverse_module_state->__pyx_tuple__45);
  Py_VISIT(traverse_module_state->__pyx_tuple__47);
  Py_VISIT(traverse_module_state->__pyx_tuple__48);
  Py_VISIT(traverse_module_state->__pyx_tuple__50);
  Py_VISIT(traverse_module_state->__pyx_tuple__52);
  Py_VISIT(traverse_module_state->__pyx_tuple__54);
  Py_VISIT(traverse_module_state->__pyx_tuple__55);
  Py_VISIT(traverse_module_state->__pyx_tuple__57);
  Py_VISIT(traverse_module_state->__pyx_tuple__59);
  Py_VISIT(traverse_module_state->__pyx_tuple__61);
  Py_VISIT(traverse_module_state->__pyx_tuple__62);
  Py_VISIT(traverse_module_state->__pyx_tuple__64);
  Py_VISIT(traverse_module_state->__pyx_tuple__66);
  Py_VISIT(traverse_module_state->__pyx_tuple__68);
  Py_VISIT(traverse_module_state->__pyx_tuple__70);
  Py_VISIT(traverse_module_state->__pyx_tuple__72);
  Py_VISIT(traverse_module_state->__pyx_tuple__74);
  Py_VISIT(traverse_module_state->__pyx_tuple__76);
  Py_VISIT(traverse_module_state->__pyx_tuple__77);
  Py_VISIT(traverse_module_state->__pyx_tuple__80);
  Py_VISIT(traverse_module_state->__pyx_tuple__82);
  Py_VISIT(traverse_module_state->__pyx_tuple__84);
  Py_VISIT(traverse_module_state->__pyx_tuple__86);
  Py_VISIT(traverse_module_state->__pyx_tuple__88);
  Py_VISIT(traverse_module_state->__pyx_tuple__90);
  Py_VISIT(traverse_module_state->__pyx_tuple__91);
  Py_VISIT(traverse_module_state->__pyx_tuple__93);
  Py_VISIT(traverse_module_state->__pyx_tuple__96);
  Py_VISIT(traverse_module_state->__pyx_tuple__104);
  Py_VISIT(traverse_module_state->__pyx_tuple__106);
  Py_VISIT(traverse_module_state->__pyx_tuple__108);
  Py_VISIT(traverse_module_state->__pyx_tuple__111);
  Py_VISIT(traverse_module_state->__pyx_tuple__113);
  Py_VISIT(traverse_module_state->__pyx_tuple__117);
  Py_VISIT(traverse_module_state->__pyx_tuple__119);
  Py_VISIT(traverse_module_state->__pyx_tuple__121);
  Py_VISIT(traverse_module_state->__pyx_tuple__124);
  Py_VISIT(traverse_module_state->__pyx_tuple__133);
  Py_VISIT(traverse_module_state->__pyx_tuple__135);
  Py_VISIT(traverse_module_state->__pyx_tuple__138);
  Py_VISIT(traverse_module_state->__pyx_tuple__140);
  Py_VISIT(traverse_module_state->__pyx_tuple__144);
  Py_VISIT(traverse_module_state->__pyx_tuple__146);
  Py_VISIT(traverse_module_state->__pyx_tuple__148);
  Py_VISIT(traverse_module_state->__pyx_tuple__149);
  Py_VISIT(traverse_module_state->__pyx_tuple__151);
  Py_VISIT(traverse_module_state->__pyx_tuple__153);
  Py_VISIT(traverse_module_state->__pyx_tuple__155);
  Py_VISIT(traverse_module_state->__pyx_tuple__158);
  Py_VISIT(traverse_module_state->__pyx_tuple__160);
  Py_VISIT(traverse_module_state->__pyx_tuple__162);
  Py_VISIT(traverse_module_state->__pyx_tuple__166);
  Py_VISIT(traverse_module_state->__pyx_tuple__168);
  Py_VISIT(traverse_module_state->__pyx_tuple__176);
  Py_VISIT(traverse_module_state->__pyx_tuple__186);
  Py_VISIT(traverse_module_state->__pyx_tuple__192);
  Py_VISIT(traverse_module_state->__pyx_tuple__195);
  Py_VISIT(traverse_module_state->__pyx_tuple__205);
  Py_VISIT(traverse_module_state->__pyx_tuple__207);
  Py_VISIT(traverse_module_state->__pyx_tuple__209);
  Py_VISIT(traverse_module_state->__pyx_tuple__211);
  Py_VISIT(traverse_module_state->__pyx_tuple__217);
  Py_VISIT(traverse_module_state->__pyx_tuple__219);
  Py_VISIT(traverse_module_state->__pyx_tuple__220);
  Py_VISIT(traverse_module_state->__pyx_tuple__222);
  Py_VISIT(traverse_module_state->__pyx_tuple__223);
  Py_VISIT(traverse_module_state->__pyx_tuple__225);
  Py_VISIT(traverse_module_state->__pyx_tuple__229);
  Py_VISIT(traverse_module_state->__pyx_tuple__231);
  Py_VISIT(traverse_module_state->__pyx_tuple__233);
  Py_VISIT(traverse_module_state->__pyx_tuple__235);
  Py_VISIT(traverse_module_state->__pyx_tuple__238);
  Py_VISIT(traverse_module_state->__pyx_tuple__240);
  Py_VISIT(traverse_module_state->__pyx_codeobj__36);
  Py_VISIT(traverse_module_state->__pyx_codeobj__38);
  Py_VISIT(traverse_module_state->__pyx_codeobj__46);
  Py_VISIT(traverse_module_state->__pyx_codeobj__49);
  Py_VISIT(traverse_module_state->__pyx_codeobj__51);
  Py_VISIT(traverse_module_state->__pyx_codeobj__53);
  Py_VISIT(traverse_module_state->__pyx_codeobj__56);
  Py_VISIT(traverse_module_state->__pyx_codeobj__58);
  Py_VISIT(traverse_module_state->__pyx_codeobj__60);
  Py_VISIT(traverse_module_state->__pyx_codeobj__63);
  Py_VISIT(traverse_module_state->__pyx_codeobj__65);
  Py_VISIT(traverse_module_state->__pyx_codeobj__67);
  Py_VISIT(traverse_module_state->__pyx_codeobj__69);
  Py_VISIT(traverse_module_state->__pyx_codeobj__71);
  Py_VISIT(traverse_module_state->__pyx_codeobj__73);
  Py_VISIT(traverse_module_state->__pyx_codeobj__75);
  Py_VISIT(traverse_module_state->__pyx_codeobj__78);
  Py_VISIT(traverse_module_state->__pyx_codeobj__81);
  Py_VISIT(traverse_module_state->__pyx_codeobj__83);
  Py_VISIT(traverse_module_state->__pyx_codeobj__85);
  Py_VISIT(traverse_module_state->__pyx_codeobj__87);
  Py_VISIT(traverse_module_state->__pyx_codeobj__89);
  Py_VISIT(traverse_module_state->__pyx_codeobj__92);
  Py_VISIT(traverse_module_state->__pyx_codeobj__94);
  Py_VISIT(traverse_module_state->__pyx_codeobj__95);
  Py_VISIT(traverse_module_state->__pyx_codeobj__97);
  Py_VISIT(traverse_module_state->__pyx_codeobj__98);
  Py_VISIT(traverse_module_state->__pyx_codeobj__99);
  Py_VISIT(traverse_module_state->__pyx_codeobj__100);
  Py_VISIT(traverse_module_state->__pyx_codeobj__101);
  Py_VISIT(traverse_module_state->__pyx_codeobj__102);
  Py_VISIT(traverse_module_state->__pyx_codeobj__103);
  Py_VISIT(traverse_module_state->__pyx_codeobj__105);
  Py_VISIT(traverse_module_state->__pyx_codeobj__107);
  Py_VISIT(traverse_module_state->__pyx_codeobj__109);
  Py_VISIT(traverse_module_state->__pyx_codeobj__110);
  Py_VISIT(traverse_module_state->__pyx_codeobj__112);
  Py_VISIT(traverse_module_state->__pyx_codeobj__114);
  Py_VISIT(traverse_module_state->__pyx_codeobj__115);
  Py_VISIT(traverse_module_state->__pyx_codeobj__116);
  Py_VISIT(traverse_module_state->__pyx_codeobj__118);
  Py_VISIT(traverse_module_state->__pyx_codeobj__120);
  Py_VISIT(traverse_module_state->__pyx_codeobj__122);
  Py_VISIT(traverse_module_state->__pyx_codeobj__123);
  Py_VISIT(traverse_module_state->__pyx_codeobj__125);
  Py_VISIT(traverse_module_state->__pyx_codeobj__126);
  Py_VISIT(traverse_module_state->__pyx_codeobj__127);
  Py_VISIT(traverse_module_state->__pyx_codeobj__128);
  Py_VISIT(traverse_module_state->__pyx_codeobj__129);
  Py_VISIT(traverse_module_state->__pyx_codeobj__130);
  Py_VISIT(traverse_module_state->__pyx_codeobj__131);
  Py_VISIT(traverse_module_state->__pyx_codeobj__132);
  Py_VISIT(traverse_module_state->__pyx_codeobj__134);
  Py_VISIT(traverse_module_state->__pyx_codeobj__136);
  Py_VISIT(traverse_module_state->__pyx_codeobj__137);
  Py_VISIT(traverse_module_state->__pyx_codeobj__139);
  Py_VISIT(traverse_module_state->__pyx_codeobj__141);
  Py_VISIT(traverse_module_state->__pyx_codeobj__142);
  Py_VISIT(traverse_module_state->__pyx_codeobj__143);
  Py_VISIT(traverse_module_state->__pyx_codeobj__145);
  Py_VISIT(traverse_module_state->__pyx_codeobj__147);
  Py_VISIT(traverse_module_state->__pyx_codeobj__150);
  Py_VISIT(traverse_module_state->__pyx_codeobj__152);
  Py_VISIT(traverse_module_state->__pyx_codeobj__154);
  Py_VISIT(traverse_module_state->__pyx_codeobj__156);
  Py_VISIT(traverse_module_state->__pyx_codeobj__157);
  Py_VISIT(traverse_module_state->__pyx_codeobj__159);
  Py_VISIT(traverse_module_state->__pyx_codeobj__161);
  Py_VISIT(traverse_module_state->__pyx_codeobj__163);
  Py_VISIT(traverse_module_state->__pyx_codeobj__164);
  Py_VISIT(traverse_module_state->__pyx_codeobj__165);
  Py_VISIT(traverse_module_state->__pyx_codeobj__167);
  Py_VISIT(traverse_module_state->__pyx_codeobj__169);
  Py_VISIT(traverse_module_state->__pyx_codeobj__170);
  Py_VISIT(traverse_module_state->__pyx_codeobj__171);
  Py_VISIT(traverse_module_state->__pyx_codeobj__172);
  Py_VISIT(traverse_module_state->__pyx_codeobj__173);
  Py_VISIT(traverse_module_state->__pyx_codeobj__174);
  Py_VISIT(traverse_module_state->__pyx_codeobj__175);
  Py_VISIT(traverse_module_state->__pyx_codeobj__177);
  Py_VISIT(traverse_module_state->__pyx_codeobj__178);
  Py_VISIT(traverse_module_state->__pyx_codeobj__179);
  Py_VISIT(traverse_module_state->__pyx_codeobj__180);
  Py_VISIT(traverse_module_state->__pyx_codeobj__181);
  Py_VISIT(traverse_module_state->__pyx_codeobj__182);
  Py_VISIT(traverse_module_state->__pyx_codeobj__183);
  Py_VISIT(traverse_module_state->__pyx_codeobj__184);
  Py_VISIT(traverse_module_state->__pyx_codeobj__185);
  Py_VISIT(traverse_module_state->__pyx_codeobj__187);
  Py_VISIT(traverse_module_state->__pyx_codeobj__188);
  Py_VISIT(traverse_module_state->__pyx_codeobj__189);
  Py_VISIT(traverse_module_state->__pyx_codeobj__190);
  Py_VISIT(traverse_module_state->__pyx_codeobj__191);
  Py_VISIT(traverse_module_state->__pyx_codeobj__193);
  Py_VISIT(traverse_module_state->__pyx_codeobj__194);
  Py_VISIT(traverse_module_state->__pyx_codeobj__196);
  Py_VISIT(traverse_module_state->__pyx_codeobj__197);
  Py_VISIT(traverse_module_state->__pyx_codeobj__198);
  Py_VISIT(traverse_module_state->__pyx_codeobj__199);
  Py_VISIT(traverse_module_state->__pyx_codeobj__200);
  Py_VISIT(traverse_module_state->__pyx_codeobj__201);
  Py_VISIT(traverse_module_state->__pyx_codeobj__202);
  Py_VISIT(traverse_module_state->__pyx_codeobj__203);
  Py_VISIT(traverse_module_state->__pyx_codeobj__204);
  Py_VISIT(traverse_module_state->__pyx_codeobj__206);
  Py_VISIT(traverse_module_state->__pyx_codeobj__208);
  Py_VISIT(traverse_module_state->__pyx_codeobj__210);
  Py_VISIT(traverse_module_state->__pyx_codeobj__212);
  Py_VISIT(traverse_module_state->__pyx_codeobj__213);
  Py_VISIT(traverse_module_state->__pyx_codeobj__214);
  Py_VISIT(traverse_module_state->__pyx_codeobj__215);
  Py_VISIT(traverse_module_state->__pyx_codeobj__216);
  Py_VISIT(traverse_module_state->__pyx_codeobj__218);
  Py_VISIT(traverse_module_state->__pyx_codeobj__221);
  Py_VISIT(traverse_module_state->__pyx_codeobj__224);
  Py_VISIT(traverse_module_state->__pyx_codeobj__226);
  Py_VISIT(traverse_module_state->__pyx_codeobj__227);
  Py_VISIT(traverse_module_state->__pyx_codeobj__228);
  Py_VISIT(traverse_module_state->__pyx_codeobj__230);
  Py_VISIT(traverse_module_state->__pyx_codeobj__232);
  Py_VISIT(traverse_module_state->__pyx_codeobj__234);
  Py_VISIT(traverse_module_state->__pyx_codeobj__236);
  Py_VISIT(traverse_module_state->__pyx_codeobj__237);
  Py_VISIT(traverse_module_state->__pyx_codeobj__239);
  Py_VISIT(traverse_module_state->__pyx_codeobj__241);
  return 0;
}
#endif
/* #### Code section: module_state_defines ### */
#define __pyx_d __pyx_mstate_global->__pyx_d
#define __pyx_b __pyx_mstate_global->__pyx_b
#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
#ifdef __Pyx_CyFunction_USED
#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
#endif
#ifdef __Pyx_FusedFunction_USED
#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
#endif
#ifdef __Pyx_Generator_USED
#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
#endif
#ifdef __Pyx_IterableCoroutine_USED
#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
#endif
#ifdef __Pyx_Coroutine_USED
#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
#endif
#ifdef __Pyx_Coroutine_USED
#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_7cpython_4bool_bool __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_7cpython_7complex_complex __pyx_mstate_global->__pyx_ptype_7cpython_7complex_complex
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_5numpy_dtype __pyx_mstate_global->__pyx_ptype_5numpy_dtype
#define __pyx_ptype_5numpy_flatiter __pyx_mstate_global->__pyx_ptype_5numpy_flatiter
#define __pyx_ptype_5numpy_broadcast __pyx_mstate_global->__pyx_ptype_5numpy_broadcast
#define __pyx_ptype_5numpy_ndarray __pyx_mstate_global->__pyx_ptype_5numpy_ndarray
#define __pyx_ptype_5numpy_generic __pyx_mstate_global->__pyx_ptype_5numpy_generic
#define __pyx_ptype_5numpy_number __pyx_mstate_global->__pyx_ptype_5numpy_number
#define __pyx_ptype_5numpy_integer __pyx_mstate_global->__pyx_ptype_5numpy_integer
#define __pyx_ptype_5numpy_signedinteger __pyx_mstate_global->__pyx_ptype_5numpy_signedinteger
#define __pyx_ptype_5numpy_unsignedinteger __pyx_mstate_global->__pyx_ptype_5numpy_unsignedinteger
#define __pyx_ptype_5numpy_inexact __pyx_mstate_global->__pyx_ptype_5numpy_inexact
#define __pyx_ptype_5numpy_floating __pyx_mstate_global->__pyx_ptype_5numpy_floating
#define __pyx_ptype_5numpy_complexfloating __pyx_mstate_global->__pyx_ptype_5numpy_complexfloating
#define __pyx_ptype_5numpy_flexible __pyx_mstate_global->__pyx_ptype_5numpy_flexible
#define __pyx_ptype_5numpy_character __pyx_mstate_global->__pyx_ptype_5numpy_character
#define __pyx_ptype_5numpy_ufunc __pyx_mstate_global->__pyx_ptype_5numpy_ufunc
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_7cpython_8datetime_date __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_date
#define __pyx_ptype_7cpython_8datetime_time __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_time
#define __pyx_ptype_7cpython_8datetime_datetime __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_datetime
#define __pyx_ptype_7cpython_8datetime_timedelta __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_timedelta
#define __pyx_ptype_7cpython_8datetime_tzinfo __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_tzinfo
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_7cytimes_6parser_Configs __pyx_mstate_global->__pyx_ptype_7cytimes_6parser_Configs
#define __pyx_ptype_7cytimes_6parser_Result __pyx_mstate_global->__pyx_ptype_7cytimes_6parser_Result
#define __pyx_ptype_7cytimes_6parser_Parser __pyx_mstate_global->__pyx_ptype_7cytimes_6parser_Parser
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#define __pyx_type_7cytimes_4pddt___pyx_scope_struct__fromisocalendar __pyx_mstate_global->__pyx_type_7cytimes_4pddt___pyx_scope_struct__fromisocalendar
#endif
#define __pyx_ptype_7cytimes_4pddt___pyx_scope_struct__fromisocalendar __pyx_mstate_global->__pyx_ptype_7cytimes_4pddt___pyx_scope_struct__fromisocalendar
#define __pyx_kp_u_00 __pyx_mstate_global->__pyx_kp_u_00
#define __pyx_kp_u_00_00 __pyx_mstate_global->__pyx_kp_u_00_00
#define __pyx_kp_u_00_00_00_06d __pyx_mstate_global->__pyx_kp_u_00_00_00_06d
#define __pyx_kp_u_00_00_02d __pyx_mstate_global->__pyx_kp_u_00_00_02d
#define __pyx_kp_u_02d __pyx_mstate_global->__pyx_kp_u_02d
#define __pyx_kp_u_04d __pyx_mstate_global->__pyx_kp_u_04d
#define __pyx_kp_u_06d __pyx_mstate_global->__pyx_kp_u_06d
#define __pyx_kp_u_06d_2 __pyx_mstate_global->__pyx_kp_u_06d_2
#define __pyx_kp_u_2d __pyx_mstate_global->__pyx_kp_u_2d
#define __pyx_kp_s_A_drop_in_replacement_for_Pandas __pyx_mstate_global->__pyx_kp_s_A_drop_in_replacement_for_Pandas
#define __pyx_kp_u_Adjust_the_date_and_time_fields __pyx_mstate_global->__pyx_kp_u_Adjust_the_date_and_time_fields
#define __pyx_kp_u_Adjust_the_date_to_the_specific __pyx_mstate_global->__pyx_kp_u_Adjust_the_date_to_the_specific
#define __pyx_kp_u_Adjust_the_date_to_the_specific_2 __pyx_mstate_global->__pyx_kp_u_Adjust_the_date_to_the_specific_2
#define __pyx_kp_u_Adjust_the_date_to_the_specific_3 __pyx_mstate_global->__pyx_kp_u_Adjust_the_date_to_the_specific_3
#define __pyx_kp_u_Adjust_the_date_to_the_specific_4 __pyx_mstate_global->__pyx_kp_u_Adjust_the_date_to_the_specific_4
#define __pyx_kp_u_Adjust_the_date_to_the_specified __pyx_mstate_global->__pyx_kp_u_Adjust_the_date_to_the_specified
#define __pyx_kp_u_Adjust_the_date_to_the_specified_10 __pyx_mstate_global->__pyx_kp_u_Adjust_the_date_to_the_specified_10
#define __pyx_kp_u_Adjust_the_date_to_the_specified_11 __pyx_mstate_global->__pyx_kp_u_Adjust_the_date_to_the_specified_11
#define __pyx_kp_u_Adjust_the_date_to_the_specified_12 __pyx_mstate_global->__pyx_kp_u_Adjust_the_date_to_the_specified_12
#define __pyx_kp_u_Adjust_the_date_to_the_specified_2 __pyx_mstate_global->__pyx_kp_u_Adjust_the_date_to_the_specified_2
#define __pyx_kp_u_Adjust_the_date_to_the_specified_3 __pyx_mstate_global->__pyx_kp_u_Adjust_the_date_to_the_specified_3
#define __pyx_kp_u_Adjust_the_date_to_the_specified_4 __pyx_mstate_global->__pyx_kp_u_Adjust_the_date_to_the_specified_4
#define __pyx_kp_u_Adjust_the_date_to_the_specified_5 __pyx_mstate_global->__pyx_kp_u_Adjust_the_date_to_the_specified_5
#define __pyx_kp_u_Adjust_the_date_to_the_specified_6 __pyx_mstate_global->__pyx_kp_u_Adjust_the_date_to_the_specified_6
#define __pyx_kp_u_Adjust_the_date_to_the_specified_7 __pyx_mstate_global->__pyx_kp_u_Adjust_the_date_to_the_specified_7
#define __pyx_kp_u_Adjust_the_date_to_the_specified_8 __pyx_mstate_global->__pyx_kp_u_Adjust_the_date_to_the_specified_8
#define __pyx_kp_u_Adjust_the_date_to_the_specified_9 __pyx_mstate_global->__pyx_kp_u_Adjust_the_date_to_the_specified_9
#define __pyx_kp_u_Adjust_the_date_with_new_values __pyx_mstate_global->__pyx_kp_u_Adjust_the_date_with_new_values
#define __pyx_kp_u_Adjust_the_time_fields_with_new __pyx_mstate_global->__pyx_kp_u_Adjust_the_time_fields_with_new
#define __pyx_n_s_AmbiguousTimeError __pyx_mstate_global->__pyx_n_s_AmbiguousTimeError
#define __pyx_n_u_Apr __pyx_mstate_global->__pyx_n_u_Apr
#define __pyx_kp_u_Array_with_dtype_of_datetime64 __pyx_mstate_global->__pyx_kp_u_Array_with_dtype_of_datetime64
#define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError
#define __pyx_n_u_Aug __pyx_mstate_global->__pyx_n_u_Aug
#define __pyx_n_s_Configs __pyx_mstate_global->__pyx_n_s_Configs
#define __pyx_kp_u_Conversion_limits_to_datetime_u __pyx_mstate_global->__pyx_kp_u_Conversion_limits_to_datetime_u
#define __pyx_n_u_D __pyx_mstate_global->__pyx_n_u_D
#define __pyx_n_s_DataFrame __pyx_mstate_global->__pyx_n_s_DataFrame
#define __pyx_n_s_DateParseError __pyx_mstate_global->__pyx_n_s_DateParseError
#define __pyx_n_s_DatetimeArray __pyx_mstate_global->__pyx_n_s_DatetimeArray
#define __pyx_n_s_DatetimeIndex __pyx_mstate_global->__pyx_n_s_DatetimeIndex
#define __pyx_n_u_Dec __pyx_mstate_global->__pyx_n_u_Dec
#define __pyx_n_u_Feb __pyx_mstate_global->__pyx_n_u_Feb
#define __pyx_kp_u_For_comparision_array_size_must __pyx_mstate_global->__pyx_kp_u_For_comparision_array_size_must
#define __pyx_n_u_Fri __pyx_mstate_global->__pyx_n_u_Fri
#define __pyx_kp_u_H_M_S_f_z __pyx_mstate_global->__pyx_kp_u_H_M_S_f_z
#define __pyx_n_s_Hashable __pyx_mstate_global->__pyx_n_s_Hashable
#define __pyx_kp_s_Hashable_None __pyx_mstate_global->__pyx_kp_s_Hashable_None
#define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError
#define __pyx_n_s_IncomparableError __pyx_mstate_global->__pyx_n_s_IncomparableError
#define __pyx_n_s_Index __pyx_mstate_global->__pyx_n_s_Index
#define __pyx_kp_s_Index_bool __pyx_mstate_global->__pyx_kp_s_Index_bool
#define __pyx_kp_s_Index_np_float64 __pyx_mstate_global->__pyx_kp_s_Index_np_float64
#define __pyx_kp_s_Index_np_int64 __pyx_mstate_global->__pyx_kp_s_Index_np_int64
#define __pyx_kp_s_Index_str __pyx_mstate_global->__pyx_kp_s_Index_str
#define __pyx_n_s_InvalidArgumentError __pyx_mstate_global->__pyx_n_s_InvalidArgumentError
#define __pyx_n_s_InvalidFspError __pyx_mstate_global->__pyx_n_s_InvalidFspError
#define __pyx_n_s_InvalidMonthError __pyx_mstate_global->__pyx_n_s_InvalidMonthError
#define __pyx_n_s_InvalidTimeUnitError __pyx_mstate_global->__pyx_n_s_InvalidTimeUnitError
#define __pyx_n_s_InvalidTimezoneError __pyx_mstate_global->__pyx_n_s_InvalidTimezoneError
#define __pyx_n_s_InvalidTypeError __pyx_mstate_global->__pyx_n_s_InvalidTypeError
#define __pyx_n_s_InvalidWeekdayError __pyx_mstate_global->__pyx_n_s_InvalidWeekdayError
#define __pyx_n_u_Jan __pyx_mstate_global->__pyx_n_u_Jan
#define __pyx_n_u_Jul __pyx_mstate_global->__pyx_n_u_Jul
#define __pyx_n_u_Jun __pyx_mstate_global->__pyx_n_u_Jun
#define __pyx_n_s_Literal __pyx_mstate_global->__pyx_n_s_Literal
#define __pyx_n_u_M __pyx_mstate_global->__pyx_n_u_M
#define __pyx_n_u_Mar __pyx_mstate_global->__pyx_n_u_Mar
#define __pyx_n_u_May __pyx_mstate_global->__pyx_n_u_May
#define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError
#define __pyx_n_u_Mon __pyx_mstate_global->__pyx_n_u_Mon
#define __pyx_n_u_NaT __pyx_mstate_global->__pyx_n_u_NaT
#define __pyx_kp_u_None __pyx_mstate_global->__pyx_kp_u_None
#define __pyx_n_u_Nov __pyx_mstate_global->__pyx_n_u_Nov
#define __pyx_n_u_Oct __pyx_mstate_global->__pyx_n_u_Oct
#define __pyx_n_s_OutOfBoundsDatetime __pyx_mstate_global->__pyx_n_s_OutOfBoundsDatetime
#define __pyx_n_s_OutOfBoundsDatetimeError __pyx_mstate_global->__pyx_n_s_OutOfBoundsDatetimeError
#define __pyx_n_s_OverflowError __pyx_mstate_global->__pyx_n_s_OverflowError
#define __pyx_n_s_ParserError __pyx_mstate_global->__pyx_n_s_ParserError
#define __pyx_n_s_Pddt __pyx_mstate_global->__pyx_n_s_Pddt
#define __pyx_n_u_Pddt __pyx_mstate_global->__pyx_n_u_Pddt
#define __pyx_n_s_Pddt___new __pyx_mstate_global->__pyx_n_s_Pddt___new
#define __pyx_n_s_Pddt__to_curr_weekday __pyx_mstate_global->__pyx_n_s_Pddt__to_curr_weekday
#define __pyx_n_s_Pddt_add __pyx_mstate_global->__pyx_n_s_Pddt_add
#define __pyx_n_s_Pddt_as_unit __pyx_mstate_global->__pyx_n_s_Pddt_as_unit
#define __pyx_n_s_Pddt_astimezone __pyx_mstate_global->__pyx_n_s_Pddt_astimezone
#define __pyx_n_s_Pddt_ceil __pyx_mstate_global->__pyx_n_s_Pddt_ceil
#define __pyx_n_s_Pddt_closest __pyx_mstate_global->__pyx_n_s_Pddt_closest
#define __pyx_n_s_Pddt_combine __pyx_mstate_global->__pyx_n_s_Pddt_combine
#define __pyx_n_s_Pddt_ctime __pyx_mstate_global->__pyx_n_s_Pddt_ctime
#define __pyx_n_s_Pddt_date __pyx_mstate_global->__pyx_n_s_Pddt_date
#define __pyx_n_s_Pddt_date_range __pyx_mstate_global->__pyx_n_s_Pddt_date_range
#define __pyx_n_s_Pddt_datetime __pyx_mstate_global->__pyx_n_s_Pddt_datetime
#define __pyx_n_s_Pddt_day __pyx_mstate_global->__pyx_n_s_Pddt_day
#define __pyx_n_s_Pddt_days_bf_month __pyx_mstate_global->__pyx_n_s_Pddt_days_bf_month
#define __pyx_n_s_Pddt_days_bf_quarter __pyx_mstate_global->__pyx_n_s_Pddt_days_bf_quarter
#define __pyx_n_s_Pddt_days_bf_year __pyx_mstate_global->__pyx_n_s_Pddt_days_bf_year
#define __pyx_n_s_Pddt_days_in_month __pyx_mstate_global->__pyx_n_s_Pddt_days_in_month
#define __pyx_n_s_Pddt_days_in_quarter __pyx_mstate_global->__pyx_n_s_Pddt_days_in_quarter
#define __pyx_n_s_Pddt_days_in_year __pyx_mstate_global->__pyx_n_s_Pddt_days_in_year
#define __pyx_n_s_Pddt_days_of_month __pyx_mstate_global->__pyx_n_s_Pddt_days_of_month
#define __pyx_kp_u_Pddt_days_of_month_line_3389 __pyx_mstate_global->__pyx_kp_u_Pddt_days_of_month_line_3389
#define __pyx_n_s_Pddt_days_of_quarter __pyx_mstate_global->__pyx_n_s_Pddt_days_of_quarter
#define __pyx_n_s_Pddt_days_of_year __pyx_mstate_global->__pyx_n_s_Pddt_days_of_year
#define __pyx_n_s_Pddt_diff __pyx_mstate_global->__pyx_n_s_Pddt_diff
#define __pyx_n_s_Pddt_farthest __pyx_mstate_global->__pyx_n_s_Pddt_farthest
#define __pyx_n_s_Pddt_floor __pyx_mstate_global->__pyx_n_s_Pddt_floor
#define __pyx_n_s_Pddt_fromdate __pyx_mstate_global->__pyx_n_s_Pddt_fromdate
#define __pyx_n_s_Pddt_fromdatetime __pyx_mstate_global->__pyx_n_s_Pddt_fromdatetime
#define __pyx_n_s_Pddt_fromdatetime64 __pyx_mstate_global->__pyx_n_s_Pddt_fromdatetime64
#define __pyx_n_s_Pddt_fromicroseconds __pyx_mstate_global->__pyx_n_s_Pddt_fromicroseconds
#define __pyx_n_s_Pddt_fromisocalendar __pyx_mstate_global->__pyx_n_s_Pddt_fromisocalendar
#define __pyx_n_s_Pddt_fromisocalendar_locals__par __pyx_mstate_global->__pyx_n_s_Pddt_fromisocalendar_locals__par
#define __pyx_n_s_Pddt_fromisocalendar_locals__par_2 __pyx_mstate_global->__pyx_n_s_Pddt_fromisocalendar_locals__par_2
#define __pyx_n_s_Pddt_fromisoformat __pyx_mstate_global->__pyx_n_s_Pddt_fromisoformat
#define __pyx_n_s_Pddt_fromordinal __pyx_mstate_global->__pyx_n_s_Pddt_fromordinal
#define __pyx_n_s_Pddt_fromseconds __pyx_mstate_global->__pyx_n_s_Pddt_fromseconds
#define __pyx_n_s_Pddt_fromtimestamp __pyx_mstate_global->__pyx_n_s_Pddt_fromtimestamp
#define __pyx_n_s_Pddt_fsp __pyx_mstate_global->__pyx_n_s_Pddt_fsp
#define __pyx_n_s_Pddt_hour __pyx_mstate_global->__pyx_n_s_Pddt_hour
#define __pyx_n_s_Pddt_is_day __pyx_mstate_global->__pyx_n_s_Pddt_is_day
#define __pyx_n_s_Pddt_is_end_of __pyx_mstate_global->__pyx_n_s_Pddt_is_end_of
#define __pyx_n_s_Pddt_is_first_of __pyx_mstate_global->__pyx_n_s_Pddt_is_first_of
#define __pyx_n_s_Pddt_is_future __pyx_mstate_global->__pyx_n_s_Pddt_is_future
#define __pyx_n_s_Pddt_is_last_of __pyx_mstate_global->__pyx_n_s_Pddt_is_last_of
#define __pyx_n_s_Pddt_is_leap_year __pyx_mstate_global->__pyx_n_s_Pddt_is_leap_year
#define __pyx_n_s_Pddt_is_local __pyx_mstate_global->__pyx_n_s_Pddt_is_local
#define __pyx_n_s_Pddt_is_long_year __pyx_mstate_global->__pyx_n_s_Pddt_is_long_year
#define __pyx_n_s_Pddt_is_month __pyx_mstate_global->__pyx_n_s_Pddt_is_month
#define __pyx_n_s_Pddt_is_past __pyx_mstate_global->__pyx_n_s_Pddt_is_past
#define __pyx_n_s_Pddt_is_quarter __pyx_mstate_global->__pyx_n_s_Pddt_is_quarter
#define __pyx_n_s_Pddt_is_start_of __pyx_mstate_global->__pyx_n_s_Pddt_is_start_of
#define __pyx_n_s_Pddt_is_utc __pyx_mstate_global->__pyx_n_s_Pddt_is_utc
#define __pyx_n_s_Pddt_is_weekday __pyx_mstate_global->__pyx_n_s_Pddt_is_weekday
#define __pyx_n_s_Pddt_is_year __pyx_mstate_global->__pyx_n_s_Pddt_is_year
#define __pyx_n_s_Pddt_isocalendar __pyx_mstate_global->__pyx_n_s_Pddt_isocalendar
#define __pyx_n_s_Pddt_isoformat __pyx_mstate_global->__pyx_n_s_Pddt_isoformat
#define __pyx_n_s_Pddt_isoweek __pyx_mstate_global->__pyx_n_s_Pddt_isoweek
#define __pyx_n_s_Pddt_isoweekday __pyx_mstate_global->__pyx_n_s_Pddt_isoweekday
#define __pyx_n_s_Pddt_isoyear __pyx_mstate_global->__pyx_n_s_Pddt_isoyear
#define __pyx_n_s_Pddt_leap_bt_year __pyx_mstate_global->__pyx_n_s_Pddt_leap_bt_year
#define __pyx_n_s_Pddt_microsecond __pyx_mstate_global->__pyx_n_s_Pddt_microsecond
#define __pyx_n_s_Pddt_microseconds __pyx_mstate_global->__pyx_n_s_Pddt_microseconds
#define __pyx_n_s_Pddt_millisecond __pyx_mstate_global->__pyx_n_s_Pddt_millisecond
#define __pyx_n_s_Pddt_minute __pyx_mstate_global->__pyx_n_s_Pddt_minute
#define __pyx_n_s_Pddt_month __pyx_mstate_global->__pyx_n_s_Pddt_month
#define __pyx_n_s_Pddt_nanosecond __pyx_mstate_global->__pyx_n_s_Pddt_nanosecond
#define __pyx_n_s_Pddt_now __pyx_mstate_global->__pyx_n_s_Pddt_now
#define __pyx_n_s_Pddt_parse __pyx_mstate_global->__pyx_n_s_Pddt_parse
#define __pyx_n_s_Pddt_quarter __pyx_mstate_global->__pyx_n_s_Pddt_quarter
#define __pyx_n_s_Pddt_replace __pyx_mstate_global->__pyx_n_s_Pddt_replace
#define __pyx_n_s_Pddt_round __pyx_mstate_global->__pyx_n_s_Pddt_round
#define __pyx_n_s_Pddt_second __pyx_mstate_global->__pyx_n_s_Pddt_second
#define __pyx_n_s_Pddt_seconds __pyx_mstate_global->__pyx_n_s_Pddt_seconds
#define __pyx_n_s_Pddt_snap __pyx_mstate_global->__pyx_n_s_Pddt_snap
#define __pyx_kp_u_Pddt_snap_line_2367 __pyx_mstate_global->__pyx_kp_u_Pddt_snap_line_2367
#define __pyx_n_s_Pddt_strptime __pyx_mstate_global->__pyx_n_s_Pddt_strptime
#define __pyx_n_s_Pddt_sub __pyx_mstate_global->__pyx_n_s_Pddt_sub
#define __pyx_n_s_Pddt_time __pyx_mstate_global->__pyx_n_s_Pddt_time
#define __pyx_n_s_Pddt_timedf __pyx_mstate_global->__pyx_n_s_Pddt_timedf
#define __pyx_n_s_Pddt_timestamp __pyx_mstate_global->__pyx_n_s_Pddt_timestamp
#define __pyx_n_s_Pddt_timetz __pyx_mstate_global->__pyx_n_s_Pddt_timetz
#define __pyx_n_s_Pddt_to_curr_month __pyx_mstate_global->__pyx_n_s_Pddt_to_curr_month
#define __pyx_kp_u_Pddt_to_curr_month_line_2028 __pyx_mstate_global->__pyx_kp_u_Pddt_to_curr_month_line_2028
#define __pyx_n_s_Pddt_to_curr_quarter __pyx_mstate_global->__pyx_n_s_Pddt_to_curr_quarter
#define __pyx_kp_u_Pddt_to_curr_quarter_line_1853 __pyx_mstate_global->__pyx_kp_u_Pddt_to_curr_quarter_line_1853
#define __pyx_n_s_Pddt_to_curr_weekday __pyx_mstate_global->__pyx_n_s_Pddt_to_curr_weekday
#define __pyx_kp_u_Pddt_to_curr_weekday_line_2200 __pyx_mstate_global->__pyx_kp_u_Pddt_to_curr_weekday_line_2200
#define __pyx_n_s_Pddt_to_curr_year __pyx_mstate_global->__pyx_n_s_Pddt_to_curr_year
#define __pyx_kp_u_Pddt_to_curr_year_line_1652 __pyx_mstate_global->__pyx_kp_u_Pddt_to_curr_year_line_1652
#define __pyx_n_s_Pddt_to_date __pyx_mstate_global->__pyx_n_s_Pddt_to_date
#define __pyx_kp_u_Pddt_to_date_line_2527 __pyx_mstate_global->__pyx_kp_u_Pddt_to_date_line_2527
#define __pyx_n_s_Pddt_to_datetime __pyx_mstate_global->__pyx_n_s_Pddt_to_datetime
#define __pyx_kp_u_Pddt_to_datetime_line_2383 __pyx_mstate_global->__pyx_kp_u_Pddt_to_datetime_line_2383
#define __pyx_n_s_Pddt_to_day __pyx_mstate_global->__pyx_n_s_Pddt_to_day
#define __pyx_n_s_Pddt_to_end_of __pyx_mstate_global->__pyx_n_s_Pddt_to_end_of
#define __pyx_n_s_Pddt_to_first_of __pyx_mstate_global->__pyx_n_s_Pddt_to_first_of
#define __pyx_n_s_Pddt_to_friday __pyx_mstate_global->__pyx_n_s_Pddt_to_friday
#define __pyx_n_s_Pddt_to_last_of __pyx_mstate_global->__pyx_n_s_Pddt_to_last_of
#define __pyx_n_s_Pddt_to_monday __pyx_mstate_global->__pyx_n_s_Pddt_to_monday
#define __pyx_n_s_Pddt_to_month __pyx_mstate_global->__pyx_n_s_Pddt_to_month
#define __pyx_kp_u_Pddt_to_month_line_2109 __pyx_mstate_global->__pyx_kp_u_Pddt_to_month_line_2109
#define __pyx_n_s_Pddt_to_next_month __pyx_mstate_global->__pyx_n_s_Pddt_to_next_month
#define __pyx_kp_u_Pddt_to_next_month_line_2096 __pyx_mstate_global->__pyx_kp_u_Pddt_to_next_month_line_2096
#define __pyx_n_s_Pddt_to_next_quarter __pyx_mstate_global->__pyx_n_s_Pddt_to_next_quarter
#define __pyx_kp_u_Pddt_to_next_quarter_line_1935 __pyx_mstate_global->__pyx_kp_u_Pddt_to_next_quarter_line_1935
#define __pyx_n_s_Pddt_to_next_weekday __pyx_mstate_global->__pyx_n_s_Pddt_to_next_weekday
#define __pyx_kp_u_Pddt_to_next_weekday_line_2228 __pyx_mstate_global->__pyx_kp_u_Pddt_to_next_weekday_line_2228
#define __pyx_n_s_Pddt_to_next_year __pyx_mstate_global->__pyx_n_s_Pddt_to_next_year
#define __pyx_kp_u_Pddt_to_next_year_line_1748 __pyx_mstate_global->__pyx_kp_u_Pddt_to_next_year_line_1748
#define __pyx_n_s_Pddt_to_prev_month __pyx_mstate_global->__pyx_n_s_Pddt_to_prev_month
#define __pyx_kp_u_Pddt_to_prev_month_line_2083 __pyx_mstate_global->__pyx_kp_u_Pddt_to_prev_month_line_2083
#define __pyx_n_s_Pddt_to_prev_quarter __pyx_mstate_global->__pyx_n_s_Pddt_to_prev_quarter
#define __pyx_kp_u_Pddt_to_prev_quarter_line_1918 __pyx_mstate_global->__pyx_kp_u_Pddt_to_prev_quarter_line_1918
#define __pyx_n_s_Pddt_to_prev_weekday __pyx_mstate_global->__pyx_n_s_Pddt_to_prev_weekday
#define __pyx_kp_u_Pddt_to_prev_weekday_line_2214 __pyx_mstate_global->__pyx_kp_u_Pddt_to_prev_weekday_line_2214
#define __pyx_n_s_Pddt_to_prev_year __pyx_mstate_global->__pyx_n_s_Pddt_to_prev_year
#define __pyx_kp_u_Pddt_to_prev_year_line_1725 __pyx_mstate_global->__pyx_kp_u_Pddt_to_prev_year_line_1725
#define __pyx_n_s_Pddt_to_quarter __pyx_mstate_global->__pyx_n_s_Pddt_to_quarter
#define __pyx_kp_u_Pddt_to_quarter_line_1952 __pyx_mstate_global->__pyx_kp_u_Pddt_to_quarter_line_1952
#define __pyx_n_s_Pddt_to_saturday __pyx_mstate_global->__pyx_n_s_Pddt_to_saturday
#define __pyx_n_s_Pddt_to_start_of __pyx_mstate_global->__pyx_n_s_Pddt_to_start_of
#define __pyx_n_s_Pddt_to_sunday __pyx_mstate_global->__pyx_n_s_Pddt_to_sunday
#define __pyx_n_s_Pddt_to_thursday __pyx_mstate_global->__pyx_n_s_Pddt_to_thursday
#define __pyx_n_s_Pddt_to_time __pyx_mstate_global->__pyx_n_s_Pddt_to_time
#define __pyx_kp_u_Pddt_to_time_line_2588 __pyx_mstate_global->__pyx_kp_u_Pddt_to_time_line_2588
#define __pyx_n_s_Pddt_to_tomorrow __pyx_mstate_global->__pyx_n_s_Pddt_to_tomorrow
#define __pyx_n_s_Pddt_to_tuesday __pyx_mstate_global->__pyx_n_s_Pddt_to_tuesday
#define __pyx_n_s_Pddt_to_wednesday __pyx_mstate_global->__pyx_n_s_Pddt_to_wednesday
#define __pyx_n_s_Pddt_to_weekday __pyx_mstate_global->__pyx_n_s_Pddt_to_weekday
#define __pyx_kp_u_Pddt_to_weekday_line_2242 __pyx_mstate_global->__pyx_kp_u_Pddt_to_weekday_line_2242
#define __pyx_n_s_Pddt_to_year __pyx_mstate_global->__pyx_n_s_Pddt_to_year
#define __pyx_kp_u_Pddt_to_year_line_1771 __pyx_mstate_global->__pyx_kp_u_Pddt_to_year_line_1771
#define __pyx_n_s_Pddt_to_yesterday __pyx_mstate_global->__pyx_n_s_Pddt_to_yesterday
#define __pyx_n_s_Pddt_today __pyx_mstate_global->__pyx_n_s_Pddt_today
#define __pyx_n_s_Pddt_toordinal __pyx_mstate_global->__pyx_n_s_Pddt_toordinal
#define __pyx_n_s_Pddt_tz_available __pyx_mstate_global->__pyx_n_s_Pddt_tz_available
#define __pyx_kp_u_Pddt_tz_available_line_3574 __pyx_mstate_global->__pyx_kp_u_Pddt_tz_available_line_3574
#define __pyx_n_s_Pddt_tz_convert __pyx_mstate_global->__pyx_n_s_Pddt_tz_convert
#define __pyx_n_s_Pddt_tz_localize __pyx_mstate_global->__pyx_n_s_Pddt_tz_localize
#define __pyx_n_s_Pddt_tz_switch __pyx_mstate_global->__pyx_n_s_Pddt_tz_switch
#define __pyx_n_s_Pddt_tzname __pyx_mstate_global->__pyx_n_s_Pddt_tzname
#define __pyx_n_s_Pddt_utcfromtimestamp __pyx_mstate_global->__pyx_n_s_Pddt_utcfromtimestamp
#define __pyx_n_s_Pddt_utcnow __pyx_mstate_global->__pyx_n_s_Pddt_utcnow
#define __pyx_n_s_Pddt_utctimedf __pyx_mstate_global->__pyx_n_s_Pddt_utctimedf
#define __pyx_n_s_Pddt_values_naive __pyx_mstate_global->__pyx_n_s_Pddt_values_naive
#define __pyx_n_s_Pddt_weekday __pyx_mstate_global->__pyx_n_s_Pddt_weekday
#define __pyx_n_s_Pddt_year __pyx_mstate_global->__pyx_n_s_Pddt_year
#define __pyx_n_u_Q __pyx_mstate_global->__pyx_n_u_Q
#define __pyx_kp_u_Return_the_number_of_days_1_31_s __pyx_mstate_global->__pyx_kp_u_Return_the_number_of_days_1_31_s
#define __pyx_n_s_RuntimeError __pyx_mstate_global->__pyx_n_s_RuntimeError
#define __pyx_n_u_S __pyx_mstate_global->__pyx_n_u_S
#define __pyx_n_u_Sat __pyx_mstate_global->__pyx_n_u_Sat
#define __pyx_n_s_Self __pyx_mstate_global->__pyx_n_s_Self
#define __pyx_n_u_Sep __pyx_mstate_global->__pyx_n_u_Sep
#define __pyx_n_s_Series __pyx_mstate_global->__pyx_n_s_Series
#define __pyx_kp_u_Snap_to_nearest_occurring_freque __pyx_mstate_global->__pyx_kp_u_Snap_to_nearest_occurring_freque
#define __pyx_n_u_Sun __pyx_mstate_global->__pyx_n_u_Sun
#define __pyx_n_u_T __pyx_mstate_global->__pyx_n_u_T
#define __pyx_kp_u_The_available_timezone_names_set __pyx_mstate_global->__pyx_kp_u_The_available_timezone_names_set
#define __pyx_n_u_Thu __pyx_mstate_global->__pyx_n_u_Thu
#define __pyx_kp_u_Time_zones_are_not_available_fro __pyx_mstate_global->__pyx_kp_u_Time_zones_are_not_available_fro
#define __pyx_n_s_Timestamp __pyx_mstate_global->__pyx_n_s_Timestamp
#define __pyx_kp_u_Timezone_aware __pyx_mstate_global->__pyx_kp_u_Timezone_aware
#define __pyx_kp_u_Timezone_naive __pyx_mstate_global->__pyx_kp_u_Timezone_naive
#define __pyx_n_u_Tue __pyx_mstate_global->__pyx_n_u_Tue
#define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError
#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError
#define __pyx_n_u_W __pyx_mstate_global->__pyx_n_u_W
#define __pyx_n_u_Wed __pyx_mstate_global->__pyx_n_u_Wed
#define __pyx_n_u_Y __pyx_mstate_global->__pyx_n_u_Y
#define __pyx_kp_u_Y_m_d __pyx_mstate_global->__pyx_kp_u_Y_m_d
#define __pyx_n_s_ZeroDivisionError __pyx_mstate_global->__pyx_n_s_ZeroDivisionError
#define __pyx_kp_u__10 __pyx_mstate_global->__pyx_kp_u__10
#define __pyx_kp_u__11 __pyx_mstate_global->__pyx_kp_u__11
#define __pyx_kp_u__12 __pyx_mstate_global->__pyx_kp_u__12
#define __pyx_kp_u__13 __pyx_mstate_global->__pyx_kp_u__13
#define __pyx_kp_u__14 __pyx_mstate_global->__pyx_kp_u__14
#define __pyx_kp_u__15 __pyx_mstate_global->__pyx_kp_u__15
#define __pyx_kp_u__19 __pyx_mstate_global->__pyx_kp_u__19
#define __pyx_n_s__242 __pyx_mstate_global->__pyx_n_s__242
#define __pyx_kp_u__43 __pyx_mstate_global->__pyx_kp_u__43
#define __pyx_n_s__44 __pyx_mstate_global->__pyx_n_s__44
#define __pyx_n_s__79 __pyx_mstate_global->__pyx_n_s__79
#define __pyx_kp_u__9 __pyx_mstate_global->__pyx_kp_u__9
#define __pyx_kp_u_a_b_d_H_M_S_Y __pyx_mstate_global->__pyx_kp_u_a_b_d_H_M_S_Y
#define __pyx_n_s_absolute __pyx_mstate_global->__pyx_n_s_absolute
#define __pyx_n_s_add __pyx_mstate_global->__pyx_n_s_add
#define __pyx_n_s_all __pyx_mstate_global->__pyx_n_s_all
#define __pyx_n_s_ambiguous __pyx_mstate_global->__pyx_n_s_ambiguous
#define __pyx_kp_u_ambiguous_NaT_is_not_supported __pyx_mstate_global->__pyx_kp_u_ambiguous_NaT_is_not_supported
#define __pyx_n_s_arr __pyx_mstate_global->__pyx_n_s_arr
#define __pyx_n_s_arr_ptr __pyx_mstate_global->__pyx_n_s_arr_ptr
#define __pyx_n_s_arr_size __pyx_mstate_global->__pyx_n_s_arr_size
#define __pyx_kp_u_array_size_must_be_and_integer_0 __pyx_mstate_global->__pyx_kp_u_array_size_must_be_and_integer_0
#define __pyx_kp_u_array_size_must_be_greater_than __pyx_mstate_global->__pyx_kp_u_array_size_must_be_greater_than
#define __pyx_n_u_as __pyx_mstate_global->__pyx_n_u_as
#define __pyx_n_s_as_unit __pyx_mstate_global->__pyx_n_s_as_unit
#define __pyx_n_s_astimezone __pyx_mstate_global->__pyx_n_s_astimezone
#define __pyx_n_s_astype __pyx_mstate_global->__pyx_n_s_astype
#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
#define __pyx_n_s_available_timezones __pyx_mstate_global->__pyx_n_s_available_timezones
#define __pyx_n_s_available_timezones_2 __pyx_mstate_global->__pyx_n_s_available_timezones_2
#define __pyx_n_s_base_tz __pyx_mstate_global->__pyx_n_s_base_tz
#define __pyx_kp_u_between_naive_aware_datetimes_T __pyx_mstate_global->__pyx_kp_u_between_naive_aware_datetimes_T
#define __pyx_kp_u_between_naive_aware_datetimes_T_2 __pyx_mstate_global->__pyx_kp_u_between_naive_aware_datetimes_T_2
#define __pyx_n_s_bool __pyx_mstate_global->__pyx_n_s_bool
#define __pyx_kp_s_bool_None __pyx_mstate_global->__pyx_kp_s_bool_None
#define __pyx_n_u_both __pyx_mstate_global->__pyx_n_u_both
#define __pyx_kp_u_calcuate_average __pyx_mstate_global->__pyx_kp_u_calcuate_average
#define __pyx_kp_u_cannot __pyx_mstate_global->__pyx_kp_u_cannot
#define __pyx_kp_u_cannot_access_the_time_value_fro __pyx_mstate_global->__pyx_kp_u_cannot_access_the_time_value_fro
#define __pyx_kp_u_cannot_cast __pyx_mstate_global->__pyx_kp_u_cannot_cast
#define __pyx_kp_u_cannot_cast_ndarray __pyx_mstate_global->__pyx_kp_u_cannot_cast_ndarray
#define __pyx_kp_u_cannot_cast_ndarray_2 __pyx_mstate_global->__pyx_kp_u_cannot_cast_ndarray_2
#define __pyx_kp_u_cannot_ceil_to_multiple_0 __pyx_mstate_global->__pyx_kp_u_cannot_ceil_to_multiple_0
#define __pyx_kp_u_cannot_check_if_ndarray_s_is_wit __pyx_mstate_global->__pyx_kp_u_cannot_check_if_ndarray_s_is_wit
#define __pyx_kp_u_cannot_check_ndarray __pyx_mstate_global->__pyx_kp_u_cannot_check_ndarray
#define __pyx_kp_u_cannot_compare_between_arrays_wi __pyx_mstate_global->__pyx_kp_u_cannot_compare_between_arrays_wi
#define __pyx_kp_u_cannot_compare_ndarrays_with_dif __pyx_mstate_global->__pyx_kp_u_cannot_compare_ndarrays_with_dif
#define __pyx_kp_u_cannot_convert_ndarray __pyx_mstate_global->__pyx_kp_u_cannot_convert_ndarray
#define __pyx_kp_u_cannot_convert_ndarray_from_date __pyx_mstate_global->__pyx_kp_u_cannot_convert_ndarray_from_date
#define __pyx_kp_u_cannot_convert_s_to_an_integer_t __pyx_mstate_global->__pyx_kp_u_cannot_convert_s_to_an_integer_t
#define __pyx_kp_u_cannot_convert_s_to_an_integer_t_2 __pyx_mstate_global->__pyx_kp_u_cannot_convert_s_to_an_integer_t_2
#define __pyx_kp_u_cannot_convert_s_to_float_to_rep __pyx_mstate_global->__pyx_kp_u_cannot_convert_s_to_float_to_rep
#define __pyx_kp_u_cannot_covnert_s_to_an_integer_t __pyx_mstate_global->__pyx_kp_u_cannot_covnert_s_to_an_integer_t
#define __pyx_kp_u_cannot_covnert_s_to_float_to_rep __pyx_mstate_global->__pyx_kp_u_cannot_covnert_s_to_float_to_rep
#define __pyx_kp_u_cannot_floor_to_multiple_0 __pyx_mstate_global->__pyx_kp_u_cannot_floor_to_multiple_0
#define __pyx_kp_u_cannot_get_the_length_of_s_to_re __pyx_mstate_global->__pyx_kp_u_cannot_get_the_length_of_s_to_re
#define __pyx_kp_u_cannot_perform_addition_on_ndarr __pyx_mstate_global->__pyx_kp_u_cannot_perform_addition_on_ndarr
#define __pyx_kp_u_cannot_perform_comparison_on_nda __pyx_mstate_global->__pyx_kp_u_cannot_perform_comparison_on_nda
#define __pyx_kp_u_cannot_perform_subtraction_on_nd __pyx_mstate_global->__pyx_kp_u_cannot_perform_subtraction_on_nd
#define __pyx_kp_u_cannot_round_to_multiple_0 __pyx_mstate_global->__pyx_kp_u_cannot_round_to_multiple_0
#define __pyx_kp_u_cannot_unpack_s_to_iso_calendar __pyx_mstate_global->__pyx_kp_u_cannot_unpack_s_to_iso_calendar
#define __pyx_n_s_ceil __pyx_mstate_global->__pyx_n_s_ceil
#define __pyx_n_u_ceil __pyx_mstate_global->__pyx_n_u_ceil
#define __pyx_n_s_cfg __pyx_mstate_global->__pyx_n_s_cfg
#define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem
#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
#define __pyx_n_s_closest __pyx_mstate_global->__pyx_n_s_closest
#define __pyx_n_u_closest __pyx_mstate_global->__pyx_n_u_closest
#define __pyx_n_s_cls __pyx_mstate_global->__pyx_n_s_cls
#define __pyx_n_s_columns __pyx_mstate_global->__pyx_n_s_columns
#define __pyx_n_s_combine __pyx_mstate_global->__pyx_n_s_combine
#define __pyx_n_u_compare __pyx_mstate_global->__pyx_n_u_compare
#define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy
#define __pyx_n_s_ctime __pyx_mstate_global->__pyx_n_s_ctime
#define __pyx_kp_s_cython_bint __pyx_mstate_global->__pyx_kp_s_cython_bint
#define __pyx_kp_s_cython_int __pyx_mstate_global->__pyx_kp_s_cython_int
#define __pyx_n_s_cytimes __pyx_mstate_global->__pyx_n_s_cytimes
#define __pyx_n_s_cytimes_parser __pyx_mstate_global->__pyx_n_s_cytimes_parser
#define __pyx_n_s_cytimes_pddt __pyx_mstate_global->__pyx_n_s_cytimes_pddt
#define __pyx_n_u_d __pyx_mstate_global->__pyx_n_u_d
#define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data
#define __pyx_n_s_date __pyx_mstate_global->__pyx_n_s_date
#define __pyx_n_s_date_range __pyx_mstate_global->__pyx_n_s_date_range
#define __pyx_n_s_dates __pyx_mstate_global->__pyx_n_s_dates
#define __pyx_n_s_datesD __pyx_mstate_global->__pyx_n_s_datesD
#define __pyx_n_s_datesD_1st __pyx_mstate_global->__pyx_n_s_datesD_1st
#define __pyx_n_s_datesD_lst __pyx_mstate_global->__pyx_n_s_datesD_lst
#define __pyx_n_s_datesM __pyx_mstate_global->__pyx_n_s_datesM
#define __pyx_n_s_datesQ __pyx_mstate_global->__pyx_n_s_datesQ
#define __pyx_n_s_datesY __pyx_mstate_global->__pyx_n_s_datesY
#define __pyx_n_s_datetime __pyx_mstate_global->__pyx_n_s_datetime
#define __pyx_n_s_datetime64 __pyx_mstate_global->__pyx_n_s_datetime64
#define __pyx_n_u_datetime64 __pyx_mstate_global->__pyx_n_u_datetime64
#define __pyx_kp_u_datetime64_D __pyx_mstate_global->__pyx_kp_u_datetime64_D
#define __pyx_kp_u_datetime64_M __pyx_mstate_global->__pyx_kp_u_datetime64_M
#define __pyx_kp_u_datetime64_W __pyx_mstate_global->__pyx_kp_u_datetime64_W
#define __pyx_kp_u_datetime64_Y __pyx_mstate_global->__pyx_kp_u_datetime64_Y
#define __pyx_kp_u_datetime64_h __pyx_mstate_global->__pyx_kp_u_datetime64_h
#define __pyx_kp_u_datetime64_m __pyx_mstate_global->__pyx_kp_u_datetime64_m
#define __pyx_kp_u_datetime64_ms __pyx_mstate_global->__pyx_kp_u_datetime64_ms
#define __pyx_kp_u_datetime64_ns __pyx_mstate_global->__pyx_kp_u_datetime64_ns
#define __pyx_kp_u_datetime64_s __pyx_mstate_global->__pyx_kp_u_datetime64_s
#define __pyx_kp_u_datetime64_s_2 __pyx_mstate_global->__pyx_kp_u_datetime64_s_2
#define __pyx_kp_u_datetime64_us __pyx_mstate_global->__pyx_kp_u_datetime64_us
#define __pyx_kp_s_datetime_date_object __pyx_mstate_global->__pyx_kp_s_datetime_date_object
#define __pyx_kp_s_datetime_date_str_None __pyx_mstate_global->__pyx_kp_s_datetime_date_str_None
#define __pyx_kp_s_datetime_datetime_object __pyx_mstate_global->__pyx_kp_s_datetime_datetime_object
#define __pyx_kp_u_datetime_s_is_ambiguous __pyx_mstate_global->__pyx_kp_u_datetime_s_is_ambiguous
#define __pyx_kp_s_datetime_time_str_None __pyx_mstate_global->__pyx_kp_s_datetime_time_str_None
#define __pyx_kp_s_datetime_tzinfo_str_None __pyx_mstate_global->__pyx_kp_s_datetime_tzinfo_str_None
#define __pyx_n_s_day __pyx_mstate_global->__pyx_n_s_day
#define __pyx_n_u_day __pyx_mstate_global->__pyx_n_u_day
#define __pyx_n_s_day1st __pyx_mstate_global->__pyx_n_s_day1st
#define __pyx_n_s_dayfirst __pyx_mstate_global->__pyx_n_s_dayfirst
#define __pyx_n_s_days __pyx_mstate_global->__pyx_n_s_days
#define __pyx_n_s_days_bf_month __pyx_mstate_global->__pyx_n_s_days_bf_month
#define __pyx_n_u_days_bf_month __pyx_mstate_global->__pyx_n_u_days_bf_month
#define __pyx_n_s_days_bf_quarter __pyx_mstate_global->__pyx_n_s_days_bf_quarter
#define __pyx_n_u_days_bf_quarter __pyx_mstate_global->__pyx_n_u_days_bf_quarter
#define __pyx_n_s_days_bf_year __pyx_mstate_global->__pyx_n_s_days_bf_year
#define __pyx_n_u_days_bf_year __pyx_mstate_global->__pyx_n_u_days_bf_year
#define __pyx_n_s_days_in_month __pyx_mstate_global->__pyx_n_s_days_in_month
#define __pyx_n_u_days_in_month __pyx_mstate_global->__pyx_n_u_days_in_month
#define __pyx_n_s_days_in_quarter __pyx_mstate_global->__pyx_n_s_days_in_quarter
#define __pyx_n_u_days_in_quarter __pyx_mstate_global->__pyx_n_u_days_in_quarter
#define __pyx_n_s_days_in_year __pyx_mstate_global->__pyx_n_s_days_in_year
#define __pyx_n_u_days_in_year __pyx_mstate_global->__pyx_n_u_days_in_year
#define __pyx_n_s_days_of_month __pyx_mstate_global->__pyx_n_s_days_of_month
#define __pyx_n_u_days_of_month __pyx_mstate_global->__pyx_n_u_days_of_month
#define __pyx_n_s_days_of_quarter __pyx_mstate_global->__pyx_n_s_days_of_quarter
#define __pyx_n_u_days_of_quarter __pyx_mstate_global->__pyx_n_u_days_of_quarter
#define __pyx_n_s_days_of_year __pyx_mstate_global->__pyx_n_s_days_of_year
#define __pyx_n_u_days_of_year __pyx_mstate_global->__pyx_n_u_days_of_year
#define __pyx_n_s_dd __pyx_mstate_global->__pyx_n_s_dd
#define __pyx_n_s_delta __pyx_mstate_global->__pyx_n_s_delta
#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict
#define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2
#define __pyx_n_s_diff __pyx_mstate_global->__pyx_n_s_diff
#define __pyx_n_u_diff __pyx_mstate_global->__pyx_n_u_diff
#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable
#define __pyx_kp_u_division_by_zero_for_utils_arr_c __pyx_mstate_global->__pyx_kp_u_division_by_zero_for_utils_arr_c
#define __pyx_kp_u_division_by_zero_for_utils_arr_f __pyx_mstate_global->__pyx_kp_u_division_by_zero_for_utils_arr_f
#define __pyx_kp_u_division_by_zero_for_utils_arr_r __pyx_mstate_global->__pyx_kp_u_division_by_zero_for_utils_arr_r
#define __pyx_kp_u_division_by_zero_for_utils_math __pyx_mstate_global->__pyx_kp_u_division_by_zero_for_utils_math
#define __pyx_kp_u_division_by_zero_for_utils_math_2 __pyx_mstate_global->__pyx_kp_u_division_by_zero_for_utils_math_2
#define __pyx_kp_u_division_by_zero_for_utils_math_3 __pyx_mstate_global->__pyx_kp_u_division_by_zero_for_utils_math_3
#define __pyx_kp_u_division_by_zero_for_utils_math_4 __pyx_mstate_global->__pyx_kp_u_division_by_zero_for_utils_math_4
#define __pyx_kp_u_division_by_zero_in_arr_mod __pyx_mstate_global->__pyx_kp_u_division_by_zero_in_arr_mod
#define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc
#define __pyx_n_s_dst __pyx_mstate_global->__pyx_n_s_dst
#define __pyx_n_s_dt __pyx_mstate_global->__pyx_n_s_dt
#define __pyx_n_s_dt64 __pyx_mstate_global->__pyx_n_s_dt64
#define __pyx_n_s_dt_val __pyx_mstate_global->__pyx_n_s_dt_val
#define __pyx_n_s_dtobjs __pyx_mstate_global->__pyx_n_s_dtobjs
#define __pyx_n_s_dts __pyx_mstate_global->__pyx_n_s_dts
#define __pyx_n_s_dtstr __pyx_mstate_global->__pyx_n_s_dtstr
#define __pyx_n_s_dtype __pyx_mstate_global->__pyx_n_s_dtype
#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable
#define __pyx_n_s_end __pyx_mstate_global->__pyx_n_s_end
#define __pyx_n_s_err __pyx_mstate_global->__pyx_n_s_err
#define __pyx_n_s_errors __pyx_mstate_global->__pyx_n_s_errors
#define __pyx_n_s_exceptions __pyx_mstate_global->__pyx_n_s_exceptions
#define __pyx_kp_u_expects_datetime_tzinfo_got_s __pyx_mstate_global->__pyx_kp_u_expects_datetime_tzinfo_got_s
#define __pyx_kp_u_expects_np_datetime64_got_s __pyx_mstate_global->__pyx_kp_u_expects_np_datetime64_got_s
#define __pyx_kp_u_expects_np_ndarray_datetime64_go __pyx_mstate_global->__pyx_kp_u_expects_np_ndarray_datetime64_go
#define __pyx_kp_u_expects_np_ndarray_datetime64_ti __pyx_mstate_global->__pyx_kp_u_expects_np_ndarray_datetime64_ti
#define __pyx_kp_u_expects_np_ndarray_datetime64_ti_2 __pyx_mstate_global->__pyx_kp_u_expects_np_ndarray_datetime64_ti_2
#define __pyx_kp_u_expects_np_ndarray_timedelta64_g __pyx_mstate_global->__pyx_kp_u_expects_np_ndarray_timedelta64_g
#define __pyx_kp_u_expects_np_timedelta64_got_s __pyx_mstate_global->__pyx_kp_u_expects_np_timedelta64_got_s
#define __pyx_n_s_f __pyx_mstate_global->__pyx_n_s_f
#define __pyx_n_s_fac __pyx_mstate_global->__pyx_n_s_fac
#define __pyx_kp_u_failed_to_allocate_memory_for_st __pyx_mstate_global->__pyx_kp_u_failed_to_allocate_memory_for_st
#define __pyx_n_s_farthest __pyx_mstate_global->__pyx_n_s_farthest
#define __pyx_n_u_farthest __pyx_mstate_global->__pyx_n_u_farthest
#define __pyx_kp_u_find_closest __pyx_mstate_global->__pyx_kp_u_find_closest
#define __pyx_kp_u_find_farthest __pyx_mstate_global->__pyx_kp_u_find_farthest
#define __pyx_n_s_floor __pyx_mstate_global->__pyx_n_s_floor
#define __pyx_n_u_floor __pyx_mstate_global->__pyx_n_u_floor
#define __pyx_n_s_fmt __pyx_mstate_global->__pyx_n_s_fmt
#define __pyx_n_s_freq __pyx_mstate_global->__pyx_n_s_freq
#define __pyx_n_s_fromdate __pyx_mstate_global->__pyx_n_s_fromdate
#define __pyx_n_s_fromdatetime __pyx_mstate_global->__pyx_n_s_fromdatetime
#define __pyx_n_s_fromdatetime64 __pyx_mstate_global->__pyx_n_s_fromdatetime64
#define __pyx_n_s_fromicroseconds __pyx_mstate_global->__pyx_n_s_fromicroseconds
#define __pyx_n_s_fromisocalendar __pyx_mstate_global->__pyx_n_s_fromisocalendar
#define __pyx_n_s_fromisoformat __pyx_mstate_global->__pyx_n_s_fromisoformat
#define __pyx_n_s_fromordinal __pyx_mstate_global->__pyx_n_s_fromordinal
#define __pyx_n_s_fromseconds __pyx_mstate_global->__pyx_n_s_fromseconds
#define __pyx_n_s_fromtimestamp __pyx_mstate_global->__pyx_n_s_fromtimestamp
#define __pyx_n_s_fromutc __pyx_mstate_global->__pyx_n_s_fromutc
#define __pyx_n_u_fs __pyx_mstate_global->__pyx_n_u_fs
#define __pyx_n_s_fsp __pyx_mstate_global->__pyx_n_s_fsp
#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc
#define __pyx_n_s_generate_range __pyx_mstate_global->__pyx_n_s_generate_range
#define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get
#define __pyx_n_u_h __pyx_mstate_global->__pyx_n_u_h
#define __pyx_n_s_hh_fac __pyx_mstate_global->__pyx_n_s_hh_fac
#define __pyx_n_s_hour __pyx_mstate_global->__pyx_n_s_hour
#define __pyx_n_u_hour __pyx_mstate_global->__pyx_n_u_hour
#define __pyx_n_s_hours __pyx_mstate_global->__pyx_n_s_hours
#define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i
#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
#define __pyx_n_s_incl_off __pyx_mstate_global->__pyx_n_s_incl_off
#define __pyx_n_s_inclusive __pyx_mstate_global->__pyx_n_s_inclusive
#define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index
#define __pyx_n_u_infer __pyx_mstate_global->__pyx_n_u_infer
#define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass
#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
#define __pyx_kp_u_instance_is_already_timezone_awa __pyx_mstate_global->__pyx_kp_u_instance_is_already_timezone_awa
#define __pyx_kp_u_instance_is_timezone_naive_Canno __pyx_mstate_global->__pyx_kp_u_instance_is_timezone_naive_Canno
#define __pyx_kp_u_instance_is_timezone_naive_Use_t __pyx_mstate_global->__pyx_kp_u_instance_is_timezone_naive_Use_t
#define __pyx_n_u_int64 __pyx_mstate_global->__pyx_n_u_int64
#define __pyx_kp_u_int64_under_D_resolution __pyx_mstate_global->__pyx_kp_u_int64_under_D_resolution
#define __pyx_kp_u_int64_under_M_resolution __pyx_mstate_global->__pyx_kp_u_int64_under_M_resolution
#define __pyx_kp_u_int64_under_Y_resolution __pyx_mstate_global->__pyx_kp_u_int64_under_Y_resolution
#define __pyx_kp_u_int64_under_h_resolution __pyx_mstate_global->__pyx_kp_u_int64_under_h_resolution
#define __pyx_kp_u_int64_under_m_resolution __pyx_mstate_global->__pyx_kp_u_int64_under_m_resolution
#define __pyx_kp_u_int64_under_ms_resolution __pyx_mstate_global->__pyx_kp_u_int64_under_ms_resolution
#define __pyx_kp_u_int64_under_ns_resolution __pyx_mstate_global->__pyx_kp_u_int64_under_ns_resolution
#define __pyx_kp_u_int64_under_s_resolution __pyx_mstate_global->__pyx_kp_u_int64_under_s_resolution
#define __pyx_kp_u_int64_under_us_resolution __pyx_mstate_global->__pyx_kp_u_int64_under_us_resolution
#define __pyx_kp_s_int_None __pyx_mstate_global->__pyx_kp_s_int_None
#define __pyx_kp_s_int_float_object __pyx_mstate_global->__pyx_kp_s_int_float_object
#define __pyx_kp_s_int_object __pyx_mstate_global->__pyx_kp_s_int_object
#define __pyx_kp_s_int_str __pyx_mstate_global->__pyx_kp_s_int_str
#define __pyx_kp_s_int_str_None __pyx_mstate_global->__pyx_kp_s_int_str_None
#define __pyx_kp_u_invalid_character_s_as_an_intege __pyx_mstate_global->__pyx_kp_u_invalid_character_s_as_an_intege
#define __pyx_kp_u_invalid_end_of_datetime_unit_s_S __pyx_mstate_global->__pyx_kp_u_invalid_end_of_datetime_unit_s_S
#define __pyx_kp_u_invalid_first_of_datetime_unit_s __pyx_mstate_global->__pyx_kp_u_invalid_first_of_datetime_unit_s
#define __pyx_kp_u_invalid_fractional_seconds_preci __pyx_mstate_global->__pyx_kp_u_invalid_fractional_seconds_preci
#define __pyx_kp_u_invalid_input_s_for_inclusive_Su __pyx_mstate_global->__pyx_kp_u_invalid_input_s_for_inclusive_Su
#define __pyx_kp_u_invalid_last_of_datetime_unit_s __pyx_mstate_global->__pyx_kp_u_invalid_last_of_datetime_unit_s
#define __pyx_kp_u_invalid_month_name_s __pyx_mstate_global->__pyx_kp_u_invalid_month_name_s
#define __pyx_kp_u_invalid_month_number_d_must_betw __pyx_mstate_global->__pyx_kp_u_invalid_month_number_d_must_betw
#define __pyx_kp_u_invalid_start_of_time_unit_s_Sup __pyx_mstate_global->__pyx_kp_u_invalid_start_of_time_unit_s_Sup
#define __pyx_kp_u_invalid_weekday_name_s __pyx_mstate_global->__pyx_kp_u_invalid_weekday_name_s
#define __pyx_kp_u_invalid_weekday_number_d_must_be __pyx_mstate_global->__pyx_kp_u_invalid_weekday_number_d_must_be
#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
#define __pyx_n_s_is_day __pyx_mstate_global->__pyx_n_s_is_day
#define __pyx_n_u_is_day __pyx_mstate_global->__pyx_n_u_is_day
#define __pyx_n_s_is_end_of __pyx_mstate_global->__pyx_n_s_is_end_of
#define __pyx_kp_u_is_end_of_s __pyx_mstate_global->__pyx_kp_u_is_end_of_s
#define __pyx_n_s_is_first_of __pyx_mstate_global->__pyx_n_s_is_first_of
#define __pyx_kp_u_is_first_of_s __pyx_mstate_global->__pyx_kp_u_is_first_of_s
#define __pyx_n_s_is_future __pyx_mstate_global->__pyx_n_s_is_future
#define __pyx_n_u_is_future __pyx_mstate_global->__pyx_n_u_is_future
#define __pyx_n_s_is_last_of __pyx_mstate_global->__pyx_n_s_is_last_of
#define __pyx_kp_u_is_last_of_s __pyx_mstate_global->__pyx_kp_u_is_last_of_s
#define __pyx_n_s_is_leap_year __pyx_mstate_global->__pyx_n_s_is_leap_year
#define __pyx_n_u_is_leap_year __pyx_mstate_global->__pyx_n_u_is_leap_year
#define __pyx_n_s_is_local __pyx_mstate_global->__pyx_n_s_is_local
#define __pyx_n_s_is_long_year __pyx_mstate_global->__pyx_n_s_is_long_year
#define __pyx_n_u_is_long_year __pyx_mstate_global->__pyx_n_u_is_long_year
#define __pyx_n_s_is_month __pyx_mstate_global->__pyx_n_s_is_month
#define __pyx_n_u_is_month __pyx_mstate_global->__pyx_n_u_is_month
#define __pyx_kp_u_is_not_supported __pyx_mstate_global->__pyx_kp_u_is_not_supported
#define __pyx_kp_u_is_not_supported_2 __pyx_mstate_global->__pyx_kp_u_is_not_supported_2
#define __pyx_kp_u_is_not_supported_3 __pyx_mstate_global->__pyx_kp_u_is_not_supported_3
#define __pyx_n_s_is_past __pyx_mstate_global->__pyx_n_s_is_past
#define __pyx_n_u_is_past __pyx_mstate_global->__pyx_n_u_is_past
#define __pyx_n_s_is_quarter __pyx_mstate_global->__pyx_n_s_is_quarter
#define __pyx_n_u_is_quarter __pyx_mstate_global->__pyx_n_u_is_quarter
#define __pyx_n_s_is_start_of __pyx_mstate_global->__pyx_n_s_is_start_of
#define __pyx_kp_u_is_start_of_s __pyx_mstate_global->__pyx_kp_u_is_start_of_s
#define __pyx_n_s_is_utc __pyx_mstate_global->__pyx_n_s_is_utc
#define __pyx_n_s_is_weekday __pyx_mstate_global->__pyx_n_s_is_weekday
#define __pyx_n_u_is_weekday __pyx_mstate_global->__pyx_n_u_is_weekday
#define __pyx_n_s_is_year __pyx_mstate_global->__pyx_n_s_is_year
#define __pyx_n_u_is_year __pyx_mstate_global->__pyx_n_u_is_year
#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled
#define __pyx_n_s_iso __pyx_mstate_global->__pyx_n_s_iso
#define __pyx_n_s_iso_2 __pyx_mstate_global->__pyx_n_s_iso_2
#define __pyx_n_s_isocalendar __pyx_mstate_global->__pyx_n_s_isocalendar
#define __pyx_n_s_isoformat __pyx_mstate_global->__pyx_n_s_isoformat
#define __pyx_n_s_isoweek __pyx_mstate_global->__pyx_n_s_isoweek
#define __pyx_n_u_isoweek __pyx_mstate_global->__pyx_n_u_isoweek
#define __pyx_n_s_isoweekday __pyx_mstate_global->__pyx_n_s_isoweekday
#define __pyx_n_u_isoweekday __pyx_mstate_global->__pyx_n_u_isoweekday
#define __pyx_n_s_isoyear __pyx_mstate_global->__pyx_n_s_isoyear
#define __pyx_n_u_isoyear __pyx_mstate_global->__pyx_n_u_isoyear
#define __pyx_n_s_item __pyx_mstate_global->__pyx_n_s_item
#define __pyx_n_s_itertuples __pyx_mstate_global->__pyx_n_s_itertuples
#define __pyx_n_s_kind __pyx_mstate_global->__pyx_n_s_kind
#define __pyx_n_s_leap_bt_year __pyx_mstate_global->__pyx_n_s_leap_bt_year
#define __pyx_n_u_leap_bt_year __pyx_mstate_global->__pyx_n_u_leap_bt_year
#define __pyx_n_s_lib __pyx_mstate_global->__pyx_n_s_lib
#define __pyx_n_s_lower __pyx_mstate_global->__pyx_n_s_lower
#define __pyx_n_u_m __pyx_mstate_global->__pyx_n_u_m
#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
#define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass
#define __pyx_n_s_mi_fac __pyx_mstate_global->__pyx_n_s_mi_fac
#define __pyx_n_s_microsecond __pyx_mstate_global->__pyx_n_s_microsecond
#define __pyx_n_u_microsecond __pyx_mstate_global->__pyx_n_u_microsecond
#define __pyx_n_s_microseconds __pyx_mstate_global->__pyx_n_s_microseconds
#define __pyx_n_u_microseconds __pyx_mstate_global->__pyx_n_u_microseconds
#define __pyx_n_s_millisecond __pyx_mstate_global->__pyx_n_s_millisecond
#define __pyx_n_u_millisecond __pyx_mstate_global->__pyx_n_u_millisecond
#define __pyx_n_s_milliseconds __pyx_mstate_global->__pyx_n_s_milliseconds
#define __pyx_n_u_min __pyx_mstate_global->__pyx_n_u_min
#define __pyx_n_s_minute __pyx_mstate_global->__pyx_n_s_minute
#define __pyx_n_u_minute __pyx_mstate_global->__pyx_n_u_minute
#define __pyx_n_s_minutes __pyx_mstate_global->__pyx_n_s_minutes
#define __pyx_kp_u_mixed_timezones __pyx_mstate_global->__pyx_kp_u_mixed_timezones
#define __pyx_n_s_mm __pyx_mstate_global->__pyx_n_s_mm
#define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module
#define __pyx_n_s_month __pyx_mstate_global->__pyx_n_s_month
#define __pyx_n_u_month __pyx_mstate_global->__pyx_n_u_month
#define __pyx_n_s_months __pyx_mstate_global->__pyx_n_s_months
#define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries
#define __pyx_n_u_ms __pyx_mstate_global->__pyx_n_u_ms
#define __pyx_n_s_mul __pyx_mstate_global->__pyx_n_s_mul
#define __pyx_kp_u_must_be_an_1_dimensional_ndarray __pyx_mstate_global->__pyx_kp_u_must_be_an_1_dimensional_ndarray
#define __pyx_n_s_my_arr __pyx_mstate_global->__pyx_n_s_my_arr
#define __pyx_n_s_my_tz __pyx_mstate_global->__pyx_n_s_my_tz
#define __pyx_n_s_my_unit __pyx_mstate_global->__pyx_n_s_my_unit
#define __pyx_n_s_my_unit_adj __pyx_mstate_global->__pyx_n_s_my_unit_adj
#define __pyx_n_s_my_unit_ch __pyx_mstate_global->__pyx_n_s_my_unit_ch
#define __pyx_n_s_my_unit_int __pyx_mstate_global->__pyx_n_s_my_unit_int
#define __pyx_n_s_my_unit_ns __pyx_mstate_global->__pyx_n_s_my_unit_ns
#define __pyx_n_s_naive __pyx_mstate_global->__pyx_n_s_naive
#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
#define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2
#define __pyx_n_s_nanosecond __pyx_mstate_global->__pyx_n_s_nanosecond
#define __pyx_n_u_nanosecond __pyx_mstate_global->__pyx_n_u_nanosecond
#define __pyx_kp_u_nanosecond_conversion_range_dat __pyx_mstate_global->__pyx_kp_u_nanosecond_conversion_range_dat
#define __pyx_n_s_nanoseconds __pyx_mstate_global->__pyx_n_s_nanoseconds
#define __pyx_kp_u_ndarray_size_must_be_an_integer __pyx_mstate_global->__pyx_kp_u_ndarray_size_must_be_an_integer
#define __pyx_n_u_neither __pyx_mstate_global->__pyx_n_u_neither
#define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new
#define __pyx_n_s_no_default __pyx_mstate_global->__pyx_n_s_no_default
#define __pyx_n_s_nonexistent __pyx_mstate_global->__pyx_n_s_nonexistent
#define __pyx_kp_u_nonexistent_NaT_is_not_supported __pyx_mstate_global->__pyx_kp_u_nonexistent_NaT_is_not_supported
#define __pyx_n_s_normalize __pyx_mstate_global->__pyx_n_s_normalize
#define __pyx_n_s_now __pyx_mstate_global->__pyx_n_s_now
#define __pyx_n_s_np __pyx_mstate_global->__pyx_n_s_np
#define __pyx_kp_s_np_datetime64_object __pyx_mstate_global->__pyx_kp_s_np_datetime64_object
#define __pyx_kp_s_np_ndarray_datetime_date __pyx_mstate_global->__pyx_kp_s_np_ndarray_datetime_date
#define __pyx_kp_s_np_ndarray_datetime_datetime __pyx_mstate_global->__pyx_kp_s_np_ndarray_datetime_datetime
#define __pyx_kp_s_np_ndarray_datetime_time __pyx_mstate_global->__pyx_kp_s_np_ndarray_datetime_time
#define __pyx_kp_s_np_ndarray_np_datetime64 __pyx_mstate_global->__pyx_kp_s_np_ndarray_np_datetime64
#define __pyx_kp_s_np_ndarray_np_int64 __pyx_mstate_global->__pyx_kp_s_np_ndarray_np_int64
#define __pyx_n_u_ns __pyx_mstate_global->__pyx_n_u_ns
#define __pyx_n_s_numpy __pyx_mstate_global->__pyx_n_s_numpy
#define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to
#define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo
#define __pyx_n_s_object __pyx_mstate_global->__pyx_n_s_object
#define __pyx_kp_s_object_None __pyx_mstate_global->__pyx_kp_s_object_None
#define __pyx_n_s_off __pyx_mstate_global->__pyx_n_s_off
#define __pyx_n_s_offset __pyx_mstate_global->__pyx_n_s_offset
#define __pyx_n_u_one __pyx_mstate_global->__pyx_n_u_one
#define __pyx_kp_u_operation_on_ndarray_datetime64 __pyx_mstate_global->__pyx_kp_u_operation_on_ndarray_datetime64
#define __pyx_n_s_ordinal __pyx_mstate_global->__pyx_n_s_ordinal
#define __pyx_n_u_ordinal __pyx_mstate_global->__pyx_n_u_ordinal
#define __pyx_n_s_pandas __pyx_mstate_global->__pyx_n_s_pandas
#define __pyx_n_s_pandas__libs __pyx_mstate_global->__pyx_n_s_pandas__libs
#define __pyx_n_s_pandas__libs_tslibs_parsing __pyx_mstate_global->__pyx_n_s_pandas__libs_tslibs_parsing
#define __pyx_n_s_pandas_core_arrays_datetimes __pyx_mstate_global->__pyx_n_s_pandas_core_arrays_datetimes
#define __pyx_n_s_parse __pyx_mstate_global->__pyx_n_s_parse
#define __pyx_n_s_parse_dict __pyx_mstate_global->__pyx_n_s_parse_dict
#define __pyx_n_s_parse_dtobj __pyx_mstate_global->__pyx_n_s_parse_dtobj
#define __pyx_n_s_parse_sequence __pyx_mstate_global->__pyx_n_s_parse_sequence
#define __pyx_n_s_pd_err __pyx_mstate_global->__pyx_n_s_pd_err
#define __pyx_n_s_periods __pyx_mstate_global->__pyx_n_s_periods
#define __pyx_n_s_precision __pyx_mstate_global->__pyx_n_s_precision
#define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare
#define __pyx_n_s_property __pyx_mstate_global->__pyx_n_s_property
#define __pyx_n_u_ps __pyx_mstate_global->__pyx_n_u_ps
#define __pyx_n_s_pt __pyx_mstate_global->__pyx_n_s_pt
#define __pyx_n_s_pt_1st __pyx_mstate_global->__pyx_n_s_pt_1st
#define __pyx_n_s_pt_arr __pyx_mstate_global->__pyx_n_s_pt_arr
#define __pyx_n_s_pt_end __pyx_mstate_global->__pyx_n_s_pt_end
#define __pyx_n_s_pt_end_unit __pyx_mstate_global->__pyx_n_s_pt_end_unit
#define __pyx_n_s_pt_lst __pyx_mstate_global->__pyx_n_s_pt_lst
#define __pyx_n_s_pt_stt __pyx_mstate_global->__pyx_n_s_pt_stt
#define __pyx_n_s_pt_stt_unit __pyx_mstate_global->__pyx_n_s_pt_stt_unit
#define __pyx_n_s_pt_tz __pyx_mstate_global->__pyx_n_s_pt_tz
#define __pyx_n_s_pt_unit __pyx_mstate_global->__pyx_n_s_pt_unit
#define __pyx_n_s_pt_unit_int __pyx_mstate_global->__pyx_n_s_pt_unit_int
#define __pyx_n_s_pytz __pyx_mstate_global->__pyx_n_s_pytz
#define __pyx_n_s_pytz_err __pyx_mstate_global->__pyx_n_s_pytz_err
#define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable
#define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname
#define __pyx_n_s_quarter __pyx_mstate_global->__pyx_n_s_quarter
#define __pyx_n_u_quarter __pyx_mstate_global->__pyx_n_u_quarter
#define __pyx_n_s_quarters __pyx_mstate_global->__pyx_n_s_quarters
#define __pyx_n_u_raise __pyx_mstate_global->__pyx_n_u_raise
#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range
#define __pyx_n_s_replace __pyx_mstate_global->__pyx_n_s_replace
#define __pyx_n_s_res __pyx_mstate_global->__pyx_n_s_res
#define __pyx_kp_u_resolution __pyx_mstate_global->__pyx_kp_u_resolution
#define __pyx_kp_u_resolution_Array_with_datetime __pyx_mstate_global->__pyx_kp_u_resolution_Array_with_datetime
#define __pyx_kp_u_resolution_Array_with_dtype_of __pyx_mstate_global->__pyx_kp_u_resolution_Array_with_dtype_of
#define __pyx_kp_u_resolution_Supported_resolution __pyx_mstate_global->__pyx_kp_u_resolution_Supported_resolution
#define __pyx_kp_u_resolution_is_not_supported __pyx_mstate_global->__pyx_kp_u_resolution_is_not_supported
#define __pyx_n_s_return __pyx_mstate_global->__pyx_n_s_return
#define __pyx_n_s_round __pyx_mstate_global->__pyx_n_s_round
#define __pyx_n_u_round __pyx_mstate_global->__pyx_n_u_round
#define __pyx_n_u_s __pyx_mstate_global->__pyx_n_u_s
#define __pyx_n_s_sec __pyx_mstate_global->__pyx_n_s_sec
#define __pyx_n_s_second __pyx_mstate_global->__pyx_n_s_second
#define __pyx_n_u_second __pyx_mstate_global->__pyx_n_u_second
#define __pyx_n_s_seconds __pyx_mstate_global->__pyx_n_s_seconds
#define __pyx_n_u_seconds __pyx_mstate_global->__pyx_n_u_seconds
#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self
#define __pyx_n_s_sep __pyx_mstate_global->__pyx_n_s_sep
#define __pyx_kp_u_sequence_must_have_3_items __pyx_mstate_global->__pyx_kp_u_sequence_must_have_3_items
#define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name
#define __pyx_kp_s_set_str __pyx_mstate_global->__pyx_kp_s_set_str
#define __pyx_n_u_shift_forward __pyx_mstate_global->__pyx_n_u_shift_forward
#define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size
#define __pyx_n_s_snap __pyx_mstate_global->__pyx_n_s_snap
#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
#define __pyx_kp_s_src_cytimes_pddt_py __pyx_mstate_global->__pyx_kp_s_src_cytimes_pddt_py
#define __pyx_n_s_ss_fac __pyx_mstate_global->__pyx_n_s_ss_fac
#define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start
#define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str
#define __pyx_kp_s_str_int __pyx_mstate_global->__pyx_kp_s_str_int
#define __pyx_kp_s_str_object __pyx_mstate_global->__pyx_kp_s_str_object
#define __pyx_n_s_strftime __pyx_mstate_global->__pyx_n_s_strftime
#define __pyx_kp_u_strftime_format_is_too_long_s __pyx_mstate_global->__pyx_kp_u_strftime_format_is_too_long_s
#define __pyx_n_s_strptime __pyx_mstate_global->__pyx_n_s_strptime
#define __pyx_n_s_sub __pyx_mstate_global->__pyx_n_s_sub
#define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super
#define __pyx_kp_u_support_ndarray_with_1_4_dimensi __pyx_mstate_global->__pyx_kp_u_support_ndarray_with_1_4_dimensi
#define __pyx_n_s_targ_tz __pyx_mstate_global->__pyx_n_s_targ_tz
#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
#define __pyx_n_s_time __pyx_mstate_global->__pyx_n_s_time
#define __pyx_n_u_timedelta64 __pyx_mstate_global->__pyx_n_u_timedelta64
#define __pyx_n_s_timedf __pyx_mstate_global->__pyx_n_s_timedf
#define __pyx_n_s_times __pyx_mstate_global->__pyx_n_s_times
#define __pyx_n_s_timestamp __pyx_mstate_global->__pyx_n_s_timestamp
#define __pyx_n_u_timestamp __pyx_mstate_global->__pyx_n_u_timestamp
#define __pyx_n_s_timetz __pyx_mstate_global->__pyx_n_s_timetz
#define __pyx_kp_u_timezone_offset_s_seconds_out_of __pyx_mstate_global->__pyx_kp_u_timezone_offset_s_seconds_out_of
#define __pyx_n_s_tm_hour __pyx_mstate_global->__pyx_n_s_tm_hour
#define __pyx_n_u_tm_hour __pyx_mstate_global->__pyx_n_u_tm_hour
#define __pyx_n_s_tm_isdst __pyx_mstate_global->__pyx_n_s_tm_isdst
#define __pyx_n_s_tm_mday __pyx_mstate_global->__pyx_n_s_tm_mday
#define __pyx_n_u_tm_mday __pyx_mstate_global->__pyx_n_u_tm_mday
#define __pyx_n_s_tm_min __pyx_mstate_global->__pyx_n_s_tm_min
#define __pyx_n_u_tm_min __pyx_mstate_global->__pyx_n_u_tm_min
#define __pyx_n_s_tm_mon __pyx_mstate_global->__pyx_n_s_tm_mon
#define __pyx_n_u_tm_mon __pyx_mstate_global->__pyx_n_u_tm_mon
#define __pyx_n_s_tm_sec __pyx_mstate_global->__pyx_n_s_tm_sec
#define __pyx_n_u_tm_sec __pyx_mstate_global->__pyx_n_u_tm_sec
#define __pyx_n_s_tm_wday __pyx_mstate_global->__pyx_n_s_tm_wday
#define __pyx_n_u_tm_wday __pyx_mstate_global->__pyx_n_u_tm_wday
#define __pyx_n_s_tm_yday __pyx_mstate_global->__pyx_n_s_tm_yday
#define __pyx_n_u_tm_yday __pyx_mstate_global->__pyx_n_u_tm_yday
#define __pyx_n_s_tm_year __pyx_mstate_global->__pyx_n_s_tm_year
#define __pyx_n_u_tm_year __pyx_mstate_global->__pyx_n_u_tm_year
#define __pyx_kp_u_to __pyx_mstate_global->__pyx_kp_u_to
#define __pyx_kp_u_to_2 __pyx_mstate_global->__pyx_kp_u_to_2
#define __pyx_kp_u_to_an_integer_under __pyx_mstate_global->__pyx_kp_u_to_an_integer_under
#define __pyx_kp_u_to_an_integer_under_2 __pyx_mstate_global->__pyx_kp_u_to_an_integer_under_2
#define __pyx_n_s_to_curr_month __pyx_mstate_global->__pyx_n_s_to_curr_month
#define __pyx_n_s_to_curr_quarter __pyx_mstate_global->__pyx_n_s_to_curr_quarter
#define __pyx_n_s_to_curr_weekday __pyx_mstate_global->__pyx_n_s_to_curr_weekday
#define __pyx_n_s_to_curr_weekday_2 __pyx_mstate_global->__pyx_n_s_to_curr_weekday_2
#define __pyx_n_s_to_curr_year __pyx_mstate_global->__pyx_n_s_to_curr_year
#define __pyx_n_s_to_date __pyx_mstate_global->__pyx_n_s_to_date
#define __pyx_n_s_to_datetime __pyx_mstate_global->__pyx_n_s_to_datetime
#define __pyx_kp_u_to_datetime64 __pyx_mstate_global->__pyx_kp_u_to_datetime64
#define __pyx_n_s_to_day __pyx_mstate_global->__pyx_n_s_to_day
#define __pyx_n_s_to_end_of __pyx_mstate_global->__pyx_n_s_to_end_of
#define __pyx_n_s_to_first_of __pyx_mstate_global->__pyx_n_s_to_first_of
#define __pyx_n_s_to_friday __pyx_mstate_global->__pyx_n_s_to_friday
#define __pyx_kp_u_to_int64_under __pyx_mstate_global->__pyx_kp_u_to_int64_under
#define __pyx_kp_u_to_int64_under_2 __pyx_mstate_global->__pyx_kp_u_to_int64_under_2
#define __pyx_kp_u_to_int64_under_3 __pyx_mstate_global->__pyx_kp_u_to_int64_under_3
#define __pyx_n_s_to_last_of __pyx_mstate_global->__pyx_n_s_to_last_of
#define __pyx_n_s_to_monday __pyx_mstate_global->__pyx_n_s_to_monday
#define __pyx_n_s_to_month __pyx_mstate_global->__pyx_n_s_to_month
#define __pyx_n_s_to_next_month __pyx_mstate_global->__pyx_n_s_to_next_month
#define __pyx_n_s_to_next_quarter __pyx_mstate_global->__pyx_n_s_to_next_quarter
#define __pyx_n_s_to_next_weekday __pyx_mstate_global->__pyx_n_s_to_next_weekday
#define __pyx_n_s_to_next_year __pyx_mstate_global->__pyx_n_s_to_next_year
#define __pyx_n_s_to_prev_month __pyx_mstate_global->__pyx_n_s_to_prev_month
#define __pyx_n_s_to_prev_quarter __pyx_mstate_global->__pyx_n_s_to_prev_quarter
#define __pyx_n_s_to_prev_weekday __pyx_mstate_global->__pyx_n_s_to_prev_weekday
#define __pyx_n_s_to_prev_year __pyx_mstate_global->__pyx_n_s_to_prev_year
#define __pyx_n_s_to_pydatetime __pyx_mstate_global->__pyx_n_s_to_pydatetime
#define __pyx_n_s_to_quarter __pyx_mstate_global->__pyx_n_s_to_quarter
#define __pyx_n_s_to_saturday __pyx_mstate_global->__pyx_n_s_to_saturday
#define __pyx_n_s_to_start_of __pyx_mstate_global->__pyx_n_s_to_start_of
#define __pyx_n_s_to_sunday __pyx_mstate_global->__pyx_n_s_to_sunday
#define __pyx_n_s_to_thursday __pyx_mstate_global->__pyx_n_s_to_thursday
#define __pyx_n_s_to_time __pyx_mstate_global->__pyx_n_s_to_time
#define __pyx_n_s_to_tomorrow __pyx_mstate_global->__pyx_n_s_to_tomorrow
#define __pyx_n_s_to_tuesday __pyx_mstate_global->__pyx_n_s_to_tuesday
#define __pyx_n_s_to_wednesday __pyx_mstate_global->__pyx_n_s_to_wednesday
#define __pyx_n_s_to_weekday __pyx_mstate_global->__pyx_n_s_to_weekday
#define __pyx_n_s_to_year __pyx_mstate_global->__pyx_n_s_to_year
#define __pyx_n_s_to_yesterday __pyx_mstate_global->__pyx_n_s_to_yesterday
#define __pyx_n_s_today __pyx_mstate_global->__pyx_n_s_today
#define __pyx_n_s_toordinal __pyx_mstate_global->__pyx_n_s_toordinal
#define __pyx_n_s_ts __pyx_mstate_global->__pyx_n_s_ts
#define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing
#define __pyx_n_s_typing_extensions __pyx_mstate_global->__pyx_n_s_typing_extensions
#define __pyx_n_s_tz __pyx_mstate_global->__pyx_n_s_tz
#define __pyx_n_s_tz_available __pyx_mstate_global->__pyx_n_s_tz_available
#define __pyx_n_s_tz_convert __pyx_mstate_global->__pyx_n_s_tz_convert
#define __pyx_n_s_tz_localize __pyx_mstate_global->__pyx_n_s_tz_localize
#define __pyx_n_s_tz_switch __pyx_mstate_global->__pyx_n_s_tz_switch
#define __pyx_n_s_tzinfo __pyx_mstate_global->__pyx_n_s_tzinfo
#define __pyx_n_s_tzname __pyx_mstate_global->__pyx_n_s_tzname
#define __pyx_kp_u_unable_to_parse_datetime_unit_fr __pyx_mstate_global->__pyx_kp_u_unable_to_parse_datetime_unit_fr
#define __pyx_n_s_unit __pyx_mstate_global->__pyx_n_s_unit
#define __pyx_kp_u_unknown_datetime_unit_d __pyx_mstate_global->__pyx_kp_u_unknown_datetime_unit_d
#define __pyx_kp_u_unknown_datetime_unit_s __pyx_mstate_global->__pyx_kp_u_unknown_datetime_unit_s
#define __pyx_kp_u_unless_utc_True __pyx_mstate_global->__pyx_kp_u_unless_utc_True
#define __pyx_kp_u_unsupported_datetime_unit_s __pyx_mstate_global->__pyx_kp_u_unsupported_datetime_unit_s
#define __pyx_kp_u_unsupported_factor_d_for_timedel __pyx_mstate_global->__pyx_kp_u_unsupported_factor_d_for_timedel
#define __pyx_kp_u_unsupported_factor_d_for_timedel_2 __pyx_mstate_global->__pyx_kp_u_unsupported_factor_d_for_timedel_2
#define __pyx_kp_u_unsupported_month_value_type_s_e __pyx_mstate_global->__pyx_kp_u_unsupported_month_value_type_s_e
#define __pyx_kp_u_unsupported_type_s_for_argument __pyx_mstate_global->__pyx_kp_u_unsupported_type_s_for_argument
#define __pyx_kp_u_unsupported_type_s_for_argument_2 __pyx_mstate_global->__pyx_kp_u_unsupported_type_s_for_argument_2
#define __pyx_kp_u_unsupported_type_s_for_argument_3 __pyx_mstate_global->__pyx_kp_u_unsupported_type_s_for_argument_3
#define __pyx_kp_u_unsupported_type_s_for_argument_4 __pyx_mstate_global->__pyx_kp_u_unsupported_type_s_for_argument_4
#define __pyx_kp_u_unsupported_type_s_for_argument_5 __pyx_mstate_global->__pyx_kp_u_unsupported_type_s_for_argument_5
#define __pyx_kp_u_unsupported_type_s_for_argument_6 __pyx_mstate_global->__pyx_kp_u_unsupported_type_s_for_argument_6
#define __pyx_kp_u_unsupported_weekday_value_type_s __pyx_mstate_global->__pyx_kp_u_unsupported_weekday_value_type_s
#define __pyx_n_s_us __pyx_mstate_global->__pyx_n_s_us
#define __pyx_n_u_us __pyx_mstate_global->__pyx_n_u_us
#define __pyx_n_s_us_fac __pyx_mstate_global->__pyx_n_s_us_fac
#define __pyx_n_s_utc __pyx_mstate_global->__pyx_n_s_utc
#define __pyx_n_s_utcfromtimestamp __pyx_mstate_global->__pyx_n_s_utcfromtimestamp
#define __pyx_n_s_utcnow __pyx_mstate_global->__pyx_n_s_utcnow
#define __pyx_n_s_utcoffset __pyx_mstate_global->__pyx_n_s_utcoffset
#define __pyx_n_s_utctimedf __pyx_mstate_global->__pyx_n_s_utctimedf
#define __pyx_n_s_utils __pyx_mstate_global->__pyx_n_s_utils
#define __pyx_n_s_val __pyx_mstate_global->__pyx_n_s_val
#define __pyx_n_s_values __pyx_mstate_global->__pyx_n_s_values
#define __pyx_n_s_values_naive __pyx_mstate_global->__pyx_n_s_values_naive
#define __pyx_kp_u_vs __pyx_mstate_global->__pyx_kp_u_vs
#define __pyx_n_s_wd __pyx_mstate_global->__pyx_n_s_wd
#define __pyx_n_s_week __pyx_mstate_global->__pyx_n_s_week
#define __pyx_n_u_week __pyx_mstate_global->__pyx_n_u_week
#define __pyx_n_s_weekday __pyx_mstate_global->__pyx_n_s_weekday
#define __pyx_n_u_weekday __pyx_mstate_global->__pyx_n_u_weekday
#define __pyx_n_s_weeks __pyx_mstate_global->__pyx_n_s_weeks
#define __pyx_kp_u_with_datetime_unit __pyx_mstate_global->__pyx_kp_u_with_datetime_unit
#define __pyx_kp_u_without_specifying_the_array_da __pyx_mstate_global->__pyx_kp_u_without_specifying_the_array_da
#define __pyx_n_s_wkd __pyx_mstate_global->__pyx_n_s_wkd
#define __pyx_n_s_ww __pyx_mstate_global->__pyx_n_s_ww
#define __pyx_n_s_year __pyx_mstate_global->__pyx_n_s_year
#define __pyx_n_u_year __pyx_mstate_global->__pyx_n_u_year
#define __pyx_n_s_year1st __pyx_mstate_global->__pyx_n_s_year1st
#define __pyx_n_s_yearfirst __pyx_mstate_global->__pyx_n_s_yearfirst
#define __pyx_n_s_years __pyx_mstate_global->__pyx_n_s_years
#define __pyx_n_s_ymd __pyx_mstate_global->__pyx_n_s_ymd
#define __pyx_n_s_yy __pyx_mstate_global->__pyx_n_s_yy
#define __pyx_n_s_zoneinfo __pyx_mstate_global->__pyx_n_s_zoneinfo
#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0
#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1
#define __pyx_int_2 __pyx_mstate_global->__pyx_int_2
#define __pyx_int_3 __pyx_mstate_global->__pyx_int_3
#define __pyx_int_4 __pyx_mstate_global->__pyx_int_4
#define __pyx_int_5 __pyx_mstate_global->__pyx_int_5
#define __pyx_int_6 __pyx_mstate_global->__pyx_int_6
#define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1
#define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_
#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2
#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3
#define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4
#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5
#define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6
#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7
#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8
#define __pyx_slice__39 __pyx_mstate_global->__pyx_slice__39
#define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16
#define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17
#define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18
#define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20
#define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21
#define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22
#define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23
#define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24
#define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25
#define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26
#define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27
#define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28
#define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29
#define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30
#define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31
#define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32
#define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33
#define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34
#define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35
#define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37
#define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40
#define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41
#define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42
#define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45
#define __pyx_tuple__47 __pyx_mstate_global->__pyx_tuple__47
#define __pyx_tuple__48 __pyx_mstate_global->__pyx_tuple__48
#define __pyx_tuple__50 __pyx_mstate_global->__pyx_tuple__50
#define __pyx_tuple__52 __pyx_mstate_global->__pyx_tuple__52
#define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54
#define __pyx_tuple__55 __pyx_mstate_global->__pyx_tuple__55
#define __pyx_tuple__57 __pyx_mstate_global->__pyx_tuple__57
#define __pyx_tuple__59 __pyx_mstate_global->__pyx_tuple__59
#define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61
#define __pyx_tuple__62 __pyx_mstate_global->__pyx_tuple__62
#define __pyx_tuple__64 __pyx_mstate_global->__pyx_tuple__64
#define __pyx_tuple__66 __pyx_mstate_global->__pyx_tuple__66
#define __pyx_tuple__68 __pyx_mstate_global->__pyx_tuple__68
#define __pyx_tuple__70 __pyx_mstate_global->__pyx_tuple__70
#define __pyx_tuple__72 __pyx_mstate_global->__pyx_tuple__72
#define __pyx_tuple__74 __pyx_mstate_global->__pyx_tuple__74
#define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76
#define __pyx_tuple__77 __pyx_mstate_global->__pyx_tuple__77
#define __pyx_tuple__80 __pyx_mstate_global->__pyx_tuple__80
#define __pyx_tuple__82 __pyx_mstate_global->__pyx_tuple__82
#define __pyx_tuple__84 __pyx_mstate_global->__pyx_tuple__84
#define __pyx_tuple__86 __pyx_mstate_global->__pyx_tuple__86
#define __pyx_tuple__88 __pyx_mstate_global->__pyx_tuple__88
#define __pyx_tuple__90 __pyx_mstate_global->__pyx_tuple__90
#define __pyx_tuple__91 __pyx_mstate_global->__pyx_tuple__91
#define __pyx_tuple__93 __pyx_mstate_global->__pyx_tuple__93
#define __pyx_tuple__96 __pyx_mstate_global->__pyx_tuple__96
#define __pyx_tuple__104 __pyx_mstate_global->__pyx_tuple__104
#define __pyx_tuple__106 __pyx_mstate_global->__pyx_tuple__106
#define __pyx_tuple__108 __pyx_mstate_global->__pyx_tuple__108
#define __pyx_tuple__111 __pyx_mstate_global->__pyx_tuple__111
#define __pyx_tuple__113 __pyx_mstate_global->__pyx_tuple__113
#define __pyx_tuple__117 __pyx_mstate_global->__pyx_tuple__117
#define __pyx_tuple__119 __pyx_mstate_global->__pyx_tuple__119
#define __pyx_tuple__121 __pyx_mstate_global->__pyx_tuple__121
#define __pyx_tuple__124 __pyx_mstate_global->__pyx_tuple__124
#define __pyx_tuple__133 __pyx_mstate_global->__pyx_tuple__133
#define __pyx_tuple__135 __pyx_mstate_global->__pyx_tuple__135
#define __pyx_tuple__138 __pyx_mstate_global->__pyx_tuple__138
#define __pyx_tuple__140 __pyx_mstate_global->__pyx_tuple__140
#define __pyx_tuple__144 __pyx_mstate_global->__pyx_tuple__144
#define __pyx_tuple__146 __pyx_mstate_global->__pyx_tuple__146
#define __pyx_tuple__148 __pyx_mstate_global->__pyx_tuple__148
#define __pyx_tuple__149 __pyx_mstate_global->__pyx_tuple__149
#define __pyx_tuple__151 __pyx_mstate_global->__pyx_tuple__151
#define __pyx_tuple__153 __pyx_mstate_global->__pyx_tuple__153
#define __pyx_tuple__155 __pyx_mstate_global->__pyx_tuple__155
#define __pyx_tuple__158 __pyx_mstate_global->__pyx_tuple__158
#define __pyx_tuple__160 __pyx_mstate_global->__pyx_tuple__160
#define __pyx_tuple__162 __pyx_mstate_global->__pyx_tuple__162
#define __pyx_tuple__166 __pyx_mstate_global->__pyx_tuple__166
#define __pyx_tuple__168 __pyx_mstate_global->__pyx_tuple__168
#define __pyx_tuple__176 __pyx_mstate_global->__pyx_tuple__176
#define __pyx_tuple__186 __pyx_mstate_global->__pyx_tuple__186
#define __pyx_tuple__192 __pyx_mstate_global->__pyx_tuple__192
#define __pyx_tuple__195 __pyx_mstate_global->__pyx_tuple__195
#define __pyx_tuple__205 __pyx_mstate_global->__pyx_tuple__205
#define __pyx_tuple__207 __pyx_mstate_global->__pyx_tuple__207
#define __pyx_tuple__209 __pyx_mstate_global->__pyx_tuple__209
#define __pyx_tuple__211 __pyx_mstate_global->__pyx_tuple__211
#define __pyx_tuple__217 __pyx_mstate_global->__pyx_tuple__217
#define __pyx_tuple__219 __pyx_mstate_global->__pyx_tuple__219
#define __pyx_tuple__220 __pyx_mstate_global->__pyx_tuple__220
#define __pyx_tuple__222 __pyx_mstate_global->__pyx_tuple__222
#define __pyx_tuple__223 __pyx_mstate_global->__pyx_tuple__223
#define __pyx_tuple__225 __pyx_mstate_global->__pyx_tuple__225
#define __pyx_tuple__229 __pyx_mstate_global->__pyx_tuple__229
#define __pyx_tuple__231 __pyx_mstate_global->__pyx_tuple__231
#define __pyx_tuple__233 __pyx_mstate_global->__pyx_tuple__233
#define __pyx_tuple__235 __pyx_mstate_global->__pyx_tuple__235
#define __pyx_tuple__238 __pyx_mstate_global->__pyx_tuple__238
#define __pyx_tuple__240 __pyx_mstate_global->__pyx_tuple__240
#define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36
#define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38
#define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46
#define __pyx_codeobj__49 __pyx_mstate_global->__pyx_codeobj__49
#define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51
#define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53
#define __pyx_codeobj__56 __pyx_mstate_global->__pyx_codeobj__56
#define __pyx_codeobj__58 __pyx_mstate_global->__pyx_codeobj__58
#define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60
#define __pyx_codeobj__63 __pyx_mstate_global->__pyx_codeobj__63
#define __pyx_codeobj__65 __pyx_mstate_global->__pyx_codeobj__65
#define __pyx_codeobj__67 __pyx_mstate_global->__pyx_codeobj__67
#define __pyx_codeobj__69 __pyx_mstate_global->__pyx_codeobj__69
#define __pyx_codeobj__71 __pyx_mstate_global->__pyx_codeobj__71
#define __pyx_codeobj__73 __pyx_mstate_global->__pyx_codeobj__73
#define __pyx_codeobj__75 __pyx_mstate_global->__pyx_codeobj__75
#define __pyx_codeobj__78 __pyx_mstate_global->__pyx_codeobj__78
#define __pyx_codeobj__81 __pyx_mstate_global->__pyx_codeobj__81
#define __pyx_codeobj__83 __pyx_mstate_global->__pyx_codeobj__83
#define __pyx_codeobj__85 __pyx_mstate_global->__pyx_codeobj__85
#define __pyx_codeobj__87 __pyx_mstate_global->__pyx_codeobj__87
#define __pyx_codeobj__89 __pyx_mstate_global->__pyx_codeobj__89
#define __pyx_codeobj__92 __pyx_mstate_global->__pyx_codeobj__92
#define __pyx_codeobj__94 __pyx_mstate_global->__pyx_codeobj__94
#define __pyx_codeobj__95 __pyx_mstate_global->__pyx_codeobj__95
#define __pyx_codeobj__97 __pyx_mstate_global->__pyx_codeobj__97
#define __pyx_codeobj__98 __pyx_mstate_global->__pyx_codeobj__98
#define __pyx_codeobj__99 __pyx_mstate_global->__pyx_codeobj__99
#define __pyx_codeobj__100 __pyx_mstate_global->__pyx_codeobj__100
#define __pyx_codeobj__101 __pyx_mstate_global->__pyx_codeobj__101
#define __pyx_codeobj__102 __pyx_mstate_global->__pyx_codeobj__102
#define __pyx_codeobj__103 __pyx_mstate_global->__pyx_codeobj__103
#define __pyx_codeobj__105 __pyx_mstate_global->__pyx_codeobj__105
#define __pyx_codeobj__107 __pyx_mstate_global->__pyx_codeobj__107
#define __pyx_codeobj__109 __pyx_mstate_global->__pyx_codeobj__109
#define __pyx_codeobj__110 __pyx_mstate_global->__pyx_codeobj__110
#define __pyx_codeobj__112 __pyx_mstate_global->__pyx_codeobj__112
#define __pyx_codeobj__114 __pyx_mstate_global->__pyx_codeobj__114
#define __pyx_codeobj__115 __pyx_mstate_global->__pyx_codeobj__115
#define __pyx_codeobj__116 __pyx_mstate_global->__pyx_codeobj__116
#define __pyx_codeobj__118 __pyx_mstate_global->__pyx_codeobj__118
#define __pyx_codeobj__120 __pyx_mstate_global->__pyx_codeobj__120
#define __pyx_codeobj__122 __pyx_mstate_global->__pyx_codeobj__122
#define __pyx_codeobj__123 __pyx_mstate_global->__pyx_codeobj__123
#define __pyx_codeobj__125 __pyx_mstate_global->__pyx_codeobj__125
#define __pyx_codeobj__126 __pyx_mstate_global->__pyx_codeobj__126
#define __pyx_codeobj__127 __pyx_mstate_global->__pyx_codeobj__127
#define __pyx_codeobj__128 __pyx_mstate_global->__pyx_codeobj__128
#define __pyx_codeobj__129 __pyx_mstate_global->__pyx_codeobj__129
#define __pyx_codeobj__130 __pyx_mstate_global->__pyx_codeobj__130
#define __pyx_codeobj__131 __pyx_mstate_global->__pyx_codeobj__131
#define __pyx_codeobj__132 __pyx_mstate_global->__pyx_codeobj__132
#define __pyx_codeobj__134 __pyx_mstate_global->__pyx_codeobj__134
#define __pyx_codeobj__136 __pyx_mstate_global->__pyx_codeobj__136
#define __pyx_codeobj__137 __pyx_mstate_global->__pyx_codeobj__137
#define __pyx_codeobj__139 __pyx_mstate_global->__pyx_codeobj__139
#define __pyx_codeobj__141 __pyx_mstate_global->__pyx_codeobj__141
#define __pyx_codeobj__142 __pyx_mstate_global->__pyx_codeobj__142
#define __pyx_codeobj__143 __pyx_mstate_global->__pyx_codeobj__143
#define __pyx_codeobj__145 __pyx_mstate_global->__pyx_codeobj__145
#define __pyx_codeobj__147 __pyx_mstate_global->__pyx_codeobj__147
#define __pyx_codeobj__150 __pyx_mstate_global->__pyx_codeobj__150
#define __pyx_codeobj__152 __pyx_mstate_global->__pyx_codeobj__152
#define __pyx_codeobj__154 __pyx_mstate_global->__pyx_codeobj__154
#define __pyx_codeobj__156 __pyx_mstate_global->__pyx_codeobj__156
#define __pyx_codeobj__157 __pyx_mstate_global->__pyx_codeobj__157
#define __pyx_codeobj__159 __pyx_mstate_global->__pyx_codeobj__159
#define __pyx_codeobj__161 __pyx_mstate_global->__pyx_codeobj__161
#define __pyx_codeobj__163 __pyx_mstate_global->__pyx_codeobj__163
#define __pyx_codeobj__164 __pyx_mstate_global->__pyx_codeobj__164
#define __pyx_codeobj__165 __pyx_mstate_global->__pyx_codeobj__165
#define __pyx_codeobj__167 __pyx_mstate_global->__pyx_codeobj__167
#define __pyx_codeobj__169 __pyx_mstate_global->__pyx_codeobj__169
#define __pyx_codeobj__170 __pyx_mstate_global->__pyx_codeobj__170
#define __pyx_codeobj__171 __pyx_mstate_global->__pyx_codeobj__171
#define __pyx_codeobj__172 __pyx_mstate_global->__pyx_codeobj__172
#define __pyx_codeobj__173 __pyx_mstate_global->__pyx_codeobj__173
#define __pyx_codeobj__174 __pyx_mstate_global->__pyx_codeobj__174
#define __pyx_codeobj__175 __pyx_mstate_global->__pyx_codeobj__175
#define __pyx_codeobj__177 __pyx_mstate_global->__pyx_codeobj__177
#define __pyx_codeobj__178 __pyx_mstate_global->__pyx_codeobj__178
#define __pyx_codeobj__179 __pyx_mstate_global->__pyx_codeobj__179
#define __pyx_codeobj__180 __pyx_mstate_global->__pyx_codeobj__180
#define __pyx_codeobj__181 __pyx_mstate_global->__pyx_codeobj__181
#define __pyx_codeobj__182 __pyx_mstate_global->__pyx_codeobj__182
#define __pyx_codeobj__183 __pyx_mstate_global->__pyx_codeobj__183
#define __pyx_codeobj__184 __pyx_mstate_global->__pyx_codeobj__184
#define __pyx_codeobj__185 __pyx_mstate_global->__pyx_codeobj__185
#define __pyx_codeobj__187 __pyx_mstate_global->__pyx_codeobj__187
#define __pyx_codeobj__188 __pyx_mstate_global->__pyx_codeobj__188
#define __pyx_codeobj__189 __pyx_mstate_global->__pyx_codeobj__189
#define __pyx_codeobj__190 __pyx_mstate_global->__pyx_codeobj__190
#define __pyx_codeobj__191 __pyx_mstate_global->__pyx_codeobj__191
#define __pyx_codeobj__193 __pyx_mstate_global->__pyx_codeobj__193
#define __pyx_codeobj__194 __pyx_mstate_global->__pyx_codeobj__194
#define __pyx_codeobj__196 __pyx_mstate_global->__pyx_codeobj__196
#define __pyx_codeobj__197 __pyx_mstate_global->__pyx_codeobj__197
#define __pyx_codeobj__198 __pyx_mstate_global->__pyx_codeobj__198
#define __pyx_codeobj__199 __pyx_mstate_global->__pyx_codeobj__199
#define __pyx_codeobj__200 __pyx_mstate_global->__pyx_codeobj__200
#define __pyx_codeobj__201 __pyx_mstate_global->__pyx_codeobj__201
#define __pyx_codeobj__202 __pyx_mstate_global->__pyx_codeobj__202
#define __pyx_codeobj__203 __pyx_mstate_global->__pyx_codeobj__203
#define __pyx_codeobj__204 __pyx_mstate_global->__pyx_codeobj__204
#define __pyx_codeobj__206 __pyx_mstate_global->__pyx_codeobj__206
#define __pyx_codeobj__208 __pyx_mstate_global->__pyx_codeobj__208
#define __pyx_codeobj__210 __pyx_mstate_global->__pyx_codeobj__210
#define __pyx_codeobj__212 __pyx_mstate_global->__pyx_codeobj__212
#define __pyx_codeobj__213 __pyx_mstate_global->__pyx_codeobj__213
#define __pyx_codeobj__214 __pyx_mstate_global->__pyx_codeobj__214
#define __pyx_codeobj__215 __pyx_mstate_global->__pyx_codeobj__215
#define __pyx_codeobj__216 __pyx_mstate_global->__pyx_codeobj__216
#define __pyx_codeobj__218 __pyx_mstate_global->__pyx_codeobj__218
#define __pyx_codeobj__221 __pyx_mstate_global->__pyx_codeobj__221
#define __pyx_codeobj__224 __pyx_mstate_global->__pyx_codeobj__224
#define __pyx_codeobj__226 __pyx_mstate_global->__pyx_codeobj__226
#define __pyx_codeobj__227 __pyx_mstate_global->__pyx_codeobj__227
#define __pyx_codeobj__228 __pyx_mstate_global->__pyx_codeobj__228
#define __pyx_codeobj__230 __pyx_mstate_global->__pyx_codeobj__230
#define __pyx_codeobj__232 __pyx_mstate_global->__pyx_codeobj__232
#define __pyx_codeobj__234 __pyx_mstate_global->__pyx_codeobj__234
#define __pyx_codeobj__236 __pyx_mstate_global->__pyx_codeobj__236
#define __pyx_codeobj__237 __pyx_mstate_global->__pyx_codeobj__237
#define __pyx_codeobj__239 __pyx_mstate_global->__pyx_codeobj__239
#define __pyx_codeobj__241 __pyx_mstate_global->__pyx_codeobj__241
/* #### Code section: module_code ### */

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":287
 * 
 *         @property
 *         cdef inline npy_intp itemsize(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             return PyDataType_ELSIZE(self)
 * 
 */

static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self) {
  npy_intp __pyx_r;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":288
 *         @property
 *         cdef inline npy_intp itemsize(self) noexcept nogil:
 *             return PyDataType_ELSIZE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":287
 * 
 *         @property
 *         cdef inline npy_intp itemsize(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             return PyDataType_ELSIZE(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":291
 * 
 *         @property
 *         cdef inline npy_intp alignment(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             return PyDataType_ALIGNMENT(self)
 * 
 */

static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self) {
  npy_intp __pyx_r;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":292
 *         @property
 *         cdef inline npy_intp alignment(self) noexcept nogil:
 *             return PyDataType_ALIGNMENT(self)             # <<<<<<<<<<<<<<
 * 
 *         # Use fields/names with care as they may be NULL.  You must check
 */
  __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":291
 * 
 *         @property
 *         cdef inline npy_intp alignment(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             return PyDataType_ALIGNMENT(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":297
 *         # for this using PyDataType_HASFIELDS.
 *         @property
 *         cdef inline object fields(self):             # <<<<<<<<<<<<<<
 *             return <object>PyDataType_FIELDS(self)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("fields", 1);

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":298
 *         @property
 *         cdef inline object fields(self):
 *             return <object>PyDataType_FIELDS(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":297
 *         # for this using PyDataType_HASFIELDS.
 *         @property
 *         cdef inline object fields(self):             # <<<<<<<<<<<<<<
 *             return <object>PyDataType_FIELDS(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":301
 * 
 *         @property
 *         cdef inline tuple names(self):             # <<<<<<<<<<<<<<
 *             return <tuple>PyDataType_NAMES(self)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("names", 1);

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":302
 *         @property
 *         cdef inline tuple names(self):
 *             return <tuple>PyDataType_NAMES(self)             # <<<<<<<<<<<<<<
 * 
 *         # Use PyDataType_HASSUBARRAY to test whether this field is
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
  __Pyx_INCREF(((PyObject*)__pyx_t_1));
  __pyx_r = ((PyObject*)__pyx_t_1);
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":301
 * 
 *         @property
 *         cdef inline tuple names(self):             # <<<<<<<<<<<<<<
 *             return <tuple>PyDataType_NAMES(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":308
 *         # this field via the inline helper method PyDataType_SHAPE.
 *         @property
 *         cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             return PyDataType_SUBARRAY(self)
 * 
 */

static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self) {
  PyArray_ArrayDescr *__pyx_r;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":309
 *         @property
 *         cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
 *             return PyDataType_SUBARRAY(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":308
 *         # this field via the inline helper method PyDataType_SHAPE.
 *         @property
 *         cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             return PyDataType_SUBARRAY(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":312
 * 
 *         @property
 *         cdef inline npy_uint64 flags(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """The data types flags."""
 *             return PyDataType_FLAGS(self)
 */

static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self) {
  npy_uint64 __pyx_r;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":314
 *         cdef inline npy_uint64 flags(self) noexcept nogil:
 *             """The data types flags."""
 *             return PyDataType_FLAGS(self)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyDataType_FLAGS(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":312
 * 
 *         @property
 *         cdef inline npy_uint64 flags(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """The data types flags."""
 *             return PyDataType_FLAGS(self)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":324
 * 
 *         @property
 *         cdef inline int numiter(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """The number of arrays that need to be broadcast to the same shape."""
 *             return PyArray_MultiIter_NUMITER(self)
 */

static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self) {
  int __pyx_r;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":326
 *         cdef inline int numiter(self) noexcept nogil:
 *             """The number of arrays that need to be broadcast to the same shape."""
 *             return PyArray_MultiIter_NUMITER(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":324
 * 
 *         @property
 *         cdef inline int numiter(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """The number of arrays that need to be broadcast to the same shape."""
 *             return PyArray_MultiIter_NUMITER(self)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":329
 * 
 *         @property
 *         cdef inline npy_intp size(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """The total broadcasted size."""
 *             return PyArray_MultiIter_SIZE(self)
 */

static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self) {
  npy_intp __pyx_r;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":331
 *         cdef inline npy_intp size(self) noexcept nogil:
 *             """The total broadcasted size."""
 *             return PyArray_MultiIter_SIZE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":329
 * 
 *         @property
 *         cdef inline npy_intp size(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """The total broadcasted size."""
 *             return PyArray_MultiIter_SIZE(self)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":334
 * 
 *         @property
 *         cdef inline npy_intp index(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """The current (1-d) index into the broadcasted result."""
 *             return PyArray_MultiIter_INDEX(self)
 */

static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self) {
  npy_intp __pyx_r;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":336
 *         cdef inline npy_intp index(self) noexcept nogil:
 *             """The current (1-d) index into the broadcasted result."""
 *             return PyArray_MultiIter_INDEX(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":334
 * 
 *         @property
 *         cdef inline npy_intp index(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """The current (1-d) index into the broadcasted result."""
 *             return PyArray_MultiIter_INDEX(self)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":339
 * 
 *         @property
 *         cdef inline int nd(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """The number of dimensions in the broadcasted result."""
 *             return PyArray_MultiIter_NDIM(self)
 */

static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self) {
  int __pyx_r;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":341
 *         cdef inline int nd(self) noexcept nogil:
 *             """The number of dimensions in the broadcasted result."""
 *             return PyArray_MultiIter_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":339
 * 
 *         @property
 *         cdef inline int nd(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """The number of dimensions in the broadcasted result."""
 *             return PyArray_MultiIter_NDIM(self)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":344
 * 
 *         @property
 *         cdef inline npy_intp* dimensions(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """The shape of the broadcasted result."""
 *             return PyArray_MultiIter_DIMS(self)
 */

static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self) {
  npy_intp *__pyx_r;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":346
 *         cdef inline npy_intp* dimensions(self) noexcept nogil:
 *             """The shape of the broadcasted result."""
 *             return PyArray_MultiIter_DIMS(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":344
 * 
 *         @property
 *         cdef inline npy_intp* dimensions(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """The shape of the broadcasted result."""
 *             return PyArray_MultiIter_DIMS(self)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":349
 * 
 *         @property
 *         cdef inline void** iters(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
 *             On return, the iterators are adjusted for broadcasting."""
 */

static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self) {
  void **__pyx_r;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":352
 *             """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
 *             On return, the iterators are adjusted for broadcasting."""
 *             return PyArray_MultiIter_ITERS(self)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":349
 * 
 *         @property
 *         cdef inline void** iters(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
 *             On return, the iterators are adjusted for broadcasting."""
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":367
 * 
 *         @property
 *         cdef inline PyObject* base(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """Returns a borrowed reference to the object owning the data/memory.
 *             """
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) {
  PyObject *__pyx_r;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":370
 *             """Returns a borrowed reference to the object owning the data/memory.
 *             """
 *             return PyArray_BASE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyArray_BASE(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":367
 * 
 *         @property
 *         cdef inline PyObject* base(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """Returns a borrowed reference to the object owning the data/memory.
 *             """
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":373
 * 
 *         @property
 *         cdef inline dtype descr(self):             # <<<<<<<<<<<<<<
 *             """Returns an owned reference to the dtype of the array.
 *             """
 */

static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self) {
  PyArray_Descr *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyArray_Descr *__pyx_t_1;
  __Pyx_RefNannySetupContext("descr", 1);

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":376
 *             """Returns an owned reference to the dtype of the array.
 *             """
 *             return <dtype>PyArray_DESCR(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
  __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
  __pyx_r = ((PyArray_Descr *)__pyx_t_1);
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":373
 * 
 *         @property
 *         cdef inline dtype descr(self):             # <<<<<<<<<<<<<<
 *             """Returns an owned reference to the dtype of the array.
 *             """
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":379
 * 
 *         @property
 *         cdef inline int ndim(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """Returns the number of dimensions in the array.
 *             """
 */

static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) {
  int __pyx_r;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":382
 *             """Returns the number of dimensions in the array.
 *             """
 *             return PyArray_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyArray_NDIM(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":379
 * 
 *         @property
 *         cdef inline int ndim(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """Returns the number of dimensions in the array.
 *             """
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":385
 * 
 *         @property
 *         cdef inline npy_intp *shape(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """Returns a pointer to the dimensions/shape of the array.
 *             The number of elements matches the number of dimensions of the array (ndim).
 */

static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) {
  npy_intp *__pyx_r;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":390
 *             Can return NULL for 0-dimensional arrays.
 *             """
 *             return PyArray_DIMS(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyArray_DIMS(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":385
 * 
 *         @property
 *         cdef inline npy_intp *shape(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """Returns a pointer to the dimensions/shape of the array.
 *             The number of elements matches the number of dimensions of the array (ndim).
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":393
 * 
 *         @property
 *         cdef inline npy_intp *strides(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """Returns a pointer to the strides of the array.
 *             The number of elements matches the number of dimensions of the array (ndim).
 */

static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) {
  npy_intp *__pyx_r;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":397
 *             The number of elements matches the number of dimensions of the array (ndim).
 *             """
 *             return PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyArray_STRIDES(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":393
 * 
 *         @property
 *         cdef inline npy_intp *strides(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """Returns a pointer to the strides of the array.
 *             The number of elements matches the number of dimensions of the array (ndim).
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":400
 * 
 *         @property
 *         cdef inline npy_intp size(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """Returns the total size (in number of elements) of the array.
 *             """
 */

static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) {
  npy_intp __pyx_r;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":403
 *             """Returns the total size (in number of elements) of the array.
 *             """
 *             return PyArray_SIZE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyArray_SIZE(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":400
 * 
 *         @property
 *         cdef inline npy_intp size(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """Returns the total size (in number of elements) of the array.
 *             """
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":406
 * 
 *         @property
 *         cdef inline char* data(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """The pointer to the data buffer as a char*.
 *             This is provided for legacy reasons to avoid direct struct field access.
 */

static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) {
  char *__pyx_r;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":412
 *             of `PyArray_DATA()` instead, which returns a 'void*'.
 *             """
 *             return PyArray_BYTES(self)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyArray_BYTES(__pyx_v_self);
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":406
 * 
 *         @property
 *         cdef inline char* data(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             """The pointer to the data buffer as a char*.
 *             This is provided for legacy reasons to avoid direct struct field access.
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":824
 * ctypedef long double complex clongdouble_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 1);

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":825
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":824
 * ctypedef long double complex clongdouble_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":827
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 1);

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":828
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":827
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":830
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 1);

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":831
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":830
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":833
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 1);

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":834
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":833
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":836
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 1);

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":837
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":836
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":839
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2;
  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 1);

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":840
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
 *         return <tuple>d.subarray.shape
 *     else:
 */
  __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
  if (__pyx_t_1) {

    /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":841
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
 *     else:
 *         return ()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray_subarray(__pyx_v_d)->shape;
    __Pyx_INCREF(((PyObject*)__pyx_t_2));
    __pyx_r = ((PyObject*)__pyx_t_2);
    goto __pyx_L0;

    /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":840
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
 *         return <tuple>d.subarray.shape
 *     else:
 */
  }

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":843
 *         return <tuple>d.subarray.shape
 *     else:
 *         return ()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_empty_tuple);
    __pyx_r = __pyx_empty_tuple;
    goto __pyx_L0;
  }

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":839
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
 *     if PyDataType_HASSUBARRAY(d):
 *         return <tuple>d.subarray.shape
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1027
 *     int _import_umath() except -1
 * 
 * cdef inline void set_array_base(ndarray arr, object base) except *:             # <<<<<<<<<<<<<<
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)
 */

static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
 * 
 * cdef inline void set_array_base(ndarray arr, object base) except *:
 *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
 *     PyArray_SetBaseObject(arr, base)
 * 
 */
  Py_INCREF(__pyx_v_base);

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1029
 * cdef inline void set_array_base(ndarray arr, object base) except *:
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object get_array_base(ndarray arr):
 */
  __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1029, __pyx_L1_error)

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1027
 *     int _import_umath() except -1
 * 
 * cdef inline void set_array_base(ndarray arr, object base) except *:             # <<<<<<<<<<<<<<
 *     Py_INCREF(base) # important to do this before stealing the reference below!
 *     PyArray_SetBaseObject(arr, base)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031
 *     PyArray_SetBaseObject(arr, base)
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_v_base;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_array_base", 1);

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1032
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
 *     if base is NULL:
 *         return None
 */
  __pyx_v_base = PyArray_BASE(__pyx_v_arr);

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1033
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)
 *     if base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     return <object>base
 */
  __pyx_t_1 = (__pyx_v_base == NULL);
  if (__pyx_t_1) {

    /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     return <object>base
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1033
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)
 *     if base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     return <object>base
 */
  }

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1035
 *     if base is NULL:
 *         return None
 *     return <object>base             # <<<<<<<<<<<<<<
 * 
 * # Versions of the import_* functions which are more suitable for
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_base));
  __pyx_r = ((PyObject *)__pyx_v_base);
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031
 *     PyArray_SetBaseObject(arr, base)
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     base = PyArray_BASE(arr)
 *     if base is NULL:
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1039
 * # Versions of the import_* functions which are more suitable for
 * # Cython code.
 * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         __pyx_import_array()
 */

static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_array", 1);

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
 */
  {
    __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:*/ {

      /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1041
 * cdef inline int import_array() except -1:
 *     try:
 *         __pyx_import_array()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy._core.multiarray failed to import")
 */
      __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1041, __pyx_L3_error)

      /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
 */
    }
    __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:;

    /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1042
 *     try:
 *         __pyx_import_array()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy._core.multiarray failed to import")
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1042, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1043
 *         __pyx_import_array()
 *     except Exception:
 *         raise ImportError("numpy._core.multiarray failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_umath() except -1:
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1043, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(1, 1043, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040
 * # Cython code.
 * cdef inline int import_array() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         __pyx_import_array()
 *     except Exception:
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1039
 * # Versions of the import_* functions which are more suitable for
 * # Cython code.
 * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         __pyx_import_array()
 */

  /* function exit code */
  __pyx_r = 0;
  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("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1045
 *         raise ImportError("numpy._core.multiarray failed to import")
 * 
 * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_umath", 1);

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1046
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
  {
    __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:*/ {

      /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1047
 * cdef inline int import_umath() except -1:
 *     try:
 *         _import_umath()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy._core.umath failed to import")
 */
      __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1047, __pyx_L3_error)

      /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1046
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    }
    __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:;

    /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1048
 *     try:
 *         _import_umath()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy._core.umath failed to import")
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1048, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1049
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy._core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_ufunc() except -1:
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1049, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(1, 1049, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1046
 * 
 * cdef inline int import_umath() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1045
 *         raise ImportError("numpy._core.multiarray failed to import")
 * 
 * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

  /* function exit code */
  __pyx_r = 0;
  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("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1051
 *         raise ImportError("numpy._core.umath failed to import")
 * 
 * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("import_ufunc", 1);

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1052
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
  {
    __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:*/ {

      /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1053
 * cdef inline int import_ufunc() except -1:
 *     try:
 *         _import_umath()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         raise ImportError("numpy._core.umath failed to import")
 */
      __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1053, __pyx_L3_error)

      /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1052
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    }
    __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:;

    /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1054
 *     try:
 *         _import_umath()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         raise ImportError("numpy._core.umath failed to import")
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_4) {
      __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1054, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1055
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy._core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1055, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(1, 1055, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1052
 * 
 * cdef inline int import_ufunc() except -1:
 *     try:             # <<<<<<<<<<<<<<
 *         _import_umath()
 *     except Exception:
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1051
 *         raise ImportError("numpy._core.umath failed to import")
 * 
 * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
 *     try:
 *         _import_umath()
 */

  /* function exit code */
  __pyx_r = 0;
  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("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1058
 * 
 * 
 * cdef inline bint is_timedelta64_object(object obj) noexcept:             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.timedelta64)`
 */

static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1070
 *     bool
 *     """
 *     return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1058
 * 
 * 
 * cdef inline bint is_timedelta64_object(object obj) noexcept:             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.timedelta64)`
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1073
 * 
 * 
 * cdef inline bint is_datetime64_object(object obj) noexcept:             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.datetime64)`
 */

static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1085
 *     bool
 *     """
 *     return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1073
 * 
 * 
 * cdef inline bint is_datetime64_object(object obj) noexcept:             # <<<<<<<<<<<<<<
 *     """
 *     Cython equivalent of `isinstance(obj, np.datetime64)`
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1088
 * 
 * 
 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy datetime64 object
 */

static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
  npy_datetime __pyx_r;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1095
 *     also needed.  That can be found using `get_datetime64_unit`.
 *     """
 *     return (<PyDatetimeScalarObject*>obj).obval             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1088
 * 
 * 
 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy datetime64 object
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1098
 * 
 * 
 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy timedelta64 object
 */

static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
  npy_timedelta __pyx_r;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1102
 *     returns the int64 value underlying scalar numpy timedelta64 object
 *     """
 *     return (<PyTimedeltaScalarObject*>obj).obval             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1098
 * 
 * 
 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the int64 value underlying scalar numpy timedelta64 object
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1105
 * 
 * 
 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the unit part of the dtype for a numpy datetime64 object.
 */

static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
  NPY_DATETIMEUNIT __pyx_r;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1109
 *     returns the unit part of the dtype for a numpy datetime64 object.
 *     """
 *     return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1105
 * 
 * 
 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     """
 *     returns the unit part of the dtype for a numpy datetime64 object.
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/complex.pxd":19
 * 
 *         @property
 *         cdef inline double real(self) noexcept:             # <<<<<<<<<<<<<<
 *             return self.cval.real
 * 
 */

static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) {
  double __pyx_r;

  /* "cpython/complex.pxd":20
 *         @property
 *         cdef inline double real(self) noexcept:
 *             return self.cval.real             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = __pyx_v_self->cval.real;
  goto __pyx_L0;

  /* "cpython/complex.pxd":19
 * 
 *         @property
 *         cdef inline double real(self) noexcept:             # <<<<<<<<<<<<<<
 *             return self.cval.real
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/complex.pxd":23
 * 
 *         @property
 *         cdef inline double imag(self) noexcept:             # <<<<<<<<<<<<<<
 *             return self.cval.imag
 * 
 */

static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) {
  double __pyx_r;

  /* "cpython/complex.pxd":24
 *         @property
 *         cdef inline double imag(self) noexcept:
 *             return self.cval.imag             # <<<<<<<<<<<<<<
 * 
 *     # PyTypeObject PyComplex_Type
 */
  __pyx_r = __pyx_v_self->cval.imag;
  goto __pyx_L0;

  /* "cpython/complex.pxd":23
 * 
 *         @property
 *         cdef inline double imag(self) noexcept:             # <<<<<<<<<<<<<<
 *             return self.cval.imag
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/contextvars.pxd":112
 * 
 * 
 * cdef inline object get_value(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the default value of the context variable,
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value *__pyx_optional_args) {
  PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
  PyObject *__pyx_v_value;
  PyObject *__pyx_v_pyvalue = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_default_value = __pyx_optional_args->default_value;
    }
  }

  /* "cpython/contextvars.pxd":117
 *     or None if no such value or default was found.
 *     """
 *     cdef PyObject *value = NULL             # <<<<<<<<<<<<<<
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:
 */
  __pyx_v_value = NULL;

  /* "cpython/contextvars.pxd":118
 *     """
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)             # <<<<<<<<<<<<<<
 *     if value is NULL:
 *         # context variable does not have a default
 */
  __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 118, __pyx_L1_error)

  /* "cpython/contextvars.pxd":119
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:             # <<<<<<<<<<<<<<
 *         # context variable does not have a default
 *         pyvalue = default_value
 */
  __pyx_t_2 = (__pyx_v_value == NULL);
  if (__pyx_t_2) {

    /* "cpython/contextvars.pxd":121
 *     if value is NULL:
 *         # context variable does not have a default
 *         pyvalue = default_value             # <<<<<<<<<<<<<<
 *     else:
 *         # value or default value of context variable
 */
    __Pyx_INCREF(__pyx_v_default_value);
    __pyx_v_pyvalue = __pyx_v_default_value;

    /* "cpython/contextvars.pxd":119
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:             # <<<<<<<<<<<<<<
 *         # context variable does not have a default
 *         pyvalue = default_value
 */
    goto __pyx_L3;
  }

  /* "cpython/contextvars.pxd":124
 *     else:
 *         # value or default value of context variable
 *         pyvalue = <object>value             # <<<<<<<<<<<<<<
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue
 */
  /*else*/ {
    __pyx_t_3 = ((PyObject *)__pyx_v_value);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_pyvalue = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cpython/contextvars.pxd":125
 *         # value or default value of context variable
 *         pyvalue = <object>value
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'             # <<<<<<<<<<<<<<
 *     return pyvalue
 * 
 */
    Py_XDECREF(__pyx_v_value);
  }
  __pyx_L3:;

  /* "cpython/contextvars.pxd":126
 *         pyvalue = <object>value
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_pyvalue);
  __pyx_r = __pyx_v_pyvalue;
  goto __pyx_L0;

  /* "cpython/contextvars.pxd":112
 * 
 * 
 * cdef inline object get_value(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the default value of the context variable,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cpython.contextvars.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pyvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/contextvars.pxd":129
 * 
 * 
 * cdef inline object get_value_no_default(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the provided default value if no such value was found.
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_default(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default *__pyx_optional_args) {
  PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
  PyObject *__pyx_v_value;
  PyObject *__pyx_v_pyvalue = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value_no_default", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_default_value = __pyx_optional_args->default_value;
    }
  }

  /* "cpython/contextvars.pxd":135
 *     Ignores the default value of the context variable, if any.
 *     """
 *     cdef PyObject *value = NULL             # <<<<<<<<<<<<<<
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)
 *     # value of context variable or 'default_value'
 */
  __pyx_v_value = NULL;

  /* "cpython/contextvars.pxd":136
 *     """
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)             # <<<<<<<<<<<<<<
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value
 */
  __pyx_t_1 = PyContextVar_Get(__pyx_v_var, ((PyObject *)__pyx_v_default_value), (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 136, __pyx_L1_error)

  /* "cpython/contextvars.pxd":138
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value             # <<<<<<<<<<<<<<
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue
 */
  __pyx_t_2 = ((PyObject *)__pyx_v_value);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_pyvalue = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cpython/contextvars.pxd":139
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'             # <<<<<<<<<<<<<<
 *     return pyvalue
 */
  Py_XDECREF(__pyx_v_value);

  /* "cpython/contextvars.pxd":140
 *     pyvalue = <object>value
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_pyvalue);
  __pyx_r = __pyx_v_pyvalue;
  goto __pyx_L0;

  /* "cpython/contextvars.pxd":129
 * 
 * 
 * cdef inline object get_value_no_default(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the provided default value if no such value was found.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cpython.contextvars.get_value_no_default", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pyvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":72
 *     ctypedef extern class datetime.date[object PyDateTime_Date]:
 *         @property
 *         cdef inline int year(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_YEAR(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_4year_year(PyDateTime_Date *__pyx_v_self) {
  int __pyx_r;

  /* "datetime.pxd":73
 *         @property
 *         cdef inline int year(self) noexcept:
 *             return PyDateTime_GET_YEAR(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_GET_YEAR(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "datetime.pxd":72
 *     ctypedef extern class datetime.date[object PyDateTime_Date]:
 *         @property
 *         cdef inline int year(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_YEAR(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":76
 * 
 *         @property
 *         cdef inline int month(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_MONTH(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_5month_month(PyDateTime_Date *__pyx_v_self) {
  int __pyx_r;

  /* "datetime.pxd":77
 *         @property
 *         cdef inline int month(self) noexcept:
 *             return PyDateTime_GET_MONTH(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_GET_MONTH(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "datetime.pxd":76
 * 
 *         @property
 *         cdef inline int month(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_MONTH(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":80
 * 
 *         @property
 *         cdef inline int day(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_DAY(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_3day_day(PyDateTime_Date *__pyx_v_self) {
  int __pyx_r;

  /* "datetime.pxd":81
 *         @property
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_GET_DAY(self)             # <<<<<<<<<<<<<<
 * 
 *     ctypedef extern class datetime.time[object PyDateTime_Time]:
 */
  __pyx_r = PyDateTime_GET_DAY(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "datetime.pxd":80
 * 
 *         @property
 *         cdef inline int day(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_DAY(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":85
 *     ctypedef extern class datetime.time[object PyDateTime_Time]:
 *         @property
 *         cdef inline int hour(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_TIME_GET_HOUR(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4hour_hour(PyDateTime_Time *__pyx_v_self) {
  int __pyx_r;

  /* "datetime.pxd":86
 *         @property
 *         cdef inline int hour(self) noexcept:
 *             return PyDateTime_TIME_GET_HOUR(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_TIME_GET_HOUR(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "datetime.pxd":85
 *     ctypedef extern class datetime.time[object PyDateTime_Time]:
 *         @property
 *         cdef inline int hour(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_TIME_GET_HOUR(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":89
 * 
 *         @property
 *         cdef inline int minute(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_TIME_GET_MINUTE(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6minute_minute(PyDateTime_Time *__pyx_v_self) {
  int __pyx_r;

  /* "datetime.pxd":90
 *         @property
 *         cdef inline int minute(self) noexcept:
 *             return PyDateTime_TIME_GET_MINUTE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_TIME_GET_MINUTE(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "datetime.pxd":89
 * 
 *         @property
 *         cdef inline int minute(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_TIME_GET_MINUTE(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":93
 * 
 *         @property
 *         cdef inline int second(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_TIME_GET_SECOND(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6second_second(PyDateTime_Time *__pyx_v_self) {
  int __pyx_r;

  /* "datetime.pxd":94
 *         @property
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_TIME_GET_SECOND(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_TIME_GET_SECOND(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "datetime.pxd":93
 * 
 *         @property
 *         cdef inline int second(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_TIME_GET_SECOND(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":97
 * 
 *         @property
 *         cdef inline int microsecond(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_TIME_GET_MICROSECOND(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(PyDateTime_Time *__pyx_v_self) {
  int __pyx_r;

  /* "datetime.pxd":98
 *         @property
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_TIME_GET_MICROSECOND(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_TIME_GET_MICROSECOND(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "datetime.pxd":97
 * 
 *         @property
 *         cdef inline int microsecond(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_TIME_GET_MICROSECOND(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":101
 * 
 *         @property
 *         cdef inline object tzinfo(self):             # <<<<<<<<<<<<<<
 *             return <object>PyDateTime_TIME_GET_TZINFO(self)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(PyDateTime_Time *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("tzinfo", 1);

  /* "datetime.pxd":102
 *         @property
 *         cdef inline object tzinfo(self):
 *             return <object>PyDateTime_TIME_GET_TZINFO(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTime_TIME_GET_TZINFO(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  goto __pyx_L0;

  /* "datetime.pxd":101
 * 
 *         @property
 *         cdef inline object tzinfo(self):             # <<<<<<<<<<<<<<
 *             return <object>PyDateTime_TIME_GET_TZINFO(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":105
 * 
 *         @property
 *         cdef inline int fold(self) noexcept:             # <<<<<<<<<<<<<<
 *             # For Python < 3.6 this returns 0 no matter what
 *             return PyDateTime_TIME_GET_FOLD(self)
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4fold_fold(PyDateTime_Time *__pyx_v_self) {
  int __pyx_r;

  /* "datetime.pxd":107
 *         cdef inline int fold(self) noexcept:
 *             # For Python < 3.6 this returns 0 no matter what
 *             return PyDateTime_TIME_GET_FOLD(self)             # <<<<<<<<<<<<<<
 * 
 *     ctypedef extern class datetime.datetime[object PyDateTime_DateTime]:
 */
  __pyx_r = PyDateTime_TIME_GET_FOLD(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "datetime.pxd":105
 * 
 *         @property
 *         cdef inline int fold(self) noexcept:             # <<<<<<<<<<<<<<
 *             # For Python < 3.6 this returns 0 no matter what
 *             return PyDateTime_TIME_GET_FOLD(self)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":111
 *     ctypedef extern class datetime.datetime[object PyDateTime_DateTime]:
 *         @property
 *         cdef inline int year(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_YEAR(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4year_year(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "datetime.pxd":112
 *         @property
 *         cdef inline int year(self) noexcept:
 *             return PyDateTime_GET_YEAR(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_GET_YEAR(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "datetime.pxd":111
 *     ctypedef extern class datetime.datetime[object PyDateTime_DateTime]:
 *         @property
 *         cdef inline int year(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_YEAR(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":115
 * 
 *         @property
 *         cdef inline int month(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_MONTH(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_5month_month(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "datetime.pxd":116
 *         @property
 *         cdef inline int month(self) noexcept:
 *             return PyDateTime_GET_MONTH(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_GET_MONTH(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "datetime.pxd":115
 * 
 *         @property
 *         cdef inline int month(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_MONTH(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":119
 * 
 *         @property
 *         cdef inline int day(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_DAY(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_3day_day(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "datetime.pxd":120
 *         @property
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_GET_DAY(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_GET_DAY(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "datetime.pxd":119
 * 
 *         @property
 *         cdef inline int day(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_DAY(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":123
 * 
 *         @property
 *         cdef inline int hour(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DATE_GET_HOUR(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4hour_hour(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "datetime.pxd":124
 *         @property
 *         cdef inline int hour(self) noexcept:
 *             return PyDateTime_DATE_GET_HOUR(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_DATE_GET_HOUR(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "datetime.pxd":123
 * 
 *         @property
 *         cdef inline int hour(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DATE_GET_HOUR(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":127
 * 
 *         @property
 *         cdef inline int minute(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DATE_GET_MINUTE(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_6minute_minute(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "datetime.pxd":128
 *         @property
 *         cdef inline int minute(self) noexcept:
 *             return PyDateTime_DATE_GET_MINUTE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_DATE_GET_MINUTE(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "datetime.pxd":127
 * 
 *         @property
 *         cdef inline int minute(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DATE_GET_MINUTE(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":131
 * 
 *         @property
 *         cdef inline int second(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DATE_GET_SECOND(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_6second_second(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "datetime.pxd":132
 *         @property
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_DATE_GET_SECOND(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_DATE_GET_SECOND(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "datetime.pxd":131
 * 
 *         @property
 *         cdef inline int second(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DATE_GET_SECOND(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":135
 * 
 *         @property
 *         cdef inline int microsecond(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DATE_GET_MICROSECOND(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "datetime.pxd":136
 *         @property
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_DATE_GET_MICROSECOND(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_DATE_GET_MICROSECOND(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "datetime.pxd":135
 * 
 *         @property
 *         cdef inline int microsecond(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DATE_GET_MICROSECOND(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":139
 * 
 *         @property
 *         cdef inline object tzinfo(self):             # <<<<<<<<<<<<<<
 *             return <object>PyDateTime_DATE_GET_TZINFO(self)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(PyDateTime_DateTime *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("tzinfo", 1);

  /* "datetime.pxd":140
 *         @property
 *         cdef inline object tzinfo(self):
 *             return <object>PyDateTime_DATE_GET_TZINFO(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTime_DATE_GET_TZINFO(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  goto __pyx_L0;

  /* "datetime.pxd":139
 * 
 *         @property
 *         cdef inline object tzinfo(self):             # <<<<<<<<<<<<<<
 *             return <object>PyDateTime_DATE_GET_TZINFO(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":143
 * 
 *         @property
 *         cdef inline int fold(self) noexcept:             # <<<<<<<<<<<<<<
 *             # For Python < 3.6 this returns 0 no matter what
 *             return PyDateTime_DATE_GET_FOLD(self)
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4fold_fold(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "datetime.pxd":145
 *         cdef inline int fold(self) noexcept:
 *             # For Python < 3.6 this returns 0 no matter what
 *             return PyDateTime_DATE_GET_FOLD(self)             # <<<<<<<<<<<<<<
 * 
 *     ctypedef extern class datetime.timedelta[object PyDateTime_Delta]:
 */
  __pyx_r = PyDateTime_DATE_GET_FOLD(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "datetime.pxd":143
 * 
 *         @property
 *         cdef inline int fold(self) noexcept:             # <<<<<<<<<<<<<<
 *             # For Python < 3.6 this returns 0 no matter what
 *             return PyDateTime_DATE_GET_FOLD(self)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":149
 *     ctypedef extern class datetime.timedelta[object PyDateTime_Delta]:
 *         @property
 *         cdef inline int day(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DELTA_GET_DAYS(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_3day_day(PyDateTime_Delta *__pyx_v_self) {
  int __pyx_r;

  /* "datetime.pxd":150
 *         @property
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_DELTA_GET_DAYS(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_DELTA_GET_DAYS(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "datetime.pxd":149
 *     ctypedef extern class datetime.timedelta[object PyDateTime_Delta]:
 *         @property
 *         cdef inline int day(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DELTA_GET_DAYS(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":153
 * 
 *         @property
 *         cdef inline int second(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DELTA_GET_SECONDS(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_6second_second(PyDateTime_Delta *__pyx_v_self) {
  int __pyx_r;

  /* "datetime.pxd":154
 *         @property
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_DELTA_GET_SECONDS(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_DELTA_GET_SECONDS(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "datetime.pxd":153
 * 
 *         @property
 *         cdef inline int second(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DELTA_GET_SECONDS(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":157
 * 
 *         @property
 *         cdef inline int microsecond(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DELTA_GET_MICROSECONDS(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(PyDateTime_Delta *__pyx_v_self) {
  int __pyx_r;

  /* "datetime.pxd":158
 *         @property
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_DELTA_GET_MICROSECONDS(self)             # <<<<<<<<<<<<<<
 * 
 *     ctypedef extern class datetime.tzinfo[object PyDateTime_TZInfo]:
 */
  __pyx_r = PyDateTime_DELTA_GET_MICROSECONDS(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "datetime.pxd":157
 * 
 *         @property
 *         cdef inline int microsecond(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DELTA_GET_MICROSECONDS(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":282
 * # Datetime C API initialization function.
 * # You have to call it before any usage of DateTime CAPI functions.
 * cdef inline void import_datetime() noexcept:             # <<<<<<<<<<<<<<
 *     PyDateTime_IMPORT
 * 
 */

static CYTHON_INLINE void __pyx_f_7cpython_8datetime_import_datetime(void) {

  /* "datetime.pxd":283
 * # You have to call it before any usage of DateTime CAPI functions.
 * cdef inline void import_datetime() noexcept:
 *     PyDateTime_IMPORT             # <<<<<<<<<<<<<<
 * 
 * # Create date object using DateTime CAPI factory function.
 */
  (void)(PyDateTime_IMPORT);

  /* "datetime.pxd":282
 * # Datetime C API initialization function.
 * # You have to call it before any usage of DateTime CAPI functions.
 * cdef inline void import_datetime() noexcept:             # <<<<<<<<<<<<<<
 *     PyDateTime_IMPORT
 * 
 */

  /* function exit code */
}

/* "datetime.pxd":287
 * # Create date object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline date date_new(int year, int month, int day):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType)
 * 
 */

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cpython_8datetime_date_new(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day) {
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_new", 1);

  /* "datetime.pxd":288
 * # Note, there are no range checks for any of the arguments.
 * cdef inline date date_new(int year, int month, int day):
 *     return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType)             # <<<<<<<<<<<<<<
 * 
 * # Create time object using DateTime CAPI factory function
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)PyDateTimeAPI->Date_FromDate(__pyx_v_year, __pyx_v_month, __pyx_v_day, PyDateTimeAPI->DateType)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "datetime.pxd":287
 * # Create date object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline date date_new(int year, int month, int day):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cpython.datetime.date_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":292
 * # Create time object using DateTime CAPI factory function
 * # Note, there are no range checks for any of the arguments.
 * cdef inline time time_new(int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)
 * 
 */

static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cpython_8datetime_time_new(int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, PyObject *__pyx_v_tz, struct __pyx_opt_args_7cpython_8datetime_time_new *__pyx_optional_args) {
  int __pyx_v_fold = ((int)0);
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_new", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fold = __pyx_optional_args->fold;
    }
  }

  /* "datetime.pxd":293
 * # Note, there are no range checks for any of the arguments.
 * cdef inline time time_new(int hour, int minute, int second, int microsecond, object tz, int fold=0):
 *     return __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)             # <<<<<<<<<<<<<<
 * 
 * # Create datetime object using DateTime CAPI factory function.
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__Pyx_DateTime_TimeWithFold(__pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_tz, __pyx_v_fold)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(3, 293, __pyx_L1_error)
  __pyx_r = ((PyDateTime_Time *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "datetime.pxd":292
 * # Create time object using DateTime CAPI factory function
 * # Note, there are no range checks for any of the arguments.
 * cdef inline time time_new(int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cpython.datetime.time_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":297
 * # Create datetime object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline datetime datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)
 * 
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cpython_8datetime_datetime_new(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day, int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, PyObject *__pyx_v_tz, struct __pyx_opt_args_7cpython_8datetime_datetime_new *__pyx_optional_args) {
  int __pyx_v_fold = ((int)0);
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("datetime_new", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fold = __pyx_optional_args->fold;
    }
  }

  /* "datetime.pxd":298
 * # Note, there are no range checks for any of the arguments.
 * cdef inline datetime datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz, int fold=0):
 *     return __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)             # <<<<<<<<<<<<<<
 * 
 * # Create timedelta object using DateTime CAPI factory function.
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__Pyx_DateTime_DateTimeWithFold(__pyx_v_year, __pyx_v_month, __pyx_v_day, __pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_tz, __pyx_v_fold)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "datetime.pxd":297
 * # Create datetime object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline datetime datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cpython.datetime.datetime_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":302
 * # Create timedelta object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline timedelta timedelta_new(int days, int seconds, int useconds):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType)
 * 
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cpython_8datetime_timedelta_new(int __pyx_v_days, int __pyx_v_seconds, int __pyx_v_useconds) {
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("timedelta_new", 1);

  /* "datetime.pxd":303
 * # Note, there are no range checks for any of the arguments.
 * cdef inline timedelta timedelta_new(int days, int seconds, int useconds):
 *     return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType)             # <<<<<<<<<<<<<<
 * 
 * # Create timedelta object using DateTime CAPI factory function.
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)PyDateTimeAPI->Delta_FromDelta(__pyx_v_days, __pyx_v_seconds, __pyx_v_useconds, 1, PyDateTimeAPI->DeltaType)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "datetime.pxd":302
 * # Create timedelta object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline timedelta timedelta_new(int days, int seconds, int useconds):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cpython.datetime.timedelta_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":306
 * 
 * # Create timedelta object using DateTime CAPI factory function.
 * cdef inline object timezone_new(object offset, object name=None):             # <<<<<<<<<<<<<<
 *     if PY_VERSION_HEX < 0x030700b1:
 *         raise RuntimeError('Time zones are not available from the C-API.')
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_timezone_new(PyObject *__pyx_v_offset, struct __pyx_opt_args_7cpython_8datetime_timezone_new *__pyx_optional_args) {
  PyObject *__pyx_v_name = ((PyObject *)Py_None);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("timezone_new", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_name = __pyx_optional_args->name;
    }
  }

  /* "datetime.pxd":307
 * # Create timedelta object using DateTime CAPI factory function.
 * cdef inline object timezone_new(object offset, object name=None):
 *     if PY_VERSION_HEX < 0x030700b1:             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Time zones are not available from the C-API.')
 *     return __Pyx_TimeZone_FromOffsetAndName(offset, <PyObject*>name if name is not None else NULL)
 */
  __pyx_t_1 = (PY_VERSION_HEX < 0x030700b1);
  if (unlikely(__pyx_t_1)) {

    /* "datetime.pxd":308
 * cdef inline object timezone_new(object offset, object name=None):
 *     if PY_VERSION_HEX < 0x030700b1:
 *         raise RuntimeError('Time zones are not available from the C-API.')             # <<<<<<<<<<<<<<
 *     return __Pyx_TimeZone_FromOffsetAndName(offset, <PyObject*>name if name is not None else NULL)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 308, __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(3, 308, __pyx_L1_error)

    /* "datetime.pxd":307
 * # Create timedelta object using DateTime CAPI factory function.
 * cdef inline object timezone_new(object offset, object name=None):
 *     if PY_VERSION_HEX < 0x030700b1:             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Time zones are not available from the C-API.')
 *     return __Pyx_TimeZone_FromOffsetAndName(offset, <PyObject*>name if name is not None else NULL)
 */
  }

  /* "datetime.pxd":309
 *     if PY_VERSION_HEX < 0x030700b1:
 *         raise RuntimeError('Time zones are not available from the C-API.')
 *     return __Pyx_TimeZone_FromOffsetAndName(offset, <PyObject*>name if name is not None else NULL)             # <<<<<<<<<<<<<<
 * 
 * # Create datetime object using DB API constructor.
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = (__pyx_v_name != Py_None);
  if (__pyx_t_1) {
    __pyx_t_3 = ((PyObject *)__pyx_v_name);
  } else {
    __pyx_t_3 = NULL;
  }
  __pyx_t_2 = __Pyx_TimeZone_FromOffsetAndName(__pyx_v_offset, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "datetime.pxd":306
 * 
 * # Create timedelta object using DateTime CAPI factory function.
 * cdef inline object timezone_new(object offset, object name=None):             # <<<<<<<<<<<<<<
 *     if PY_VERSION_HEX < 0x030700b1:
 *         raise RuntimeError('Time zones are not available from the C-API.')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cpython.datetime.timezone_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":312
 * 
 * # Create datetime object using DB API constructor.
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.DateTime_FromTimestamp(
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cpython_8datetime_datetime_from_timestamp(PyObject *__pyx_v_timestamp, struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("datetime_from_timestamp", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "datetime.pxd":313
 * # Create datetime object using DB API constructor.
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):
 *     return PyDateTimeAPI.DateTime_FromTimestamp(             # <<<<<<<<<<<<<<
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "datetime.pxd":314
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):
 *     return PyDateTimeAPI.DateTime_FromTimestamp(
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)             # <<<<<<<<<<<<<<
 * 
 * # Create date object using DB API constructor.
 */
  __pyx_t_2 = (__pyx_v_tz != Py_None);
  if (__pyx_t_2) {
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_timestamp);
    __Pyx_GIVEREF(__pyx_v_timestamp);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_timestamp)) __PYX_ERR(3, 314, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_tz);
    __Pyx_GIVEREF(__pyx_v_tz);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_tz)) __PYX_ERR(3, 314, __pyx_L1_error);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_timestamp);
    __Pyx_GIVEREF(__pyx_v_timestamp);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_timestamp)) __PYX_ERR(3, 314, __pyx_L1_error);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }

  /* "datetime.pxd":313
 * # Create datetime object using DB API constructor.
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):
 *     return PyDateTimeAPI.DateTime_FromTimestamp(             # <<<<<<<<<<<<<<
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)
 * 
 */
  __pyx_t_3 = ((PyObject *)PyDateTimeAPI->DateTime_FromTimestamp(((PyObject *)PyDateTimeAPI->DateTimeType), __pyx_t_1, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "datetime.pxd":312
 * 
 * # Create datetime object using DB API constructor.
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.DateTime_FromTimestamp(
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cpython.datetime.datetime_from_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":317
 * 
 * # Create date object using DB API constructor.
 * cdef inline date date_from_timestamp(timestamp):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Date_FromTimestamp(<PyObject*>PyDateTimeAPI.DateType, (timestamp,))
 * 
 */

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cpython_8datetime_date_from_timestamp(PyObject *__pyx_v_timestamp) {
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_from_timestamp", 1);

  /* "datetime.pxd":318
 * # Create date object using DB API constructor.
 * cdef inline date date_from_timestamp(timestamp):
 *     return PyDateTimeAPI.Date_FromTimestamp(<PyObject*>PyDateTimeAPI.DateType, (timestamp,))             # <<<<<<<<<<<<<<
 * 
 * # More recognizable getters for date/time/datetime/timedelta.
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_timestamp);
  __Pyx_GIVEREF(__pyx_v_timestamp);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_timestamp)) __PYX_ERR(3, 318, __pyx_L1_error);
  __pyx_t_2 = ((PyObject *)PyDateTimeAPI->Date_FromTimestamp(((PyObject *)PyDateTimeAPI->DateType), __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_Date *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "datetime.pxd":317
 * 
 * # Create date object using DB API constructor.
 * cdef inline date date_from_timestamp(timestamp):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Date_FromTimestamp(<PyObject*>PyDateTimeAPI.DateType, (timestamp,))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cpython.datetime.date_from_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":326
 * 
 * # Get UTC singleton
 * cdef inline object get_utc():             # <<<<<<<<<<<<<<
 *     if PY_VERSION_HEX < 0x030700b1:
 *         raise RuntimeError('Time zones are not available from the C-API.')
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_get_utc(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_utc", 1);

  /* "datetime.pxd":327
 * # Get UTC singleton
 * cdef inline object get_utc():
 *     if PY_VERSION_HEX < 0x030700b1:             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Time zones are not available from the C-API.')
 *     return <object>__Pyx_TimeZone_UTC
 */
  __pyx_t_1 = (PY_VERSION_HEX < 0x030700b1);
  if (unlikely(__pyx_t_1)) {

    /* "datetime.pxd":328
 * cdef inline object get_utc():
 *     if PY_VERSION_HEX < 0x030700b1:
 *         raise RuntimeError('Time zones are not available from the C-API.')             # <<<<<<<<<<<<<<
 *     return <object>__Pyx_TimeZone_UTC
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 328, __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(3, 328, __pyx_L1_error)

    /* "datetime.pxd":327
 * # Get UTC singleton
 * cdef inline object get_utc():
 *     if PY_VERSION_HEX < 0x030700b1:             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Time zones are not available from the C-API.')
 *     return <object>__Pyx_TimeZone_UTC
 */
  }

  /* "datetime.pxd":329
 *     if PY_VERSION_HEX < 0x030700b1:
 *         raise RuntimeError('Time zones are not available from the C-API.')
 *     return <object>__Pyx_TimeZone_UTC             # <<<<<<<<<<<<<<
 * 
 * # Get tzinfo of time
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__Pyx_TimeZone_UTC));
  __pyx_r = ((PyObject *)__Pyx_TimeZone_UTC);
  goto __pyx_L0;

  /* "datetime.pxd":326
 * 
 * # Get UTC singleton
 * cdef inline object get_utc():             # <<<<<<<<<<<<<<
 *     if PY_VERSION_HEX < 0x030700b1:
 *         raise RuntimeError('Time zones are not available from the C-API.')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cpython.datetime.get_utc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":332
 * 
 * # Get tzinfo of time
 * cdef inline object time_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     return <object>PyDateTime_TIME_GET_TZINFO(o)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_time_tzinfo(PyObject *__pyx_v_o) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("time_tzinfo", 1);

  /* "datetime.pxd":333
 * # Get tzinfo of time
 * cdef inline object time_tzinfo(object o):
 *     return <object>PyDateTime_TIME_GET_TZINFO(o)             # <<<<<<<<<<<<<<
 * 
 * # Get tzinfo of datetime
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTime_TIME_GET_TZINFO(__pyx_v_o);
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  goto __pyx_L0;

  /* "datetime.pxd":332
 * 
 * # Get tzinfo of time
 * cdef inline object time_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     return <object>PyDateTime_TIME_GET_TZINFO(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":336
 * 
 * # Get tzinfo of datetime
 * cdef inline object datetime_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     return <object>PyDateTime_DATE_GET_TZINFO(o)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_datetime_tzinfo(PyObject *__pyx_v_o) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("datetime_tzinfo", 1);

  /* "datetime.pxd":337
 * # Get tzinfo of datetime
 * cdef inline object datetime_tzinfo(object o):
 *     return <object>PyDateTime_DATE_GET_TZINFO(o)             # <<<<<<<<<<<<<<
 * 
 * # Get year of date
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTime_DATE_GET_TZINFO(__pyx_v_o);
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  goto __pyx_L0;

  /* "datetime.pxd":336
 * 
 * # Get tzinfo of datetime
 * cdef inline object datetime_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     return <object>PyDateTime_DATE_GET_TZINFO(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":340
 * 
 * # Get year of date
 * cdef inline int date_year(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_year(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "datetime.pxd":341
 * # Get year of date
 * cdef inline int date_year(object o) noexcept:
 *     return PyDateTime_GET_YEAR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get month of date
 */
  __pyx_r = PyDateTime_GET_YEAR(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":340
 * 
 * # Get year of date
 * cdef inline int date_year(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":344
 * 
 * # Get month of date
 * cdef inline int date_month(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_month(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "datetime.pxd":345
 * # Get month of date
 * cdef inline int date_month(object o) noexcept:
 *     return PyDateTime_GET_MONTH(o)             # <<<<<<<<<<<<<<
 * 
 * # Get day of date
 */
  __pyx_r = PyDateTime_GET_MONTH(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":344
 * 
 * # Get month of date
 * cdef inline int date_month(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":348
 * 
 * # Get day of date
 * cdef inline int date_day(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_day(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "datetime.pxd":349
 * # Get day of date
 * cdef inline int date_day(object o) noexcept:
 *     return PyDateTime_GET_DAY(o)             # <<<<<<<<<<<<<<
 * 
 * # Get year of datetime
 */
  __pyx_r = PyDateTime_GET_DAY(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":348
 * 
 * # Get day of date
 * cdef inline int date_day(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":352
 * 
 * # Get year of datetime
 * cdef inline int datetime_year(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_year(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "datetime.pxd":353
 * # Get year of datetime
 * cdef inline int datetime_year(object o) noexcept:
 *     return PyDateTime_GET_YEAR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get month of datetime
 */
  __pyx_r = PyDateTime_GET_YEAR(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":352
 * 
 * # Get year of datetime
 * cdef inline int datetime_year(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":356
 * 
 * # Get month of datetime
 * cdef inline int datetime_month(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_month(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "datetime.pxd":357
 * # Get month of datetime
 * cdef inline int datetime_month(object o) noexcept:
 *     return PyDateTime_GET_MONTH(o)             # <<<<<<<<<<<<<<
 * 
 * # Get day of datetime
 */
  __pyx_r = PyDateTime_GET_MONTH(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":356
 * 
 * # Get month of datetime
 * cdef inline int datetime_month(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":360
 * 
 * # Get day of datetime
 * cdef inline int datetime_day(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_day(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "datetime.pxd":361
 * # Get day of datetime
 * cdef inline int datetime_day(object o) noexcept:
 *     return PyDateTime_GET_DAY(o)             # <<<<<<<<<<<<<<
 * 
 * # Get hour of time
 */
  __pyx_r = PyDateTime_GET_DAY(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":360
 * 
 * # Get day of datetime
 * cdef inline int datetime_day(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":364
 * 
 * # Get hour of time
 * cdef inline int time_hour(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_HOUR(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_hour(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "datetime.pxd":365
 * # Get hour of time
 * cdef inline int time_hour(object o) noexcept:
 *     return PyDateTime_TIME_GET_HOUR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get minute of time
 */
  __pyx_r = PyDateTime_TIME_GET_HOUR(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":364
 * 
 * # Get hour of time
 * cdef inline int time_hour(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_HOUR(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":368
 * 
 * # Get minute of time
 * cdef inline int time_minute(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MINUTE(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_minute(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "datetime.pxd":369
 * # Get minute of time
 * cdef inline int time_minute(object o) noexcept:
 *     return PyDateTime_TIME_GET_MINUTE(o)             # <<<<<<<<<<<<<<
 * 
 * # Get second of time
 */
  __pyx_r = PyDateTime_TIME_GET_MINUTE(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":368
 * 
 * # Get minute of time
 * cdef inline int time_minute(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MINUTE(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":372
 * 
 * # Get second of time
 * cdef inline int time_second(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_SECOND(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_second(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "datetime.pxd":373
 * # Get second of time
 * cdef inline int time_second(object o) noexcept:
 *     return PyDateTime_TIME_GET_SECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get microsecond of time
 */
  __pyx_r = PyDateTime_TIME_GET_SECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":372
 * 
 * # Get second of time
 * cdef inline int time_second(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_SECOND(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":376
 * 
 * # Get microsecond of time
 * cdef inline int time_microsecond(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MICROSECOND(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_microsecond(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "datetime.pxd":377
 * # Get microsecond of time
 * cdef inline int time_microsecond(object o) noexcept:
 *     return PyDateTime_TIME_GET_MICROSECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get fold of time
 */
  __pyx_r = PyDateTime_TIME_GET_MICROSECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":376
 * 
 * # Get microsecond of time
 * cdef inline int time_microsecond(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MICROSECOND(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":380
 * 
 * # Get fold of time
 * cdef inline int time_fold(object o) noexcept:             # <<<<<<<<<<<<<<
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_TIME_GET_FOLD(o)
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_fold(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "datetime.pxd":382
 * cdef inline int time_fold(object o) noexcept:
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_TIME_GET_FOLD(o)             # <<<<<<<<<<<<<<
 * 
 * # Get hour of datetime
 */
  __pyx_r = PyDateTime_TIME_GET_FOLD(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":380
 * 
 * # Get fold of time
 * cdef inline int time_fold(object o) noexcept:             # <<<<<<<<<<<<<<
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_TIME_GET_FOLD(o)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":385
 * 
 * # Get hour of datetime
 * cdef inline int datetime_hour(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_HOUR(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_hour(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "datetime.pxd":386
 * # Get hour of datetime
 * cdef inline int datetime_hour(object o) noexcept:
 *     return PyDateTime_DATE_GET_HOUR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get minute of datetime
 */
  __pyx_r = PyDateTime_DATE_GET_HOUR(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":385
 * 
 * # Get hour of datetime
 * cdef inline int datetime_hour(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_HOUR(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":389
 * 
 * # Get minute of datetime
 * cdef inline int datetime_minute(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MINUTE(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_minute(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "datetime.pxd":390
 * # Get minute of datetime
 * cdef inline int datetime_minute(object o) noexcept:
 *     return PyDateTime_DATE_GET_MINUTE(o)             # <<<<<<<<<<<<<<
 * 
 * # Get second of datetime
 */
  __pyx_r = PyDateTime_DATE_GET_MINUTE(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":389
 * 
 * # Get minute of datetime
 * cdef inline int datetime_minute(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MINUTE(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":393
 * 
 * # Get second of datetime
 * cdef inline int datetime_second(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_SECOND(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_second(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "datetime.pxd":394
 * # Get second of datetime
 * cdef inline int datetime_second(object o) noexcept:
 *     return PyDateTime_DATE_GET_SECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get microsecond of datetime
 */
  __pyx_r = PyDateTime_DATE_GET_SECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":393
 * 
 * # Get second of datetime
 * cdef inline int datetime_second(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_SECOND(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":397
 * 
 * # Get microsecond of datetime
 * cdef inline int datetime_microsecond(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MICROSECOND(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_microsecond(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "datetime.pxd":398
 * # Get microsecond of datetime
 * cdef inline int datetime_microsecond(object o) noexcept:
 *     return PyDateTime_DATE_GET_MICROSECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get fold of datetime
 */
  __pyx_r = PyDateTime_DATE_GET_MICROSECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":397
 * 
 * # Get microsecond of datetime
 * cdef inline int datetime_microsecond(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MICROSECOND(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":401
 * 
 * # Get fold of datetime
 * cdef inline int datetime_fold(object o) noexcept:             # <<<<<<<<<<<<<<
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_DATE_GET_FOLD(o)
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_fold(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "datetime.pxd":403
 * cdef inline int datetime_fold(object o) noexcept:
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_DATE_GET_FOLD(o)             # <<<<<<<<<<<<<<
 * 
 * # Get days of timedelta
 */
  __pyx_r = PyDateTime_DATE_GET_FOLD(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":401
 * 
 * # Get fold of datetime
 * cdef inline int datetime_fold(object o) noexcept:             # <<<<<<<<<<<<<<
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_DATE_GET_FOLD(o)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":406
 * 
 * # Get days of timedelta
 * cdef inline int timedelta_days(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).days
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_days(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "datetime.pxd":407
 * # Get days of timedelta
 * cdef inline int timedelta_days(object o) noexcept:
 *     return (<PyDateTime_Delta*>o).days             # <<<<<<<<<<<<<<
 * 
 * # Get seconds of timedelta
 */
  __pyx_r = ((PyDateTime_Delta *)__pyx_v_o)->days;
  goto __pyx_L0;

  /* "datetime.pxd":406
 * 
 * # Get days of timedelta
 * cdef inline int timedelta_days(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).days
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":410
 * 
 * # Get seconds of timedelta
 * cdef inline int timedelta_seconds(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).seconds
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_seconds(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "datetime.pxd":411
 * # Get seconds of timedelta
 * cdef inline int timedelta_seconds(object o) noexcept:
 *     return (<PyDateTime_Delta*>o).seconds             # <<<<<<<<<<<<<<
 * 
 * # Get microseconds of timedelta
 */
  __pyx_r = ((PyDateTime_Delta *)__pyx_v_o)->seconds;
  goto __pyx_L0;

  /* "datetime.pxd":410
 * 
 * # Get seconds of timedelta
 * cdef inline int timedelta_seconds(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).seconds
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":414
 * 
 * # Get microseconds of timedelta
 * cdef inline int timedelta_microseconds(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).microseconds
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_microseconds(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "datetime.pxd":415
 * # Get microseconds of timedelta
 * cdef inline int timedelta_microseconds(object o) noexcept:
 *     return (<PyDateTime_Delta*>o).microseconds             # <<<<<<<<<<<<<<
 * 
 * cdef inline double total_seconds(timedelta obj) noexcept:
 */
  __pyx_r = ((PyDateTime_Delta *)__pyx_v_o)->microseconds;
  goto __pyx_L0;

  /* "datetime.pxd":414
 * 
 * # Get microseconds of timedelta
 * cdef inline int timedelta_microseconds(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).microseconds
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "datetime.pxd":417
 *     return (<PyDateTime_Delta*>o).microseconds
 * 
 * cdef inline double total_seconds(timedelta obj) noexcept:             # <<<<<<<<<<<<<<
 *     # Mirrors the "timedelta.total_seconds()" method.
 *     # Note that this implementation is not guaranteed to give *exactly* the same
 */

static CYTHON_INLINE double __pyx_f_7cpython_8datetime_total_seconds(PyDateTime_Delta *__pyx_v_obj) {
  double __pyx_v_days;
  double __pyx_v_seconds;
  double __pyx_v_micros;
  double __pyx_r;

  /* "datetime.pxd":423
 *     cdef:
 *         double days, seconds, micros
 *     days = <double>PyDateTime_DELTA_GET_DAYS(obj)             # <<<<<<<<<<<<<<
 *     seconds = <double>PyDateTime_DELTA_GET_SECONDS(obj)
 *     micros = <double>PyDateTime_DELTA_GET_MICROSECONDS(obj)
 */
  __pyx_v_days = ((double)PyDateTime_DELTA_GET_DAYS(((PyObject *)__pyx_v_obj)));

  /* "datetime.pxd":424
 *         double days, seconds, micros
 *     days = <double>PyDateTime_DELTA_GET_DAYS(obj)
 *     seconds = <double>PyDateTime_DELTA_GET_SECONDS(obj)             # <<<<<<<<<<<<<<
 *     micros = <double>PyDateTime_DELTA_GET_MICROSECONDS(obj)
 *     return days * 24 * 3600 + seconds + micros / 1_000_000
 */
  __pyx_v_seconds = ((double)PyDateTime_DELTA_GET_SECONDS(((PyObject *)__pyx_v_obj)));

  /* "datetime.pxd":425
 *     days = <double>PyDateTime_DELTA_GET_DAYS(obj)
 *     seconds = <double>PyDateTime_DELTA_GET_SECONDS(obj)
 *     micros = <double>PyDateTime_DELTA_GET_MICROSECONDS(obj)             # <<<<<<<<<<<<<<
 *     return days * 24 * 3600 + seconds + micros / 1_000_000
 */
  __pyx_v_micros = ((double)PyDateTime_DELTA_GET_MICROSECONDS(((PyObject *)__pyx_v_obj)));

  /* "datetime.pxd":426
 *     seconds = <double>PyDateTime_DELTA_GET_SECONDS(obj)
 *     micros = <double>PyDateTime_DELTA_GET_MICROSECONDS(obj)
 *     return days * 24 * 3600 + seconds + micros / 1_000_000             # <<<<<<<<<<<<<<
 */
  __pyx_r = ((((__pyx_v_days * 24.0) * 3600.0) + __pyx_v_seconds) + (__pyx_v_micros / 1000000.0));
  goto __pyx_L0;

  /* "datetime.pxd":417
 *     return (<PyDateTime_Delta*>o).microseconds
 * 
 * cdef inline double total_seconds(timedelta obj) noexcept:             # <<<<<<<<<<<<<<
 *     # Mirrors the "timedelta.total_seconds()" method.
 *     # Note that this implementation is not guaranteed to give *exactly* the same
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/time.pxd":48
 * 
 * 
 * cdef inline double time() noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         _PyTime_t tic
 */

static CYTHON_INLINE double __pyx_f_7cpython_4time_time(void) {
  __Pyx_PyTime_t __pyx_v_tic;
  double __pyx_r;

  /* "cpython/time.pxd":52
 *         _PyTime_t tic
 * 
 *     tic = PyTime_TimeUnchecked()             # <<<<<<<<<<<<<<
 *     return PyTime_AsSecondsDouble(tic)
 * 
 */
  __pyx_v_tic = __Pyx_PyTime_TimeUnchecked();

  /* "cpython/time.pxd":53
 * 
 *     tic = PyTime_TimeUnchecked()
 *     return PyTime_AsSecondsDouble(tic)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __Pyx_PyTime_AsSecondsDouble(__pyx_v_tic);
  goto __pyx_L0;

  /* "cpython/time.pxd":48
 * 
 * 
 * cdef inline double time() noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         _PyTime_t tic
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/time.pxd":56
 * 
 * 
 * cdef inline int _raise_from_errno() except -1 with gil:             # <<<<<<<<<<<<<<
 *     PyErr_SetFromErrno(RuntimeError)
 *     return <int> -1  # Let the C compiler know that this function always raises.
 */

static CYTHON_INLINE int __pyx_f_7cpython_4time__raise_from_errno(void) {
  int __pyx_r;
  PyObject *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif

  /* "cpython/time.pxd":57
 * 
 * cdef inline int _raise_from_errno() except -1 with gil:
 *     PyErr_SetFromErrno(RuntimeError)             # <<<<<<<<<<<<<<
 *     return <int> -1  # Let the C compiler know that this function always raises.
 * 
 */
  __pyx_t_1 = PyErr_SetFromErrno(__pyx_builtin_RuntimeError); if (unlikely(__pyx_t_1 == ((PyObject *)NULL))) __PYX_ERR(4, 57, __pyx_L1_error)

  /* "cpython/time.pxd":58
 * cdef inline int _raise_from_errno() except -1 with gil:
 *     PyErr_SetFromErrno(RuntimeError)
 *     return <int> -1  # Let the C compiler know that this function always raises.             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((int)-1L);
  goto __pyx_L0;

  /* "cpython/time.pxd":56
 * 
 * 
 * cdef inline int _raise_from_errno() except -1 with gil:             # <<<<<<<<<<<<<<
 *     PyErr_SetFromErrno(RuntimeError)
 *     return <int> -1  # Let the C compiler know that this function always raises.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cpython.time._raise_from_errno", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "cpython/time.pxd":61
 * 
 * 
 * cdef inline tm localtime() except * nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Analogue to the stdlib time.localtime.  The returned struct
 */

static CYTHON_INLINE struct tm __pyx_f_7cpython_4time_localtime(void) {
  time_t __pyx_v_tic;
  struct tm *__pyx_v_result;
  struct tm __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif

  /* "cpython/time.pxd":67
 *     """
 *     cdef:
 *         time_t tic = <time_t>time()             # <<<<<<<<<<<<<<
 *         tm* result
 * 
 */
  __pyx_v_tic = ((time_t)__pyx_f_7cpython_4time_time());

  /* "cpython/time.pxd":70
 *         tm* result
 * 
 *     result = libc_localtime(&tic)             # <<<<<<<<<<<<<<
 *     if result is NULL:
 *         _raise_from_errno()
 */
  __pyx_v_result = localtime((&__pyx_v_tic));

  /* "cpython/time.pxd":71
 * 
 *     result = libc_localtime(&tic)
 *     if result is NULL:             # <<<<<<<<<<<<<<
 *         _raise_from_errno()
 *     # Fix 0-based date values (and the 1900-based year).
 */
  __pyx_t_1 = (__pyx_v_result == NULL);
  if (__pyx_t_1) {

    /* "cpython/time.pxd":72
 *     result = libc_localtime(&tic)
 *     if result is NULL:
 *         _raise_from_errno()             # <<<<<<<<<<<<<<
 *     # Fix 0-based date values (and the 1900-based year).
 *     # See tmtotuple() in https://github.com/python/cpython/blob/master/Modules/timemodule.c
 */
    __pyx_t_2 = __pyx_f_7cpython_4time__raise_from_errno(); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 72, __pyx_L1_error)

    /* "cpython/time.pxd":71
 * 
 *     result = libc_localtime(&tic)
 *     if result is NULL:             # <<<<<<<<<<<<<<
 *         _raise_from_errno()
 *     # Fix 0-based date values (and the 1900-based year).
 */
  }

  /* "cpython/time.pxd":75
 *     # Fix 0-based date values (and the 1900-based year).
 *     # See tmtotuple() in https://github.com/python/cpython/blob/master/Modules/timemodule.c
 *     result.tm_year += 1900             # <<<<<<<<<<<<<<
 *     result.tm_mon += 1
 *     result.tm_wday = <int> ((result.tm_wday + 6) % 7)
 */
  __pyx_v_result->tm_year = (__pyx_v_result->tm_year + 0x76C);

  /* "cpython/time.pxd":76
 *     # See tmtotuple() in https://github.com/python/cpython/blob/master/Modules/timemodule.c
 *     result.tm_year += 1900
 *     result.tm_mon += 1             # <<<<<<<<<<<<<<
 *     result.tm_wday = <int> ((result.tm_wday + 6) % 7)
 *     result.tm_yday += 1
 */
  __pyx_v_result->tm_mon = (__pyx_v_result->tm_mon + 1);

  /* "cpython/time.pxd":77
 *     result.tm_year += 1900
 *     result.tm_mon += 1
 *     result.tm_wday = <int> ((result.tm_wday + 6) % 7)             # <<<<<<<<<<<<<<
 *     result.tm_yday += 1
 *     return result[0]
 */
  __pyx_v_result->tm_wday = ((int)__Pyx_mod_long((__pyx_v_result->tm_wday + 6), 7));

  /* "cpython/time.pxd":78
 *     result.tm_mon += 1
 *     result.tm_wday = <int> ((result.tm_wday + 6) % 7)
 *     result.tm_yday += 1             # <<<<<<<<<<<<<<
 *     return result[0]
 */
  __pyx_v_result->tm_yday = (__pyx_v_result->tm_yday + 1);

  /* "cpython/time.pxd":79
 *     result.tm_wday = <int> ((result.tm_wday + 6) % 7)
 *     result.tm_yday += 1
 *     return result[0]             # <<<<<<<<<<<<<<
 */
  __pyx_r = (__pyx_v_result[0]);
  goto __pyx_L0;

  /* "cpython/time.pxd":61
 * 
 * 
 * cdef inline tm localtime() except * nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Analogue to the stdlib time.localtime.  The returned struct
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cpython.time.localtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":137
 * 
 * # Math -------------------------------------------------------------------------------------------------
 * cdef inline long long math_mod(long long num, long long factor, long long offset=0):             # <<<<<<<<<<<<<<
 *     """Computes the modulo of a number by the factor, handling
 *     negative numbers accoring to Python's modulo semantics `<'int'>`.
 */

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_math_mod(PY_LONG_LONG __pyx_v_num, PY_LONG_LONG __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_math_mod *__pyx_optional_args) {
  PY_LONG_LONG __pyx_v_offset = ((PY_LONG_LONG)0);
  int __pyx_v_neg_f;
  PY_LONG_LONG __pyx_v_r;
  PY_LONG_LONG __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("math_mod", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }

  /* "utils.pxd":144
 *     >>> (num % factor) + offset
 *     """
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.math_mod()'.")
 * 
 */
  __pyx_t_1 = (__pyx_v_factor == 0);
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":145
 *     """
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.math_mod()'.")             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 145, __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(5, 145, __pyx_L1_error)

    /* "utils.pxd":144
 *     >>> (num % factor) + offset
 *     """
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.math_mod()'.")
 * 
 */
  }

  /* "utils.pxd":148
 * 
 *     cdef:
 *         bint neg_f = factor < 0             # <<<<<<<<<<<<<<
 *         long long r
 * 
 */
  __pyx_v_neg_f = (__pyx_v_factor < 0);

  /* "utils.pxd":152
 * 
 *     with cython.cdivision(True):
 *         r = num % factor             # <<<<<<<<<<<<<<
 *         if r != 0:
 *             if not neg_f:
 */
  __pyx_v_r = (__pyx_v_num % __pyx_v_factor);

  /* "utils.pxd":153
 *     with cython.cdivision(True):
 *         r = num % factor
 *         if r != 0:             # <<<<<<<<<<<<<<
 *             if not neg_f:
 *                 if r < 0:
 */
  __pyx_t_1 = (__pyx_v_r != 0);
  if (__pyx_t_1) {

    /* "utils.pxd":154
 *         r = num % factor
 *         if r != 0:
 *             if not neg_f:             # <<<<<<<<<<<<<<
 *                 if r < 0:
 *                     r += factor
 */
    __pyx_t_1 = (!__pyx_v_neg_f);
    if (__pyx_t_1) {

      /* "utils.pxd":155
 *         if r != 0:
 *             if not neg_f:
 *                 if r < 0:             # <<<<<<<<<<<<<<
 *                     r += factor
 *             else:
 */
      __pyx_t_1 = (__pyx_v_r < 0);
      if (__pyx_t_1) {

        /* "utils.pxd":156
 *             if not neg_f:
 *                 if r < 0:
 *                     r += factor             # <<<<<<<<<<<<<<
 *             else:
 *                 if r > 0:
 */
        __pyx_v_r = (__pyx_v_r + __pyx_v_factor);

        /* "utils.pxd":155
 *         if r != 0:
 *             if not neg_f:
 *                 if r < 0:             # <<<<<<<<<<<<<<
 *                     r += factor
 *             else:
 */
      }

      /* "utils.pxd":154
 *         r = num % factor
 *         if r != 0:
 *             if not neg_f:             # <<<<<<<<<<<<<<
 *                 if r < 0:
 *                     r += factor
 */
      goto __pyx_L5;
    }

    /* "utils.pxd":158
 *                     r += factor
 *             else:
 *                 if r > 0:             # <<<<<<<<<<<<<<
 *                     r += factor
 *     return r + offset
 */
    /*else*/ {
      __pyx_t_1 = (__pyx_v_r > 0);
      if (__pyx_t_1) {

        /* "utils.pxd":159
 *             else:
 *                 if r > 0:
 *                     r += factor             # <<<<<<<<<<<<<<
 *     return r + offset
 * 
 */
        __pyx_v_r = (__pyx_v_r + __pyx_v_factor);

        /* "utils.pxd":158
 *                     r += factor
 *             else:
 *                 if r > 0:             # <<<<<<<<<<<<<<
 *                     r += factor
 *     return r + offset
 */
      }
    }
    __pyx_L5:;

    /* "utils.pxd":153
 *     with cython.cdivision(True):
 *         r = num % factor
 *         if r != 0:             # <<<<<<<<<<<<<<
 *             if not neg_f:
 *                 if r < 0:
 */
  }

  /* "utils.pxd":160
 *                 if r > 0:
 *                     r += factor
 *     return r + offset             # <<<<<<<<<<<<<<
 * 
 * cdef inline long long math_round_div(long long num, long long factor, long long offset=0):
 */
  __pyx_r = (__pyx_v_r + __pyx_v_offset);
  goto __pyx_L0;

  /* "utils.pxd":137
 * 
 * # Math -------------------------------------------------------------------------------------------------
 * cdef inline long long math_mod(long long num, long long factor, long long offset=0):             # <<<<<<<<<<<<<<
 *     """Computes the modulo of a number by the factor, handling
 *     negative numbers accoring to Python's modulo semantics `<'int'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.math_mod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":162
 *     return r + offset
 * 
 * cdef inline long long math_round_div(long long num, long long factor, long long offset=0):             # <<<<<<<<<<<<<<
 *     """Divides a number by the factor and rounds the result to
 *     the nearest integer (half away from zero), handling negative
 */

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_math_round_div(PY_LONG_LONG __pyx_v_num, PY_LONG_LONG __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_math_round_div *__pyx_optional_args) {
  PY_LONG_LONG __pyx_v_offset = ((PY_LONG_LONG)0);
  int __pyx_v_neg_f;
  PY_LONG_LONG __pyx_v_abs_f;
  PY_LONG_LONG __pyx_v_q;
  PY_LONG_LONG __pyx_v_r;
  PY_LONG_LONG __pyx_v_abs_r;
  PY_LONG_LONG __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PY_LONG_LONG __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("math_round_div", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }

  /* "utils.pxd":170
 *     >>> round(num / factor, 0) + offset
 *     """
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.math_round_div()'.")
 * 
 */
  __pyx_t_1 = (__pyx_v_factor == 0);
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":171
 *     """
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.math_round_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 171, __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(5, 171, __pyx_L1_error)

    /* "utils.pxd":170
 *     >>> round(num / factor, 0) + offset
 *     """
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.math_round_div()'.")
 * 
 */
  }

  /* "utils.pxd":174
 * 
 *     cdef:
 *         bint neg_f = factor < 0             # <<<<<<<<<<<<<<
 *         long long abs_f = -factor if neg_f else factor
 *         long long q, r, abs_r
 */
  __pyx_v_neg_f = (__pyx_v_factor < 0);

  /* "utils.pxd":175
 *     cdef:
 *         bint neg_f = factor < 0
 *         long long abs_f = -factor if neg_f else factor             # <<<<<<<<<<<<<<
 *         long long q, r, abs_r
 * 
 */
  if (__pyx_v_neg_f) {
    __pyx_t_3 = (-__pyx_v_factor);
  } else {
    __pyx_t_3 = __pyx_v_factor;
  }
  __pyx_v_abs_f = __pyx_t_3;

  /* "utils.pxd":179
 * 
 *     with cython.cdivision(True):
 *         q = num // factor             # <<<<<<<<<<<<<<
 *         r = num % factor
 *         abs_r = -r if r < 0 else r
 */
  __pyx_v_q = (__pyx_v_num / __pyx_v_factor);

  /* "utils.pxd":180
 *     with cython.cdivision(True):
 *         q = num // factor
 *         r = num % factor             # <<<<<<<<<<<<<<
 *         abs_r = -r if r < 0 else r
 *         if abs_r * 2 >= abs_f:
 */
  __pyx_v_r = (__pyx_v_num % __pyx_v_factor);

  /* "utils.pxd":181
 *         q = num // factor
 *         r = num % factor
 *         abs_r = -r if r < 0 else r             # <<<<<<<<<<<<<<
 *         if abs_r * 2 >= abs_f:
 *             if (not neg_f and num >= 0) or (neg_f and num < 0):
 */
  __pyx_t_1 = (__pyx_v_r < 0);
  if (__pyx_t_1) {
    __pyx_t_3 = (-__pyx_v_r);
  } else {
    __pyx_t_3 = __pyx_v_r;
  }
  __pyx_v_abs_r = __pyx_t_3;

  /* "utils.pxd":182
 *         r = num % factor
 *         abs_r = -r if r < 0 else r
 *         if abs_r * 2 >= abs_f:             # <<<<<<<<<<<<<<
 *             if (not neg_f and num >= 0) or (neg_f and num < 0):
 *                 q += 1
 */
  __pyx_t_1 = ((__pyx_v_abs_r * 2) >= __pyx_v_abs_f);
  if (__pyx_t_1) {

    /* "utils.pxd":183
 *         abs_r = -r if r < 0 else r
 *         if abs_r * 2 >= abs_f:
 *             if (not neg_f and num >= 0) or (neg_f and num < 0):             # <<<<<<<<<<<<<<
 *                 q += 1
 *             else:
 */
    __pyx_t_4 = (!__pyx_v_neg_f);
    if (!__pyx_t_4) {
      goto __pyx_L7_next_or;
    } else {
    }
    __pyx_t_4 = (__pyx_v_num >= 0);
    if (!__pyx_t_4) {
    } else {
      __pyx_t_1 = __pyx_t_4;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_L7_next_or:;
    if (__pyx_v_neg_f) {
    } else {
      __pyx_t_1 = __pyx_v_neg_f;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_num < 0);
    __pyx_t_1 = __pyx_t_4;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_1) {

      /* "utils.pxd":184
 *         if abs_r * 2 >= abs_f:
 *             if (not neg_f and num >= 0) or (neg_f and num < 0):
 *                 q += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 q -= 1
 */
      __pyx_v_q = (__pyx_v_q + 1);

      /* "utils.pxd":183
 *         abs_r = -r if r < 0 else r
 *         if abs_r * 2 >= abs_f:
 *             if (not neg_f and num >= 0) or (neg_f and num < 0):             # <<<<<<<<<<<<<<
 *                 q += 1
 *             else:
 */
      goto __pyx_L5;
    }

    /* "utils.pxd":186
 *                 q += 1
 *             else:
 *                 q -= 1             # <<<<<<<<<<<<<<
 *     return q + offset
 * 
 */
    /*else*/ {
      __pyx_v_q = (__pyx_v_q - 1);
    }
    __pyx_L5:;

    /* "utils.pxd":182
 *         r = num % factor
 *         abs_r = -r if r < 0 else r
 *         if abs_r * 2 >= abs_f:             # <<<<<<<<<<<<<<
 *             if (not neg_f and num >= 0) or (neg_f and num < 0):
 *                 q += 1
 */
  }

  /* "utils.pxd":187
 *             else:
 *                 q -= 1
 *     return q + offset             # <<<<<<<<<<<<<<
 * 
 * cdef inline long long math_ceil_div(long long num, long long factor, long long offset=0):
 */
  __pyx_r = (__pyx_v_q + __pyx_v_offset);
  goto __pyx_L0;

  /* "utils.pxd":162
 *     return r + offset
 * 
 * cdef inline long long math_round_div(long long num, long long factor, long long offset=0):             # <<<<<<<<<<<<<<
 *     """Divides a number by the factor and rounds the result to
 *     the nearest integer (half away from zero), handling negative
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.math_round_div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":189
 *     return q + offset
 * 
 * cdef inline long long math_ceil_div(long long num, long long factor, long long offset=0):             # <<<<<<<<<<<<<<
 *     """Divides a number by the factor and rounds the result up
 *     to the nearest integer, handling negative numbers accoring
 */

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_math_ceil_div(PY_LONG_LONG __pyx_v_num, PY_LONG_LONG __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_math_ceil_div *__pyx_optional_args) {
  PY_LONG_LONG __pyx_v_offset = ((PY_LONG_LONG)0);
  PY_LONG_LONG __pyx_v_q;
  PY_LONG_LONG __pyx_v_r;
  PY_LONG_LONG __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("math_ceil_div", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }

  /* "utils.pxd":197
 *     >>> math.ceil(num / factor) + offset
 *     """
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.math_ceil_div()'.")
 * 
 */
  __pyx_t_1 = (__pyx_v_factor == 0);
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":198
 *     """
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.math_ceil_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     cdef long long q, r
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 198, __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(5, 198, __pyx_L1_error)

    /* "utils.pxd":197
 *     >>> math.ceil(num / factor) + offset
 *     """
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.math_ceil_div()'.")
 * 
 */
  }

  /* "utils.pxd":202
 *     cdef long long q, r
 *     with cython.cdivision(True):
 *         q = num // factor             # <<<<<<<<<<<<<<
 *         r = num % factor
 *         if r != 0:
 */
  __pyx_v_q = (__pyx_v_num / __pyx_v_factor);

  /* "utils.pxd":203
 *     with cython.cdivision(True):
 *         q = num // factor
 *         r = num % factor             # <<<<<<<<<<<<<<
 *         if r != 0:
 *             if factor > 0:
 */
  __pyx_v_r = (__pyx_v_num % __pyx_v_factor);

  /* "utils.pxd":204
 *         q = num // factor
 *         r = num % factor
 *         if r != 0:             # <<<<<<<<<<<<<<
 *             if factor > 0:
 *                 if num > 0:
 */
  __pyx_t_1 = (__pyx_v_r != 0);
  if (__pyx_t_1) {

    /* "utils.pxd":205
 *         r = num % factor
 *         if r != 0:
 *             if factor > 0:             # <<<<<<<<<<<<<<
 *                 if num > 0:
 *                     q += 1
 */
    __pyx_t_1 = (__pyx_v_factor > 0);
    if (__pyx_t_1) {

      /* "utils.pxd":206
 *         if r != 0:
 *             if factor > 0:
 *                 if num > 0:             # <<<<<<<<<<<<<<
 *                     q += 1
 *             else:
 */
      __pyx_t_1 = (__pyx_v_num > 0);
      if (__pyx_t_1) {

        /* "utils.pxd":207
 *             if factor > 0:
 *                 if num > 0:
 *                     q += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 if num < 0:
 */
        __pyx_v_q = (__pyx_v_q + 1);

        /* "utils.pxd":206
 *         if r != 0:
 *             if factor > 0:
 *                 if num > 0:             # <<<<<<<<<<<<<<
 *                     q += 1
 *             else:
 */
      }

      /* "utils.pxd":205
 *         r = num % factor
 *         if r != 0:
 *             if factor > 0:             # <<<<<<<<<<<<<<
 *                 if num > 0:
 *                     q += 1
 */
      goto __pyx_L5;
    }

    /* "utils.pxd":209
 *                     q += 1
 *             else:
 *                 if num < 0:             # <<<<<<<<<<<<<<
 *                     q += 1
 *     return q + offset
 */
    /*else*/ {
      __pyx_t_1 = (__pyx_v_num < 0);
      if (__pyx_t_1) {

        /* "utils.pxd":210
 *             else:
 *                 if num < 0:
 *                     q += 1             # <<<<<<<<<<<<<<
 *     return q + offset
 * 
 */
        __pyx_v_q = (__pyx_v_q + 1);

        /* "utils.pxd":209
 *                     q += 1
 *             else:
 *                 if num < 0:             # <<<<<<<<<<<<<<
 *                     q += 1
 *     return q + offset
 */
      }
    }
    __pyx_L5:;

    /* "utils.pxd":204
 *         q = num // factor
 *         r = num % factor
 *         if r != 0:             # <<<<<<<<<<<<<<
 *             if factor > 0:
 *                 if num > 0:
 */
  }

  /* "utils.pxd":211
 *                 if num < 0:
 *                     q += 1
 *     return q + offset             # <<<<<<<<<<<<<<
 * 
 * cdef inline long long math_floor_div(long long num, long long factor, long long offset=0):
 */
  __pyx_r = (__pyx_v_q + __pyx_v_offset);
  goto __pyx_L0;

  /* "utils.pxd":189
 *     return q + offset
 * 
 * cdef inline long long math_ceil_div(long long num, long long factor, long long offset=0):             # <<<<<<<<<<<<<<
 *     """Divides a number by the factor and rounds the result up
 *     to the nearest integer, handling negative numbers accoring
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.math_ceil_div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":213
 *     return q + offset
 * 
 * cdef inline long long math_floor_div(long long num, long long factor, long long offset=0):             # <<<<<<<<<<<<<<
 *     """Divides a number by the factor and rounds the result
 *     down to the nearest integer, handling negative numbers
 */

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_math_floor_div(PY_LONG_LONG __pyx_v_num, PY_LONG_LONG __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_math_floor_div *__pyx_optional_args) {
  PY_LONG_LONG __pyx_v_offset = ((PY_LONG_LONG)0);
  PY_LONG_LONG __pyx_v_q;
  PY_LONG_LONG __pyx_v_r;
  PY_LONG_LONG __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("math_floor_div", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }

  /* "utils.pxd":221
 *     >>> math.floor(num / factor) + offset
 *     """
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.math_floor_div()'.")
 * 
 */
  __pyx_t_1 = (__pyx_v_factor == 0);
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":222
 *     """
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.math_floor_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     cdef long long q, r
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 222, __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(5, 222, __pyx_L1_error)

    /* "utils.pxd":221
 *     >>> math.floor(num / factor) + offset
 *     """
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.math_floor_div()'.")
 * 
 */
  }

  /* "utils.pxd":226
 *     cdef long long q, r
 *     with cython.cdivision(True):
 *         q = num // factor             # <<<<<<<<<<<<<<
 *         r = num % factor
 *         if r != 0:
 */
  __pyx_v_q = (__pyx_v_num / __pyx_v_factor);

  /* "utils.pxd":227
 *     with cython.cdivision(True):
 *         q = num // factor
 *         r = num % factor             # <<<<<<<<<<<<<<
 *         if r != 0:
 *             if factor > 0:
 */
  __pyx_v_r = (__pyx_v_num % __pyx_v_factor);

  /* "utils.pxd":228
 *         q = num // factor
 *         r = num % factor
 *         if r != 0:             # <<<<<<<<<<<<<<
 *             if factor > 0:
 *                 if num < 0:
 */
  __pyx_t_1 = (__pyx_v_r != 0);
  if (__pyx_t_1) {

    /* "utils.pxd":229
 *         r = num % factor
 *         if r != 0:
 *             if factor > 0:             # <<<<<<<<<<<<<<
 *                 if num < 0:
 *                     q -= 1
 */
    __pyx_t_1 = (__pyx_v_factor > 0);
    if (__pyx_t_1) {

      /* "utils.pxd":230
 *         if r != 0:
 *             if factor > 0:
 *                 if num < 0:             # <<<<<<<<<<<<<<
 *                     q -= 1
 *             else:
 */
      __pyx_t_1 = (__pyx_v_num < 0);
      if (__pyx_t_1) {

        /* "utils.pxd":231
 *             if factor > 0:
 *                 if num < 0:
 *                     q -= 1             # <<<<<<<<<<<<<<
 *             else:
 *                 if num > 0:
 */
        __pyx_v_q = (__pyx_v_q - 1);

        /* "utils.pxd":230
 *         if r != 0:
 *             if factor > 0:
 *                 if num < 0:             # <<<<<<<<<<<<<<
 *                     q -= 1
 *             else:
 */
      }

      /* "utils.pxd":229
 *         r = num % factor
 *         if r != 0:
 *             if factor > 0:             # <<<<<<<<<<<<<<
 *                 if num < 0:
 *                     q -= 1
 */
      goto __pyx_L5;
    }

    /* "utils.pxd":233
 *                     q -= 1
 *             else:
 *                 if num > 0:             # <<<<<<<<<<<<<<
 *                     q -= 1
 *     return q + offset
 */
    /*else*/ {
      __pyx_t_1 = (__pyx_v_num > 0);
      if (__pyx_t_1) {

        /* "utils.pxd":234
 *             else:
 *                 if num > 0:
 *                     q -= 1             # <<<<<<<<<<<<<<
 *     return q + offset
 * 
 */
        __pyx_v_q = (__pyx_v_q - 1);

        /* "utils.pxd":233
 *                     q -= 1
 *             else:
 *                 if num > 0:             # <<<<<<<<<<<<<<
 *                     q -= 1
 *     return q + offset
 */
      }
    }
    __pyx_L5:;

    /* "utils.pxd":228
 *         q = num // factor
 *         r = num % factor
 *         if r != 0:             # <<<<<<<<<<<<<<
 *             if factor > 0:
 *                 if num < 0:
 */
  }

  /* "utils.pxd":235
 *                 if num > 0:
 *                     q -= 1
 *     return q + offset             # <<<<<<<<<<<<<<
 * 
 * # Parser -----------------------------------------------------------------------------------------------
 */
  __pyx_r = (__pyx_v_q + __pyx_v_offset);
  goto __pyx_L0;

  /* "utils.pxd":213
 *     return q + offset
 * 
 * cdef inline long long math_floor_div(long long num, long long factor, long long offset=0):             # <<<<<<<<<<<<<<
 *     """Divides a number by the factor and rounds the result
 *     down to the nearest integer, handling negative numbers
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.math_floor_div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":239
 * # Parser -----------------------------------------------------------------------------------------------
 * # . check
 * cdef inline Py_ssize_t str_count(str s, str substr) except -1:             # <<<<<<<<<<<<<<
 *     """Get the number of occurrences of a 'substr' in an unicode `<'int'>`.
 * 
 */

static CYTHON_INLINE Py_ssize_t __pyx_f_7cytimes_5utils_str_count(PyObject *__pyx_v_s, PyObject *__pyx_v_substr) {
  Py_ssize_t __pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":245
 *     >>> s.count(substr)
 *     """
 *     return PyUnicode_Count(s, substr, 0, PY_SSIZE_T_MAX)             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_iso_sep(Py_UCS4 ch) except -1:
 */
  __pyx_t_1 = PyUnicode_Count(__pyx_v_s, __pyx_v_substr, 0, PY_SSIZE_T_MAX); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1L))) __PYX_ERR(5, 245, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "utils.pxd":239
 * # Parser -----------------------------------------------------------------------------------------------
 * # . check
 * cdef inline Py_ssize_t str_count(str s, str substr) except -1:             # <<<<<<<<<<<<<<
 *     """Get the number of occurrences of a 'substr' in an unicode `<'int'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.str_count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":247
 *     return PyUnicode_Count(s, substr, 0, PY_SSIZE_T_MAX)
 * 
 * cdef inline bint is_iso_sep(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ISO format date/time seperator (" " or "T") `<'bool'>`"""
 *     return ch in (" ", "t", "T")
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_iso_sep(Py_UCS4 __pyx_v_ch) {
  int __pyx_r;
  int __pyx_t_1;

  /* "utils.pxd":249
 * cdef inline bint is_iso_sep(Py_UCS4 ch) except -1:
 *     """Check if the passed in 'ch' is an ISO format date/time seperator (" " or "T") `<'bool'>`"""
 *     return ch in (" ", "t", "T")             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_isodate_sep(Py_UCS4 ch) except -1:
 */
  switch (__pyx_v_ch) {
    case 32:
    case 0x74:
    case 84:
    __pyx_t_1 = 1;
    break;
    default:
    __pyx_t_1 = 0;
    break;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "utils.pxd":247
 *     return PyUnicode_Count(s, substr, 0, PY_SSIZE_T_MAX)
 * 
 * cdef inline bint is_iso_sep(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ISO format date/time seperator (" " or "T") `<'bool'>`"""
 *     return ch in (" ", "t", "T")
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":251
 *     return ch in (" ", "t", "T")
 * 
 * cdef inline bint is_isodate_sep(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ISO format date fields separator ("-" or "/") `<'bool'>`"""
 *     return ch in ("-", "/")
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_isodate_sep(Py_UCS4 __pyx_v_ch) {
  int __pyx_r;
  int __pyx_t_1;

  /* "utils.pxd":253
 * cdef inline bint is_isodate_sep(Py_UCS4 ch) except -1:
 *     """Check if the passed in 'ch' is an ISO format date fields separator ("-" or "/") `<'bool'>`"""
 *     return ch in ("-", "/")             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_isoweek_sep(Py_UCS4 ch) except -1:
 */
  switch (__pyx_v_ch) {
    case 45:
    case 47:
    __pyx_t_1 = 1;
    break;
    default:
    __pyx_t_1 = 0;
    break;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "utils.pxd":251
 *     return ch in (" ", "t", "T")
 * 
 * cdef inline bint is_isodate_sep(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ISO format date fields separator ("-" or "/") `<'bool'>`"""
 *     return ch in ("-", "/")
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":255
 *     return ch in ("-", "/")
 * 
 * cdef inline bint is_isoweek_sep(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ISO format week number identifier ("W") `<'bool'>`"""
 *     return ch in ("W", "w")
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_isoweek_sep(Py_UCS4 __pyx_v_ch) {
  int __pyx_r;
  int __pyx_t_1;

  /* "utils.pxd":257
 * cdef inline bint is_isoweek_sep(Py_UCS4 ch) except -1:
 *     """Check if the passed in 'ch' is an ISO format week number identifier ("W") `<'bool'>`"""
 *     return ch in ("W", "w")             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_isotime_sep(Py_UCS4 ch) except -1:
 */
  switch (__pyx_v_ch) {
    case 87:
    case 0x77:
    __pyx_t_1 = 1;
    break;
    default:
    __pyx_t_1 = 0;
    break;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "utils.pxd":255
 *     return ch in ("-", "/")
 * 
 * cdef inline bint is_isoweek_sep(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ISO format week number identifier ("W") `<'bool'>`"""
 *     return ch in ("W", "w")
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":259
 *     return ch in ("W", "w")
 * 
 * cdef inline bint is_isotime_sep(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ISO format time fields separator (":") `<'bool'>`"""
 *     return ch == ":"
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_isotime_sep(Py_UCS4 __pyx_v_ch) {
  int __pyx_r;

  /* "utils.pxd":261
 * cdef inline bint is_isotime_sep(Py_UCS4 ch) except -1:
 *     """Check if the passed in 'ch' is an ISO format time fields separator (":") `<'bool'>`"""
 *     return ch == ":"             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_ascii_digit(Py_UCS4 ch) except -1:
 */
  __pyx_r = (__pyx_v_ch == 58);
  goto __pyx_L0;

  /* "utils.pxd":259
 *     return ch in ("W", "w")
 * 
 * cdef inline bint is_isotime_sep(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ISO format time fields separator (":") `<'bool'>`"""
 *     return ch == ":"
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":263
 *     return ch == ":"
 * 
 * cdef inline bint is_ascii_digit(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ASCII digit [0-9] `<'bool'>`"""
 *     return "0" <= ch <= "9"
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_ascii_digit(Py_UCS4 __pyx_v_ch) {
  int __pyx_r;
  int __pyx_t_1;

  /* "utils.pxd":265
 * cdef inline bint is_ascii_digit(Py_UCS4 ch) except -1:
 *     """Check if the passed in 'ch' is an ASCII digit [0-9] `<'bool'>`"""
 *     return "0" <= ch <= "9"             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_ascii_alpha_upper(Py_UCS4 ch) except -1:
 */
  __pyx_t_1 = (48 <= __pyx_v_ch);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_ch <= 57);
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "utils.pxd":263
 *     return ch == ":"
 * 
 * cdef inline bint is_ascii_digit(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ASCII digit [0-9] `<'bool'>`"""
 *     return "0" <= ch <= "9"
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":267
 *     return "0" <= ch <= "9"
 * 
 * cdef inline bint is_ascii_alpha_upper(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ASCII alpha in uppercase [A-Z] `<'bool'>`."""
 *     return "A" <= ch <= "Z"
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_ascii_alpha_upper(Py_UCS4 __pyx_v_ch) {
  int __pyx_r;
  int __pyx_t_1;

  /* "utils.pxd":269
 * cdef inline bint is_ascii_alpha_upper(Py_UCS4 ch) except -1:
 *     """Check if the passed in 'ch' is an ASCII alpha in uppercase [A-Z] `<'bool'>`."""
 *     return "A" <= ch <= "Z"             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_ascii_alpha_lower(Py_UCS4 ch) except -1:
 */
  __pyx_t_1 = (65 <= __pyx_v_ch);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_ch <= 90);
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "utils.pxd":267
 *     return "0" <= ch <= "9"
 * 
 * cdef inline bint is_ascii_alpha_upper(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ASCII alpha in uppercase [A-Z] `<'bool'>`."""
 *     return "A" <= ch <= "Z"
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":271
 *     return "A" <= ch <= "Z"
 * 
 * cdef inline bint is_ascii_alpha_lower(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ASCII alpha in lowercase [a-z] `<'bool'>`."""
 *     return "a" <= ch <= "z"
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_ascii_alpha_lower(Py_UCS4 __pyx_v_ch) {
  int __pyx_r;
  int __pyx_t_1;

  /* "utils.pxd":273
 * cdef inline bint is_ascii_alpha_lower(Py_UCS4 ch) except -1:
 *     """Check if the passed in 'ch' is an ASCII alpha in lowercase [a-z] `<'bool'>`."""
 *     return "a" <= ch <= "z"             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_ascii_alpha(Py_UCS4 ch) except -1:
 */
  __pyx_t_1 = (97 <= __pyx_v_ch);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_ch <= 0x7A);
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "utils.pxd":271
 *     return "A" <= ch <= "Z"
 * 
 * cdef inline bint is_ascii_alpha_lower(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ASCII alpha in lowercase [a-z] `<'bool'>`."""
 *     return "a" <= ch <= "z"
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":275
 *     return "a" <= ch <= "z"
 * 
 * cdef inline bint is_ascii_alpha(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ASCII alpha [a-zA-Z] `<'bool'>`."""
 *     return is_ascii_alpha_lower(ch) or is_ascii_alpha_upper(ch)
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_ascii_alpha(Py_UCS4 __pyx_v_ch) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":277
 * cdef inline bint is_ascii_alpha(Py_UCS4 ch) except -1:
 *     """Check if the passed in 'ch' is an ASCII alpha [a-zA-Z] `<'bool'>`."""
 *     return is_ascii_alpha_lower(ch) or is_ascii_alpha_upper(ch)             # <<<<<<<<<<<<<<
 * 
 * # . parse
 */
  __pyx_t_2 = __pyx_f_7cytimes_5utils_is_ascii_alpha_lower(__pyx_v_ch); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 277, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = __pyx_f_7cytimes_5utils_is_ascii_alpha_upper(__pyx_v_ch); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 277, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "utils.pxd":275
 *     return "a" <= ch <= "z"
 * 
 * cdef inline bint is_ascii_alpha(Py_UCS4 ch) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'ch' is an ASCII alpha [a-zA-Z] `<'bool'>`."""
 *     return is_ascii_alpha_lower(ch) or is_ascii_alpha_upper(ch)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.is_ascii_alpha", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":280
 * 
 * # . parse
 * cdef inline int parse_isoyear(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse ISO format year component (YYYY) from a string,
 *     returns `-1` for invalid ISO years `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isoyear(PyObject *__pyx_v_data, Py_ssize_t __pyx_v_pos, Py_ssize_t __pyx_v_size) {
  char __pyx_v_buffer[5];
  Py_UCS4 __pyx_v_ch;
  Py_ssize_t __pyx_v_i;
  int __pyx_v_year;
  int __pyx_r;
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":295
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 4:
 */
  __pyx_t_1 = (__pyx_v_size <= 0);
  if (__pyx_t_1) {

    /* "utils.pxd":296
 *     # Validate
 *     if size <= 0:
 *         size = str_len(data)             # <<<<<<<<<<<<<<
 *     if size - pos < 4:
 *         return -1  # exit: invalid
 */
    __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_data);

    /* "utils.pxd":295
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 4:
 */
  }

  /* "utils.pxd":297
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 4:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  __pyx_t_1 = ((__pyx_v_size - __pyx_v_pos) < 4);
  if (__pyx_t_1) {

    /* "utils.pxd":298
 *         size = str_len(data)
 *     if size - pos < 4:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 * 
 *     # Parse values
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "utils.pxd":297
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 4:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  }

  /* "utils.pxd":304
 *     cdef Py_UCS4 ch
 *     cdef Py_ssize_t i
 *     for i in range(4):             # <<<<<<<<<<<<<<
 *         ch = str_read(data, pos + i)
 *         if not is_ascii_digit(ch):
 */
  for (__pyx_t_2 = 0; __pyx_t_2 < 4; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "utils.pxd":305
 *     cdef Py_ssize_t i
 *     for i in range(4):
 *         ch = str_read(data, pos + i)             # <<<<<<<<<<<<<<
 *         if not is_ascii_digit(ch):
 *             return -1  # exit: invalid
 */
    __pyx_t_3 = PyUnicode_ReadChar(__pyx_v_data, (__pyx_v_pos + __pyx_v_i)); if (unlikely(__pyx_t_3 == ((Py_UCS4)-1))) __PYX_ERR(5, 305, __pyx_L1_error)
    __pyx_v_ch = __pyx_t_3;

    /* "utils.pxd":306
 *     for i in range(4):
 *         ch = str_read(data, pos + i)
 *         if not is_ascii_digit(ch):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *         buffer[i] = ch
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_ascii_digit(__pyx_v_ch); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 306, __pyx_L1_error)
    __pyx_t_4 = (!__pyx_t_1);
    if (__pyx_t_4) {

      /* "utils.pxd":307
 *         ch = str_read(data, pos + i)
 *         if not is_ascii_digit(ch):
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *         buffer[i] = ch
 *     # . null-terminate
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "utils.pxd":306
 *     for i in range(4):
 *         ch = str_read(data, pos + i)
 *         if not is_ascii_digit(ch):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *         buffer[i] = ch
 */
    }

    /* "utils.pxd":308
 *         if not is_ascii_digit(ch):
 *             return -1  # exit: invalid
 *         buffer[i] = ch             # <<<<<<<<<<<<<<
 *     # . null-terminate
 *     buffer[4] = 0  # null-term
 */
    (__pyx_v_buffer[__pyx_v_i]) = __pyx_v_ch;
  }

  /* "utils.pxd":310
 *         buffer[i] = ch
 *     # . null-terminate
 *     buffer[4] = 0  # null-term             # <<<<<<<<<<<<<<
 * 
 *     # Convert to integer
 */
  (__pyx_v_buffer[4]) = 0;

  /* "utils.pxd":313
 * 
 *     # Convert to integer
 *     cdef int year = strtoll(buffer, NULL, 10)             # <<<<<<<<<<<<<<
 *     return year if year != 0 else -1
 * 
 */
  __pyx_v_year = strtoll(__pyx_v_buffer, NULL, 10);

  /* "utils.pxd":314
 *     # Convert to integer
 *     cdef int year = strtoll(buffer, NULL, 10)
 *     return year if year != 0 else -1             # <<<<<<<<<<<<<<
 * 
 * cdef inline int parse_isomonth(str data, Py_ssize_t pos, Py_ssize_t size)  except -2:
 */
  __pyx_t_4 = (__pyx_v_year != 0);
  if (__pyx_t_4) {
    __pyx_t_5 = __pyx_v_year;
  } else {
    __pyx_t_5 = -1;
  }
  __pyx_r = __pyx_t_5;
  goto __pyx_L0;

  /* "utils.pxd":280
 * 
 * # . parse
 * cdef inline int parse_isoyear(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse ISO format year component (YYYY) from a string,
 *     returns `-1` for invalid ISO years `<'int'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.parse_isoyear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -2;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":316
 *     return year if year != 0 else -1
 * 
 * cdef inline int parse_isomonth(str data, Py_ssize_t pos, Py_ssize_t size)  except -2:             # <<<<<<<<<<<<<<
 *     """Parse ISO format month component (MM) from a string,
 *     returns `-1` for invalid ISO months `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isomonth(PyObject *__pyx_v_data, Py_ssize_t __pyx_v_pos, Py_ssize_t __pyx_v_size) {
  char __pyx_v_buffer[3];
  Py_UCS4 __pyx_v_ch1;
  Py_UCS4 __pyx_v_ch2;
  int __pyx_r;
  int __pyx_t_1;
  Py_UCS4 __pyx_t_2;
  int __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":331
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 2:
 */
  __pyx_t_1 = (__pyx_v_size <= 0);
  if (__pyx_t_1) {

    /* "utils.pxd":332
 *     # Validate
 *     if size <= 0:
 *         size = str_len(data)             # <<<<<<<<<<<<<<
 *     if size - pos < 2:
 *         return -1  # exit: invalid
 */
    __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_data);

    /* "utils.pxd":331
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 2:
 */
  }

  /* "utils.pxd":333
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 2:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  __pyx_t_1 = ((__pyx_v_size - __pyx_v_pos) < 2);
  if (__pyx_t_1) {

    /* "utils.pxd":334
 *         size = str_len(data)
 *     if size - pos < 2:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 * 
 *     # Parse values
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "utils.pxd":333
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 2:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  }

  /* "utils.pxd":338
 *     # Parse values
 *     cdef char buffer[3]
 *     cdef Py_UCS4 ch1 = str_read(data, pos)             # <<<<<<<<<<<<<<
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 == "0":
 */
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_data, __pyx_v_pos); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(5, 338, __pyx_L1_error)
  __pyx_v_ch1 = __pyx_t_2;

  /* "utils.pxd":339
 *     cdef char buffer[3]
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)             # <<<<<<<<<<<<<<
 *     if ch1 == "0":
 *         if not "1" <= ch2 <= "9":
 */
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_data, (__pyx_v_pos + 1)); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(5, 339, __pyx_L1_error)
  __pyx_v_ch2 = __pyx_t_2;

  /* "utils.pxd":340
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 == "0":             # <<<<<<<<<<<<<<
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid
 */
  switch (__pyx_v_ch1) {
    case 48:

    /* "utils.pxd":341
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 == "0":
 *         if not "1" <= ch2 <= "9":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "1":
 */
    __pyx_t_1 = (49 <= __pyx_v_ch2);
    if (__pyx_t_1) {
      __pyx_t_1 = (__pyx_v_ch2 <= 57);
    }
    __pyx_t_3 = (!__pyx_t_1);
    if (__pyx_t_3) {

      /* "utils.pxd":342
 *     if ch1 == "0":
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     elif ch1 == "1":
 *         if not "0" <= ch2 <= "2":
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "utils.pxd":341
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 == "0":
 *         if not "1" <= ch2 <= "9":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "1":
 */
    }

    /* "utils.pxd":340
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 == "0":             # <<<<<<<<<<<<<<
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid
 */
    break;
    case 49:

    /* "utils.pxd":344
 *             return -1  # exit: invalid
 *     elif ch1 == "1":
 *         if not "0" <= ch2 <= "2":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     else:
 */
    __pyx_t_3 = (48 <= __pyx_v_ch2);
    if (__pyx_t_3) {
      __pyx_t_3 = (__pyx_v_ch2 <= 50);
    }
    __pyx_t_1 = (!__pyx_t_3);
    if (__pyx_t_1) {

      /* "utils.pxd":345
 *     elif ch1 == "1":
 *         if not "0" <= ch2 <= "2":
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     else:
 *         return -1  # exit: invalid
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "utils.pxd":344
 *             return -1  # exit: invalid
 *     elif ch1 == "1":
 *         if not "0" <= ch2 <= "2":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     else:
 */
    }

    /* "utils.pxd":343
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid
 *     elif ch1 == "1":             # <<<<<<<<<<<<<<
 *         if not "0" <= ch2 <= "2":
 *             return -1  # exit: invalid
 */
    break;
    default:

    /* "utils.pxd":347
 *             return -1  # exit: invalid
 *     else:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2
 */
    __pyx_r = -1;
    goto __pyx_L0;
    break;
  }

  /* "utils.pxd":349
 *         return -1  # exit: invalid
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2             # <<<<<<<<<<<<<<
 *     buffer[2] = 0  # null-term
 * 
 */
  __pyx_t_2 = __pyx_v_ch1;
  __pyx_t_4 = __pyx_v_ch2;
  (__pyx_v_buffer[0]) = __pyx_t_2;
  (__pyx_v_buffer[1]) = __pyx_t_4;

  /* "utils.pxd":350
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2
 *     buffer[2] = 0  # null-term             # <<<<<<<<<<<<<<
 * 
 *     # Convert to integer
 */
  (__pyx_v_buffer[2]) = 0;

  /* "utils.pxd":353
 * 
 *     # Convert to integer
 *     return strtoll(buffer, NULL, 10)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int parse_isoday(str data, Py_ssize_t pos, Py_ssize_t size) except -2:
 */
  __pyx_r = strtoll(__pyx_v_buffer, NULL, 10);
  goto __pyx_L0;

  /* "utils.pxd":316
 *     return year if year != 0 else -1
 * 
 * cdef inline int parse_isomonth(str data, Py_ssize_t pos, Py_ssize_t size)  except -2:             # <<<<<<<<<<<<<<
 *     """Parse ISO format month component (MM) from a string,
 *     returns `-1` for invalid ISO months `<'int'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.parse_isomonth", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -2;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":355
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline int parse_isoday(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse ISO format day component (DD) from a string,
 *     returns `-1` for invalid ISO days `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isoday(PyObject *__pyx_v_data, Py_ssize_t __pyx_v_pos, Py_ssize_t __pyx_v_size) {
  char __pyx_v_buffer[3];
  Py_UCS4 __pyx_v_ch1;
  Py_UCS4 __pyx_v_ch2;
  int __pyx_r;
  int __pyx_t_1;
  Py_UCS4 __pyx_t_2;
  int __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":370
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 2:
 */
  __pyx_t_1 = (__pyx_v_size <= 0);
  if (__pyx_t_1) {

    /* "utils.pxd":371
 *     # Validate
 *     if size <= 0:
 *         size = str_len(data)             # <<<<<<<<<<<<<<
 *     if size - pos < 2:
 *         return -1  # exit: invalid
 */
    __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_data);

    /* "utils.pxd":370
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 2:
 */
  }

  /* "utils.pxd":372
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 2:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  __pyx_t_1 = ((__pyx_v_size - __pyx_v_pos) < 2);
  if (__pyx_t_1) {

    /* "utils.pxd":373
 *         size = str_len(data)
 *     if size - pos < 2:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 * 
 *     # Parse values
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "utils.pxd":372
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 2:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  }

  /* "utils.pxd":377
 *     # Parse values
 *     cdef char buffer[3]
 *     cdef Py_UCS4 ch1 = str_read(data, pos)             # <<<<<<<<<<<<<<
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 in ("1", "2"):
 */
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_data, __pyx_v_pos); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(5, 377, __pyx_L1_error)
  __pyx_v_ch1 = __pyx_t_2;

  /* "utils.pxd":378
 *     cdef char buffer[3]
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)             # <<<<<<<<<<<<<<
 *     if ch1 in ("1", "2"):
 *         if not is_ascii_digit(ch2):
 */
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_data, (__pyx_v_pos + 1)); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(5, 378, __pyx_L1_error)
  __pyx_v_ch2 = __pyx_t_2;

  /* "utils.pxd":379
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 in ("1", "2"):             # <<<<<<<<<<<<<<
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid
 */
  switch (__pyx_v_ch1) {
    case 49:
    case 50:

    /* "utils.pxd":380
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 in ("1", "2"):
 *         if not is_ascii_digit(ch2):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "0":
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_ascii_digit(__pyx_v_ch2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 380, __pyx_L1_error)
    __pyx_t_3 = (!__pyx_t_1);
    if (__pyx_t_3) {

      /* "utils.pxd":381
 *     if ch1 in ("1", "2"):
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     elif ch1 == "0":
 *         if not "1" <= ch2 <= "9":
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "utils.pxd":380
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 in ("1", "2"):
 *         if not is_ascii_digit(ch2):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "0":
 */
    }

    /* "utils.pxd":379
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 in ("1", "2"):             # <<<<<<<<<<<<<<
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid
 */
    break;
    case 48:

    /* "utils.pxd":383
 *             return -1  # exit: invalid
 *     elif ch1 == "0":
 *         if not "1" <= ch2 <= "9":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "3":
 */
    __pyx_t_3 = (49 <= __pyx_v_ch2);
    if (__pyx_t_3) {
      __pyx_t_3 = (__pyx_v_ch2 <= 57);
    }
    __pyx_t_1 = (!__pyx_t_3);
    if (__pyx_t_1) {

      /* "utils.pxd":384
 *     elif ch1 == "0":
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     elif ch1 == "3":
 *         if not ch2 in ("0", "1"):
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "utils.pxd":383
 *             return -1  # exit: invalid
 *     elif ch1 == "0":
 *         if not "1" <= ch2 <= "9":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "3":
 */
    }

    /* "utils.pxd":382
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid
 *     elif ch1 == "0":             # <<<<<<<<<<<<<<
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid
 */
    break;
    case 51:

    /* "utils.pxd":386
 *             return -1  # exit: invalid
 *     elif ch1 == "3":
 *         if not ch2 in ("0", "1"):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     else:
 */
    switch (__pyx_v_ch2) {
      case 48:
      case 49:
      __pyx_t_1 = 0;
      break;
      default:
      __pyx_t_1 = 1;
      break;
    }
    __pyx_t_3 = __pyx_t_1;
    if (__pyx_t_3) {

      /* "utils.pxd":387
 *     elif ch1 == "3":
 *         if not ch2 in ("0", "1"):
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     else:
 *         return -1  # exit: invalid
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "utils.pxd":386
 *             return -1  # exit: invalid
 *     elif ch1 == "3":
 *         if not ch2 in ("0", "1"):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     else:
 */
    }

    /* "utils.pxd":385
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid
 *     elif ch1 == "3":             # <<<<<<<<<<<<<<
 *         if not ch2 in ("0", "1"):
 *             return -1  # exit: invalid
 */
    break;
    default:

    /* "utils.pxd":389
 *             return -1  # exit: invalid
 *     else:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2
 */
    __pyx_r = -1;
    goto __pyx_L0;
    break;
  }

  /* "utils.pxd":391
 *         return -1  # exit: invalid
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2             # <<<<<<<<<<<<<<
 *     buffer[2] = 0  # null-term
 * 
 */
  __pyx_t_2 = __pyx_v_ch1;
  __pyx_t_4 = __pyx_v_ch2;
  (__pyx_v_buffer[0]) = __pyx_t_2;
  (__pyx_v_buffer[1]) = __pyx_t_4;

  /* "utils.pxd":392
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2
 *     buffer[2] = 0  # null-term             # <<<<<<<<<<<<<<
 * 
 *     # Convert to integer
 */
  (__pyx_v_buffer[2]) = 0;

  /* "utils.pxd":395
 * 
 *     # Convert to integer
 *     return strtoll(buffer, NULL, 10)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int parse_isoweek(str data, Py_ssize_t pos, Py_ssize_t size) except -2:
 */
  __pyx_r = strtoll(__pyx_v_buffer, NULL, 10);
  goto __pyx_L0;

  /* "utils.pxd":355
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline int parse_isoday(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse ISO format day component (DD) from a string,
 *     returns `-1` for invalid ISO days `<'int'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.parse_isoday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -2;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":397
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline int parse_isoweek(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Prase an ISO format week number component (WW) from a string,
 *     returns `-1` for invalid ISO week number `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isoweek(PyObject *__pyx_v_data, Py_ssize_t __pyx_v_pos, Py_ssize_t __pyx_v_size) {
  char __pyx_v_buffer[3];
  Py_UCS4 __pyx_v_ch1;
  Py_UCS4 __pyx_v_ch2;
  int __pyx_r;
  int __pyx_t_1;
  Py_UCS4 __pyx_t_2;
  int __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":412
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 2:
 */
  __pyx_t_1 = (__pyx_v_size <= 0);
  if (__pyx_t_1) {

    /* "utils.pxd":413
 *     # Validate
 *     if size <= 0:
 *         size = str_len(data)             # <<<<<<<<<<<<<<
 *     if size - pos < 2:
 *         return -1  # exit: invalid
 */
    __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_data);

    /* "utils.pxd":412
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 2:
 */
  }

  /* "utils.pxd":414
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 2:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  __pyx_t_1 = ((__pyx_v_size - __pyx_v_pos) < 2);
  if (__pyx_t_1) {

    /* "utils.pxd":415
 *         size = str_len(data)
 *     if size - pos < 2:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 * 
 *     # Parse values
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "utils.pxd":414
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 2:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  }

  /* "utils.pxd":419
 *     # Parse values
 *     cdef char buffer[3]
 *     cdef Py_UCS4 ch1 = str_read(data, pos)             # <<<<<<<<<<<<<<
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if "1" <= ch1 <= "4":
 */
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_data, __pyx_v_pos); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(5, 419, __pyx_L1_error)
  __pyx_v_ch1 = __pyx_t_2;

  /* "utils.pxd":420
 *     cdef char buffer[3]
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)             # <<<<<<<<<<<<<<
 *     if "1" <= ch1 <= "4":
 *         if not is_ascii_digit(ch2):
 */
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_data, (__pyx_v_pos + 1)); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(5, 420, __pyx_L1_error)
  __pyx_v_ch2 = __pyx_t_2;

  /* "utils.pxd":421
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if "1" <= ch1 <= "4":             # <<<<<<<<<<<<<<
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid
 */
  __pyx_t_1 = (49 <= __pyx_v_ch1);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_ch1 <= 52);
  }
  if (__pyx_t_1) {

    /* "utils.pxd":422
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if "1" <= ch1 <= "4":
 *         if not is_ascii_digit(ch2):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "0":
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_ascii_digit(__pyx_v_ch2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 422, __pyx_L1_error)
    __pyx_t_3 = (!__pyx_t_1);
    if (__pyx_t_3) {

      /* "utils.pxd":423
 *     if "1" <= ch1 <= "4":
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     elif ch1 == "0":
 *         if not "1" <= ch2 <= "9":
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "utils.pxd":422
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if "1" <= ch1 <= "4":
 *         if not is_ascii_digit(ch2):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "0":
 */
    }

    /* "utils.pxd":421
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if "1" <= ch1 <= "4":             # <<<<<<<<<<<<<<
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid
 */
    goto __pyx_L5;
  }

  /* "utils.pxd":424
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid
 *     elif ch1 == "0":             # <<<<<<<<<<<<<<
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid
 */
  __pyx_t_3 = (__pyx_v_ch1 == 48);
  if (__pyx_t_3) {

    /* "utils.pxd":425
 *             return -1  # exit: invalid
 *     elif ch1 == "0":
 *         if not "1" <= ch2 <= "9":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "5":
 */
    __pyx_t_3 = (49 <= __pyx_v_ch2);
    if (__pyx_t_3) {
      __pyx_t_3 = (__pyx_v_ch2 <= 57);
    }
    __pyx_t_1 = (!__pyx_t_3);
    if (__pyx_t_1) {

      /* "utils.pxd":426
 *     elif ch1 == "0":
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     elif ch1 == "5":
 *         if not "0" <= ch2 <= "3":
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "utils.pxd":425
 *             return -1  # exit: invalid
 *     elif ch1 == "0":
 *         if not "1" <= ch2 <= "9":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "5":
 */
    }

    /* "utils.pxd":424
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid
 *     elif ch1 == "0":             # <<<<<<<<<<<<<<
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid
 */
    goto __pyx_L5;
  }

  /* "utils.pxd":427
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid
 *     elif ch1 == "5":             # <<<<<<<<<<<<<<
 *         if not "0" <= ch2 <= "3":
 *             return -1  # exit: invalid
 */
  __pyx_t_1 = (__pyx_v_ch1 == 53);
  if (__pyx_t_1) {

    /* "utils.pxd":428
 *             return -1  # exit: invalid
 *     elif ch1 == "5":
 *         if not "0" <= ch2 <= "3":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     else:
 */
    __pyx_t_1 = (48 <= __pyx_v_ch2);
    if (__pyx_t_1) {
      __pyx_t_1 = (__pyx_v_ch2 <= 51);
    }
    __pyx_t_3 = (!__pyx_t_1);
    if (__pyx_t_3) {

      /* "utils.pxd":429
 *     elif ch1 == "5":
 *         if not "0" <= ch2 <= "3":
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     else:
 *         return -1  # exit: invalid
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "utils.pxd":428
 *             return -1  # exit: invalid
 *     elif ch1 == "5":
 *         if not "0" <= ch2 <= "3":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     else:
 */
    }

    /* "utils.pxd":427
 *         if not "1" <= ch2 <= "9":
 *             return -1  # exit: invalid
 *     elif ch1 == "5":             # <<<<<<<<<<<<<<
 *         if not "0" <= ch2 <= "3":
 *             return -1  # exit: invalid
 */
    goto __pyx_L5;
  }

  /* "utils.pxd":431
 *             return -1  # exit: invalid
 *     else:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2
 */
  /*else*/ {
    __pyx_r = -1;
    goto __pyx_L0;
  }
  __pyx_L5:;

  /* "utils.pxd":433
 *         return -1  # exit: invalid
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2             # <<<<<<<<<<<<<<
 *     buffer[2] = 0  # null-term
 * 
 */
  __pyx_t_2 = __pyx_v_ch1;
  __pyx_t_4 = __pyx_v_ch2;
  (__pyx_v_buffer[0]) = __pyx_t_2;
  (__pyx_v_buffer[1]) = __pyx_t_4;

  /* "utils.pxd":434
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2
 *     buffer[2] = 0  # null-term             # <<<<<<<<<<<<<<
 * 
 *     # Convert to integer
 */
  (__pyx_v_buffer[2]) = 0;

  /* "utils.pxd":437
 * 
 *     # Convert to integer
 *     return strtoll(buffer, NULL, 10)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int parse_isoweekday(str data, Py_ssize_t pos, Py_ssize_t size) except -2:
 */
  __pyx_r = strtoll(__pyx_v_buffer, NULL, 10);
  goto __pyx_L0;

  /* "utils.pxd":397
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline int parse_isoweek(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Prase an ISO format week number component (WW) from a string,
 *     returns `-1` for invalid ISO week number `<'int'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.parse_isoweek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -2;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":439
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline int parse_isoweekday(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Prase an ISO format weekday component (D) from a string,
 *     returns `-1` for invalid ISO weekdays `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isoweekday(PyObject *__pyx_v_data, Py_ssize_t __pyx_v_pos, Py_ssize_t __pyx_v_size) {
  Py_UCS4 __pyx_v_ch;
  int __pyx_r;
  int __pyx_t_1;
  Py_UCS4 __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":453
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 1:
 */
  __pyx_t_1 = (__pyx_v_size <= 0);
  if (__pyx_t_1) {

    /* "utils.pxd":454
 *     # Validate
 *     if size <= 0:
 *         size = str_len(data)             # <<<<<<<<<<<<<<
 *     if size - pos < 1:
 *         return -1  # exit: invalid
 */
    __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_data);

    /* "utils.pxd":453
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 1:
 */
  }

  /* "utils.pxd":455
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 1:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  __pyx_t_1 = ((__pyx_v_size - __pyx_v_pos) < 1);
  if (__pyx_t_1) {

    /* "utils.pxd":456
 *         size = str_len(data)
 *     if size - pos < 1:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 * 
 *     # Parse values
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "utils.pxd":455
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 1:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  }

  /* "utils.pxd":459
 * 
 *     # Parse values
 *     cdef Py_UCS4 ch = str_read(data, pos)             # <<<<<<<<<<<<<<
 *     if not "1" <= ch <= "7":
 *         return -1  # exit: invalid
 */
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_data, __pyx_v_pos); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(5, 459, __pyx_L1_error)
  __pyx_v_ch = __pyx_t_2;

  /* "utils.pxd":460
 *     # Parse values
 *     cdef Py_UCS4 ch = str_read(data, pos)
 *     if not "1" <= ch <= "7":             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 *     return ord(ch) - 48
 */
  __pyx_t_1 = (49 <= __pyx_v_ch);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_ch <= 55);
  }
  __pyx_t_3 = (!__pyx_t_1);
  if (__pyx_t_3) {

    /* "utils.pxd":461
 *     cdef Py_UCS4 ch = str_read(data, pos)
 *     if not "1" <= ch <= "7":
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     return ord(ch) - 48
 * 
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "utils.pxd":460
 *     # Parse values
 *     cdef Py_UCS4 ch = str_read(data, pos)
 *     if not "1" <= ch <= "7":             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 *     return ord(ch) - 48
 */
  }

  /* "utils.pxd":462
 *     if not "1" <= ch <= "7":
 *         return -1  # exit: invalid
 *     return ord(ch) - 48             # <<<<<<<<<<<<<<
 * 
 * cdef inline int parse_isoyearday(str data, Py_ssize_t pos, Py_ssize_t size) except -2:
 */
  __pyx_r = (__Pyx_long_cast(__pyx_v_ch) - 48);
  goto __pyx_L0;

  /* "utils.pxd":439
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline int parse_isoweekday(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Prase an ISO format weekday component (D) from a string,
 *     returns `-1` for invalid ISO weekdays `<'int'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.parse_isoweekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -2;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":464
 *     return ord(ch) - 48
 * 
 * cdef inline int parse_isoyearday(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Prase an ISO format day of the year component (DDD) from a string,
 *     returns `-1` for invalid ISO day of the year `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isoyearday(PyObject *__pyx_v_data, Py_ssize_t __pyx_v_pos, Py_ssize_t __pyx_v_size) {
  char __pyx_v_buffer[4];
  Py_UCS4 __pyx_v_ch;
  Py_ssize_t __pyx_v_i;
  int __pyx_v_days;
  int __pyx_r;
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":479
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 3:
 */
  __pyx_t_1 = (__pyx_v_size <= 0);
  if (__pyx_t_1) {

    /* "utils.pxd":480
 *     # Validate
 *     if size <= 0:
 *         size = str_len(data)             # <<<<<<<<<<<<<<
 *     if size - pos < 3:
 *         return -1  # exit: invalid
 */
    __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_data);

    /* "utils.pxd":479
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 3:
 */
  }

  /* "utils.pxd":481
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 3:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  __pyx_t_1 = ((__pyx_v_size - __pyx_v_pos) < 3);
  if (__pyx_t_1) {

    /* "utils.pxd":482
 *         size = str_len(data)
 *     if size - pos < 3:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 * 
 *     # Parse values
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "utils.pxd":481
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 3:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  }

  /* "utils.pxd":488
 *     cdef Py_UCS4 ch
 *     cdef Py_ssize_t i
 *     for i in range(3):             # <<<<<<<<<<<<<<
 *         ch = str_read(data, pos + i)
 *         if not is_ascii_digit(ch):
 */
  for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "utils.pxd":489
 *     cdef Py_ssize_t i
 *     for i in range(3):
 *         ch = str_read(data, pos + i)             # <<<<<<<<<<<<<<
 *         if not is_ascii_digit(ch):
 *             return -1  # exit: invalid
 */
    __pyx_t_3 = PyUnicode_ReadChar(__pyx_v_data, (__pyx_v_pos + __pyx_v_i)); if (unlikely(__pyx_t_3 == ((Py_UCS4)-1))) __PYX_ERR(5, 489, __pyx_L1_error)
    __pyx_v_ch = __pyx_t_3;

    /* "utils.pxd":490
 *     for i in range(3):
 *         ch = str_read(data, pos + i)
 *         if not is_ascii_digit(ch):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *         buffer[i] = ch
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_ascii_digit(__pyx_v_ch); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 490, __pyx_L1_error)
    __pyx_t_4 = (!__pyx_t_1);
    if (__pyx_t_4) {

      /* "utils.pxd":491
 *         ch = str_read(data, pos + i)
 *         if not is_ascii_digit(ch):
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *         buffer[i] = ch
 *     # . null-terminate
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "utils.pxd":490
 *     for i in range(3):
 *         ch = str_read(data, pos + i)
 *         if not is_ascii_digit(ch):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *         buffer[i] = ch
 */
    }

    /* "utils.pxd":492
 *         if not is_ascii_digit(ch):
 *             return -1  # exit: invalid
 *         buffer[i] = ch             # <<<<<<<<<<<<<<
 *     # . null-terminate
 *     buffer[3] = 0
 */
    (__pyx_v_buffer[__pyx_v_i]) = __pyx_v_ch;
  }

  /* "utils.pxd":494
 *         buffer[i] = ch
 *     # . null-terminate
 *     buffer[3] = 0             # <<<<<<<<<<<<<<
 * 
 *     # Convert to integer
 */
  (__pyx_v_buffer[3]) = 0;

  /* "utils.pxd":497
 * 
 *     # Convert to integer
 *     cdef int days = strtoll(buffer, NULL, 10)             # <<<<<<<<<<<<<<
 *     return days if 1 <= days <= 366 else -1
 * 
 */
  __pyx_v_days = strtoll(__pyx_v_buffer, NULL, 10);

  /* "utils.pxd":498
 *     # Convert to integer
 *     cdef int days = strtoll(buffer, NULL, 10)
 *     return days if 1 <= days <= 366 else -1             # <<<<<<<<<<<<<<
 * 
 * cdef inline int parse_isohour(str data, Py_ssize_t pos, Py_ssize_t size) except -2:
 */
  __pyx_t_4 = (1 <= __pyx_v_days);
  if (__pyx_t_4) {
    __pyx_t_4 = (__pyx_v_days <= 0x16E);
  }
  if (__pyx_t_4) {
    __pyx_t_5 = __pyx_v_days;
  } else {
    __pyx_t_5 = -1;
  }
  __pyx_r = __pyx_t_5;
  goto __pyx_L0;

  /* "utils.pxd":464
 *     return ord(ch) - 48
 * 
 * cdef inline int parse_isoyearday(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Prase an ISO format day of the year component (DDD) from a string,
 *     returns `-1` for invalid ISO day of the year `<'int'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.parse_isoyearday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -2;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":500
 *     return days if 1 <= days <= 366 else -1
 * 
 * cdef inline int parse_isohour(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse an ISO format hour (HH) component from a string,
 *     returns `-1` for invalid ISO hours `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isohour(PyObject *__pyx_v_data, Py_ssize_t __pyx_v_pos, Py_ssize_t __pyx_v_size) {
  char __pyx_v_buffer[3];
  Py_UCS4 __pyx_v_ch1;
  Py_UCS4 __pyx_v_ch2;
  int __pyx_r;
  int __pyx_t_1;
  Py_UCS4 __pyx_t_2;
  int __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":515
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 2:
 */
  __pyx_t_1 = (__pyx_v_size <= 0);
  if (__pyx_t_1) {

    /* "utils.pxd":516
 *     # Validate
 *     if size <= 0:
 *         size = str_len(data)             # <<<<<<<<<<<<<<
 *     if size - pos < 2:
 *         return -1  # exit: invalid
 */
    __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_data);

    /* "utils.pxd":515
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 2:
 */
  }

  /* "utils.pxd":517
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 2:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  __pyx_t_1 = ((__pyx_v_size - __pyx_v_pos) < 2);
  if (__pyx_t_1) {

    /* "utils.pxd":518
 *         size = str_len(data)
 *     if size - pos < 2:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 * 
 *     # Parse values
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "utils.pxd":517
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 2:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  }

  /* "utils.pxd":522
 *     # Parse values
 *     cdef char buffer[3]
 *     cdef Py_UCS4 ch1 = str_read(data, pos)             # <<<<<<<<<<<<<<
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 in ("0", "1"):
 */
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_data, __pyx_v_pos); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(5, 522, __pyx_L1_error)
  __pyx_v_ch1 = __pyx_t_2;

  /* "utils.pxd":523
 *     cdef char buffer[3]
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)             # <<<<<<<<<<<<<<
 *     if ch1 in ("0", "1"):
 *         if not is_ascii_digit(ch2):
 */
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_data, (__pyx_v_pos + 1)); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(5, 523, __pyx_L1_error)
  __pyx_v_ch2 = __pyx_t_2;

  /* "utils.pxd":524
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 in ("0", "1"):             # <<<<<<<<<<<<<<
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid
 */
  switch (__pyx_v_ch1) {
    case 48:
    case 49:

    /* "utils.pxd":525
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 in ("0", "1"):
 *         if not is_ascii_digit(ch2):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "2":
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_ascii_digit(__pyx_v_ch2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 525, __pyx_L1_error)
    __pyx_t_3 = (!__pyx_t_1);
    if (__pyx_t_3) {

      /* "utils.pxd":526
 *     if ch1 in ("0", "1"):
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     elif ch1 == "2":
 *         if not "0" <= ch2 <= "3":
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "utils.pxd":525
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 in ("0", "1"):
 *         if not is_ascii_digit(ch2):             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     elif ch1 == "2":
 */
    }

    /* "utils.pxd":524
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if ch1 in ("0", "1"):             # <<<<<<<<<<<<<<
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid
 */
    break;
    case 50:

    /* "utils.pxd":528
 *             return -1  # exit: invalid
 *     elif ch1 == "2":
 *         if not "0" <= ch2 <= "3":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     else:
 */
    __pyx_t_3 = (48 <= __pyx_v_ch2);
    if (__pyx_t_3) {
      __pyx_t_3 = (__pyx_v_ch2 <= 51);
    }
    __pyx_t_1 = (!__pyx_t_3);
    if (__pyx_t_1) {

      /* "utils.pxd":529
 *     elif ch1 == "2":
 *         if not "0" <= ch2 <= "3":
 *             return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     else:
 *         return -1  # exit: invalid
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "utils.pxd":528
 *             return -1  # exit: invalid
 *     elif ch1 == "2":
 *         if not "0" <= ch2 <= "3":             # <<<<<<<<<<<<<<
 *             return -1  # exit: invalid
 *     else:
 */
    }

    /* "utils.pxd":527
 *         if not is_ascii_digit(ch2):
 *             return -1  # exit: invalid
 *     elif ch1 == "2":             # <<<<<<<<<<<<<<
 *         if not "0" <= ch2 <= "3":
 *             return -1  # exit: invalid
 */
    break;
    default:

    /* "utils.pxd":531
 *             return -1  # exit: invalid
 *     else:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2
 */
    __pyx_r = -1;
    goto __pyx_L0;
    break;
  }

  /* "utils.pxd":533
 *         return -1  # exit: invalid
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2             # <<<<<<<<<<<<<<
 *     buffer[2] = 0  # null-term
 * 
 */
  __pyx_t_2 = __pyx_v_ch1;
  __pyx_t_4 = __pyx_v_ch2;
  (__pyx_v_buffer[0]) = __pyx_t_2;
  (__pyx_v_buffer[1]) = __pyx_t_4;

  /* "utils.pxd":534
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2
 *     buffer[2] = 0  # null-term             # <<<<<<<<<<<<<<
 * 
 *     # Convert to integer
 */
  (__pyx_v_buffer[2]) = 0;

  /* "utils.pxd":537
 * 
 *     # Convert to integer
 *     return strtoll(buffer, NULL, 10)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int parse_isominute(str data, Py_ssize_t pos, Py_ssize_t size) except -2:
 */
  __pyx_r = strtoll(__pyx_v_buffer, NULL, 10);
  goto __pyx_L0;

  /* "utils.pxd":500
 *     return days if 1 <= days <= 366 else -1
 * 
 * cdef inline int parse_isohour(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse an ISO format hour (HH) component from a string,
 *     returns `-1` for invalid ISO hours `<'int'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.parse_isohour", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -2;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":539
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline int parse_isominute(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse an ISO format minute (MM) component from a string,
 *     returns `-1` for invalid ISO minutes `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isominute(PyObject *__pyx_v_data, Py_ssize_t __pyx_v_pos, Py_ssize_t __pyx_v_size) {
  char __pyx_v_buffer[3];
  Py_UCS4 __pyx_v_ch1;
  Py_UCS4 __pyx_v_ch2;
  int __pyx_r;
  int __pyx_t_1;
  Py_UCS4 __pyx_t_2;
  int __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":554
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 2:
 */
  __pyx_t_1 = (__pyx_v_size <= 0);
  if (__pyx_t_1) {

    /* "utils.pxd":555
 *     # Validate
 *     if size <= 0:
 *         size = str_len(data)             # <<<<<<<<<<<<<<
 *     if size - pos < 2:
 *         return -1  # exit: invalid
 */
    __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_data);

    /* "utils.pxd":554
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 *     if size - pos < 2:
 */
  }

  /* "utils.pxd":556
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 2:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  __pyx_t_1 = ((__pyx_v_size - __pyx_v_pos) < 2);
  if (__pyx_t_1) {

    /* "utils.pxd":557
 *         size = str_len(data)
 *     if size - pos < 2:
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 * 
 *     # Parse values
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "utils.pxd":556
 *     if size <= 0:
 *         size = str_len(data)
 *     if size - pos < 2:             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 * 
 */
  }

  /* "utils.pxd":561
 *     # Parse values
 *     cdef char buffer[3]
 *     cdef Py_UCS4 ch1 = str_read(data, pos)             # <<<<<<<<<<<<<<
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if not "0" <= ch1 <= "5":
 */
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_data, __pyx_v_pos); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(5, 561, __pyx_L1_error)
  __pyx_v_ch1 = __pyx_t_2;

  /* "utils.pxd":562
 *     cdef char buffer[3]
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)             # <<<<<<<<<<<<<<
 *     if not "0" <= ch1 <= "5":
 *         return -1  # exit: invalid
 */
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_data, (__pyx_v_pos + 1)); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(5, 562, __pyx_L1_error)
  __pyx_v_ch2 = __pyx_t_2;

  /* "utils.pxd":563
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if not "0" <= ch1 <= "5":             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 *     if not is_ascii_digit(ch2):
 */
  __pyx_t_1 = (48 <= __pyx_v_ch1);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_ch1 <= 53);
  }
  __pyx_t_3 = (!__pyx_t_1);
  if (__pyx_t_3) {

    /* "utils.pxd":564
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if not "0" <= ch1 <= "5":
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     if not is_ascii_digit(ch2):
 *         return -1  # exit: invalid
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "utils.pxd":563
 *     cdef Py_UCS4 ch1 = str_read(data, pos)
 *     cdef Py_UCS4 ch2 = str_read(data, pos + 1)
 *     if not "0" <= ch1 <= "5":             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 *     if not is_ascii_digit(ch2):
 */
  }

  /* "utils.pxd":565
 *     if not "0" <= ch1 <= "5":
 *         return -1  # exit: invalid
 *     if not is_ascii_digit(ch2):             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 *     # . assign values
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_is_ascii_digit(__pyx_v_ch2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 565, __pyx_L1_error)
  __pyx_t_1 = (!__pyx_t_3);
  if (__pyx_t_1) {

    /* "utils.pxd":566
 *         return -1  # exit: invalid
 *     if not is_ascii_digit(ch2):
 *         return -1  # exit: invalid             # <<<<<<<<<<<<<<
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "utils.pxd":565
 *     if not "0" <= ch1 <= "5":
 *         return -1  # exit: invalid
 *     if not is_ascii_digit(ch2):             # <<<<<<<<<<<<<<
 *         return -1  # exit: invalid
 *     # . assign values
 */
  }

  /* "utils.pxd":568
 *         return -1  # exit: invalid
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2             # <<<<<<<<<<<<<<
 *     buffer[2] = 0  # null-term
 * 
 */
  __pyx_t_2 = __pyx_v_ch1;
  __pyx_t_4 = __pyx_v_ch2;
  (__pyx_v_buffer[0]) = __pyx_t_2;
  (__pyx_v_buffer[1]) = __pyx_t_4;

  /* "utils.pxd":569
 *     # . assign values
 *     buffer[0], buffer[1] = ch1, ch2
 *     buffer[2] = 0  # null-term             # <<<<<<<<<<<<<<
 * 
 *     # Convert to integer
 */
  (__pyx_v_buffer[2]) = 0;

  /* "utils.pxd":572
 * 
 *     # Convert to integer
 *     return strtoll(buffer, NULL, 10)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int parse_isosecond(str data, Py_ssize_t pos, Py_ssize_t size) except -2:
 */
  __pyx_r = strtoll(__pyx_v_buffer, NULL, 10);
  goto __pyx_L0;

  /* "utils.pxd":539
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline int parse_isominute(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse an ISO format minute (MM) component from a string,
 *     returns `-1` for invalid ISO minutes `<'int'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.parse_isominute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -2;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":574
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline int parse_isosecond(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse an ISO format second (SS) component from a string,
 *     returns `-1` for invalid ISO seconds `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isosecond(PyObject *__pyx_v_data, Py_ssize_t __pyx_v_pos, Py_ssize_t __pyx_v_size) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":588
 *         If 'size <= 0', the function computes the size of the 'data' string internally.
 *     """
 *     return parse_isominute(data, pos, size)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int parse_isofraction(str data, Py_ssize_t pos, Py_ssize_t size) except -2:
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_parse_isominute(__pyx_v_data, __pyx_v_pos, __pyx_v_size); if (unlikely(__pyx_t_1 == ((int)-2))) __PYX_ERR(5, 588, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "utils.pxd":574
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline int parse_isosecond(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse an ISO format second (SS) component from a string,
 *     returns `-1` for invalid ISO seconds `<'int'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.parse_isosecond", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -2;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":590
 *     return parse_isominute(data, pos, size)
 * 
 * cdef inline int parse_isofraction(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse an ISO fractional time component (fractions of a second) from a string,
 *     returns `-1` for invalid ISO fraction `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_isofraction(PyObject *__pyx_v_data, Py_ssize_t __pyx_v_pos, Py_ssize_t __pyx_v_size) {
  char __pyx_v_buffer[7];
  Py_UCS4 __pyx_v_ch;
  Py_ssize_t __pyx_v_idx;
  Py_ssize_t __pyx_v_i;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":605
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 * 
 */
  __pyx_t_1 = (__pyx_v_size <= 0);
  if (__pyx_t_1) {

    /* "utils.pxd":606
 *     # Validate
 *     if size <= 0:
 *         size = str_len(data)             # <<<<<<<<<<<<<<
 * 
 *     # Parse value
 */
    __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_data);

    /* "utils.pxd":605
 *     """
 *     # Validate
 *     if size <= 0:             # <<<<<<<<<<<<<<
 *         size = str_len(data)
 * 
 */
  }

  /* "utils.pxd":611
 *     cdef char buffer[7]
 *     cdef Py_UCS4 ch
 *     cdef Py_ssize_t idx = 0             # <<<<<<<<<<<<<<
 *     while pos < size and idx < 6:
 *         ch = str_read(data, pos)
 */
  __pyx_v_idx = 0;

  /* "utils.pxd":612
 *     cdef Py_UCS4 ch
 *     cdef Py_ssize_t idx = 0
 *     while pos < size and idx < 6:             # <<<<<<<<<<<<<<
 *         ch = str_read(data, pos)
 *         if not is_ascii_digit(ch):
 */
  while (1) {
    __pyx_t_2 = (__pyx_v_pos < __pyx_v_size);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_idx < 6);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L6_bool_binop_done:;
    if (!__pyx_t_1) break;

    /* "utils.pxd":613
 *     cdef Py_ssize_t idx = 0
 *     while pos < size and idx < 6:
 *         ch = str_read(data, pos)             # <<<<<<<<<<<<<<
 *         if not is_ascii_digit(ch):
 *             break
 */
    __pyx_t_3 = PyUnicode_ReadChar(__pyx_v_data, __pyx_v_pos); if (unlikely(__pyx_t_3 == ((Py_UCS4)-1))) __PYX_ERR(5, 613, __pyx_L1_error)
    __pyx_v_ch = __pyx_t_3;

    /* "utils.pxd":614
 *     while pos < size and idx < 6:
 *         ch = str_read(data, pos)
 *         if not is_ascii_digit(ch):             # <<<<<<<<<<<<<<
 *             break
 *         buffer[idx], pos, idx = ch, pos + 1, idx + 1
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_ascii_digit(__pyx_v_ch); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 614, __pyx_L1_error)
    __pyx_t_2 = (!__pyx_t_1);
    if (__pyx_t_2) {

      /* "utils.pxd":615
 *         ch = str_read(data, pos)
 *         if not is_ascii_digit(ch):
 *             break             # <<<<<<<<<<<<<<
 *         buffer[idx], pos, idx = ch, pos + 1, idx + 1
 *     # . invalid
 */
      goto __pyx_L5_break;

      /* "utils.pxd":614
 *     while pos < size and idx < 6:
 *         ch = str_read(data, pos)
 *         if not is_ascii_digit(ch):             # <<<<<<<<<<<<<<
 *             break
 *         buffer[idx], pos, idx = ch, pos + 1, idx + 1
 */
    }

    /* "utils.pxd":616
 *         if not is_ascii_digit(ch):
 *             break
 *         buffer[idx], pos, idx = ch, pos + 1, idx + 1             # <<<<<<<<<<<<<<
 *     # . invalid
 *     if idx == 0:
 */
    __pyx_t_3 = __pyx_v_ch;
    __pyx_t_4 = (__pyx_v_pos + 1);
    __pyx_t_5 = (__pyx_v_idx + 1);
    (__pyx_v_buffer[__pyx_v_idx]) = __pyx_t_3;
    __pyx_v_pos = __pyx_t_4;
    __pyx_v_idx = __pyx_t_5;
  }
  __pyx_L5_break:;

  /* "utils.pxd":618
 *         buffer[idx], pos, idx = ch, pos + 1, idx + 1
 *     # . invalid
 *     if idx == 0:             # <<<<<<<<<<<<<<
 *         return -1  # exit:
 *     # . compensate missing digits
 */
  __pyx_t_2 = (__pyx_v_idx == 0);
  if (__pyx_t_2) {

    /* "utils.pxd":619
 *     # . invalid
 *     if idx == 0:
 *         return -1  # exit:             # <<<<<<<<<<<<<<
 *     # . compensate missing digits
 *     if idx < 6:
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "utils.pxd":618
 *         buffer[idx], pos, idx = ch, pos + 1, idx + 1
 *     # . invalid
 *     if idx == 0:             # <<<<<<<<<<<<<<
 *         return -1  # exit:
 *     # . compensate missing digits
 */
  }

  /* "utils.pxd":621
 *         return -1  # exit:
 *     # . compensate missing digits
 *     if idx < 6:             # <<<<<<<<<<<<<<
 *         ch = "0"
 *         for i in range(idx, 6):
 */
  __pyx_t_2 = (__pyx_v_idx < 6);
  if (__pyx_t_2) {

    /* "utils.pxd":622
 *     # . compensate missing digits
 *     if idx < 6:
 *         ch = "0"             # <<<<<<<<<<<<<<
 *         for i in range(idx, 6):
 *             buffer[i] = ch
 */
    __pyx_v_ch = 48;

    /* "utils.pxd":623
 *     if idx < 6:
 *         ch = "0"
 *         for i in range(idx, 6):             # <<<<<<<<<<<<<<
 *             buffer[i] = ch
 *     # . null-terminate
 */
    for (__pyx_t_5 = __pyx_v_idx; __pyx_t_5 < 6; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "utils.pxd":624
 *         ch = "0"
 *         for i in range(idx, 6):
 *             buffer[i] = ch             # <<<<<<<<<<<<<<
 *     # . null-terminate
 *     buffer[6] = 0
 */
      (__pyx_v_buffer[__pyx_v_i]) = __pyx_v_ch;
    }

    /* "utils.pxd":621
 *         return -1  # exit:
 *     # . compensate missing digits
 *     if idx < 6:             # <<<<<<<<<<<<<<
 *         ch = "0"
 *         for i in range(idx, 6):
 */
  }

  /* "utils.pxd":626
 *             buffer[i] = ch
 *     # . null-terminate
 *     buffer[6] = 0             # <<<<<<<<<<<<<<
 * 
 *     # Convert to integer
 */
  (__pyx_v_buffer[6]) = 0;

  /* "utils.pxd":629
 * 
 *     # Convert to integer
 *     return strtoll(buffer, NULL, 10)             # <<<<<<<<<<<<<<
 * 
 * cdef inline long long slice_to_uint(str data, Py_ssize_t start, Py_ssize_t size) except -2:
 */
  __pyx_r = strtoll(__pyx_v_buffer, NULL, 10);
  goto __pyx_L0;

  /* "utils.pxd":590
 *     return parse_isominute(data, pos, size)
 * 
 * cdef inline int parse_isofraction(str data, Py_ssize_t pos, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Parse an ISO fractional time component (fractions of a second) from a string,
 *     returns `-1` for invalid ISO fraction `<'int'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.parse_isofraction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -2;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":631
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline long long slice_to_uint(str data, Py_ssize_t start, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Slice a substring from a string and convert to an unsigned integer `<'int'>`.
 * 
 */

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_slice_to_uint(PyObject *__pyx_v_data, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_size) {
  char *__pyx_v_buffer;
  Py_ssize_t __pyx_v_i;
  Py_UCS4 __pyx_v_ch;
  PY_LONG_LONG __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PY_LONG_LONG __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("slice_to_uint", 1);

  /* "utils.pxd":644
 *     """
 *     # Allocate memory
 *     cdef char* buffer = <char*> malloc(size + 1)             # <<<<<<<<<<<<<<
 *     if buffer == NULL:
 *         raise MemoryError("failed to allocate memory for string slice.")
 */
  __pyx_v_buffer = ((char *)malloc((__pyx_v_size + 1)));

  /* "utils.pxd":645
 *     # Allocate memory
 *     cdef char* buffer = <char*> malloc(size + 1)
 *     if buffer == NULL:             # <<<<<<<<<<<<<<
 *         raise MemoryError("failed to allocate memory for string slice.")
 * 
 */
  __pyx_t_1 = (__pyx_v_buffer == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":646
 *     cdef char* buffer = <char*> malloc(size + 1)
 *     if buffer == NULL:
 *         raise MemoryError("failed to allocate memory for string slice.")             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t i
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 646, __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(5, 646, __pyx_L1_error)

    /* "utils.pxd":645
 *     # Allocate memory
 *     cdef char* buffer = <char*> malloc(size + 1)
 *     if buffer == NULL:             # <<<<<<<<<<<<<<
 *         raise MemoryError("failed to allocate memory for string slice.")
 * 
 */
  }

  /* "utils.pxd":650
 *     cdef Py_ssize_t i
 *     cdef Py_UCS4 ch
 *     try:             # <<<<<<<<<<<<<<
 *         # Parse value
 *         for i in range(size):
 */
  /*try:*/ {

    /* "utils.pxd":652
 *     try:
 *         # Parse value
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             ch = str_read(data, start + i)
 *             if not is_ascii_digit(ch):
 */
    __pyx_t_3 = __pyx_v_size;
    __pyx_t_4 = __pyx_t_3;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "utils.pxd":653
 *         # Parse value
 *         for i in range(size):
 *             ch = str_read(data, start + i)             # <<<<<<<<<<<<<<
 *             if not is_ascii_digit(ch):
 *                 raise ValueError("invalid character '%s' as an integer." % str_chr(ch))
 */
      __pyx_t_6 = PyUnicode_ReadChar(__pyx_v_data, (__pyx_v_start + __pyx_v_i)); if (unlikely(__pyx_t_6 == ((Py_UCS4)-1))) __PYX_ERR(5, 653, __pyx_L5_error)
      __pyx_v_ch = __pyx_t_6;

      /* "utils.pxd":654
 *         for i in range(size):
 *             ch = str_read(data, start + i)
 *             if not is_ascii_digit(ch):             # <<<<<<<<<<<<<<
 *                 raise ValueError("invalid character '%s' as an integer." % str_chr(ch))
 *             buffer[i] = ch
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_ascii_digit(__pyx_v_ch); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 654, __pyx_L5_error)
      __pyx_t_7 = (!__pyx_t_1);
      if (unlikely(__pyx_t_7)) {

        /* "utils.pxd":655
 *             ch = str_read(data, start + i)
 *             if not is_ascii_digit(ch):
 *                 raise ValueError("invalid character '%s' as an integer." % str_chr(ch))             # <<<<<<<<<<<<<<
 *             buffer[i] = ch
 *         # . null-terminate
 */
        __pyx_t_2 = PyUnicode_FromOrdinal(__pyx_v_ch); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 655, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_invalid_character_s_as_an_intege, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 655, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 655, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(5, 655, __pyx_L5_error)

        /* "utils.pxd":654
 *         for i in range(size):
 *             ch = str_read(data, start + i)
 *             if not is_ascii_digit(ch):             # <<<<<<<<<<<<<<
 *                 raise ValueError("invalid character '%s' as an integer." % str_chr(ch))
 *             buffer[i] = ch
 */
      }

      /* "utils.pxd":656
 *             if not is_ascii_digit(ch):
 *                 raise ValueError("invalid character '%s' as an integer." % str_chr(ch))
 *             buffer[i] = ch             # <<<<<<<<<<<<<<
 *         # . null-terminate
 *         buffer[size] = 0
 */
      (__pyx_v_buffer[__pyx_v_i]) = __pyx_v_ch;
    }

    /* "utils.pxd":658
 *             buffer[i] = ch
 *         # . null-terminate
 *         buffer[size] = 0             # <<<<<<<<<<<<<<
 * 
 *         # Convert to integer
 */
    (__pyx_v_buffer[__pyx_v_size]) = 0;

    /* "utils.pxd":661
 * 
 *         # Convert to integer
 *         return strtoll(buffer, NULL, 10)             # <<<<<<<<<<<<<<
 *     finally:
 *         free(buffer)
 */
    __pyx_r = strtoll(__pyx_v_buffer, NULL, 10);
    goto __pyx_L4_return;
  }

  /* "utils.pxd":663
 *         return strtoll(buffer, NULL, 10)
 *     finally:
 *         free(buffer)             # <<<<<<<<<<<<<<
 * 
 * # Time -------------------------------------------------------------------------------------------------
 */
  /*finally:*/ {
    __pyx_L5_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_17);
      __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
      {
        free(__pyx_v_buffer);
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
      goto __pyx_L1_error;
    }
    __pyx_L4_return: {
      __pyx_t_18 = __pyx_r;
      free(__pyx_v_buffer);
      __pyx_r = __pyx_t_18;
      goto __pyx_L0;
    }
  }

  /* "utils.pxd":631
 *     return strtoll(buffer, NULL, 10)
 * 
 * cdef inline long long slice_to_uint(str data, Py_ssize_t start, Py_ssize_t size) except -2:             # <<<<<<<<<<<<<<
 *     """Slice a substring from a string and convert to an unsigned integer `<'int'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cytimes.utils.slice_to_uint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -2LL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":666
 * 
 * # Time -------------------------------------------------------------------------------------------------
 * cdef inline tm tm_gmtime(double ts) except * nogil:             # <<<<<<<<<<<<<<
 *     """Convert a timestamp to 'struct:tm' expressing UTC time `<'struct:tm'>`.
 * 
 */

static CYTHON_INLINE struct tm __pyx_f_7cytimes_5utils_tm_gmtime(double __pyx_v_ts) {
  time_t __pyx_v_tic;
  struct tm *__pyx_v_t;
  struct tm __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  long __pyx_t_3;
  long __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif

  /* "utils.pxd":673
 *     but implemented in Cython for efficiency.
 *     """
 *     cdef time_t tic = <time_t> ts             # <<<<<<<<<<<<<<
 *     cdef tm* t = libc_gmtime(&tic)
 *     if t is NULL:
 */
  __pyx_v_tic = ((time_t)__pyx_v_ts);

  /* "utils.pxd":674
 *     """
 *     cdef time_t tic = <time_t> ts
 *     cdef tm* t = libc_gmtime(&tic)             # <<<<<<<<<<<<<<
 *     if t is NULL:
 *         _raise_from_errno()
 */
  __pyx_v_t = gmtime((&__pyx_v_tic));

  /* "utils.pxd":675
 *     cdef time_t tic = <time_t> ts
 *     cdef tm* t = libc_gmtime(&tic)
 *     if t is NULL:             # <<<<<<<<<<<<<<
 *         _raise_from_errno()
 *     # Fix 0-based date values (and the 1900-based year).
 */
  __pyx_t_1 = (__pyx_v_t == NULL);
  if (__pyx_t_1) {

    /* "utils.pxd":676
 *     cdef tm* t = libc_gmtime(&tic)
 *     if t is NULL:
 *         _raise_from_errno()             # <<<<<<<<<<<<<<
 *     # Fix 0-based date values (and the 1900-based year).
 *     # See tmtotuple() in https://github.com/python/cpython/blob/master/Modules/timemodule.c
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils__raise_from_errno(); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 676, __pyx_L1_error)

    /* "utils.pxd":675
 *     cdef time_t tic = <time_t> ts
 *     cdef tm* t = libc_gmtime(&tic)
 *     if t is NULL:             # <<<<<<<<<<<<<<
 *         _raise_from_errno()
 *     # Fix 0-based date values (and the 1900-based year).
 */
  }

  /* "utils.pxd":679
 *     # Fix 0-based date values (and the 1900-based year).
 *     # See tmtotuple() in https://github.com/python/cpython/blob/master/Modules/timemodule.c
 *     t.tm_year += 1900             # <<<<<<<<<<<<<<
 *     t.tm_mon += 1
 *     t.tm_sec = min(t.tm_sec, 59)  # clamp leap seconds
 */
  __pyx_v_t->tm_year = (__pyx_v_t->tm_year + 0x76C);

  /* "utils.pxd":680
 *     # See tmtotuple() in https://github.com/python/cpython/blob/master/Modules/timemodule.c
 *     t.tm_year += 1900
 *     t.tm_mon += 1             # <<<<<<<<<<<<<<
 *     t.tm_sec = min(t.tm_sec, 59)  # clamp leap seconds
 *     t.tm_wday = (t.tm_wday + 6) % 7
 */
  __pyx_v_t->tm_mon = (__pyx_v_t->tm_mon + 1);

  /* "utils.pxd":681
 *     t.tm_year += 1900
 *     t.tm_mon += 1
 *     t.tm_sec = min(t.tm_sec, 59)  # clamp leap seconds             # <<<<<<<<<<<<<<
 *     t.tm_wday = (t.tm_wday + 6) % 7
 *     t.tm_yday += 1
 */
  __pyx_t_3 = 59;
  __pyx_t_2 = __pyx_v_t->tm_sec;
  __pyx_t_1 = (__pyx_t_3 < __pyx_t_2);
  if (__pyx_t_1) {
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_t->tm_sec = __pyx_t_4;

  /* "utils.pxd":682
 *     t.tm_mon += 1
 *     t.tm_sec = min(t.tm_sec, 59)  # clamp leap seconds
 *     t.tm_wday = (t.tm_wday + 6) % 7             # <<<<<<<<<<<<<<
 *     t.tm_yday += 1
 *     return t[0]
 */
  __pyx_v_t->tm_wday = __Pyx_mod_long((__pyx_v_t->tm_wday + 6), 7);

  /* "utils.pxd":683
 *     t.tm_sec = min(t.tm_sec, 59)  # clamp leap seconds
 *     t.tm_wday = (t.tm_wday + 6) % 7
 *     t.tm_yday += 1             # <<<<<<<<<<<<<<
 *     return t[0]
 * 
 */
  __pyx_v_t->tm_yday = (__pyx_v_t->tm_yday + 1);

  /* "utils.pxd":684
 *     t.tm_wday = (t.tm_wday + 6) % 7
 *     t.tm_yday += 1
 *     return t[0]             # <<<<<<<<<<<<<<
 * 
 * cdef inline tm tm_localtime(double ts) except * nogil:
 */
  __pyx_r = (__pyx_v_t[0]);
  goto __pyx_L0;

  /* "utils.pxd":666
 * 
 * # Time -------------------------------------------------------------------------------------------------
 * cdef inline tm tm_gmtime(double ts) except * nogil:             # <<<<<<<<<<<<<<
 *     """Convert a timestamp to 'struct:tm' expressing UTC time `<'struct:tm'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cytimes.utils.tm_gmtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":686
 *     return t[0]
 * 
 * cdef inline tm tm_localtime(double ts) except * nogil:             # <<<<<<<<<<<<<<
 *     """Convert a timestamp to 'struct:tm' expressing local time `<'struct:tm'>`.
 * 
 */

static CYTHON_INLINE struct tm __pyx_f_7cytimes_5utils_tm_localtime(double __pyx_v_ts) {
  time_t __pyx_v_tic;
  struct tm *__pyx_v_t;
  struct tm __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  long __pyx_t_3;
  long __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif

  /* "utils.pxd":693
 *     Python but implemented in Cython for efficiency.
 *     """
 *     cdef time_t tic = <time_t> ts             # <<<<<<<<<<<<<<
 *     cdef tm* t = libc_localtime(&tic)
 *     if t is NULL:
 */
  __pyx_v_tic = ((time_t)__pyx_v_ts);

  /* "utils.pxd":694
 *     """
 *     cdef time_t tic = <time_t> ts
 *     cdef tm* t = libc_localtime(&tic)             # <<<<<<<<<<<<<<
 *     if t is NULL:
 *         _raise_from_errno()
 */
  __pyx_v_t = localtime((&__pyx_v_tic));

  /* "utils.pxd":695
 *     cdef time_t tic = <time_t> ts
 *     cdef tm* t = libc_localtime(&tic)
 *     if t is NULL:             # <<<<<<<<<<<<<<
 *         _raise_from_errno()
 *     # Fix 0-based date values (and the 1900-based year).
 */
  __pyx_t_1 = (__pyx_v_t == NULL);
  if (__pyx_t_1) {

    /* "utils.pxd":696
 *     cdef tm* t = libc_localtime(&tic)
 *     if t is NULL:
 *         _raise_from_errno()             # <<<<<<<<<<<<<<
 *     # Fix 0-based date values (and the 1900-based year).
 *     # See tmtotuple() in https://github.com/python/cpython/blob/master/Modules/timemodule.c
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils__raise_from_errno(); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 696, __pyx_L1_error)

    /* "utils.pxd":695
 *     cdef time_t tic = <time_t> ts
 *     cdef tm* t = libc_localtime(&tic)
 *     if t is NULL:             # <<<<<<<<<<<<<<
 *         _raise_from_errno()
 *     # Fix 0-based date values (and the 1900-based year).
 */
  }

  /* "utils.pxd":699
 *     # Fix 0-based date values (and the 1900-based year).
 *     # See tmtotuple() in https://github.com/python/cpython/blob/master/Modules/timemodule.c
 *     t.tm_year += 1900             # <<<<<<<<<<<<<<
 *     t.tm_mon += 1
 *     t.tm_sec = min(t.tm_sec, 59)  # clamp leap seconds
 */
  __pyx_v_t->tm_year = (__pyx_v_t->tm_year + 0x76C);

  /* "utils.pxd":700
 *     # See tmtotuple() in https://github.com/python/cpython/blob/master/Modules/timemodule.c
 *     t.tm_year += 1900
 *     t.tm_mon += 1             # <<<<<<<<<<<<<<
 *     t.tm_sec = min(t.tm_sec, 59)  # clamp leap seconds
 *     t.tm_wday = (t.tm_wday + 6) % 7
 */
  __pyx_v_t->tm_mon = (__pyx_v_t->tm_mon + 1);

  /* "utils.pxd":701
 *     t.tm_year += 1900
 *     t.tm_mon += 1
 *     t.tm_sec = min(t.tm_sec, 59)  # clamp leap seconds             # <<<<<<<<<<<<<<
 *     t.tm_wday = (t.tm_wday + 6) % 7
 *     t.tm_yday += 1
 */
  __pyx_t_3 = 59;
  __pyx_t_2 = __pyx_v_t->tm_sec;
  __pyx_t_1 = (__pyx_t_3 < __pyx_t_2);
  if (__pyx_t_1) {
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_t->tm_sec = __pyx_t_4;

  /* "utils.pxd":702
 *     t.tm_mon += 1
 *     t.tm_sec = min(t.tm_sec, 59)  # clamp leap seconds
 *     t.tm_wday = (t.tm_wday + 6) % 7             # <<<<<<<<<<<<<<
 *     t.tm_yday += 1
 *     return t[0]
 */
  __pyx_v_t->tm_wday = __Pyx_mod_long((__pyx_v_t->tm_wday + 6), 7);

  /* "utils.pxd":703
 *     t.tm_sec = min(t.tm_sec, 59)  # clamp leap seconds
 *     t.tm_wday = (t.tm_wday + 6) % 7
 *     t.tm_yday += 1             # <<<<<<<<<<<<<<
 *     return t[0]
 * 
 */
  __pyx_v_t->tm_yday = (__pyx_v_t->tm_yday + 1);

  /* "utils.pxd":704
 *     t.tm_wday = (t.tm_wday + 6) % 7
 *     t.tm_yday += 1
 *     return t[0]             # <<<<<<<<<<<<<<
 * 
 * cdef inline long long ts_gmtime(double ts):
 */
  __pyx_r = (__pyx_v_t[0]);
  goto __pyx_L0;

  /* "utils.pxd":686
 *     return t[0]
 * 
 * cdef inline tm tm_localtime(double ts) except * nogil:             # <<<<<<<<<<<<<<
 *     """Convert a timestamp to 'struct:tm' expressing local time `<'struct:tm'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cytimes.utils.tm_localtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":706
 *     return t[0]
 * 
 * cdef inline long long ts_gmtime(double ts):             # <<<<<<<<<<<<<<
 *     """Convert a timestamp to UTC seconds since the Unix Epoch `<'int'>`.
 * 
 */

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_ts_gmtime(double __pyx_v_ts) {
  struct tm __pyx_v__tm;
  PY_LONG_LONG __pyx_v_ordinal;
  PY_LONG_LONG __pyx_r;
  struct tm __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":712
 *     seconds since the Unix Epoch, representing the UTC time.
 *     """
 *     cdef tm _tm = tm_gmtime(ts)             # <<<<<<<<<<<<<<
 *     cdef long long ordinal = ymd_to_ordinal(_tm.tm_year, _tm.tm_mon, _tm.tm_mday)
 *     return (
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_tm_gmtime(__pyx_v_ts); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 712, __pyx_L1_error)
  __pyx_v__tm = __pyx_t_1;

  /* "utils.pxd":713
 *     """
 *     cdef tm _tm = tm_gmtime(ts)
 *     cdef long long ordinal = ymd_to_ordinal(_tm.tm_year, _tm.tm_mon, _tm.tm_mday)             # <<<<<<<<<<<<<<
 *     return (
 *         (ordinal - EPOCH_DAY) * SS_DAY
 */
  __pyx_t_2 = __pyx_f_7cytimes_5utils_ymd_to_ordinal(__pyx_v__tm.tm_year, __pyx_v__tm.tm_mon, __pyx_v__tm.tm_mday); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 713, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_2;

  /* "utils.pxd":718
 *         + _tm.tm_hour * SS_HOUR
 *         + _tm.tm_min * SS_MINUTE
 *         + _tm.tm_sec             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_r = (((((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_SS_DAY) + (__pyx_v__tm.tm_hour * __pyx_v_7cytimes_5utils_SS_HOUR)) + (__pyx_v__tm.tm_min * __pyx_v_7cytimes_5utils_SS_MINUTE)) + __pyx_v__tm.tm_sec);
  goto __pyx_L0;

  /* "utils.pxd":706
 *     return t[0]
 * 
 * cdef inline long long ts_gmtime(double ts):             # <<<<<<<<<<<<<<
 *     """Convert a timestamp to UTC seconds since the Unix Epoch `<'int'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.ts_gmtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":721
 *     )
 * 
 * cdef inline long long ts_localtime(double ts):             # <<<<<<<<<<<<<<
 *     """Convert a timestamp to local seconds since the Unix Epoch `<'int'>`.
 * 
 */

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_ts_localtime(double __pyx_v_ts) {
  struct tm __pyx_v__tm;
  PY_LONG_LONG __pyx_v_ordinal;
  PY_LONG_LONG __pyx_r;
  struct tm __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":727
 *     seconds since the Unix Epoch, representing the local time.
 *     """
 *     cdef tm _tm = tm_localtime(ts)             # <<<<<<<<<<<<<<
 *     cdef long long ordinal = ymd_to_ordinal(_tm.tm_year, _tm.tm_mon, _tm.tm_mday)
 *     return (
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_tm_localtime(__pyx_v_ts); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 727, __pyx_L1_error)
  __pyx_v__tm = __pyx_t_1;

  /* "utils.pxd":728
 *     """
 *     cdef tm _tm = tm_localtime(ts)
 *     cdef long long ordinal = ymd_to_ordinal(_tm.tm_year, _tm.tm_mon, _tm.tm_mday)             # <<<<<<<<<<<<<<
 *     return (
 *         (ordinal - EPOCH_DAY) * SS_DAY
 */
  __pyx_t_2 = __pyx_f_7cytimes_5utils_ymd_to_ordinal(__pyx_v__tm.tm_year, __pyx_v__tm.tm_mon, __pyx_v__tm.tm_mday); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 728, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_2;

  /* "utils.pxd":733
 *         + _tm.tm_hour * SS_HOUR
 *         + _tm.tm_min * SS_MINUTE
 *         + _tm.tm_sec             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_r = (((((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_SS_DAY) + (__pyx_v__tm.tm_hour * __pyx_v_7cytimes_5utils_SS_HOUR)) + (__pyx_v__tm.tm_min * __pyx_v_7cytimes_5utils_SS_MINUTE)) + __pyx_v__tm.tm_sec);
  goto __pyx_L0;

  /* "utils.pxd":721
 *     )
 * 
 * cdef inline long long ts_localtime(double ts):             # <<<<<<<<<<<<<<
 *     """Convert a timestamp to local seconds since the Unix Epoch `<'int'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.ts_localtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":736
 *     )
 * 
 * cdef inline int _raise_from_errno() except -1 with gil:             # <<<<<<<<<<<<<<
 *     """(internal) Error handling for 'ts_gmtime/ts_localtime' functions."""
 *     PyErr_SetFromErrno(RuntimeError)
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils__raise_from_errno(void) {
  int __pyx_r;
  PyObject *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif

  /* "utils.pxd":738
 * cdef inline int _raise_from_errno() except -1 with gil:
 *     """(internal) Error handling for 'ts_gmtime/ts_localtime' functions."""
 *     PyErr_SetFromErrno(RuntimeError)             # <<<<<<<<<<<<<<
 *     return <int> -1  # type: ignore
 * 
 */
  __pyx_t_1 = PyErr_SetFromErrno(__pyx_builtin_RuntimeError); if (unlikely(__pyx_t_1 == ((PyObject *)NULL))) __PYX_ERR(5, 738, __pyx_L1_error)

  /* "utils.pxd":739
 *     """(internal) Error handling for 'ts_gmtime/ts_localtime' functions."""
 *     PyErr_SetFromErrno(RuntimeError)
 *     return <int> -1  # type: ignore             # <<<<<<<<<<<<<<
 * 
 * # . conversion
 */
  __pyx_r = ((int)-1L);
  goto __pyx_L0;

  /* "utils.pxd":736
 *     )
 * 
 * cdef inline int _raise_from_errno() except -1 with gil:             # <<<<<<<<<<<<<<
 *     """(internal) Error handling for 'ts_gmtime/ts_localtime' functions."""
 *     PyErr_SetFromErrno(RuntimeError)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils._raise_from_errno", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "utils.pxd":742
 * 
 * # . conversion
 * cdef inline str tm_strftime(tm t, str fmt):             # <<<<<<<<<<<<<<
 *     """Convert 'struct:tm' to string according to the given format `<'str'>`."""
 *     # Revert fields to 0-based
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_tm_strftime(struct tm __pyx_v_t, PyObject *__pyx_v_fmt) {
  char __pyx_v_buffer[0x100];
  Py_ssize_t __pyx_v_size;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tm_strftime", 1);

  /* "utils.pxd":745
 *     """Convert 'struct:tm' to string according to the given format `<'str'>`."""
 *     # Revert fields to 0-based
 *     t.tm_year -= 1_900             # <<<<<<<<<<<<<<
 *     t.tm_mon -= 1
 *     t.tm_wday = (t.tm_wday + 1) % 7
 */
  __pyx_v_t.tm_year = (__pyx_v_t.tm_year - 0x76C);

  /* "utils.pxd":746
 *     # Revert fields to 0-based
 *     t.tm_year -= 1_900
 *     t.tm_mon -= 1             # <<<<<<<<<<<<<<
 *     t.tm_wday = (t.tm_wday + 1) % 7
 *     t.tm_yday -= 1
 */
  __pyx_v_t.tm_mon = (__pyx_v_t.tm_mon - 1);

  /* "utils.pxd":747
 *     t.tm_year -= 1_900
 *     t.tm_mon -= 1
 *     t.tm_wday = (t.tm_wday + 1) % 7             # <<<<<<<<<<<<<<
 *     t.tm_yday -= 1
 * 
 */
  __pyx_v_t.tm_wday = __Pyx_mod_long((__pyx_v_t.tm_wday + 1), 7);

  /* "utils.pxd":748
 *     t.tm_mon -= 1
 *     t.tm_wday = (t.tm_wday + 1) % 7
 *     t.tm_yday -= 1             # <<<<<<<<<<<<<<
 * 
 *     # Perform strftime
 */
  __pyx_v_t.tm_yday = (__pyx_v_t.tm_yday - 1);

  /* "utils.pxd":752
 *     # Perform strftime
 *     cdef char buffer[256]
 *     cdef Py_ssize_t size = strftime(buffer, sizeof(buffer), PyUnicode_AsUTF8(fmt), &t)             # <<<<<<<<<<<<<<
 *     if size == 0:
 *         raise OverflowError("strftime format is too long:\n'%s'" % fmt)
 */
  __pyx_t_1 = PyUnicode_AsUTF8(__pyx_v_fmt); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(5, 752, __pyx_L1_error)
  __pyx_v_size = strftime(__pyx_v_buffer, (sizeof(__pyx_v_buffer)), __pyx_t_1, (&__pyx_v_t));

  /* "utils.pxd":753
 *     cdef char buffer[256]
 *     cdef Py_ssize_t size = strftime(buffer, sizeof(buffer), PyUnicode_AsUTF8(fmt), &t)
 *     if size == 0:             # <<<<<<<<<<<<<<
 *         raise OverflowError("strftime format is too long:\n'%s'" % fmt)
 *     return PyUnicode_DecodeUTF8(buffer, size, NULL)
 */
  __pyx_t_2 = (__pyx_v_size == 0);
  if (unlikely(__pyx_t_2)) {

    /* "utils.pxd":754
 *     cdef Py_ssize_t size = strftime(buffer, sizeof(buffer), PyUnicode_AsUTF8(fmt), &t)
 *     if size == 0:
 *         raise OverflowError("strftime format is too long:\n'%s'" % fmt)             # <<<<<<<<<<<<<<
 *     return PyUnicode_DecodeUTF8(buffer, size, NULL)
 * 
 */
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_strftime_format_is_too_long_s, __pyx_v_fmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 754, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_OverflowError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 754, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(5, 754, __pyx_L1_error)

    /* "utils.pxd":753
 *     cdef char buffer[256]
 *     cdef Py_ssize_t size = strftime(buffer, sizeof(buffer), PyUnicode_AsUTF8(fmt), &t)
 *     if size == 0:             # <<<<<<<<<<<<<<
 *         raise OverflowError("strftime format is too long:\n'%s'" % fmt)
 *     return PyUnicode_DecodeUTF8(buffer, size, NULL)
 */
  }

  /* "utils.pxd":755
 *     if size == 0:
 *         raise OverflowError("strftime format is too long:\n'%s'" % fmt)
 *     return PyUnicode_DecodeUTF8(buffer, size, NULL)             # <<<<<<<<<<<<<<
 * 
 * cdef inline tm tm_fr_us(long long val) except *:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyUnicode_DecodeUTF8(__pyx_v_buffer, __pyx_v_size, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "utils.pxd":742
 * 
 * # . conversion
 * cdef inline str tm_strftime(tm t, str fmt):             # <<<<<<<<<<<<<<
 *     """Convert 'struct:tm' to string according to the given format `<'str'>`."""
 *     # Revert fields to 0-based
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils.tm_strftime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":757
 *     return PyUnicode_DecodeUTF8(buffer, size, NULL)
 * 
 * cdef inline tm tm_fr_us(long long val) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:tm' from `EPOCH` microseconds (int) `<'struct:tm'>`."""
 *     # Compute ymd & hmsf
 */

static CYTHON_INLINE struct tm __pyx_f_7cytimes_5utils_tm_fr_us(PY_LONG_LONG __pyx_v_val) {
  __pyx_t_7cytimes_5utils_ymd __pyx_v__ymd;
  __pyx_t_7cytimes_5utils_hmsf __pyx_v__hmsf;
  int __pyx_v_yy;
  int __pyx_v_mm;
  int __pyx_v_dd;
  struct tm __pyx_r;
  PY_LONG_LONG __pyx_t_1;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_2;
  __pyx_t_7cytimes_5utils_hmsf __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  struct tm __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":760
 *     """Create 'struct:tm' from `EPOCH` microseconds (int) `<'struct:tm'>`."""
 *     # Compute ymd & hmsf
 *     val += EPOCH_MICROSECOND             # <<<<<<<<<<<<<<
 *     _ymd = ymd_fr_ordinal(math_floor_div(val, US_DAY))
 *     _hmsf = hmsf_fr_us(val)
 */
  __pyx_v_val = (__pyx_v_val + __pyx_v_7cytimes_5utils_EPOCH_MICROSECOND);

  /* "utils.pxd":761
 *     # Compute ymd & hmsf
 *     val += EPOCH_MICROSECOND
 *     _ymd = ymd_fr_ordinal(math_floor_div(val, US_DAY))             # <<<<<<<<<<<<<<
 *     _hmsf = hmsf_fr_us(val)
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_val, __pyx_v_7cytimes_5utils_US_DAY, NULL); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 761, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 761, __pyx_L1_error)
  __pyx_v__ymd = __pyx_t_2;

  /* "utils.pxd":762
 *     val += EPOCH_MICROSECOND
 *     _ymd = ymd_fr_ordinal(math_floor_div(val, US_DAY))
 *     _hmsf = hmsf_fr_us(val)             # <<<<<<<<<<<<<<
 * 
 *     # New 'struct:tm'
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_hmsf_fr_us(__pyx_v_val); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 762, __pyx_L1_error)
  __pyx_v__hmsf = __pyx_t_3;

  /* "utils.pxd":766
 *     # New 'struct:tm'
 *     cdef int yy, mm, dd
 *     yy, mm, dd = _ymd.year, _ymd.month, _ymd.day             # <<<<<<<<<<<<<<
 *     return tm(
 *         _hmsf.second, _hmsf.minute, _hmsf.hour,  # sec, min, hour
 */
  __pyx_t_4 = __pyx_v__ymd.year;
  __pyx_t_5 = __pyx_v__ymd.month;
  __pyx_t_6 = __pyx_v__ymd.day;
  __pyx_v_yy = __pyx_t_4;
  __pyx_v_mm = __pyx_t_5;
  __pyx_v_dd = __pyx_t_6;

  /* "utils.pxd":768
 *     yy, mm, dd = _ymd.year, _ymd.month, _ymd.day
 *     return tm(
 *         _hmsf.second, _hmsf.minute, _hmsf.hour,  # sec, min, hour             # <<<<<<<<<<<<<<
 *         dd, mm, dd,  # day, mon, year
 *         ymd_weekday(dd, mm, dd),  # wday
 */
  __pyx_t_7.tm_sec = __pyx_v__hmsf.second;
  __pyx_t_7.tm_min = __pyx_v__hmsf.minute;
  __pyx_t_7.tm_hour = __pyx_v__hmsf.hour;

  /* "utils.pxd":769
 *     return tm(
 *         _hmsf.second, _hmsf.minute, _hmsf.hour,  # sec, min, hour
 *         dd, mm, dd,  # day, mon, year             # <<<<<<<<<<<<<<
 *         ymd_weekday(dd, mm, dd),  # wday
 *         days_bf_month(yy, mm) + dd,  # yday
 */
  __pyx_t_7.tm_mday = __pyx_v_dd;
  __pyx_t_7.tm_mon = __pyx_v_mm;
  __pyx_t_7.tm_year = __pyx_v_dd;

  /* "utils.pxd":770
 *         _hmsf.second, _hmsf.minute, _hmsf.hour,  # sec, min, hour
 *         dd, mm, dd,  # day, mon, year
 *         ymd_weekday(dd, mm, dd),  # wday             # <<<<<<<<<<<<<<
 *         days_bf_month(yy, mm) + dd,  # yday
 *         -1,  # isdst
 */
  __pyx_t_6 = __pyx_f_7cytimes_5utils_ymd_weekday(__pyx_v_dd, __pyx_v_mm, __pyx_v_dd); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(5, 770, __pyx_L1_error)
  __pyx_t_7.tm_wday = __pyx_t_6;

  /* "utils.pxd":771
 *         dd, mm, dd,  # day, mon, year
 *         ymd_weekday(dd, mm, dd),  # wday
 *         days_bf_month(yy, mm) + dd,  # yday             # <<<<<<<<<<<<<<
 *         -1,  # isdst
 *     )
 */
  __pyx_t_6 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_yy, __pyx_v_mm); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(5, 771, __pyx_L1_error)
  __pyx_t_7.tm_yday = (__pyx_t_6 + __pyx_v_dd);
  __pyx_t_7.tm_isdst = -1;
  __pyx_r = __pyx_t_7;
  goto __pyx_L0;

  /* "utils.pxd":757
 *     return PyUnicode_DecodeUTF8(buffer, size, NULL)
 * 
 * cdef inline tm tm_fr_us(long long val) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:tm' from `EPOCH` microseconds (int) `<'struct:tm'>`."""
 *     # Compute ymd & hmsf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.tm_fr_us", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":775
 *     )
 * 
 * cdef inline tm tm_fr_seconds(double val) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:tm' from `EPOCH` seconds (float) `<'struct:tm'>`."""
 *     return tm_fr_us(<long long> int(val * US_SECOND))
 */

static CYTHON_INLINE struct tm __pyx_f_7cytimes_5utils_tm_fr_seconds(double __pyx_v_val) {
  struct tm __pyx_r;
  struct tm __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":777
 * cdef inline tm tm_fr_seconds(double val) except *:
 *     """Create 'struct:tm' from `EPOCH` seconds (float) `<'struct:tm'>`."""
 *     return tm_fr_us(<long long> int(val * US_SECOND))             # <<<<<<<<<<<<<<
 * 
 * cdef inline hmsf hmsf_fr_us(long long val) except *:
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_tm_fr_us(((PY_LONG_LONG)((PY_LONG_LONG)(__pyx_v_val * __pyx_v_7cytimes_5utils_US_SECOND)))); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 777, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "utils.pxd":775
 *     )
 * 
 * cdef inline tm tm_fr_seconds(double val) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:tm' from `EPOCH` seconds (float) `<'struct:tm'>`."""
 *     return tm_fr_us(<long long> int(val * US_SECOND))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.tm_fr_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":779
 *     return tm_fr_us(<long long> int(val * US_SECOND))
 * 
 * cdef inline hmsf hmsf_fr_us(long long val) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:hmsf' from microseconds (int) `<'struct:hmsf'>`.
 * 
 */

static CYTHON_INLINE __pyx_t_7cytimes_5utils_hmsf __pyx_f_7cytimes_5utils_hmsf_fr_us(PY_LONG_LONG __pyx_v_val) {
  int __pyx_v_hh;
  int __pyx_v_mi;
  PY_LONG_LONG __pyx_v_ss;
  __pyx_t_7cytimes_5utils_hmsf __pyx_r;
  int __pyx_t_1;
  __pyx_t_7cytimes_5utils_hmsf __pyx_t_2;
  PY_LONG_LONG __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":785
 *     and `NOT` the Unix Epoch (1970-01-01 00:00:00).
 *     """
 *     if val <= 0:             # <<<<<<<<<<<<<<
 *         return hmsf(0, 0, 0, 0)
 * 
 */
  __pyx_t_1 = (__pyx_v_val <= 0);
  if (__pyx_t_1) {

    /* "utils.pxd":786
 *     """
 *     if val <= 0:
 *         return hmsf(0, 0, 0, 0)             # <<<<<<<<<<<<<<
 * 
 *     val = math_mod(val, US_DAY)
 */
    __pyx_t_2.hour = 0;
    __pyx_t_2.minute = 0;
    __pyx_t_2.second = 0;
    __pyx_t_2.microsecond = 0;
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "utils.pxd":785
 *     and `NOT` the Unix Epoch (1970-01-01 00:00:00).
 *     """
 *     if val <= 0:             # <<<<<<<<<<<<<<
 *         return hmsf(0, 0, 0, 0)
 * 
 */
  }

  /* "utils.pxd":788
 *         return hmsf(0, 0, 0, 0)
 * 
 *     val = math_mod(val, US_DAY)             # <<<<<<<<<<<<<<
 *     cdef int hh = math_floor_div(val, US_HOUR)
 *     val -= hh * US_HOUR
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_math_mod(__pyx_v_val, __pyx_v_7cytimes_5utils_US_DAY, NULL); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 788, __pyx_L1_error)
  __pyx_v_val = __pyx_t_3;

  /* "utils.pxd":789
 * 
 *     val = math_mod(val, US_DAY)
 *     cdef int hh = math_floor_div(val, US_HOUR)             # <<<<<<<<<<<<<<
 *     val -= hh * US_HOUR
 *     cdef int mi = math_floor_div(val, US_MINUTE)
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_val, __pyx_v_7cytimes_5utils_US_HOUR, NULL); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 789, __pyx_L1_error)
  __pyx_v_hh = __pyx_t_3;

  /* "utils.pxd":790
 *     val = math_mod(val, US_DAY)
 *     cdef int hh = math_floor_div(val, US_HOUR)
 *     val -= hh * US_HOUR             # <<<<<<<<<<<<<<
 *     cdef int mi = math_floor_div(val, US_MINUTE)
 *     val -= mi * US_MINUTE
 */
  __pyx_v_val = (__pyx_v_val - (__pyx_v_hh * __pyx_v_7cytimes_5utils_US_HOUR));

  /* "utils.pxd":791
 *     cdef int hh = math_floor_div(val, US_HOUR)
 *     val -= hh * US_HOUR
 *     cdef int mi = math_floor_div(val, US_MINUTE)             # <<<<<<<<<<<<<<
 *     val -= mi * US_MINUTE
 *     cdef long long ss = math_floor_div(val, US_SECOND)
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_val, __pyx_v_7cytimes_5utils_US_MINUTE, NULL); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 791, __pyx_L1_error)
  __pyx_v_mi = __pyx_t_3;

  /* "utils.pxd":792
 *     val -= hh * US_HOUR
 *     cdef int mi = math_floor_div(val, US_MINUTE)
 *     val -= mi * US_MINUTE             # <<<<<<<<<<<<<<
 *     cdef long long ss = math_floor_div(val, US_SECOND)
 *     return hmsf(hh, mi, ss, val - ss * US_SECOND)
 */
  __pyx_v_val = (__pyx_v_val - (__pyx_v_mi * __pyx_v_7cytimes_5utils_US_MINUTE));

  /* "utils.pxd":793
 *     cdef int mi = math_floor_div(val, US_MINUTE)
 *     val -= mi * US_MINUTE
 *     cdef long long ss = math_floor_div(val, US_SECOND)             # <<<<<<<<<<<<<<
 *     return hmsf(hh, mi, ss, val - ss * US_SECOND)
 * 
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_val, __pyx_v_7cytimes_5utils_US_SECOND, NULL); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 793, __pyx_L1_error)
  __pyx_v_ss = __pyx_t_3;

  /* "utils.pxd":794
 *     val -= mi * US_MINUTE
 *     cdef long long ss = math_floor_div(val, US_SECOND)
 *     return hmsf(hh, mi, ss, val - ss * US_SECOND)             # <<<<<<<<<<<<<<
 * 
 * cdef inline hmsf hmsf_fr_seconds(double val) except *:
 */
  __pyx_t_2.hour = __pyx_v_hh;
  __pyx_t_2.minute = __pyx_v_mi;
  __pyx_t_2.second = __pyx_v_ss;
  __pyx_t_2.microsecond = (__pyx_v_val - (__pyx_v_ss * __pyx_v_7cytimes_5utils_US_SECOND));
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "utils.pxd":779
 *     return tm_fr_us(<long long> int(val * US_SECOND))
 * 
 * cdef inline hmsf hmsf_fr_us(long long val) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:hmsf' from microseconds (int) `<'struct:hmsf'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.hmsf_fr_us", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":796
 *     return hmsf(hh, mi, ss, val - ss * US_SECOND)
 * 
 * cdef inline hmsf hmsf_fr_seconds(double val) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:hmsf' from seconds (float) `<'struct:hmsf'>`.
 * 
 */

static CYTHON_INLINE __pyx_t_7cytimes_5utils_hmsf __pyx_f_7cytimes_5utils_hmsf_fr_seconds(double __pyx_v_val) {
  __pyx_t_7cytimes_5utils_hmsf __pyx_r;
  __pyx_t_7cytimes_5utils_hmsf __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":802
 *     and `NOT` the Unix Epoch (1970-01-01 00:00:00).
 *     """
 *     return hmsf_fr_us(<long long> int(val * US_SECOND))             # <<<<<<<<<<<<<<
 * 
 * # Calendar ---------------------------------------------------------------------------------------------
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_hmsf_fr_us(((PY_LONG_LONG)((PY_LONG_LONG)(__pyx_v_val * __pyx_v_7cytimes_5utils_US_SECOND)))); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 802, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "utils.pxd":796
 *     return hmsf(hh, mi, ss, val - ss * US_SECOND)
 * 
 * cdef inline hmsf hmsf_fr_seconds(double val) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:hmsf' from seconds (float) `<'struct:hmsf'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.hmsf_fr_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":806
 * # Calendar ---------------------------------------------------------------------------------------------
 * # . year
 * cdef inline bint is_leap_year(int year) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'year' is a leap year `<'bool'>`."""
 *     if year < 1:
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_leap_year(int __pyx_v_year) {
  int __pyx_r;
  int __pyx_t_1;

  /* "utils.pxd":808
 * cdef inline bint is_leap_year(int year) except -1:
 *     """Check if the passed in 'year' is a leap year `<'bool'>`."""
 *     if year < 1:             # <<<<<<<<<<<<<<
 *         return False
 *     if year % 4 == 0:
 */
  __pyx_t_1 = (__pyx_v_year < 1);
  if (__pyx_t_1) {

    /* "utils.pxd":809
 *     """Check if the passed in 'year' is a leap year `<'bool'>`."""
 *     if year < 1:
 *         return False             # <<<<<<<<<<<<<<
 *     if year % 4 == 0:
 *         if year % 400 == 0:
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "utils.pxd":808
 * cdef inline bint is_leap_year(int year) except -1:
 *     """Check if the passed in 'year' is a leap year `<'bool'>`."""
 *     if year < 1:             # <<<<<<<<<<<<<<
 *         return False
 *     if year % 4 == 0:
 */
  }

  /* "utils.pxd":810
 *     if year < 1:
 *         return False
 *     if year % 4 == 0:             # <<<<<<<<<<<<<<
 *         if year % 400 == 0:
 *             return True
 */
  __pyx_t_1 = (__Pyx_mod_long(__pyx_v_year, 4) == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":811
 *         return False
 *     if year % 4 == 0:
 *         if year % 400 == 0:             # <<<<<<<<<<<<<<
 *             return True
 *         if year % 100 != 0:
 */
    __pyx_t_1 = (__Pyx_mod_long(__pyx_v_year, 0x190) == 0);
    if (__pyx_t_1) {

      /* "utils.pxd":812
 *     if year % 4 == 0:
 *         if year % 400 == 0:
 *             return True             # <<<<<<<<<<<<<<
 *         if year % 100 != 0:
 *             return True
 */
      __pyx_r = 1;
      goto __pyx_L0;

      /* "utils.pxd":811
 *         return False
 *     if year % 4 == 0:
 *         if year % 400 == 0:             # <<<<<<<<<<<<<<
 *             return True
 *         if year % 100 != 0:
 */
    }

    /* "utils.pxd":813
 *         if year % 400 == 0:
 *             return True
 *         if year % 100 != 0:             # <<<<<<<<<<<<<<
 *             return True
 *     return False
 */
    __pyx_t_1 = (__Pyx_mod_long(__pyx_v_year, 0x64) != 0);
    if (__pyx_t_1) {

      /* "utils.pxd":814
 *             return True
 *         if year % 100 != 0:
 *             return True             # <<<<<<<<<<<<<<
 *     return False
 * 
 */
      __pyx_r = 1;
      goto __pyx_L0;

      /* "utils.pxd":813
 *         if year % 400 == 0:
 *             return True
 *         if year % 100 != 0:             # <<<<<<<<<<<<<<
 *             return True
 *     return False
 */
    }

    /* "utils.pxd":810
 *     if year < 1:
 *         return False
 *     if year % 4 == 0:             # <<<<<<<<<<<<<<
 *         if year % 400 == 0:
 *             return True
 */
  }

  /* "utils.pxd":815
 *         if year % 100 != 0:
 *             return True
 *     return False             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_long_year(int year) except -1:
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "utils.pxd":806
 * # Calendar ---------------------------------------------------------------------------------------------
 * # . year
 * cdef inline bint is_leap_year(int year) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'year' is a leap year `<'bool'>`."""
 *     if year < 1:
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":817
 *     return False
 * 
 * cdef inline bint is_long_year(int year) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'year' is a long year `<'bool'>`.
 * 
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_long_year(int __pyx_v_year) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":822
 *     #### Long year: maximum ISO week number equal 53.
 *     """
 *     return ymd_isoweek(year, 12, 28) == 53             # <<<<<<<<<<<<<<
 * 
 * cdef inline int leap_bt_year(int year1, int year2) except -1:
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_ymd_isoweek(__pyx_v_year, 12, 28); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 822, __pyx_L1_error)
  __pyx_r = (__pyx_t_1 == 53);
  goto __pyx_L0;

  /* "utils.pxd":817
 *     return False
 * 
 * cdef inline bint is_long_year(int year) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the passed in 'year' is a long year `<'bool'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.is_long_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":824
 *     return ymd_isoweek(year, 12, 28) == 53
 * 
 * cdef inline int leap_bt_year(int year1, int year2) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of leap years between 'year1' & 'year2' `<'int'>`."""
 *     cdef int y1, y2
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_leap_bt_year(int __pyx_v_year1, int __pyx_v_year2) {
  int __pyx_v_y1;
  int __pyx_v_y2;
  int __pyx_r;
  int __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  long __pyx_t_4;
  long __pyx_t_5;

  /* "utils.pxd":827
 *     """Compute the number of leap years between 'year1' & 'year2' `<'int'>`."""
 *     cdef int y1, y2
 *     if year1 < year2:             # <<<<<<<<<<<<<<
 *         y1, y2 = max(year1, 1) - 1, max(year2, 1) - 1
 *     else:
 */
  __pyx_t_1 = (__pyx_v_year1 < __pyx_v_year2);
  if (__pyx_t_1) {

    /* "utils.pxd":828
 *     cdef int y1, y2
 *     if year1 < year2:
 *         y1, y2 = max(year1, 1) - 1, max(year2, 1) - 1             # <<<<<<<<<<<<<<
 *     else:
 *         y1, y2 = max(year2, 1) - 1, max(year1, 1) - 1
 */
    __pyx_t_2 = 1;
    __pyx_t_3 = __pyx_v_year1;
    __pyx_t_1 = (__pyx_t_2 > __pyx_t_3);
    if (__pyx_t_1) {
      __pyx_t_4 = __pyx_t_2;
    } else {
      __pyx_t_4 = __pyx_t_3;
    }
    __pyx_t_2 = (__pyx_t_4 - 1);
    __pyx_t_4 = 1;
    __pyx_t_3 = __pyx_v_year2;
    __pyx_t_1 = (__pyx_t_4 > __pyx_t_3);
    if (__pyx_t_1) {
      __pyx_t_5 = __pyx_t_4;
    } else {
      __pyx_t_5 = __pyx_t_3;
    }
    __pyx_t_4 = (__pyx_t_5 - 1);
    __pyx_v_y1 = __pyx_t_2;
    __pyx_v_y2 = __pyx_t_4;

    /* "utils.pxd":827
 *     """Compute the number of leap years between 'year1' & 'year2' `<'int'>`."""
 *     cdef int y1, y2
 *     if year1 < year2:             # <<<<<<<<<<<<<<
 *         y1, y2 = max(year1, 1) - 1, max(year2, 1) - 1
 *     else:
 */
    goto __pyx_L3;
  }

  /* "utils.pxd":830
 *         y1, y2 = max(year1, 1) - 1, max(year2, 1) - 1
 *     else:
 *         y1, y2 = max(year2, 1) - 1, max(year1, 1) - 1             # <<<<<<<<<<<<<<
 *     return (
 *         (y2 // 4 - y1 // 4)
 */
  /*else*/ {
    __pyx_t_4 = 1;
    __pyx_t_3 = __pyx_v_year2;
    __pyx_t_1 = (__pyx_t_4 > __pyx_t_3);
    if (__pyx_t_1) {
      __pyx_t_2 = __pyx_t_4;
    } else {
      __pyx_t_2 = __pyx_t_3;
    }
    __pyx_t_4 = (__pyx_t_2 - 1);
    __pyx_t_2 = 1;
    __pyx_t_3 = __pyx_v_year1;
    __pyx_t_1 = (__pyx_t_2 > __pyx_t_3);
    if (__pyx_t_1) {
      __pyx_t_5 = __pyx_t_2;
    } else {
      __pyx_t_5 = __pyx_t_3;
    }
    __pyx_t_2 = (__pyx_t_5 - 1);
    __pyx_v_y1 = __pyx_t_4;
    __pyx_v_y2 = __pyx_t_2;
  }
  __pyx_L3:;

  /* "utils.pxd":834
 *         (y2 // 4 - y1 // 4)
 *         - (y2 // 100 - y1 // 100)
 *         + (y2 // 400 - y1 // 400)             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_r = (((__Pyx_div_long(__pyx_v_y2, 4) - __Pyx_div_long(__pyx_v_y1, 4)) - (__Pyx_div_long(__pyx_v_y2, 0x64) - __Pyx_div_long(__pyx_v_y1, 0x64))) + (__Pyx_div_long(__pyx_v_y2, 0x190) - __Pyx_div_long(__pyx_v_y1, 0x190)));
  goto __pyx_L0;

  /* "utils.pxd":824
 *     return ymd_isoweek(year, 12, 28) == 53
 * 
 * cdef inline int leap_bt_year(int year1, int year2) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of leap years between 'year1' & 'year2' `<'int'>`."""
 *     cdef int y1, y2
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":837
 *     )
 * 
 * cdef inline int days_in_year(int year) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the maximum days (365, 366) in the 'year' `<'int'>`."""
 *     return 366 if is_leap_year(year) else 365
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_in_year(int __pyx_v_year) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":839
 * cdef inline int days_in_year(int year) except -1:
 *     """Compute the maximum days (365, 366) in the 'year' `<'int'>`."""
 *     return 366 if is_leap_year(year) else 365             # <<<<<<<<<<<<<<
 * 
 * cdef inline int days_bf_year(int year) except -1:
 */
  __pyx_t_2 = __pyx_f_7cytimes_5utils_is_leap_year(__pyx_v_year); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 839, __pyx_L1_error)
  if (__pyx_t_2) {
    __pyx_t_1 = 0x16E;
  } else {
    __pyx_t_1 = 0x16D;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "utils.pxd":837
 *     )
 * 
 * cdef inline int days_in_year(int year) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the maximum days (365, 366) in the 'year' `<'int'>`."""
 *     return 366 if is_leap_year(year) else 365
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.days_in_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":841
 *     return 366 if is_leap_year(year) else 365
 * 
 * cdef inline int days_bf_year(int year) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of days between the 1st day of 1AD and the 'year' `<'int'>`."""
 *     if year <= 1:
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_bf_year(int __pyx_v_year) {
  int __pyx_v_y_1;
  int __pyx_r;
  int __pyx_t_1;

  /* "utils.pxd":843
 * cdef inline int days_bf_year(int year) except -1:
 *     """Compute the number of days between the 1st day of 1AD and the 'year' `<'int'>`."""
 *     if year <= 1:             # <<<<<<<<<<<<<<
 *         return 0
 *     cdef int y_1 = year - 1
 */
  __pyx_t_1 = (__pyx_v_year <= 1);
  if (__pyx_t_1) {

    /* "utils.pxd":844
 *     """Compute the number of days between the 1st day of 1AD and the 'year' `<'int'>`."""
 *     if year <= 1:
 *         return 0             # <<<<<<<<<<<<<<
 *     cdef int y_1 = year - 1
 *     return y_1 * 365 + y_1 // 4 - y_1 // 100 + y_1 // 400
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "utils.pxd":843
 * cdef inline int days_bf_year(int year) except -1:
 *     """Compute the number of days between the 1st day of 1AD and the 'year' `<'int'>`."""
 *     if year <= 1:             # <<<<<<<<<<<<<<
 *         return 0
 *     cdef int y_1 = year - 1
 */
  }

  /* "utils.pxd":845
 *     if year <= 1:
 *         return 0
 *     cdef int y_1 = year - 1             # <<<<<<<<<<<<<<
 *     return y_1 * 365 + y_1 // 4 - y_1 // 100 + y_1 // 400
 * 
 */
  __pyx_v_y_1 = (__pyx_v_year - 1);

  /* "utils.pxd":846
 *         return 0
 *     cdef int y_1 = year - 1
 *     return y_1 * 365 + y_1 // 4 - y_1 // 100 + y_1 // 400             # <<<<<<<<<<<<<<
 * 
 * cdef inline int days_of_year(int year, int month, int day) except -1:
 */
  __pyx_r = ((((__pyx_v_y_1 * 0x16D) + __Pyx_div_long(__pyx_v_y_1, 4)) - __Pyx_div_long(__pyx_v_y_1, 0x64)) + __Pyx_div_long(__pyx_v_y_1, 0x190));
  goto __pyx_L0;

  /* "utils.pxd":841
 *     return 366 if is_leap_year(year) else 365
 * 
 * cdef inline int days_bf_year(int year) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of days between the 1st day of 1AD and the 'year' `<'int'>`."""
 *     if year <= 1:
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":848
 *     return y_1 * 365 + y_1 // 4 - y_1 // 100 + y_1 // 400
 * 
 * cdef inline int days_of_year(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of days between the 1st day of
 *     the 'year' and the current Y/M/D `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_of_year(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":852
 *     the 'year' and the current Y/M/D `<'int'>`.
 *     """
 *     if day > 28:             # <<<<<<<<<<<<<<
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 */
  __pyx_t_1 = (__pyx_v_day > 28);
  if (__pyx_t_1) {

    /* "utils.pxd":853
 *     """
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))             # <<<<<<<<<<<<<<
 *     elif day < 1:
 *         day = 1
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_days_in_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 853, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_day;
    __pyx_t_1 = (__pyx_t_2 < __pyx_t_3);
    if (__pyx_t_1) {
      __pyx_t_4 = __pyx_t_2;
    } else {
      __pyx_t_4 = __pyx_t_3;
    }
    __pyx_v_day = __pyx_t_4;

    /* "utils.pxd":852
 *     the 'year' and the current Y/M/D `<'int'>`.
 *     """
 *     if day > 28:             # <<<<<<<<<<<<<<
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 */
    goto __pyx_L3;
  }

  /* "utils.pxd":854
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:             # <<<<<<<<<<<<<<
 *         day = 1
 *     return days_bf_month(year, month) + day
 */
  __pyx_t_1 = (__pyx_v_day < 1);
  if (__pyx_t_1) {

    /* "utils.pxd":855
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 *         day = 1             # <<<<<<<<<<<<<<
 *     return days_bf_month(year, month) + day
 * 
 */
    __pyx_v_day = 1;

    /* "utils.pxd":854
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:             # <<<<<<<<<<<<<<
 *         day = 1
 *     return days_bf_month(year, month) + day
 */
  }
  __pyx_L3:;

  /* "utils.pxd":856
 *     elif day < 1:
 *         day = 1
 *     return days_bf_month(year, month) + day             # <<<<<<<<<<<<<<
 * 
 * # . quarter
 */
  __pyx_t_4 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 856, __pyx_L1_error)
  __pyx_r = (__pyx_t_4 + __pyx_v_day);
  goto __pyx_L0;

  /* "utils.pxd":848
 *     return y_1 * 365 + y_1 // 4 - y_1 // 100 + y_1 // 400
 * 
 * cdef inline int days_of_year(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of days between the 1st day of
 *     the 'year' and the current Y/M/D `<'int'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.days_of_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":859
 * 
 * # . quarter
 * cdef inline int quarter_of_month(int month) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the quarter (1-4) of the passed in 'month' `<'int'>`."""
 *     # Jan - Mar
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_quarter_of_month(int __pyx_v_month) {
  int __pyx_r;
  int __pyx_t_1;

  /* "utils.pxd":862
 *     """Compute the quarter (1-4) of the passed in 'month' `<'int'>`."""
 *     # Jan - Mar
 *     if month <= 3:             # <<<<<<<<<<<<<<
 *         return 1
 *     # Oct - Dec
 */
  __pyx_t_1 = (__pyx_v_month <= 3);
  if (__pyx_t_1) {

    /* "utils.pxd":863
 *     # Jan - Mar
 *     if month <= 3:
 *         return 1             # <<<<<<<<<<<<<<
 *     # Oct - Dec
 *     if month >= 10:
 */
    __pyx_r = 1;
    goto __pyx_L0;

    /* "utils.pxd":862
 *     """Compute the quarter (1-4) of the passed in 'month' `<'int'>`."""
 *     # Jan - Mar
 *     if month <= 3:             # <<<<<<<<<<<<<<
 *         return 1
 *     # Oct - Dec
 */
  }

  /* "utils.pxd":865
 *         return 1
 *     # Oct - Dec
 *     if month >= 10:             # <<<<<<<<<<<<<<
 *         return 4
 *     # Rest
 */
  __pyx_t_1 = (__pyx_v_month >= 10);
  if (__pyx_t_1) {

    /* "utils.pxd":866
 *     # Oct - Dec
 *     if month >= 10:
 *         return 4             # <<<<<<<<<<<<<<
 *     # Rest
 *     return (month - 1) // 3 + 1
 */
    __pyx_r = 4;
    goto __pyx_L0;

    /* "utils.pxd":865
 *         return 1
 *     # Oct - Dec
 *     if month >= 10:             # <<<<<<<<<<<<<<
 *         return 4
 *     # Rest
 */
  }

  /* "utils.pxd":868
 *         return 4
 *     # Rest
 *     return (month - 1) // 3 + 1             # <<<<<<<<<<<<<<
 * 
 * cdef inline int days_in_quarter(int year, int month) except -1:
 */
  __pyx_r = (__Pyx_div_long((__pyx_v_month - 1), 3) + 1);
  goto __pyx_L0;

  /* "utils.pxd":859
 * 
 * # . quarter
 * cdef inline int quarter_of_month(int month) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the quarter (1-4) of the passed in 'month' `<'int'>`."""
 *     # Jan - Mar
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":870
 *     return (month - 1) // 3 + 1
 * 
 * cdef inline int days_in_quarter(int year, int month) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the maximum days in the quarter `<'int'>`."""
 *     cdef:
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_in_quarter(int __pyx_v_year, int __pyx_v_month) {
  int __pyx_v_quarter;
  int __pyx_v_days;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":873
 *     """Compute the maximum days in the quarter `<'int'>`."""
 *     cdef:
 *         int quarter = quarter_of_month(month)             # <<<<<<<<<<<<<<
 *         int days = DAYS_IN_QUARTER[quarter]
 *     if quarter == 1 and is_leap_year(year):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_quarter_of_month(__pyx_v_month); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 873, __pyx_L1_error)
  __pyx_v_quarter = __pyx_t_1;

  /* "utils.pxd":874
 *     cdef:
 *         int quarter = quarter_of_month(month)
 *         int days = DAYS_IN_QUARTER[quarter]             # <<<<<<<<<<<<<<
 *     if quarter == 1 and is_leap_year(year):
 *         days += 1
 */
  __pyx_v_days = (__pyx_v_7cytimes_5utils_DAYS_IN_QUARTER[__pyx_v_quarter]);

  /* "utils.pxd":875
 *         int quarter = quarter_of_month(month)
 *         int days = DAYS_IN_QUARTER[quarter]
 *     if quarter == 1 and is_leap_year(year):             # <<<<<<<<<<<<<<
 *         days += 1
 *     return days
 */
  __pyx_t_3 = (__pyx_v_quarter == 1);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __pyx_f_7cytimes_5utils_is_leap_year(__pyx_v_year); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 875, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "utils.pxd":876
 *         int days = DAYS_IN_QUARTER[quarter]
 *     if quarter == 1 and is_leap_year(year):
 *         days += 1             # <<<<<<<<<<<<<<
 *     return days
 * 
 */
    __pyx_v_days = (__pyx_v_days + 1);

    /* "utils.pxd":875
 *         int quarter = quarter_of_month(month)
 *         int days = DAYS_IN_QUARTER[quarter]
 *     if quarter == 1 and is_leap_year(year):             # <<<<<<<<<<<<<<
 *         days += 1
 *     return days
 */
  }

  /* "utils.pxd":877
 *     if quarter == 1 and is_leap_year(year):
 *         days += 1
 *     return days             # <<<<<<<<<<<<<<
 * 
 * cdef inline int days_bf_quarter(int year, int month) except -1:
 */
  __pyx_r = __pyx_v_days;
  goto __pyx_L0;

  /* "utils.pxd":870
 *     return (month - 1) // 3 + 1
 * 
 * cdef inline int days_in_quarter(int year, int month) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the maximum days in the quarter `<'int'>`."""
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.days_in_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":879
 *     return days
 * 
 * cdef inline int days_bf_quarter(int year, int month) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of days between the 1st day of the
 *     'year' and the 1st day of the quarter `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_bf_quarter(int __pyx_v_year, int __pyx_v_month) {
  int __pyx_v_quarter;
  int __pyx_v_days;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":884
 *     """
 *     cdef:
 *         int quarter = quarter_of_month(month)             # <<<<<<<<<<<<<<
 *         int days = DAYS_BR_QUARTER[quarter - 1]
 *     if quarter > 1 and is_leap_year(year):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_quarter_of_month(__pyx_v_month); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 884, __pyx_L1_error)
  __pyx_v_quarter = __pyx_t_1;

  /* "utils.pxd":885
 *     cdef:
 *         int quarter = quarter_of_month(month)
 *         int days = DAYS_BR_QUARTER[quarter - 1]             # <<<<<<<<<<<<<<
 *     if quarter > 1 and is_leap_year(year):
 *         days += 1
 */
  __pyx_v_days = (__pyx_v_7cytimes_5utils_DAYS_BR_QUARTER[(__pyx_v_quarter - 1)]);

  /* "utils.pxd":886
 *         int quarter = quarter_of_month(month)
 *         int days = DAYS_BR_QUARTER[quarter - 1]
 *     if quarter > 1 and is_leap_year(year):             # <<<<<<<<<<<<<<
 *         days += 1
 *     return days
 */
  __pyx_t_3 = (__pyx_v_quarter > 1);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __pyx_f_7cytimes_5utils_is_leap_year(__pyx_v_year); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 886, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "utils.pxd":887
 *         int days = DAYS_BR_QUARTER[quarter - 1]
 *     if quarter > 1 and is_leap_year(year):
 *         days += 1             # <<<<<<<<<<<<<<
 *     return days
 * 
 */
    __pyx_v_days = (__pyx_v_days + 1);

    /* "utils.pxd":886
 *         int quarter = quarter_of_month(month)
 *         int days = DAYS_BR_QUARTER[quarter - 1]
 *     if quarter > 1 and is_leap_year(year):             # <<<<<<<<<<<<<<
 *         days += 1
 *     return days
 */
  }

  /* "utils.pxd":888
 *     if quarter > 1 and is_leap_year(year):
 *         days += 1
 *     return days             # <<<<<<<<<<<<<<
 * 
 * cdef inline int days_of_quarter(int year, int month, int day) except -1:
 */
  __pyx_r = __pyx_v_days;
  goto __pyx_L0;

  /* "utils.pxd":879
 *     return days
 * 
 * cdef inline int days_bf_quarter(int year, int month) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of days between the 1st day of the
 *     'year' and the 1st day of the quarter `<'int'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.days_bf_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":890
 *     return days
 * 
 * cdef inline int days_of_quarter(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of days between the 1st day
 *     of the quarter and the current Y/M/D `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_of_quarter(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":894
 *     of the quarter and the current Y/M/D `<'int'>`.
 *     """
 *     return days_of_year(year, month, day) - days_bf_quarter(year, month)             # <<<<<<<<<<<<<<
 * 
 * # . month
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_days_of_year(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 894, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7cytimes_5utils_days_bf_quarter(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 894, __pyx_L1_error)
  __pyx_r = (__pyx_t_1 - __pyx_t_2);
  goto __pyx_L0;

  /* "utils.pxd":890
 *     return days
 * 
 * cdef inline int days_of_quarter(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of days between the 1st day
 *     of the quarter and the current Y/M/D `<'int'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.days_of_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":897
 * 
 * # . month
 * cdef inline int days_in_month(int year, int month) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the maximum days in the month `<'int'>`."""
 *     # January & December
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_in_month(int __pyx_v_year, int __pyx_v_month) {
  int __pyx_v_days;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":900
 *     """Compute the maximum days in the month `<'int'>`."""
 *     # January & December
 *     if not 1 < month < 12:             # <<<<<<<<<<<<<<
 *         return 31
 *     # Rest
 */
  __pyx_t_1 = (1 < __pyx_v_month);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_month < 12);
  }
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "utils.pxd":901
 *     # January & December
 *     if not 1 < month < 12:
 *         return 31             # <<<<<<<<<<<<<<
 *     # Rest
 *     cdef int days = DAYS_IN_MONTH[month]
 */
    __pyx_r = 31;
    goto __pyx_L0;

    /* "utils.pxd":900
 *     """Compute the maximum days in the month `<'int'>`."""
 *     # January & December
 *     if not 1 < month < 12:             # <<<<<<<<<<<<<<
 *         return 31
 *     # Rest
 */
  }

  /* "utils.pxd":903
 *         return 31
 *     # Rest
 *     cdef int days = DAYS_IN_MONTH[month]             # <<<<<<<<<<<<<<
 *     if month == 2 and is_leap_year(year):
 *         days += 1
 */
  __pyx_v_days = (__pyx_v_7cytimes_5utils_DAYS_IN_MONTH[__pyx_v_month]);

  /* "utils.pxd":904
 *     # Rest
 *     cdef int days = DAYS_IN_MONTH[month]
 *     if month == 2 and is_leap_year(year):             # <<<<<<<<<<<<<<
 *         days += 1
 *     return days
 */
  __pyx_t_1 = (__pyx_v_month == 2);
  if (__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __pyx_f_7cytimes_5utils_is_leap_year(__pyx_v_year); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 904, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "utils.pxd":905
 *     cdef int days = DAYS_IN_MONTH[month]
 *     if month == 2 and is_leap_year(year):
 *         days += 1             # <<<<<<<<<<<<<<
 *     return days
 * 
 */
    __pyx_v_days = (__pyx_v_days + 1);

    /* "utils.pxd":904
 *     # Rest
 *     cdef int days = DAYS_IN_MONTH[month]
 *     if month == 2 and is_leap_year(year):             # <<<<<<<<<<<<<<
 *         days += 1
 *     return days
 */
  }

  /* "utils.pxd":906
 *     if month == 2 and is_leap_year(year):
 *         days += 1
 *     return days             # <<<<<<<<<<<<<<
 * 
 * cdef inline int days_bf_month(int year, int month) except -1:
 */
  __pyx_r = __pyx_v_days;
  goto __pyx_L0;

  /* "utils.pxd":897
 * 
 * # . month
 * cdef inline int days_in_month(int year, int month) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the maximum days in the month `<'int'>`."""
 *     # January & December
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.days_in_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":908
 *     return days
 * 
 * cdef inline int days_bf_month(int year, int month) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of days between the 1st day of the
 *     'year' and the 1st day of the 'month' `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_days_bf_month(int __pyx_v_year, int __pyx_v_month) {
  int __pyx_v_days;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":913
 *     """
 *     # January
 *     if month <= 1:             # <<<<<<<<<<<<<<
 *         return 0
 *     # February
 */
  __pyx_t_1 = (__pyx_v_month <= 1);
  if (__pyx_t_1) {

    /* "utils.pxd":914
 *     # January
 *     if month <= 1:
 *         return 0             # <<<<<<<<<<<<<<
 *     # February
 *     if month == 2:
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "utils.pxd":913
 *     """
 *     # January
 *     if month <= 1:             # <<<<<<<<<<<<<<
 *         return 0
 *     # February
 */
  }

  /* "utils.pxd":916
 *         return 0
 *     # February
 *     if month == 2:             # <<<<<<<<<<<<<<
 *         return 31
 *     # Rest
 */
  __pyx_t_1 = (__pyx_v_month == 2);
  if (__pyx_t_1) {

    /* "utils.pxd":917
 *     # February
 *     if month == 2:
 *         return 31             # <<<<<<<<<<<<<<
 *     # Rest
 *     cdef int days = DAYS_BR_MONTH[month - 1] if month < 12 else 334
 */
    __pyx_r = 31;
    goto __pyx_L0;

    /* "utils.pxd":916
 *         return 0
 *     # February
 *     if month == 2:             # <<<<<<<<<<<<<<
 *         return 31
 *     # Rest
 */
  }

  /* "utils.pxd":919
 *         return 31
 *     # Rest
 *     cdef int days = DAYS_BR_MONTH[month - 1] if month < 12 else 334             # <<<<<<<<<<<<<<
 *     if is_leap_year(year):
 *         days += 1
 */
  __pyx_t_1 = (__pyx_v_month < 12);
  if (__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_7cytimes_5utils_DAYS_BR_MONTH[(__pyx_v_month - 1)]);
  } else {
    __pyx_t_2 = 0x14E;
  }
  __pyx_v_days = __pyx_t_2;

  /* "utils.pxd":920
 *     # Rest
 *     cdef int days = DAYS_BR_MONTH[month - 1] if month < 12 else 334
 *     if is_leap_year(year):             # <<<<<<<<<<<<<<
 *         days += 1
 *     return days
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_is_leap_year(__pyx_v_year); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 920, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "utils.pxd":921
 *     cdef int days = DAYS_BR_MONTH[month - 1] if month < 12 else 334
 *     if is_leap_year(year):
 *         days += 1             # <<<<<<<<<<<<<<
 *     return days
 * 
 */
    __pyx_v_days = (__pyx_v_days + 1);

    /* "utils.pxd":920
 *     # Rest
 *     cdef int days = DAYS_BR_MONTH[month - 1] if month < 12 else 334
 *     if is_leap_year(year):             # <<<<<<<<<<<<<<
 *         days += 1
 *     return days
 */
  }

  /* "utils.pxd":922
 *     if is_leap_year(year):
 *         days += 1
 *     return days             # <<<<<<<<<<<<<<
 * 
 * # . week
 */
  __pyx_r = __pyx_v_days;
  goto __pyx_L0;

  /* "utils.pxd":908
 *     return days
 * 
 * cdef inline int days_bf_month(int year, int month) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the number of days between the 1st day of the
 *     'year' and the 1st day of the 'month' `<'int'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.days_bf_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":925
 * 
 * # . week
 * cdef inline int ymd_weekday(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the weekday (0=Mon...6=Sun) `<'int'>`."""
 *     return (ymd_to_ordinal(year, month, day) + 6) % 7
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_ymd_weekday(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":927
 * cdef inline int ymd_weekday(int year, int month, int day) except -1:
 *     """Compute the weekday (0=Mon...6=Sun) `<'int'>`."""
 *     return (ymd_to_ordinal(year, month, day) + 6) % 7             # <<<<<<<<<<<<<<
 * 
 * # . iso
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_ymd_to_ordinal(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 927, __pyx_L1_error)
  __pyx_r = __Pyx_mod_long((__pyx_t_1 + 6), 7);
  goto __pyx_L0;

  /* "utils.pxd":925
 * 
 * # . week
 * cdef inline int ymd_weekday(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the weekday (0=Mon...6=Sun) `<'int'>`."""
 *     return (ymd_to_ordinal(year, month, day) + 6) % 7
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.ymd_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":930
 * 
 * # . iso
 * cdef inline iso ymd_isocalendar(int year, int month, int day) except *:             # <<<<<<<<<<<<<<
 *     """Compute the ISO calendar `<'struct:iso'>`."""
 *     year = min(max(year, 1), 9_999)
 */

static CYTHON_INLINE __pyx_t_7cytimes_5utils_iso __pyx_f_7cytimes_5utils_ymd_isocalendar(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day) {
  int __pyx_v_ordinal;
  int __pyx_v_mon_1st;
  int __pyx_v_days;
  int __pyx_v_weeks;
  __pyx_t_7cytimes_5utils_iso __pyx_r;
  long __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_t_7cytimes_5utils_iso __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":932
 * cdef inline iso ymd_isocalendar(int year, int month, int day) except *:
 *     """Compute the ISO calendar `<'struct:iso'>`."""
 *     year = min(max(year, 1), 9_999)             # <<<<<<<<<<<<<<
 *     cdef:
 *         int ordinal = ymd_to_ordinal(year, month, day)
 */
  __pyx_t_1 = 0x270F;
  __pyx_t_2 = 1;
  __pyx_t_3 = __pyx_v_year;
  __pyx_t_5 = (__pyx_t_2 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = (__pyx_t_1 < __pyx_t_2);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_year = __pyx_t_4;

  /* "utils.pxd":934
 *     year = min(max(year, 1), 9_999)
 *     cdef:
 *         int ordinal = ymd_to_ordinal(year, month, day)             # <<<<<<<<<<<<<<
 *         int mon_1st = _iso_1st_monday(year)
 *         int days = ordinal - mon_1st
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_ymd_to_ordinal(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 934, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_3;

  /* "utils.pxd":935
 *     cdef:
 *         int ordinal = ymd_to_ordinal(year, month, day)
 *         int mon_1st = _iso_1st_monday(year)             # <<<<<<<<<<<<<<
 *         int days = ordinal - mon_1st
 *         int weeks = days // 7
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils__iso_1st_monday(__pyx_v_year); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 935, __pyx_L1_error)
  __pyx_v_mon_1st = __pyx_t_3;

  /* "utils.pxd":936
 *         int ordinal = ymd_to_ordinal(year, month, day)
 *         int mon_1st = _iso_1st_monday(year)
 *         int days = ordinal - mon_1st             # <<<<<<<<<<<<<<
 *         int weeks = days // 7
 * 
 */
  __pyx_v_days = (__pyx_v_ordinal - __pyx_v_mon_1st);

  /* "utils.pxd":937
 *         int mon_1st = _iso_1st_monday(year)
 *         int days = ordinal - mon_1st
 *         int weeks = days // 7             # <<<<<<<<<<<<<<
 * 
 *     if weeks < 0:
 */
  __pyx_v_weeks = __Pyx_div_long(__pyx_v_days, 7);

  /* "utils.pxd":939
 *         int weeks = days // 7
 * 
 *     if weeks < 0:             # <<<<<<<<<<<<<<
 *         year -= 1
 *         weeks = (ordinal - _iso_1st_monday(year)) // 7 + 1
 */
  __pyx_t_5 = (__pyx_v_weeks < 0);
  if (__pyx_t_5) {

    /* "utils.pxd":940
 * 
 *     if weeks < 0:
 *         year -= 1             # <<<<<<<<<<<<<<
 *         weeks = (ordinal - _iso_1st_monday(year)) // 7 + 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 */
    __pyx_v_year = (__pyx_v_year - 1);

    /* "utils.pxd":941
 *     if weeks < 0:
 *         year -= 1
 *         weeks = (ordinal - _iso_1st_monday(year)) // 7 + 1             # <<<<<<<<<<<<<<
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 *         year += 1
 */
    __pyx_t_3 = __pyx_f_7cytimes_5utils__iso_1st_monday(__pyx_v_year); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 941, __pyx_L1_error)
    __pyx_v_weeks = (__Pyx_div_long((__pyx_v_ordinal - __pyx_t_3), 7) + 1);

    /* "utils.pxd":939
 *         int weeks = days // 7
 * 
 *     if weeks < 0:             # <<<<<<<<<<<<<<
 *         year -= 1
 *         weeks = (ordinal - _iso_1st_monday(year)) // 7 + 1
 */
    goto __pyx_L3;
  }

  /* "utils.pxd":942
 *         year -= 1
 *         weeks = (ordinal - _iso_1st_monday(year)) // 7 + 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):             # <<<<<<<<<<<<<<
 *         year += 1
 *         weeks = 1
 */
  __pyx_t_6 = (__pyx_v_weeks >= 52);
  if (__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __pyx_f_7cytimes_5utils__iso_1st_monday((__pyx_v_year + 1)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 942, __pyx_L1_error)
  __pyx_t_6 = (__pyx_v_ordinal >= __pyx_t_3);
  __pyx_t_5 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_5) {

    /* "utils.pxd":943
 *         weeks = (ordinal - _iso_1st_monday(year)) // 7 + 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 *         year += 1             # <<<<<<<<<<<<<<
 *         weeks = 1
 *     else:
 */
    __pyx_v_year = (__pyx_v_year + 1);

    /* "utils.pxd":944
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 *         year += 1
 *         weeks = 1             # <<<<<<<<<<<<<<
 *     else:
 *         weeks += 1
 */
    __pyx_v_weeks = 1;

    /* "utils.pxd":942
 *         year -= 1
 *         weeks = (ordinal - _iso_1st_monday(year)) // 7 + 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):             # <<<<<<<<<<<<<<
 *         year += 1
 *         weeks = 1
 */
    goto __pyx_L3;
  }

  /* "utils.pxd":946
 *         weeks = 1
 *     else:
 *         weeks += 1             # <<<<<<<<<<<<<<
 *     return iso(year, weeks, days % 7 + 1)
 * 
 */
  /*else*/ {
    __pyx_v_weeks = (__pyx_v_weeks + 1);
  }
  __pyx_L3:;

  /* "utils.pxd":947
 *     else:
 *         weeks += 1
 *     return iso(year, weeks, days % 7 + 1)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int ymd_isoyear(int year, int month, int day) except -1:
 */
  __pyx_t_7.year = __pyx_v_year;
  __pyx_t_7.week = __pyx_v_weeks;
  __pyx_t_7.weekday = (__Pyx_mod_long(__pyx_v_days, 7) + 1);
  __pyx_r = __pyx_t_7;
  goto __pyx_L0;

  /* "utils.pxd":930
 * 
 * # . iso
 * cdef inline iso ymd_isocalendar(int year, int month, int day) except *:             # <<<<<<<<<<<<<<
 *     """Compute the ISO calendar `<'struct:iso'>`."""
 *     year = min(max(year, 1), 9_999)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.ymd_isocalendar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":949
 *     return iso(year, weeks, days % 7 + 1)
 * 
 * cdef inline int ymd_isoyear(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the ISO calendar year (0-10000) `<'int'>`."""
 *     year = min(max(year, 1), 9_999)
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_ymd_isoyear(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day) {
  int __pyx_v_ordinal;
  int __pyx_v_mon_1st;
  int __pyx_v_days;
  int __pyx_v_weeks;
  int __pyx_r;
  long __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":951
 * cdef inline int ymd_isoyear(int year, int month, int day) except -1:
 *     """Compute the ISO calendar year (0-10000) `<'int'>`."""
 *     year = min(max(year, 1), 9_999)             # <<<<<<<<<<<<<<
 *     cdef:
 *         int ordinal = ymd_to_ordinal(year, month, day)
 */
  __pyx_t_1 = 0x270F;
  __pyx_t_2 = 1;
  __pyx_t_3 = __pyx_v_year;
  __pyx_t_5 = (__pyx_t_2 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = (__pyx_t_1 < __pyx_t_2);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_year = __pyx_t_4;

  /* "utils.pxd":953
 *     year = min(max(year, 1), 9_999)
 *     cdef:
 *         int ordinal = ymd_to_ordinal(year, month, day)             # <<<<<<<<<<<<<<
 *         int mon_1st = _iso_1st_monday(year)
 *         int days = ordinal - mon_1st
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_ymd_to_ordinal(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 953, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_3;

  /* "utils.pxd":954
 *     cdef:
 *         int ordinal = ymd_to_ordinal(year, month, day)
 *         int mon_1st = _iso_1st_monday(year)             # <<<<<<<<<<<<<<
 *         int days = ordinal - mon_1st
 *         int weeks = days // 7
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils__iso_1st_monday(__pyx_v_year); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 954, __pyx_L1_error)
  __pyx_v_mon_1st = __pyx_t_3;

  /* "utils.pxd":955
 *         int ordinal = ymd_to_ordinal(year, month, day)
 *         int mon_1st = _iso_1st_monday(year)
 *         int days = ordinal - mon_1st             # <<<<<<<<<<<<<<
 *         int weeks = days // 7
 * 
 */
  __pyx_v_days = (__pyx_v_ordinal - __pyx_v_mon_1st);

  /* "utils.pxd":956
 *         int mon_1st = _iso_1st_monday(year)
 *         int days = ordinal - mon_1st
 *         int weeks = days // 7             # <<<<<<<<<<<<<<
 * 
 *     if weeks < 0:
 */
  __pyx_v_weeks = __Pyx_div_long(__pyx_v_days, 7);

  /* "utils.pxd":958
 *         int weeks = days // 7
 * 
 *     if weeks < 0:             # <<<<<<<<<<<<<<
 *         return year - 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 */
  __pyx_t_5 = (__pyx_v_weeks < 0);
  if (__pyx_t_5) {

    /* "utils.pxd":959
 * 
 *     if weeks < 0:
 *         return year - 1             # <<<<<<<<<<<<<<
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 *         return year + 1
 */
    __pyx_r = (__pyx_v_year - 1);
    goto __pyx_L0;

    /* "utils.pxd":958
 *         int weeks = days // 7
 * 
 *     if weeks < 0:             # <<<<<<<<<<<<<<
 *         return year - 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 */
  }

  /* "utils.pxd":960
 *     if weeks < 0:
 *         return year - 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):             # <<<<<<<<<<<<<<
 *         return year + 1
 *     else:
 */
  __pyx_t_6 = (__pyx_v_weeks >= 52);
  if (__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __pyx_f_7cytimes_5utils__iso_1st_monday((__pyx_v_year + 1)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 960, __pyx_L1_error)
  __pyx_t_6 = (__pyx_v_ordinal >= __pyx_t_3);
  __pyx_t_5 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_5) {

    /* "utils.pxd":961
 *         return year - 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 *         return year + 1             # <<<<<<<<<<<<<<
 *     else:
 *         return year
 */
    __pyx_r = (__pyx_v_year + 1);
    goto __pyx_L0;

    /* "utils.pxd":960
 *     if weeks < 0:
 *         return year - 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):             # <<<<<<<<<<<<<<
 *         return year + 1
 *     else:
 */
  }

  /* "utils.pxd":963
 *         return year + 1
 *     else:
 *         return year             # <<<<<<<<<<<<<<
 * 
 * cdef inline int ymd_isoweek(int year, int month, int day) except -1:
 */
  /*else*/ {
    __pyx_r = __pyx_v_year;
    goto __pyx_L0;
  }

  /* "utils.pxd":949
 *     return iso(year, weeks, days % 7 + 1)
 * 
 * cdef inline int ymd_isoyear(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the ISO calendar year (0-10000) `<'int'>`."""
 *     year = min(max(year, 1), 9_999)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.ymd_isoyear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":965
 *         return year
 * 
 * cdef inline int ymd_isoweek(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the ISO calendar week number (1-53) `<'int'>`."""
 *     year = min(max(year, 1), 9_999)
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_ymd_isoweek(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day) {
  int __pyx_v_ordinal;
  int __pyx_v_mon_1st;
  int __pyx_v_days;
  int __pyx_v_weeks;
  int __pyx_r;
  long __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":967
 * cdef inline int ymd_isoweek(int year, int month, int day) except -1:
 *     """Compute the ISO calendar week number (1-53) `<'int'>`."""
 *     year = min(max(year, 1), 9_999)             # <<<<<<<<<<<<<<
 *     cdef:
 *         int ordinal = ymd_to_ordinal(year, month, day)
 */
  __pyx_t_1 = 0x270F;
  __pyx_t_2 = 1;
  __pyx_t_3 = __pyx_v_year;
  __pyx_t_5 = (__pyx_t_2 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = (__pyx_t_1 < __pyx_t_2);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_year = __pyx_t_4;

  /* "utils.pxd":969
 *     year = min(max(year, 1), 9_999)
 *     cdef:
 *         int ordinal = ymd_to_ordinal(year, month, day)             # <<<<<<<<<<<<<<
 *         int mon_1st = _iso_1st_monday(year)
 *         int days = ordinal - mon_1st
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_ymd_to_ordinal(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 969, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_3;

  /* "utils.pxd":970
 *     cdef:
 *         int ordinal = ymd_to_ordinal(year, month, day)
 *         int mon_1st = _iso_1st_monday(year)             # <<<<<<<<<<<<<<
 *         int days = ordinal - mon_1st
 *         int weeks = days // 7
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils__iso_1st_monday(__pyx_v_year); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 970, __pyx_L1_error)
  __pyx_v_mon_1st = __pyx_t_3;

  /* "utils.pxd":971
 *         int ordinal = ymd_to_ordinal(year, month, day)
 *         int mon_1st = _iso_1st_monday(year)
 *         int days = ordinal - mon_1st             # <<<<<<<<<<<<<<
 *         int weeks = days // 7
 * 
 */
  __pyx_v_days = (__pyx_v_ordinal - __pyx_v_mon_1st);

  /* "utils.pxd":972
 *         int mon_1st = _iso_1st_monday(year)
 *         int days = ordinal - mon_1st
 *         int weeks = days // 7             # <<<<<<<<<<<<<<
 * 
 *     if weeks < 0:
 */
  __pyx_v_weeks = __Pyx_div_long(__pyx_v_days, 7);

  /* "utils.pxd":974
 *         int weeks = days // 7
 * 
 *     if weeks < 0:             # <<<<<<<<<<<<<<
 *         return (ordinal - _iso_1st_monday(year - 1)) // 7 + 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 */
  __pyx_t_5 = (__pyx_v_weeks < 0);
  if (__pyx_t_5) {

    /* "utils.pxd":975
 * 
 *     if weeks < 0:
 *         return (ordinal - _iso_1st_monday(year - 1)) // 7 + 1             # <<<<<<<<<<<<<<
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 *         return 1
 */
    __pyx_t_3 = __pyx_f_7cytimes_5utils__iso_1st_monday((__pyx_v_year - 1)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 975, __pyx_L1_error)
    __pyx_r = (__Pyx_div_long((__pyx_v_ordinal - __pyx_t_3), 7) + 1);
    goto __pyx_L0;

    /* "utils.pxd":974
 *         int weeks = days // 7
 * 
 *     if weeks < 0:             # <<<<<<<<<<<<<<
 *         return (ordinal - _iso_1st_monday(year - 1)) // 7 + 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 */
  }

  /* "utils.pxd":976
 *     if weeks < 0:
 *         return (ordinal - _iso_1st_monday(year - 1)) // 7 + 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):             # <<<<<<<<<<<<<<
 *         return 1
 *     else:
 */
  __pyx_t_6 = (__pyx_v_weeks >= 52);
  if (__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __pyx_f_7cytimes_5utils__iso_1st_monday((__pyx_v_year + 1)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 976, __pyx_L1_error)
  __pyx_t_6 = (__pyx_v_ordinal >= __pyx_t_3);
  __pyx_t_5 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_5) {

    /* "utils.pxd":977
 *         return (ordinal - _iso_1st_monday(year - 1)) // 7 + 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):
 *         return 1             # <<<<<<<<<<<<<<
 *     else:
 *         return weeks + 1
 */
    __pyx_r = 1;
    goto __pyx_L0;

    /* "utils.pxd":976
 *     if weeks < 0:
 *         return (ordinal - _iso_1st_monday(year - 1)) // 7 + 1
 *     elif weeks >= 52 and ordinal >= _iso_1st_monday(year + 1):             # <<<<<<<<<<<<<<
 *         return 1
 *     else:
 */
  }

  /* "utils.pxd":979
 *         return 1
 *     else:
 *         return weeks + 1             # <<<<<<<<<<<<<<
 * 
 * cdef inline int ymd_isoweekday(int year, int month, int day) except -1:
 */
  /*else*/ {
    __pyx_r = (__pyx_v_weeks + 1);
    goto __pyx_L0;
  }

  /* "utils.pxd":965
 *         return year
 * 
 * cdef inline int ymd_isoweek(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the ISO calendar week number (1-53) `<'int'>`."""
 *     year = min(max(year, 1), 9_999)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.ymd_isoweek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":981
 *         return weeks + 1
 * 
 * cdef inline int ymd_isoweekday(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the ISO weekday (1=Mon...7=Sun) `<'int'>`."""
 *     return ymd_weekday(year, month, day) + 1
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_ymd_isoweekday(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":983
 * cdef inline int ymd_isoweekday(int year, int month, int day) except -1:
 *     """Compute the ISO weekday (1=Mon...7=Sun) `<'int'>`."""
 *     return ymd_weekday(year, month, day) + 1             # <<<<<<<<<<<<<<
 * 
 * # . Y/M/D
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_ymd_weekday(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 983, __pyx_L1_error)
  __pyx_r = (__pyx_t_1 + 1);
  goto __pyx_L0;

  /* "utils.pxd":981
 *         return weeks + 1
 * 
 * cdef inline int ymd_isoweekday(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Compute the ISO weekday (1=Mon...7=Sun) `<'int'>`."""
 *     return ymd_weekday(year, month, day) + 1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.ymd_isoweekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":986
 * 
 * # . Y/M/D
 * cdef inline int ymd_to_ordinal(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Convert 'Y/M/D' to Gregorian ordinal days `<'int'>`."""
 *     if day > 28:
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_ymd_to_ordinal(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":988
 * cdef inline int ymd_to_ordinal(int year, int month, int day) except -1:
 *     """Convert 'Y/M/D' to Gregorian ordinal days `<'int'>`."""
 *     if day > 28:             # <<<<<<<<<<<<<<
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 */
  __pyx_t_1 = (__pyx_v_day > 28);
  if (__pyx_t_1) {

    /* "utils.pxd":989
 *     """Convert 'Y/M/D' to Gregorian ordinal days `<'int'>`."""
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))             # <<<<<<<<<<<<<<
 *     elif day < 1:
 *         day = 1
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_days_in_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 989, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_day;
    __pyx_t_1 = (__pyx_t_2 < __pyx_t_3);
    if (__pyx_t_1) {
      __pyx_t_4 = __pyx_t_2;
    } else {
      __pyx_t_4 = __pyx_t_3;
    }
    __pyx_v_day = __pyx_t_4;

    /* "utils.pxd":988
 * cdef inline int ymd_to_ordinal(int year, int month, int day) except -1:
 *     """Convert 'Y/M/D' to Gregorian ordinal days `<'int'>`."""
 *     if day > 28:             # <<<<<<<<<<<<<<
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 */
    goto __pyx_L3;
  }

  /* "utils.pxd":990
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:             # <<<<<<<<<<<<<<
 *         day = 1
 *     return days_bf_year(year) + days_bf_month(year, month) + day
 */
  __pyx_t_1 = (__pyx_v_day < 1);
  if (__pyx_t_1) {

    /* "utils.pxd":991
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 *         day = 1             # <<<<<<<<<<<<<<
 *     return days_bf_year(year) + days_bf_month(year, month) + day
 * 
 */
    __pyx_v_day = 1;

    /* "utils.pxd":990
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:             # <<<<<<<<<<<<<<
 *         day = 1
 *     return days_bf_year(year) + days_bf_month(year, month) + day
 */
  }
  __pyx_L3:;

  /* "utils.pxd":992
 *     elif day < 1:
 *         day = 1
 *     return days_bf_year(year) + days_bf_month(year, month) + day             # <<<<<<<<<<<<<<
 * 
 * cdef inline ymd ymd_fr_ordinal(int val) except *:
 */
  __pyx_t_4 = __pyx_f_7cytimes_5utils_days_bf_year(__pyx_v_year); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 992, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 992, __pyx_L1_error)
  __pyx_r = ((__pyx_t_4 + __pyx_t_2) + __pyx_v_day);
  goto __pyx_L0;

  /* "utils.pxd":986
 * 
 * # . Y/M/D
 * cdef inline int ymd_to_ordinal(int year, int month, int day) except -1:             # <<<<<<<<<<<<<<
 *     """Convert 'Y/M/D' to Gregorian ordinal days `<'int'>`."""
 *     if day > 28:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.ymd_to_ordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":994
 *     return days_bf_year(year) + days_bf_month(year, month) + day
 * 
 * cdef inline ymd ymd_fr_ordinal(int val) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:ymd' from Gregorian ordinal days `<'struct:ymd'>`."""
 *     # n is a 1-based index, starting at 1-Jan-1.  The pattern of leap years
 */

static CYTHON_INLINE __pyx_t_7cytimes_5utils_ymd __pyx_f_7cytimes_5utils_ymd_fr_ordinal(int __pyx_v_val) {
  int __pyx_v_n;
  int __pyx_v_n400;
  int __pyx_v_n100;
  int __pyx_v_n4;
  int __pyx_v_n1;
  int __pyx_v_yy;
  int __pyx_v_mm;
  int __pyx_v_days_bf;
  __pyx_t_7cytimes_5utils_ymd __pyx_r;
  int __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":1006
 *         int yy, mm, days_bf
 * 
 *     n = min(max(val, 1), ORDINAL_MAX) - 1             # <<<<<<<<<<<<<<
 *     n400 = n // 146_097
 *     n -= n400 * 146_097
 */
  __pyx_t_1 = __pyx_v_7cytimes_5utils_ORDINAL_MAX;
  __pyx_t_2 = 1;
  __pyx_t_3 = __pyx_v_val;
  __pyx_t_5 = (__pyx_t_2 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = (__pyx_t_1 < __pyx_t_2);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_n = (__pyx_t_4 - 1);

  /* "utils.pxd":1007
 * 
 *     n = min(max(val, 1), ORDINAL_MAX) - 1
 *     n400 = n // 146_097             # <<<<<<<<<<<<<<
 *     n -= n400 * 146_097
 * 
 */
  __pyx_v_n400 = __Pyx_div_long(__pyx_v_n, 0x23AB1);

  /* "utils.pxd":1008
 *     n = min(max(val, 1), ORDINAL_MAX) - 1
 *     n400 = n // 146_097
 *     n -= n400 * 146_097             # <<<<<<<<<<<<<<
 * 
 *     # Now n is the (non-negative) offset, in days, from January 1 of year, to
 */
  __pyx_v_n = (__pyx_v_n - (__pyx_v_n400 * 0x23AB1));

  /* "utils.pxd":1015
 *     # 100-year cycles precede the desired day, which implies the desired
 *     # day is December 31 at the end of a 400-year cycle.
 *     n100 = n // 36_524             # <<<<<<<<<<<<<<
 *     n -= n100 * 36_524
 * 
 */
  __pyx_v_n100 = __Pyx_div_long(__pyx_v_n, 0x8EAC);

  /* "utils.pxd":1016
 *     # day is December 31 at the end of a 400-year cycle.
 *     n100 = n // 36_524
 *     n -= n100 * 36_524             # <<<<<<<<<<<<<<
 * 
 *     # Now compute how many 4-year cycles precede it.
 */
  __pyx_v_n = (__pyx_v_n - (__pyx_v_n100 * 0x8EAC));

  /* "utils.pxd":1019
 * 
 *     # Now compute how many 4-year cycles precede it.
 *     n4 = n // 1_461             # <<<<<<<<<<<<<<
 *     n -= n4 * 1_461
 * 
 */
  __pyx_v_n4 = __Pyx_div_long(__pyx_v_n, 0x5B5);

  /* "utils.pxd":1020
 *     # Now compute how many 4-year cycles precede it.
 *     n4 = n // 1_461
 *     n -= n4 * 1_461             # <<<<<<<<<<<<<<
 * 
 *     # And now how many single years.  Again n1 can be 4, and again meaning
 */
  __pyx_v_n = (__pyx_v_n - (__pyx_v_n4 * 0x5B5));

  /* "utils.pxd":1024
 *     # And now how many single years.  Again n1 can be 4, and again meaning
 *     # that the desired day is December 31 at the end of the 4-year cycle.
 *     n1 = n // 365             # <<<<<<<<<<<<<<
 *     n -= n1 * 365
 * 
 */
  __pyx_v_n1 = __Pyx_div_long(__pyx_v_n, 0x16D);

  /* "utils.pxd":1025
 *     # that the desired day is December 31 at the end of the 4-year cycle.
 *     n1 = n // 365
 *     n -= n1 * 365             # <<<<<<<<<<<<<<
 * 
 *     # We now know the year and the offset from January 1st.  Leap years are
 */
  __pyx_v_n = (__pyx_v_n - (__pyx_v_n1 * 0x16D));

  /* "utils.pxd":1033
 *     # whether year is divisible by 4.  If not, then we're done -- the answer
 *     # is December 31 at the end of the year.
 *     yy = n400 * 400 + n100 * 100 + n4 * 4 + n1             # <<<<<<<<<<<<<<
 *     if n1 == 4 or n100 == 4:
 *         return ymd(yy, 12, 31)  # exit: Last day of the year
 */
  __pyx_v_yy = ((((__pyx_v_n400 * 0x190) + (__pyx_v_n100 * 0x64)) + (__pyx_v_n4 * 4)) + __pyx_v_n1);

  /* "utils.pxd":1034
 *     # is December 31 at the end of the year.
 *     yy = n400 * 400 + n100 * 100 + n4 * 4 + n1
 *     if n1 == 4 or n100 == 4:             # <<<<<<<<<<<<<<
 *         return ymd(yy, 12, 31)  # exit: Last day of the year
 *     yy += 1
 */
  __pyx_t_6 = (__pyx_v_n1 == 4);
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = (__pyx_v_n100 == 4);
  __pyx_t_5 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_5) {

    /* "utils.pxd":1035
 *     yy = n400 * 400 + n100 * 100 + n4 * 4 + n1
 *     if n1 == 4 or n100 == 4:
 *         return ymd(yy, 12, 31)  # exit: Last day of the year             # <<<<<<<<<<<<<<
 *     yy += 1
 * 
 */
    __pyx_t_7.year = __pyx_v_yy;
    __pyx_t_7.month = 12;
    __pyx_t_7.day = 31;
    __pyx_r = __pyx_t_7;
    goto __pyx_L0;

    /* "utils.pxd":1034
 *     # is December 31 at the end of the year.
 *     yy = n400 * 400 + n100 * 100 + n4 * 4 + n1
 *     if n1 == 4 or n100 == 4:             # <<<<<<<<<<<<<<
 *         return ymd(yy, 12, 31)  # exit: Last day of the year
 *     yy += 1
 */
  }

  /* "utils.pxd":1036
 *     if n1 == 4 or n100 == 4:
 *         return ymd(yy, 12, 31)  # exit: Last day of the year
 *     yy += 1             # <<<<<<<<<<<<<<
 * 
 *     # Now the year is correct, and n is the offset from January 1.  We find
 */
  __pyx_v_yy = (__pyx_v_yy + 1);

  /* "utils.pxd":1040
 *     # Now the year is correct, and n is the offset from January 1.  We find
 *     # the month via an estimate that's either exact or one too large.
 *     mm = (n + 50) >> 5             # <<<<<<<<<<<<<<
 *     days_bf = days_bf_month(yy, mm)
 *     if days_bf > n:
 */
  __pyx_v_mm = ((__pyx_v_n + 50) >> 5);

  /* "utils.pxd":1041
 *     # the month via an estimate that's either exact or one too large.
 *     mm = (n + 50) >> 5
 *     days_bf = days_bf_month(yy, mm)             # <<<<<<<<<<<<<<
 *     if days_bf > n:
 *         mm -= 1
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_yy, __pyx_v_mm); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 1041, __pyx_L1_error)
  __pyx_v_days_bf = __pyx_t_1;

  /* "utils.pxd":1042
 *     mm = (n + 50) >> 5
 *     days_bf = days_bf_month(yy, mm)
 *     if days_bf > n:             # <<<<<<<<<<<<<<
 *         mm -= 1
 *         days_bf = days_bf_month(yy, mm)
 */
  __pyx_t_5 = (__pyx_v_days_bf > __pyx_v_n);
  if (__pyx_t_5) {

    /* "utils.pxd":1043
 *     days_bf = days_bf_month(yy, mm)
 *     if days_bf > n:
 *         mm -= 1             # <<<<<<<<<<<<<<
 *         days_bf = days_bf_month(yy, mm)
 *     return ymd(yy, mm, n - days_bf + 1)
 */
    __pyx_v_mm = (__pyx_v_mm - 1);

    /* "utils.pxd":1044
 *     if days_bf > n:
 *         mm -= 1
 *         days_bf = days_bf_month(yy, mm)             # <<<<<<<<<<<<<<
 *     return ymd(yy, mm, n - days_bf + 1)
 * 
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_yy, __pyx_v_mm); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 1044, __pyx_L1_error)
    __pyx_v_days_bf = __pyx_t_1;

    /* "utils.pxd":1042
 *     mm = (n + 50) >> 5
 *     days_bf = days_bf_month(yy, mm)
 *     if days_bf > n:             # <<<<<<<<<<<<<<
 *         mm -= 1
 *         days_bf = days_bf_month(yy, mm)
 */
  }

  /* "utils.pxd":1045
 *         mm -= 1
 *         days_bf = days_bf_month(yy, mm)
 *     return ymd(yy, mm, n - days_bf + 1)             # <<<<<<<<<<<<<<
 * 
 * cdef inline ymd ymd_fr_isocalendar(int year, int week, int weekday) except *:
 */
  __pyx_t_7.year = __pyx_v_yy;
  __pyx_t_7.month = __pyx_v_mm;
  __pyx_t_7.day = ((__pyx_v_n - __pyx_v_days_bf) + 1);
  __pyx_r = __pyx_t_7;
  goto __pyx_L0;

  /* "utils.pxd":994
 *     return days_bf_year(year) + days_bf_month(year, month) + day
 * 
 * cdef inline ymd ymd_fr_ordinal(int val) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:ymd' from Gregorian ordinal days `<'struct:ymd'>`."""
 *     # n is a 1-based index, starting at 1-Jan-1.  The pattern of leap years
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.ymd_fr_ordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":1047
 *     return ymd(yy, mm, n - days_bf + 1)
 * 
 * cdef inline ymd ymd_fr_isocalendar(int year, int week, int weekday) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:ymd' from ISO calendar values `<'struct:ymd'>`."""
 *     # Clip year
 */

static CYTHON_INLINE __pyx_t_7cytimes_5utils_ymd __pyx_f_7cytimes_5utils_ymd_fr_isocalendar(int __pyx_v_year, int __pyx_v_week, int __pyx_v_weekday) {
  int __pyx_v_wkd_1st;
  int __pyx_v_mon_1st;
  int __pyx_v_offset;
  __pyx_t_7cytimes_5utils_ymd __pyx_r;
  long __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":1050
 *     """Create 'struct:ymd' from ISO calendar values `<'struct:ymd'>`."""
 *     # Clip year
 *     year = min(max(year, 1), 9_999)             # <<<<<<<<<<<<<<
 * 
 *     # 53th week adjustment
 */
  __pyx_t_1 = 0x270F;
  __pyx_t_2 = 1;
  __pyx_t_3 = __pyx_v_year;
  __pyx_t_5 = (__pyx_t_2 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = (__pyx_t_1 < __pyx_t_2);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_year = __pyx_t_4;

  /* "utils.pxd":1054
 *     # 53th week adjustment
 *     cdef int wkd_1st
 *     if week == 53:             # <<<<<<<<<<<<<<
 *         # ISO years have 53 weeks in them on years starting with a
 *         # Thursday or leap years starting on a Wednesday. So for
 */
  __pyx_t_5 = (__pyx_v_week == 53);
  if (__pyx_t_5) {

    /* "utils.pxd":1058
 *         # Thursday or leap years starting on a Wednesday. So for
 *         # invalid weeks, we shift to the 1st week of the next year.
 *         wkd_1st = ymd_to_ordinal(year, 1, 1) % 7             # <<<<<<<<<<<<<<
 *         if wkd_1st != 4 and not (wkd_1st == 3 and is_leap_year(year)):
 *             week = 1
 */
    __pyx_t_3 = __pyx_f_7cytimes_5utils_ymd_to_ordinal(__pyx_v_year, 1, 1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 1058, __pyx_L1_error)
    __pyx_v_wkd_1st = __Pyx_mod_long(__pyx_t_3, 7);

    /* "utils.pxd":1059
 *         # invalid weeks, we shift to the 1st week of the next year.
 *         wkd_1st = ymd_to_ordinal(year, 1, 1) % 7
 *         if wkd_1st != 4 and not (wkd_1st == 3 and is_leap_year(year)):             # <<<<<<<<<<<<<<
 *             week = 1
 *             year += 1
 */
    __pyx_t_6 = (__pyx_v_wkd_1st != 4);
    if (__pyx_t_6) {
    } else {
      __pyx_t_5 = __pyx_t_6;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_wkd_1st == 3);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_7 = __pyx_f_7cytimes_5utils_is_leap_year(__pyx_v_year); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 1059, __pyx_L1_error)
    __pyx_t_6 = __pyx_t_7;
    __pyx_L7_bool_binop_done:;
    __pyx_t_7 = (!__pyx_t_6);
    __pyx_t_5 = __pyx_t_7;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_5) {

      /* "utils.pxd":1060
 *         wkd_1st = ymd_to_ordinal(year, 1, 1) % 7
 *         if wkd_1st != 4 and not (wkd_1st == 3 and is_leap_year(year)):
 *             week = 1             # <<<<<<<<<<<<<<
 *             year += 1
 *     # Clip week
 */
      __pyx_v_week = 1;

      /* "utils.pxd":1061
 *         if wkd_1st != 4 and not (wkd_1st == 3 and is_leap_year(year)):
 *             week = 1
 *             year += 1             # <<<<<<<<<<<<<<
 *     # Clip week
 *     else:
 */
      __pyx_v_year = (__pyx_v_year + 1);

      /* "utils.pxd":1059
 *         # invalid weeks, we shift to the 1st week of the next year.
 *         wkd_1st = ymd_to_ordinal(year, 1, 1) % 7
 *         if wkd_1st != 4 and not (wkd_1st == 3 and is_leap_year(year)):             # <<<<<<<<<<<<<<
 *             week = 1
 *             year += 1
 */
    }

    /* "utils.pxd":1054
 *     # 53th week adjustment
 *     cdef int wkd_1st
 *     if week == 53:             # <<<<<<<<<<<<<<
 *         # ISO years have 53 weeks in them on years starting with a
 *         # Thursday or leap years starting on a Wednesday. So for
 */
    goto __pyx_L3;
  }

  /* "utils.pxd":1064
 *     # Clip week
 *     else:
 *         week = min(max(week, 1), 52)             # <<<<<<<<<<<<<<
 * 
 *     # Clip weekday
 */
  /*else*/ {
    __pyx_t_4 = 52;
    __pyx_t_1 = 1;
    __pyx_t_3 = __pyx_v_week;
    __pyx_t_5 = (__pyx_t_1 > __pyx_t_3);
    if (__pyx_t_5) {
      __pyx_t_2 = __pyx_t_1;
    } else {
      __pyx_t_2 = __pyx_t_3;
    }
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_5 = (__pyx_t_4 < __pyx_t_1);
    if (__pyx_t_5) {
      __pyx_t_2 = __pyx_t_4;
    } else {
      __pyx_t_2 = __pyx_t_1;
    }
    __pyx_v_week = __pyx_t_2;
  }
  __pyx_L3:;

  /* "utils.pxd":1067
 * 
 *     # Clip weekday
 *     weekday = min(max(weekday, 1), 7)             # <<<<<<<<<<<<<<
 * 
 *     # Compute ordinal
 */
  __pyx_t_2 = 7;
  __pyx_t_4 = 1;
  __pyx_t_3 = __pyx_v_weekday;
  __pyx_t_5 = (__pyx_t_4 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_1 = __pyx_t_4;
  } else {
    __pyx_t_1 = __pyx_t_3;
  }
  __pyx_t_4 = __pyx_t_1;
  __pyx_t_5 = (__pyx_t_2 < __pyx_t_4);
  if (__pyx_t_5) {
    __pyx_t_1 = __pyx_t_2;
  } else {
    __pyx_t_1 = __pyx_t_4;
  }
  __pyx_v_weekday = __pyx_t_1;

  /* "utils.pxd":1070
 * 
 *     # Compute ordinal
 *     cdef int mon_1st = _iso_1st_monday(year)             # <<<<<<<<<<<<<<
 *     cdef int offset = (week - 1) * 7 + weekday - 1
 *     return ymd_fr_ordinal(mon_1st + offset)
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils__iso_1st_monday(__pyx_v_year); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 1070, __pyx_L1_error)
  __pyx_v_mon_1st = __pyx_t_3;

  /* "utils.pxd":1071
 *     # Compute ordinal
 *     cdef int mon_1st = _iso_1st_monday(year)
 *     cdef int offset = (week - 1) * 7 + weekday - 1             # <<<<<<<<<<<<<<
 *     return ymd_fr_ordinal(mon_1st + offset)
 * 
 */
  __pyx_v_offset = ((((__pyx_v_week - 1) * 7) + __pyx_v_weekday) - 1);

  /* "utils.pxd":1072
 *     cdef int mon_1st = _iso_1st_monday(year)
 *     cdef int offset = (week - 1) * 7 + weekday - 1
 *     return ymd_fr_ordinal(mon_1st + offset)             # <<<<<<<<<<<<<<
 * 
 * cdef inline ymd ymd_fr_days_of_year(int year, int days) except *:
 */
  __pyx_t_8 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal((__pyx_v_mon_1st + __pyx_v_offset)); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1072, __pyx_L1_error)
  __pyx_r = __pyx_t_8;
  goto __pyx_L0;

  /* "utils.pxd":1047
 *     return ymd(yy, mm, n - days_bf + 1)
 * 
 * cdef inline ymd ymd_fr_isocalendar(int year, int week, int weekday) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:ymd' from ISO calendar values `<'struct:ymd'>`."""
 *     # Clip year
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.ymd_fr_isocalendar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":1074
 *     return ymd_fr_ordinal(mon_1st + offset)
 * 
 * cdef inline ymd ymd_fr_days_of_year(int year, int days) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:ymd' from the year and days of the year `<'struct:ymd'>`."""
 *     # Clip year
 */

static CYTHON_INLINE __pyx_t_7cytimes_5utils_ymd __pyx_f_7cytimes_5utils_ymd_fr_days_of_year(int __pyx_v_year, int __pyx_v_days) {
  int __pyx_v_leap;
  int __pyx_v_mm;
  int __pyx_v_dd;
  int __pyx_v_days_bf;
  __pyx_t_7cytimes_5utils_ymd __pyx_r;
  long __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":1077
 *     """Create 'struct:ymd' from the year and days of the year `<'struct:ymd'>`."""
 *     # Clip year
 *     year = min(max(year, 1), 9_999)             # <<<<<<<<<<<<<<
 * 
 *     # January
 */
  __pyx_t_1 = 0x270F;
  __pyx_t_2 = 1;
  __pyx_t_3 = __pyx_v_year;
  __pyx_t_5 = (__pyx_t_2 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = (__pyx_t_1 < __pyx_t_2);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_year = __pyx_t_4;

  /* "utils.pxd":1080
 * 
 *     # January
 *     if days <= 31:             # <<<<<<<<<<<<<<
 *         return ymd(year, 1, max(days, 1))
 * 
 */
  __pyx_t_5 = (__pyx_v_days <= 31);
  if (__pyx_t_5) {

    /* "utils.pxd":1081
 *     # January
 *     if days <= 31:
 *         return ymd(year, 1, max(days, 1))             # <<<<<<<<<<<<<<
 * 
 *     # February
 */
    __pyx_t_6.year = __pyx_v_year;
    __pyx_t_6.month = 1;
    __pyx_t_4 = 1;
    __pyx_t_3 = __pyx_v_days;
    __pyx_t_5 = (__pyx_t_4 > __pyx_t_3);
    if (__pyx_t_5) {
      __pyx_t_1 = __pyx_t_4;
    } else {
      __pyx_t_1 = __pyx_t_3;
    }
    __pyx_t_6.day = __pyx_t_1;
    __pyx_r = __pyx_t_6;
    goto __pyx_L0;

    /* "utils.pxd":1080
 * 
 *     # January
 *     if days <= 31:             # <<<<<<<<<<<<<<
 *         return ymd(year, 1, max(days, 1))
 * 
 */
  }

  /* "utils.pxd":1084
 * 
 *     # February
 *     cdef int leap = is_leap_year(year)             # <<<<<<<<<<<<<<
 *     if days <= 59 + leap:
 *         return ymd(year, 2, days - 31)
 */
  __pyx_t_5 = __pyx_f_7cytimes_5utils_is_leap_year(__pyx_v_year); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(5, 1084, __pyx_L1_error)
  __pyx_v_leap = __pyx_t_5;

  /* "utils.pxd":1085
 *     # February
 *     cdef int leap = is_leap_year(year)
 *     if days <= 59 + leap:             # <<<<<<<<<<<<<<
 *         return ymd(year, 2, days - 31)
 * 
 */
  __pyx_t_5 = (__pyx_v_days <= (59 + __pyx_v_leap));
  if (__pyx_t_5) {

    /* "utils.pxd":1086
 *     cdef int leap = is_leap_year(year)
 *     if days <= 59 + leap:
 *         return ymd(year, 2, days - 31)             # <<<<<<<<<<<<<<
 * 
 *     # Find month & day
 */
    __pyx_t_6.year = __pyx_v_year;
    __pyx_t_6.month = 2;
    __pyx_t_6.day = (__pyx_v_days - 31);
    __pyx_r = __pyx_t_6;
    goto __pyx_L0;

    /* "utils.pxd":1085
 *     # February
 *     cdef int leap = is_leap_year(year)
 *     if days <= 59 + leap:             # <<<<<<<<<<<<<<
 *         return ymd(year, 2, days - 31)
 * 
 */
  }

  /* "utils.pxd":1090
 *     # Find month & day
 *     cdef int mm, dd, days_bf
 *     days -= leap             # <<<<<<<<<<<<<<
 *     for mm in range(3, 13):
 *         days_bf = DAYS_BR_MONTH[mm]
 */
  __pyx_v_days = (__pyx_v_days - __pyx_v_leap);

  /* "utils.pxd":1091
 *     cdef int mm, dd, days_bf
 *     days -= leap
 *     for mm in range(3, 13):             # <<<<<<<<<<<<<<
 *         days_bf = DAYS_BR_MONTH[mm]
 *         if days <= days_bf:
 */
  for (__pyx_t_3 = 3; __pyx_t_3 < 13; __pyx_t_3+=1) {
    __pyx_v_mm = __pyx_t_3;

    /* "utils.pxd":1092
 *     days -= leap
 *     for mm in range(3, 13):
 *         days_bf = DAYS_BR_MONTH[mm]             # <<<<<<<<<<<<<<
 *         if days <= days_bf:
 *             dd = days - DAYS_BR_MONTH[mm - 1]
 */
    __pyx_v_days_bf = (__pyx_v_7cytimes_5utils_DAYS_BR_MONTH[__pyx_v_mm]);

    /* "utils.pxd":1093
 *     for mm in range(3, 13):
 *         days_bf = DAYS_BR_MONTH[mm]
 *         if days <= days_bf:             # <<<<<<<<<<<<<<
 *             dd = days - DAYS_BR_MONTH[mm - 1]
 *             return ymd(year, mm, dd)
 */
    __pyx_t_5 = (__pyx_v_days <= __pyx_v_days_bf);
    if (__pyx_t_5) {

      /* "utils.pxd":1094
 *         days_bf = DAYS_BR_MONTH[mm]
 *         if days <= days_bf:
 *             dd = days - DAYS_BR_MONTH[mm - 1]             # <<<<<<<<<<<<<<
 *             return ymd(year, mm, dd)
 *     return ymd(year, 12, 31)  # last day of the year
 */
      __pyx_v_dd = (__pyx_v_days - (__pyx_v_7cytimes_5utils_DAYS_BR_MONTH[(__pyx_v_mm - 1)]));

      /* "utils.pxd":1095
 *         if days <= days_bf:
 *             dd = days - DAYS_BR_MONTH[mm - 1]
 *             return ymd(year, mm, dd)             # <<<<<<<<<<<<<<
 *     return ymd(year, 12, 31)  # last day of the year
 * 
 */
      __pyx_t_6.year = __pyx_v_year;
      __pyx_t_6.month = __pyx_v_mm;
      __pyx_t_6.day = __pyx_v_dd;
      __pyx_r = __pyx_t_6;
      goto __pyx_L0;

      /* "utils.pxd":1093
 *     for mm in range(3, 13):
 *         days_bf = DAYS_BR_MONTH[mm]
 *         if days <= days_bf:             # <<<<<<<<<<<<<<
 *             dd = days - DAYS_BR_MONTH[mm - 1]
 *             return ymd(year, mm, dd)
 */
    }
  }

  /* "utils.pxd":1096
 *             dd = days - DAYS_BR_MONTH[mm - 1]
 *             return ymd(year, mm, dd)
 *     return ymd(year, 12, 31)  # last day of the year             # <<<<<<<<<<<<<<
 * 
 * cdef inline int _iso_1st_monday(int year) except -1:
 */
  __pyx_t_6.year = __pyx_v_year;
  __pyx_t_6.month = 12;
  __pyx_t_6.day = 31;
  __pyx_r = __pyx_t_6;
  goto __pyx_L0;

  /* "utils.pxd":1074
 *     return ymd_fr_ordinal(mon_1st + offset)
 * 
 * cdef inline ymd ymd_fr_days_of_year(int year, int days) except *:             # <<<<<<<<<<<<<<
 *     """Create 'struct:ymd' from the year and days of the year `<'struct:ymd'>`."""
 *     # Clip year
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.ymd_fr_days_of_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":1098
 *     return ymd(year, 12, 31)  # last day of the year
 * 
 * cdef inline int _iso_1st_monday(int year) except -1:             # <<<<<<<<<<<<<<
 *     """(internla) Compute the Gregorian ordinal days for the
 *     1st Monday of the passed in ISO 'year' `<'int'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils__iso_1st_monday(int __pyx_v_year) {
  int __pyx_v_day_1st;
  int __pyx_v_wkd_1st;
  int __pyx_v_mon_1st;
  int __pyx_r;
  int __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":1103
 *     """
 *     cdef:
 *         int day_1st = ymd_to_ordinal(year, 1, 1)  # 1st day of the year             # <<<<<<<<<<<<<<
 *         int wkd_1st = (day_1st + 6) % 7  # 1st weekday of the year
 *         int mon_1st = day_1st - wkd_1st  # 1st Monday of the year
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_ymd_to_ordinal(__pyx_v_year, 1, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 1103, __pyx_L1_error)
  __pyx_v_day_1st = __pyx_t_1;

  /* "utils.pxd":1104
 *     cdef:
 *         int day_1st = ymd_to_ordinal(year, 1, 1)  # 1st day of the year
 *         int wkd_1st = (day_1st + 6) % 7  # 1st weekday of the year             # <<<<<<<<<<<<<<
 *         int mon_1st = day_1st - wkd_1st  # 1st Monday of the year
 *     return mon_1st + 7 if wkd_1st > 3 else mon_1st
 */
  __pyx_v_wkd_1st = __Pyx_mod_long((__pyx_v_day_1st + 6), 7);

  /* "utils.pxd":1105
 *         int day_1st = ymd_to_ordinal(year, 1, 1)  # 1st day of the year
 *         int wkd_1st = (day_1st + 6) % 7  # 1st weekday of the year
 *         int mon_1st = day_1st - wkd_1st  # 1st Monday of the year             # <<<<<<<<<<<<<<
 *     return mon_1st + 7 if wkd_1st > 3 else mon_1st
 * 
 */
  __pyx_v_mon_1st = (__pyx_v_day_1st - __pyx_v_wkd_1st);

  /* "utils.pxd":1106
 *         int wkd_1st = (day_1st + 6) % 7  # 1st weekday of the year
 *         int mon_1st = day_1st - wkd_1st  # 1st Monday of the year
 *     return mon_1st + 7 if wkd_1st > 3 else mon_1st             # <<<<<<<<<<<<<<
 * 
 * # datetime.date ----------------------------------------------------------------------------------------
 */
  __pyx_t_3 = (__pyx_v_wkd_1st > 3);
  if (__pyx_t_3) {
    __pyx_t_2 = (__pyx_v_mon_1st + 7);
  } else {
    __pyx_t_2 = __pyx_v_mon_1st;
  }
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "utils.pxd":1098
 *     return ymd(year, 12, 31)  # last day of the year
 * 
 * cdef inline int _iso_1st_monday(int year) except -1:             # <<<<<<<<<<<<<<
 *     """(internla) Compute the Gregorian ordinal days for the
 *     1st Monday of the passed in ISO 'year' `<'int'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils._iso_1st_monday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":1110
 * # datetime.date ----------------------------------------------------------------------------------------
 * # . generate
 * cdef inline datetime.date date_new(int year=1, int month=1, int day=1):             # <<<<<<<<<<<<<<
 *     """Create a new `<'datetime.date'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_new(struct __pyx_opt_args_7cytimes_5utils_date_new *__pyx_optional_args) {
  int __pyx_v_year = ((int)1);
  int __pyx_v_month = ((int)1);
  int __pyx_v_day = ((int)1);
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_new", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_year = __pyx_optional_args->year;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_month = __pyx_optional_args->month;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_day = __pyx_optional_args->day;
        }
      }
    }
  }

  /* "utils.pxd":1116
 *     >>> datetime.date(year, month, day)
 *     """
 *     year = min(max(year, 1), 9_999)             # <<<<<<<<<<<<<<
 *     month = min(max(month, 1), 12)
 *     if day > 28:
 */
  __pyx_t_1 = 0x270F;
  __pyx_t_2 = 1;
  __pyx_t_3 = __pyx_v_year;
  __pyx_t_5 = (__pyx_t_2 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = (__pyx_t_1 < __pyx_t_2);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_year = __pyx_t_4;

  /* "utils.pxd":1117
 *     """
 *     year = min(max(year, 1), 9_999)
 *     month = min(max(month, 1), 12)             # <<<<<<<<<<<<<<
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))
 */
  __pyx_t_4 = 12;
  __pyx_t_1 = 1;
  __pyx_t_3 = __pyx_v_month;
  __pyx_t_5 = (__pyx_t_1 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_2 = __pyx_t_1;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  __pyx_t_1 = __pyx_t_2;
  __pyx_t_5 = (__pyx_t_4 < __pyx_t_1);
  if (__pyx_t_5) {
    __pyx_t_2 = __pyx_t_4;
  } else {
    __pyx_t_2 = __pyx_t_1;
  }
  __pyx_v_month = __pyx_t_2;

  /* "utils.pxd":1118
 *     year = min(max(year, 1), 9_999)
 *     month = min(max(month, 1), 12)
 *     if day > 28:             # <<<<<<<<<<<<<<
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 */
  __pyx_t_5 = (__pyx_v_day > 28);
  if (__pyx_t_5) {

    /* "utils.pxd":1119
 *     month = min(max(month, 1), 12)
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))             # <<<<<<<<<<<<<<
 *     elif day < 1:
 *         day = 1
 */
    __pyx_t_3 = __pyx_f_7cytimes_5utils_days_in_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 1119, __pyx_L1_error)
    __pyx_t_6 = __pyx_v_day;
    __pyx_t_5 = (__pyx_t_3 < __pyx_t_6);
    if (__pyx_t_5) {
      __pyx_t_7 = __pyx_t_3;
    } else {
      __pyx_t_7 = __pyx_t_6;
    }
    __pyx_v_day = __pyx_t_7;

    /* "utils.pxd":1118
 *     year = min(max(year, 1), 9_999)
 *     month = min(max(month, 1), 12)
 *     if day > 28:             # <<<<<<<<<<<<<<
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 */
    goto __pyx_L3;
  }

  /* "utils.pxd":1120
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:             # <<<<<<<<<<<<<<
 *         day = 1
 *     return datetime.date_new(year, month, day)
 */
  __pyx_t_5 = (__pyx_v_day < 1);
  if (__pyx_t_5) {

    /* "utils.pxd":1121
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 *         day = 1             # <<<<<<<<<<<<<<
 *     return datetime.date_new(year, month, day)
 * 
 */
    __pyx_v_day = 1;

    /* "utils.pxd":1120
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:             # <<<<<<<<<<<<<<
 *         day = 1
 *     return datetime.date_new(year, month, day)
 */
  }
  __pyx_L3:;

  /* "utils.pxd":1122
 *     elif day < 1:
 *         day = 1
 *     return datetime.date_new(year, month, day)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.date date_now(object tz=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_8 = ((PyObject *)__pyx_f_7cpython_8datetime_date_new(__pyx_v_year, __pyx_v_month, __pyx_v_day)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 1122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_8);
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1110
 * # datetime.date ----------------------------------------------------------------------------------------
 * # . generate
 * cdef inline datetime.date date_new(int year=1, int month=1, int day=1):             # <<<<<<<<<<<<<<
 *     """Create a new `<'datetime.date'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cytimes.utils.date_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1124
 *     return datetime.date_new(year, month, day)
 * 
 * cdef inline datetime.date date_now(object tz=None):             # <<<<<<<<<<<<<<
 *     """Get the current date `<'datetime.date'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_now(struct __pyx_opt_args_7cytimes_5utils_date_now *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  struct tm __pyx_v__tm;
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp __pyx_t_4;
  struct tm __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_now", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "utils.pxd":1131
 *     """
 *     # With timezone
 *     if tz is not None:             # <<<<<<<<<<<<<<
 *         return date_fr_dt(datetime.datetime_from_timestamp(unix_time(), tz))
 * 
 */
  __pyx_t_1 = (__pyx_v_tz != Py_None);
  if (__pyx_t_1) {

    /* "utils.pxd":1132
 *     # With timezone
 *     if tz is not None:
 *         return date_fr_dt(datetime.datetime_from_timestamp(unix_time(), tz))             # <<<<<<<<<<<<<<
 * 
 *     # With timezone
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_f_7cpython_4time_time()); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.tz = __pyx_v_tz;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_from_timestamp(__pyx_t_2, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_date_fr_dt(((PyDateTime_DateTime *)__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((PyDateTime_Date *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "utils.pxd":1131
 *     """
 *     # With timezone
 *     if tz is not None:             # <<<<<<<<<<<<<<
 *         return date_fr_dt(datetime.datetime_from_timestamp(unix_time(), tz))
 * 
 */
  }

  /* "utils.pxd":1135
 * 
 *     # With timezone
 *     _tm = tm_localtime(unix_time())             # <<<<<<<<<<<<<<
 *     return datetime.date_new(_tm.tm_year, _tm.tm_mon, _tm.tm_mday)
 * 
 */
  __pyx_t_5 = __pyx_f_7cytimes_5utils_tm_localtime(__pyx_f_7cpython_4time_time()); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1135, __pyx_L1_error)
  __pyx_v__tm = __pyx_t_5;

  /* "utils.pxd":1136
 *     # With timezone
 *     _tm = tm_localtime(unix_time())
 *     return datetime.date_new(_tm.tm_year, _tm.tm_mon, _tm.tm_mday)             # <<<<<<<<<<<<<<
 * 
 * # . type check
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_date_new(__pyx_v__tm.tm_year, __pyx_v__tm.tm_mon, __pyx_v__tm.tm_mday)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1124
 *     return datetime.date_new(year, month, day)
 * 
 * cdef inline datetime.date date_now(object tz=None):             # <<<<<<<<<<<<<<
 *     """Get the current date `<'datetime.date'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.date_now", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1139
 * 
 * # . type check
 * cdef inline bint is_date(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of datetime.date `<'bool'>`.
 * 
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_date(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "utils.pxd":1145
 *     >>> isinstance(obj, datetime.date)
 *     """
 *     return datetime.PyDate_Check(obj)             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_date_exact(object obj) except -1:
 */
  __pyx_r = PyDate_Check(__pyx_v_obj);
  goto __pyx_L0;

  /* "utils.pxd":1139
 * 
 * # . type check
 * cdef inline bint is_date(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of datetime.date `<'bool'>`.
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":1147
 *     return datetime.PyDate_Check(obj)
 * 
 * cdef inline bint is_date_exact(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is the exact datetime.date type `<'bool'>`.
 * 
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_date_exact(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "utils.pxd":1153
 *     >>> type(obj) is datetime.date
 *     """
 *     return datetime.PyDate_CheckExact(obj)             # <<<<<<<<<<<<<<
 * 
 * # . conversion: to
 */
  __pyx_r = PyDate_CheckExact(__pyx_v_obj);
  goto __pyx_L0;

  /* "utils.pxd":1147
 *     return datetime.PyDate_Check(obj)
 * 
 * cdef inline bint is_date_exact(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is the exact datetime.date type `<'bool'>`.
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":1156
 * 
 * # . conversion: to
 * cdef inline tm date_to_tm(datetime.date date) except *:             # <<<<<<<<<<<<<<
 *     """Convert date to `<'struct:tm'>`.
 * 
 */

static CYTHON_INLINE struct tm __pyx_f_7cytimes_5utils_date_to_tm(PyDateTime_Date *__pyx_v_date) {
  int __pyx_v_yy;
  int __pyx_v_mm;
  int __pyx_v_dd;
  struct tm __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  struct tm __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":1162
 *     """
 *     cdef int yy, mm, dd
 *     yy, mm, dd = date.year, date.month, date.day             # <<<<<<<<<<<<<<
 *     return tm(
 *         0, 0, 0, # sec, min, hour
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_4date_4year_year(__pyx_v_date);
  __pyx_t_2 = __pyx_f_7cpython_8datetime_4date_5month_month(__pyx_v_date);
  __pyx_t_3 = __pyx_f_7cpython_8datetime_4date_3day_day(__pyx_v_date);
  __pyx_v_yy = __pyx_t_1;
  __pyx_v_mm = __pyx_t_2;
  __pyx_v_dd = __pyx_t_3;

  /* "utils.pxd":1163
 *     cdef int yy, mm, dd
 *     yy, mm, dd = date.year, date.month, date.day
 *     return tm(             # <<<<<<<<<<<<<<
 *         0, 0, 0, # sec, min, hour
 *         dd, mm, yy,  # day, mon, year
 */
  __pyx_t_4.tm_sec = 0;
  __pyx_t_4.tm_min = 0;
  __pyx_t_4.tm_hour = 0;

  /* "utils.pxd":1165
 *     return tm(
 *         0, 0, 0, # sec, min, hour
 *         dd, mm, yy,  # day, mon, year             # <<<<<<<<<<<<<<
 *         ymd_weekday(yy, mm, dd),  # wday
 *         days_bf_month(yy, mm) + dd,  # yday
 */
  __pyx_t_4.tm_mday = __pyx_v_dd;
  __pyx_t_4.tm_mon = __pyx_v_mm;
  __pyx_t_4.tm_year = __pyx_v_yy;

  /* "utils.pxd":1166
 *         0, 0, 0, # sec, min, hour
 *         dd, mm, yy,  # day, mon, year
 *         ymd_weekday(yy, mm, dd),  # wday             # <<<<<<<<<<<<<<
 *         days_bf_month(yy, mm) + dd,  # yday
 *         -1  # isdst
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_ymd_weekday(__pyx_v_yy, __pyx_v_mm, __pyx_v_dd); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 1166, __pyx_L1_error)
  __pyx_t_4.tm_wday = __pyx_t_3;

  /* "utils.pxd":1167
 *         dd, mm, yy,  # day, mon, year
 *         ymd_weekday(yy, mm, dd),  # wday
 *         days_bf_month(yy, mm) + dd,  # yday             # <<<<<<<<<<<<<<
 *         -1  # isdst
 *     )
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_yy, __pyx_v_mm); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 1167, __pyx_L1_error)
  __pyx_t_4.tm_yday = (__pyx_t_3 + __pyx_v_dd);
  __pyx_t_4.tm_isdst = -1;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "utils.pxd":1156
 * 
 * # . conversion: to
 * cdef inline tm date_to_tm(datetime.date date) except *:             # <<<<<<<<<<<<<<
 *     """Convert date to `<'struct:tm'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.date_to_tm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":1171
 *     )
 * 
 * cdef inline str date_to_strformat(datetime.date date, str fmt):             # <<<<<<<<<<<<<<
 *     """Convert date to string according to the given format `<'str'>`.
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_date_to_strformat(PyDateTime_Date *__pyx_v_date, PyObject *__pyx_v_fmt) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct tm __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_to_strformat", 1);

  /* "utils.pxd":1177
 *     >>> date.strftime(fmt)
 *     """
 *     return tm_strftime(date_to_tm(date), fmt)             # <<<<<<<<<<<<<<
 * 
 * cdef inline str date_to_isoformat(datetime.date date):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cytimes_5utils_date_to_tm(__pyx_v_date); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1177, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7cytimes_5utils_tm_strftime(__pyx_t_1, __pyx_v_fmt); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1171
 *     )
 * 
 * cdef inline str date_to_strformat(datetime.date date, str fmt):             # <<<<<<<<<<<<<<
 *     """Convert date to string according to the given format `<'str'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.date_to_strformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1179
 *     return tm_strftime(date_to_tm(date), fmt)
 * 
 * cdef inline str date_to_isoformat(datetime.date date):             # <<<<<<<<<<<<<<
 *     """Convert date to string in ISO format ('%Y-%m-%d') `<'str'>`."""
 *     return "%04d-%02d-%02d" % (date.year, date.month, date.day)
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_date_to_isoformat(PyDateTime_Date *__pyx_v_date) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_to_isoformat", 1);

  /* "utils.pxd":1181
 * cdef inline str date_to_isoformat(datetime.date date):
 *     """Convert date to string in ISO format ('%Y-%m-%d') `<'str'>`."""
 *     return "%04d-%02d-%02d" % (date.year, date.month, date.day)             # <<<<<<<<<<<<<<
 * 
 * cdef inline long long date_to_us(datetime.date date):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4date_4year_year(__pyx_v_date), 4, '0', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__9);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__9);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__9);
  __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4date_5month_month(__pyx_v_date), 2, '0', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__9);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__9);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__9);
  __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4date_3day_day(__pyx_v_date), 2, '0', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1179
 *     return tm_strftime(date_to_tm(date), fmt)
 * 
 * cdef inline str date_to_isoformat(datetime.date date):             # <<<<<<<<<<<<<<
 *     """Convert date to string in ISO format ('%Y-%m-%d') `<'str'>`."""
 *     return "%04d-%02d-%02d" % (date.year, date.month, date.day)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils.date_to_isoformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1183
 *     return "%04d-%02d-%02d" % (date.year, date.month, date.day)
 * 
 * cdef inline long long date_to_us(datetime.date date):             # <<<<<<<<<<<<<<
 *     """Convert date to `EPOCH` microseconds `<'int'>`."""
 *     cdef long long ordinal = date_to_ordinal(date)
 */

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_date_to_us(PyDateTime_Date *__pyx_v_date) {
  PY_LONG_LONG __pyx_v_ordinal;
  PY_LONG_LONG __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":1185
 * cdef inline long long date_to_us(datetime.date date):
 *     """Convert date to `EPOCH` microseconds `<'int'>`."""
 *     cdef long long ordinal = date_to_ordinal(date)             # <<<<<<<<<<<<<<
 *     return (ordinal - EPOCH_DAY) * US_DAY
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_date_to_ordinal(__pyx_v_date); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 1185, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_1;

  /* "utils.pxd":1186
 *     """Convert date to `EPOCH` microseconds `<'int'>`."""
 *     cdef long long ordinal = date_to_ordinal(date)
 *     return (ordinal - EPOCH_DAY) * US_DAY             # <<<<<<<<<<<<<<
 * 
 * cdef inline double date_to_seconds(datetime.date date):
 */
  __pyx_r = ((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_US_DAY);
  goto __pyx_L0;

  /* "utils.pxd":1183
 *     return "%04d-%02d-%02d" % (date.year, date.month, date.day)
 * 
 * cdef inline long long date_to_us(datetime.date date):             # <<<<<<<<<<<<<<
 *     """Convert date to `EPOCH` microseconds `<'int'>`."""
 *     cdef long long ordinal = date_to_ordinal(date)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.date_to_us", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":1188
 *     return (ordinal - EPOCH_DAY) * US_DAY
 * 
 * cdef inline double date_to_seconds(datetime.date date):             # <<<<<<<<<<<<<<
 *     """Convert date to `EPOCH` seconds `<'float'>`."""
 *     cdef long long ordinal = date_to_ordinal(date)
 */

static CYTHON_INLINE double __pyx_f_7cytimes_5utils_date_to_seconds(PyDateTime_Date *__pyx_v_date) {
  PY_LONG_LONG __pyx_v_ordinal;
  double __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":1190
 * cdef inline double date_to_seconds(datetime.date date):
 *     """Convert date to `EPOCH` seconds `<'float'>`."""
 *     cdef long long ordinal = date_to_ordinal(date)             # <<<<<<<<<<<<<<
 *     return (ordinal - EPOCH_DAY) * SS_DAY
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_date_to_ordinal(__pyx_v_date); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 1190, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_1;

  /* "utils.pxd":1191
 *     """Convert date to `EPOCH` seconds `<'float'>`."""
 *     cdef long long ordinal = date_to_ordinal(date)
 *     return (ordinal - EPOCH_DAY) * SS_DAY             # <<<<<<<<<<<<<<
 * 
 * cdef inline int date_to_ordinal(datetime.date date) except -1:
 */
  __pyx_r = ((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_SS_DAY);
  goto __pyx_L0;

  /* "utils.pxd":1188
 *     return (ordinal - EPOCH_DAY) * US_DAY
 * 
 * cdef inline double date_to_seconds(datetime.date date):             # <<<<<<<<<<<<<<
 *     """Convert date to `EPOCH` seconds `<'float'>`."""
 *     cdef long long ordinal = date_to_ordinal(date)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.date_to_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":1193
 *     return (ordinal - EPOCH_DAY) * SS_DAY
 * 
 * cdef inline int date_to_ordinal(datetime.date date) except -1:             # <<<<<<<<<<<<<<
 *     """Convert date to Gregorian ordinal days `<'int'>`."""
 *     return ymd_to_ordinal(date.year, date.month, date.day)
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_date_to_ordinal(PyDateTime_Date *__pyx_v_date) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":1195
 * cdef inline int date_to_ordinal(datetime.date date) except -1:
 *     """Convert date to Gregorian ordinal days `<'int'>`."""
 *     return ymd_to_ordinal(date.year, date.month, date.day)             # <<<<<<<<<<<<<<
 * 
 * cdef inline double date_to_ts(datetime.date date):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_ymd_to_ordinal(__pyx_f_7cpython_8datetime_4date_4year_year(__pyx_v_date), __pyx_f_7cpython_8datetime_4date_5month_month(__pyx_v_date), __pyx_f_7cpython_8datetime_4date_3day_day(__pyx_v_date)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 1195, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "utils.pxd":1193
 *     return (ordinal - EPOCH_DAY) * SS_DAY
 * 
 * cdef inline int date_to_ordinal(datetime.date date) except -1:             # <<<<<<<<<<<<<<
 *     """Convert date to Gregorian ordinal days `<'int'>`."""
 *     return ymd_to_ordinal(date.year, date.month, date.day)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.date_to_ordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":1197
 *     return ymd_to_ordinal(date.year, date.month, date.day)
 * 
 * cdef inline double date_to_ts(datetime.date date):             # <<<<<<<<<<<<<<
 *     """Convert date to `EPOCH` timestamp `<'float'>`."""
 *     cdef:
 */

static CYTHON_INLINE double __pyx_f_7cytimes_5utils_date_to_ts(PyDateTime_Date *__pyx_v_date) {
  PY_LONG_LONG __pyx_v_ordinal;
  PY_LONG_LONG __pyx_v_ss;
  double __pyx_r;
  int __pyx_t_1;
  PY_LONG_LONG __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":1200
 *     """Convert date to `EPOCH` timestamp `<'float'>`."""
 *     cdef:
 *         long long ordinal = date_to_ordinal(date)             # <<<<<<<<<<<<<<
 *         long long ss = (ordinal - EPOCH_DAY) * SS_DAY
 *     return ss * 2 - ts_localtime(ss)
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_date_to_ordinal(__pyx_v_date); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 1200, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_1;

  /* "utils.pxd":1201
 *     cdef:
 *         long long ordinal = date_to_ordinal(date)
 *         long long ss = (ordinal - EPOCH_DAY) * SS_DAY             # <<<<<<<<<<<<<<
 *     return ss * 2 - ts_localtime(ss)
 * 
 */
  __pyx_v_ss = ((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_SS_DAY);

  /* "utils.pxd":1202
 *         long long ordinal = date_to_ordinal(date)
 *         long long ss = (ordinal - EPOCH_DAY) * SS_DAY
 *     return ss * 2 - ts_localtime(ss)             # <<<<<<<<<<<<<<
 * 
 * # . conversion: from
 */
  __pyx_t_2 = __pyx_f_7cytimes_5utils_ts_localtime(__pyx_v_ss); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 1202, __pyx_L1_error)
  __pyx_r = ((__pyx_v_ss * 2) - __pyx_t_2);
  goto __pyx_L0;

  /* "utils.pxd":1197
 *     return ymd_to_ordinal(date.year, date.month, date.day)
 * 
 * cdef inline double date_to_ts(datetime.date date):             # <<<<<<<<<<<<<<
 *     """Convert date to `EPOCH` timestamp `<'float'>`."""
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.date_to_ts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":1205
 * 
 * # . conversion: from
 * cdef inline datetime.date date_fr_us(long long val):             # <<<<<<<<<<<<<<
 *     """Create date from `EPOCH` microseconds (int) `<'datetime.date'>`."""
 *     return date_fr_ordinal(math_floor_div(val + EPOCH_MICROSECOND, US_DAY))
 */

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_fr_us(PY_LONG_LONG __pyx_v_val) {
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PY_LONG_LONG __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_fr_us", 1);

  /* "utils.pxd":1207
 * cdef inline datetime.date date_fr_us(long long val):
 *     """Create date from `EPOCH` microseconds (int) `<'datetime.date'>`."""
 *     return date_fr_ordinal(math_floor_div(val + EPOCH_MICROSECOND, US_DAY))             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.date date_fr_seconds(double val):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __pyx_f_7cytimes_5utils_math_floor_div((__pyx_v_val + __pyx_v_7cytimes_5utils_EPOCH_MICROSECOND), __pyx_v_7cytimes_5utils_US_DAY, NULL); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 1207, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_date_fr_ordinal(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1205
 * 
 * # . conversion: from
 * cdef inline datetime.date date_fr_us(long long val):             # <<<<<<<<<<<<<<
 *     """Create date from `EPOCH` microseconds (int) `<'datetime.date'>`."""
 *     return date_fr_ordinal(math_floor_div(val + EPOCH_MICROSECOND, US_DAY))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.date_fr_us", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1209
 *     return date_fr_ordinal(math_floor_div(val + EPOCH_MICROSECOND, US_DAY))
 * 
 * cdef inline datetime.date date_fr_seconds(double val):             # <<<<<<<<<<<<<<
 *     """Create date from `EPOCH` seconds (float) `<'datetime.date'>`."""
 *     cdef long long sec = int(val)
 */

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_fr_seconds(double __pyx_v_val) {
  PY_LONG_LONG __pyx_v_sec;
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_fr_seconds", 1);

  /* "utils.pxd":1211
 * cdef inline datetime.date date_fr_seconds(double val):
 *     """Create date from `EPOCH` seconds (float) `<'datetime.date'>`."""
 *     cdef long long sec = int(val)             # <<<<<<<<<<<<<<
 *     return date_fr_ordinal(sec // 86_400 + EPOCH_DAY)
 * 
 */
  __pyx_v_sec = ((PY_LONG_LONG)__pyx_v_val);

  /* "utils.pxd":1212
 *     """Create date from `EPOCH` seconds (float) `<'datetime.date'>`."""
 *     cdef long long sec = int(val)
 *     return date_fr_ordinal(sec // 86_400 + EPOCH_DAY)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.date date_fr_ordinal(int val):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_date_fr_ordinal((__Pyx_div_PY_LONG_LONG(__pyx_v_sec, 0x15180) + __pyx_v_7cytimes_5utils_EPOCH_DAY))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1209
 *     return date_fr_ordinal(math_floor_div(val + EPOCH_MICROSECOND, US_DAY))
 * 
 * cdef inline datetime.date date_fr_seconds(double val):             # <<<<<<<<<<<<<<
 *     """Create date from `EPOCH` seconds (float) `<'datetime.date'>`."""
 *     cdef long long sec = int(val)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.date_fr_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1214
 *     return date_fr_ordinal(sec // 86_400 + EPOCH_DAY)
 * 
 * cdef inline datetime.date date_fr_ordinal(int val):             # <<<<<<<<<<<<<<
 *     """Create date from Gregorian ordinal days `<'datetime.date'>`."""
 *     _ymd = ymd_fr_ordinal(val)
 */

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_fr_ordinal(int __pyx_v_val) {
  __pyx_t_7cytimes_5utils_ymd __pyx_v__ymd;
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_t_7cytimes_5utils_ymd __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_fr_ordinal", 1);

  /* "utils.pxd":1216
 * cdef inline datetime.date date_fr_ordinal(int val):
 *     """Create date from Gregorian ordinal days `<'datetime.date'>`."""
 *     _ymd = ymd_fr_ordinal(val)             # <<<<<<<<<<<<<<
 *     return datetime.date_new(_ymd.year, _ymd.month, _ymd.day)
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal(__pyx_v_val); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1216, __pyx_L1_error)
  __pyx_v__ymd = __pyx_t_1;

  /* "utils.pxd":1217
 *     """Create date from Gregorian ordinal days `<'datetime.date'>`."""
 *     _ymd = ymd_fr_ordinal(val)
 *     return datetime.date_new(_ymd.year, _ymd.month, _ymd.day)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.date date_fr_ts(double val):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_date_new(__pyx_v__ymd.year, __pyx_v__ymd.month, __pyx_v__ymd.day)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1214
 *     return date_fr_ordinal(sec // 86_400 + EPOCH_DAY)
 * 
 * cdef inline datetime.date date_fr_ordinal(int val):             # <<<<<<<<<<<<<<
 *     """Create date from Gregorian ordinal days `<'datetime.date'>`."""
 *     _ymd = ymd_fr_ordinal(val)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.date_fr_ordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1219
 *     return datetime.date_new(_ymd.year, _ymd.month, _ymd.day)
 * 
 * cdef inline datetime.date date_fr_ts(double val):             # <<<<<<<<<<<<<<
 *     """Create date from `EPOCH` timestamp (float) `<'datetime.date'>`."""
 *     return datetime.date_from_timestamp(val)
 */

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_fr_ts(double __pyx_v_val) {
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_fr_ts", 1);

  /* "utils.pxd":1221
 * cdef inline datetime.date date_fr_ts(double val):
 *     """Create date from `EPOCH` timestamp (float) `<'datetime.date'>`."""
 *     return datetime.date_from_timestamp(val)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.date date_fr_date(datetime.date date):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_date_from_timestamp(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_Date *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1219
 *     return datetime.date_new(_ymd.year, _ymd.month, _ymd.day)
 * 
 * cdef inline datetime.date date_fr_ts(double val):             # <<<<<<<<<<<<<<
 *     """Create date from `EPOCH` timestamp (float) `<'datetime.date'>`."""
 *     return datetime.date_from_timestamp(val)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.date_fr_ts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1223
 *     return datetime.date_from_timestamp(val)
 * 
 * cdef inline datetime.date date_fr_date(datetime.date date):             # <<<<<<<<<<<<<<
 *     """Create date from another date (include subclass) `<'datetime.date'>`."""
 *     return datetime.date_new(date.year, date.month, date.day)
 */

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_fr_date(PyDateTime_Date *__pyx_v_date) {
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_fr_date", 1);

  /* "utils.pxd":1225
 * cdef inline datetime.date date_fr_date(datetime.date date):
 *     """Create date from another date (include subclass) `<'datetime.date'>`."""
 *     return datetime.date_new(date.year, date.month, date.day)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.date date_fr_dt(datetime.datetime dt):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cpython_8datetime_date_new(__pyx_f_7cpython_8datetime_4date_4year_year(__pyx_v_date), __pyx_f_7cpython_8datetime_4date_5month_month(__pyx_v_date), __pyx_f_7cpython_8datetime_4date_3day_day(__pyx_v_date))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1223
 *     return datetime.date_from_timestamp(val)
 * 
 * cdef inline datetime.date date_fr_date(datetime.date date):             # <<<<<<<<<<<<<<
 *     """Create date from another date (include subclass) `<'datetime.date'>`."""
 *     return datetime.date_new(date.year, date.month, date.day)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.date_fr_date", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1227
 *     return datetime.date_new(date.year, date.month, date.day)
 * 
 * cdef inline datetime.date date_fr_dt(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Create date from datetime (include subclass) `<'datetime.date'>`."""
 *     return datetime.date_new(dt.year, dt.month, dt.day)
 */

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cytimes_5utils_date_fr_dt(PyDateTime_DateTime *__pyx_v_dt) {
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_fr_dt", 1);

  /* "utils.pxd":1229
 * cdef inline datetime.date date_fr_dt(datetime.datetime dt):
 *     """Create date from datetime (include subclass) `<'datetime.date'>`."""
 *     return datetime.date_new(dt.year, dt.month, dt.day)             # <<<<<<<<<<<<<<
 * 
 * # datetime.datetime ------------------------------------------------------------------------------------
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cpython_8datetime_date_new(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1227
 *     return datetime.date_new(date.year, date.month, date.day)
 * 
 * cdef inline datetime.date date_fr_dt(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Create date from datetime (include subclass) `<'datetime.date'>`."""
 *     return datetime.date_new(dt.year, dt.month, dt.day)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.date_fr_dt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1233
 * # datetime.datetime ------------------------------------------------------------------------------------
 * # . generate
 * cdef inline datetime.datetime dt_new(             # <<<<<<<<<<<<<<
 *     int year=1, int month=1, int day=1,
 *     int hour=0, int minute=0, int second=0,
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_new(struct __pyx_opt_args_7cytimes_5utils_dt_new *__pyx_optional_args) {
  int __pyx_v_year = ((int)1);
  int __pyx_v_month = ((int)1);
  int __pyx_v_day = ((int)1);
  int __pyx_v_hour = ((int)0);
  int __pyx_v_minute = ((int)0);
  int __pyx_v_second = ((int)0);
  int __pyx_v_microsecond = ((int)0);

  /* "utils.pxd":1236
 *     int year=1, int month=1, int day=1,
 *     int hour=0, int minute=0, int second=0,
 *     int microsecond=0, object tz=None, int fold=0,             # <<<<<<<<<<<<<<
 * ):
 *     """Create a new datetime `<'datetime.datetime'>`.
 */
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  int __pyx_v_fold = ((int)0);
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_new", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_year = __pyx_optional_args->year;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_month = __pyx_optional_args->month;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_day = __pyx_optional_args->day;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_hour = __pyx_optional_args->hour;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_minute = __pyx_optional_args->minute;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_second = __pyx_optional_args->second;
                if (__pyx_optional_args->__pyx_n > 6) {
                  __pyx_v_microsecond = __pyx_optional_args->microsecond;
                  if (__pyx_optional_args->__pyx_n > 7) {
                    __pyx_v_tz = __pyx_optional_args->tz;
                    if (__pyx_optional_args->__pyx_n > 8) {
                      __pyx_v_fold = __pyx_optional_args->fold;
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }

  /* "utils.pxd":1243
 *     >>> datetime.datetime(year, month, day, hour, minute, second, microsecond, tz, fold)
 *     """
 *     year = min(max(year, 1), 9_999)             # <<<<<<<<<<<<<<
 *     month = min(max(month, 1), 12)
 *     if day > 28:
 */
  __pyx_t_1 = 0x270F;
  __pyx_t_2 = 1;
  __pyx_t_3 = __pyx_v_year;
  __pyx_t_5 = (__pyx_t_2 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = (__pyx_t_1 < __pyx_t_2);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_year = __pyx_t_4;

  /* "utils.pxd":1244
 *     """
 *     year = min(max(year, 1), 9_999)
 *     month = min(max(month, 1), 12)             # <<<<<<<<<<<<<<
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))
 */
  __pyx_t_4 = 12;
  __pyx_t_1 = 1;
  __pyx_t_3 = __pyx_v_month;
  __pyx_t_5 = (__pyx_t_1 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_2 = __pyx_t_1;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  __pyx_t_1 = __pyx_t_2;
  __pyx_t_5 = (__pyx_t_4 < __pyx_t_1);
  if (__pyx_t_5) {
    __pyx_t_2 = __pyx_t_4;
  } else {
    __pyx_t_2 = __pyx_t_1;
  }
  __pyx_v_month = __pyx_t_2;

  /* "utils.pxd":1245
 *     year = min(max(year, 1), 9_999)
 *     month = min(max(month, 1), 12)
 *     if day > 28:             # <<<<<<<<<<<<<<
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 */
  __pyx_t_5 = (__pyx_v_day > 28);
  if (__pyx_t_5) {

    /* "utils.pxd":1246
 *     month = min(max(month, 1), 12)
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))             # <<<<<<<<<<<<<<
 *     elif day < 1:
 *         day = 1
 */
    __pyx_t_3 = __pyx_f_7cytimes_5utils_days_in_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 1246, __pyx_L1_error)
    __pyx_t_6 = __pyx_v_day;
    __pyx_t_5 = (__pyx_t_3 < __pyx_t_6);
    if (__pyx_t_5) {
      __pyx_t_7 = __pyx_t_3;
    } else {
      __pyx_t_7 = __pyx_t_6;
    }
    __pyx_v_day = __pyx_t_7;

    /* "utils.pxd":1245
 *     year = min(max(year, 1), 9_999)
 *     month = min(max(month, 1), 12)
 *     if day > 28:             # <<<<<<<<<<<<<<
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 */
    goto __pyx_L3;
  }

  /* "utils.pxd":1247
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:             # <<<<<<<<<<<<<<
 *         day = 1
 *     hour = min(max(hour, 0), 23)
 */
  __pyx_t_5 = (__pyx_v_day < 1);
  if (__pyx_t_5) {

    /* "utils.pxd":1248
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:
 *         day = 1             # <<<<<<<<<<<<<<
 *     hour = min(max(hour, 0), 23)
 *     minute = min(max(minute, 0), 59)
 */
    __pyx_v_day = 1;

    /* "utils.pxd":1247
 *     if day > 28:
 *         day = min(day, days_in_month(year, month))
 *     elif day < 1:             # <<<<<<<<<<<<<<
 *         day = 1
 *     hour = min(max(hour, 0), 23)
 */
  }
  __pyx_L3:;

  /* "utils.pxd":1249
 *     elif day < 1:
 *         day = 1
 *     hour = min(max(hour, 0), 23)             # <<<<<<<<<<<<<<
 *     minute = min(max(minute, 0), 59)
 *     second = min(max(second, 0), 59)
 */
  __pyx_t_2 = 23;
  __pyx_t_4 = 0;
  __pyx_t_7 = __pyx_v_hour;
  __pyx_t_5 = (__pyx_t_4 > __pyx_t_7);
  if (__pyx_t_5) {
    __pyx_t_1 = __pyx_t_4;
  } else {
    __pyx_t_1 = __pyx_t_7;
  }
  __pyx_t_4 = __pyx_t_1;
  __pyx_t_5 = (__pyx_t_2 < __pyx_t_4);
  if (__pyx_t_5) {
    __pyx_t_1 = __pyx_t_2;
  } else {
    __pyx_t_1 = __pyx_t_4;
  }
  __pyx_v_hour = __pyx_t_1;

  /* "utils.pxd":1250
 *         day = 1
 *     hour = min(max(hour, 0), 23)
 *     minute = min(max(minute, 0), 59)             # <<<<<<<<<<<<<<
 *     second = min(max(second, 0), 59)
 *     microsecond = min(max(microsecond, 0), 999_999)
 */
  __pyx_t_1 = 59;
  __pyx_t_2 = 0;
  __pyx_t_7 = __pyx_v_minute;
  __pyx_t_5 = (__pyx_t_2 > __pyx_t_7);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_7;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = (__pyx_t_1 < __pyx_t_2);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_minute = __pyx_t_4;

  /* "utils.pxd":1251
 *     hour = min(max(hour, 0), 23)
 *     minute = min(max(minute, 0), 59)
 *     second = min(max(second, 0), 59)             # <<<<<<<<<<<<<<
 *     microsecond = min(max(microsecond, 0), 999_999)
 *     return datetime.datetime_new(
 */
  __pyx_t_4 = 59;
  __pyx_t_1 = 0;
  __pyx_t_7 = __pyx_v_second;
  __pyx_t_5 = (__pyx_t_1 > __pyx_t_7);
  if (__pyx_t_5) {
    __pyx_t_2 = __pyx_t_1;
  } else {
    __pyx_t_2 = __pyx_t_7;
  }
  __pyx_t_1 = __pyx_t_2;
  __pyx_t_5 = (__pyx_t_4 < __pyx_t_1);
  if (__pyx_t_5) {
    __pyx_t_2 = __pyx_t_4;
  } else {
    __pyx_t_2 = __pyx_t_1;
  }
  __pyx_v_second = __pyx_t_2;

  /* "utils.pxd":1252
 *     minute = min(max(minute, 0), 59)
 *     second = min(max(second, 0), 59)
 *     microsecond = min(max(microsecond, 0), 999_999)             # <<<<<<<<<<<<<<
 *     return datetime.datetime_new(
 *         year, month, day,
 */
  __pyx_t_2 = 0xF423F;
  __pyx_t_4 = 0;
  __pyx_t_7 = __pyx_v_microsecond;
  __pyx_t_5 = (__pyx_t_4 > __pyx_t_7);
  if (__pyx_t_5) {
    __pyx_t_1 = __pyx_t_4;
  } else {
    __pyx_t_1 = __pyx_t_7;
  }
  __pyx_t_4 = __pyx_t_1;
  __pyx_t_5 = (__pyx_t_2 < __pyx_t_4);
  if (__pyx_t_5) {
    __pyx_t_1 = __pyx_t_2;
  } else {
    __pyx_t_1 = __pyx_t_4;
  }
  __pyx_v_microsecond = __pyx_t_1;

  /* "utils.pxd":1253
 *     second = min(max(second, 0), 59)
 *     microsecond = min(max(microsecond, 0), 999_999)
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         year, month, day,
 *         hour, minute, second, microsecond,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "utils.pxd":1256
 *         year, month, day,
 *         hour, minute, second, microsecond,
 *         tz, 1 if fold == 1 else 0,             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_5 = (__pyx_v_fold == 1);
  if (__pyx_t_5) {
    __pyx_t_7 = 1;
  } else {
    __pyx_t_7 = 0;
  }

  /* "utils.pxd":1253
 *     second = min(max(second, 0), 59)
 *     microsecond = min(max(microsecond, 0), 999_999)
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         year, month, day,
 *         hour, minute, second, microsecond,
 */
  __pyx_t_9.__pyx_n = 1;
  __pyx_t_9.fold = __pyx_t_7;
  __pyx_t_8 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_v_year, __pyx_v_month, __pyx_v_day, __pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_tz, &__pyx_t_9)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 1253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_8);
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1233
 * # datetime.datetime ------------------------------------------------------------------------------------
 * # . generate
 * cdef inline datetime.datetime dt_new(             # <<<<<<<<<<<<<<
 *     int year=1, int month=1, int day=1,
 *     int hour=0, int minute=0, int second=0,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cytimes.utils.dt_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1259
 *     )
 * 
 * cdef inline datetime.datetime dt_now(object tz=None):             # <<<<<<<<<<<<<<
 *     """Get the current datetime `<'datetime.datetime'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_now(struct __pyx_opt_args_7cytimes_5utils_dt_now *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  double __pyx_v_ts;
  PY_LONG_LONG __pyx_v_us;
  struct tm __pyx_v__tm;
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp __pyx_t_4;
  struct tm __pyx_t_5;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_now", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "utils.pxd":1266
 *     """
 *     # With timezone
 *     if tz is not None:             # <<<<<<<<<<<<<<
 *         return datetime.datetime_from_timestamp(unix_time(), tz)
 * 
 */
  __pyx_t_1 = (__pyx_v_tz != Py_None);
  if (__pyx_t_1) {

    /* "utils.pxd":1267
 *     # With timezone
 *     if tz is not None:
 *         return datetime.datetime_from_timestamp(unix_time(), tz)             # <<<<<<<<<<<<<<
 * 
 *     # Without timezone
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_f_7cpython_4time_time()); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.tz = __pyx_v_tz;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_from_timestamp(__pyx_t_2, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((PyDateTime_DateTime *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":1266
 *     """
 *     # With timezone
 *     if tz is not None:             # <<<<<<<<<<<<<<
 *         return datetime.datetime_from_timestamp(unix_time(), tz)
 * 
 */
  }

  /* "utils.pxd":1270
 * 
 *     # Without timezone
 *     cdef double ts = unix_time()             # <<<<<<<<<<<<<<
 *     cdef long long us = int(ts * 1_000_000)
 *     _tm = tm_localtime(ts)
 */
  __pyx_v_ts = __pyx_f_7cpython_4time_time();

  /* "utils.pxd":1271
 *     # Without timezone
 *     cdef double ts = unix_time()
 *     cdef long long us = int(ts * 1_000_000)             # <<<<<<<<<<<<<<
 *     _tm = tm_localtime(ts)
 *     return datetime.datetime_new(
 */
  __pyx_v_us = ((PY_LONG_LONG)(__pyx_v_ts * 1000000.0));

  /* "utils.pxd":1272
 *     cdef double ts = unix_time()
 *     cdef long long us = int(ts * 1_000_000)
 *     _tm = tm_localtime(ts)             # <<<<<<<<<<<<<<
 *     return datetime.datetime_new(
 *         _tm.tm_year, _tm.tm_mon, _tm.tm_mday,
 */
  __pyx_t_5 = __pyx_f_7cytimes_5utils_tm_localtime(__pyx_v_ts); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1272, __pyx_L1_error)
  __pyx_v__tm = __pyx_t_5;

  /* "utils.pxd":1273
 *     cdef long long us = int(ts * 1_000_000)
 *     _tm = tm_localtime(ts)
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         _tm.tm_year, _tm.tm_mon, _tm.tm_mday,
 *         _tm.tm_hour, _tm.tm_min, _tm.tm_sec,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "utils.pxd":1276
 *         _tm.tm_year, _tm.tm_mon, _tm.tm_mday,
 *         _tm.tm_hour, _tm.tm_min, _tm.tm_sec,
 *         us % 1_000_000, None, 0,             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.fold = 0;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_v__tm.tm_year, __pyx_v__tm.tm_mon, __pyx_v__tm.tm_mday, __pyx_v__tm.tm_hour, __pyx_v__tm.tm_min, __pyx_v__tm.tm_sec, __Pyx_mod_PY_LONG_LONG(__pyx_v_us, 0xF4240), Py_None, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1259
 *     )
 * 
 * cdef inline datetime.datetime dt_now(object tz=None):             # <<<<<<<<<<<<<<
 *     """Get the current datetime `<'datetime.datetime'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.dt_now", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1280
 * 
 * # . type check
 * cdef inline bint is_dt(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of datetime.datetime `<'bool'>`.
 * 
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_dt(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "utils.pxd":1286
 *     >>> isinstance(obj, datetime.datetime)
 *     """
 *     return datetime.PyDateTime_Check(obj)             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_dt_exact(object obj) except -1:
 */
  __pyx_r = PyDateTime_Check(__pyx_v_obj);
  goto __pyx_L0;

  /* "utils.pxd":1280
 * 
 * # . type check
 * cdef inline bint is_dt(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of datetime.datetime `<'bool'>`.
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":1288
 *     return datetime.PyDateTime_Check(obj)
 * 
 * cdef inline bint is_dt_exact(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is the exact datetime.datetime type `<'bool'>`.
 * 
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_dt_exact(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "utils.pxd":1294
 *     >>> type(obj) is datetime.datetime
 *     """
 *     return datetime.PyDateTime_CheckExact(obj)             # <<<<<<<<<<<<<<
 * 
 * # . tzinfo
 */
  __pyx_r = PyDateTime_CheckExact(__pyx_v_obj);
  goto __pyx_L0;

  /* "utils.pxd":1288
 *     return datetime.PyDateTime_Check(obj)
 * 
 * cdef inline bint is_dt_exact(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is the exact datetime.datetime type `<'bool'>`.
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":1297
 * 
 * # . tzinfo
 * cdef inline str dt_tzname(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'tzname' of the datetime `<'str/None'>`.
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_dt_tzname(PyDateTime_DateTime *__pyx_v_dt) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_name __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_tzname", 1);

  /* "utils.pxd":1303
 *     >>> dt.tzname()
 *     """
 *     return tz_name(dt.tzinfo, dt)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.timedelta dt_dst(datetime.datetime dt):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.dt = __pyx_v_dt;
  __pyx_t_2 = __pyx_f_7cytimes_5utils_tz_name(__pyx_t_1, &__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1297
 * 
 * # . tzinfo
 * cdef inline str dt_tzname(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'tzname' of the datetime `<'str/None'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.dt_tzname", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1305
 *     return tz_name(dt.tzinfo, dt)
 * 
 * cdef inline datetime.timedelta dt_dst(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'dst' of the datetime `<'datetime.timedelta/None'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_dt_dst(PyDateTime_DateTime *__pyx_v_dt) {
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_dst __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_dst", 1);

  /* "utils.pxd":1311
 *     >>> dt.dst()
 *     """
 *     return tz_dst(dt.tzinfo, dt)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.timedelta dt_utcoffset(datetime.datetime dt):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.dt = __pyx_v_dt;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_dst(__pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1305
 *     return tz_name(dt.tzinfo, dt)
 * 
 * cdef inline datetime.timedelta dt_dst(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'dst' of the datetime `<'datetime.timedelta/None'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.dt_dst", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1313
 *     return tz_dst(dt.tzinfo, dt)
 * 
 * cdef inline datetime.timedelta dt_utcoffset(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'utcoffset' of the datetime `<'datetime.timedelta/None'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_dt_utcoffset(PyDateTime_DateTime *__pyx_v_dt) {
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_utcoffset", 1);

  /* "utils.pxd":1319
 *     >>> dt.utcoffset()
 *     """
 *     return tz_utcoffset(dt.tzinfo, dt)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.datetime dt_normalize_tz(datetime.datetime dt):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.dt = __pyx_v_dt;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_utcoffset(__pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1313
 *     return tz_dst(dt.tzinfo, dt)
 * 
 * cdef inline datetime.timedelta dt_utcoffset(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'utcoffset' of the datetime `<'datetime.timedelta/None'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.dt_utcoffset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1321
 *     return tz_utcoffset(dt.tzinfo, dt)
 * 
 * cdef inline datetime.datetime dt_normalize_tz(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Normalize the datetime to its tzinfo `<'datetime.datetime'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_normalize_tz(PyDateTime_DateTime *__pyx_v_dt) {
  PyObject *__pyx_v_tz = NULL;
  int __pyx_v_off0;
  int __pyx_v_off1;
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset_seconds __pyx_t_4;
  struct __pyx_opt_args_7cytimes_5utils_dt_add __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_normalize_tz", 1);

  /* "utils.pxd":1327
 *     datetime by normalizing it to its timezone.
 *     """
 *     tz = dt.tzinfo             # <<<<<<<<<<<<<<
 *     if tz is None:
 *         return dt
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "utils.pxd":1328
 *     """
 *     tz = dt.tzinfo
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         return dt
 * 
 */
  __pyx_t_2 = (__pyx_v_tz == Py_None);
  if (__pyx_t_2) {

    /* "utils.pxd":1329
 *     tz = dt.tzinfo
 *     if tz is None:
 *         return dt             # <<<<<<<<<<<<<<
 * 
 *     cdef int off0, off1
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_dt);
    __pyx_r = __pyx_v_dt;
    goto __pyx_L0;

    /* "utils.pxd":1328
 *     """
 *     tz = dt.tzinfo
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         return dt
 * 
 */
  }

  /* "utils.pxd":1332
 * 
 *     cdef int off0, off1
 *     if dt.fold == 1:             # <<<<<<<<<<<<<<
 *         off0 = tz_utcoffset_seconds(tz, dt_replace_fold(dt, 0))
 *         off1 = tz_utcoffset_seconds(tz, dt)
 */
  __pyx_t_2 = (__pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt) == 1);
  if (__pyx_t_2) {

    /* "utils.pxd":1333
 *     cdef int off0, off1
 *     if dt.fold == 1:
 *         off0 = tz_utcoffset_seconds(tz, dt_replace_fold(dt, 0))             # <<<<<<<<<<<<<<
 *         off1 = tz_utcoffset_seconds(tz, dt)
 *     else:
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_replace_fold(__pyx_v_dt, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.dt = ((PyDateTime_DateTime *)__pyx_t_1);
    __pyx_t_3 = __pyx_f_7cytimes_5utils_tz_utcoffset_seconds(__pyx_v_tz, &__pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-200000))) __PYX_ERR(5, 1333, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_off0 = __pyx_t_3;

    /* "utils.pxd":1334
 *     if dt.fold == 1:
 *         off0 = tz_utcoffset_seconds(tz, dt_replace_fold(dt, 0))
 *         off1 = tz_utcoffset_seconds(tz, dt)             # <<<<<<<<<<<<<<
 *     else:
 *         off0 = tz_utcoffset_seconds(tz, dt)
 */
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.dt = __pyx_v_dt;
    __pyx_t_3 = __pyx_f_7cytimes_5utils_tz_utcoffset_seconds(__pyx_v_tz, &__pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-200000))) __PYX_ERR(5, 1334, __pyx_L1_error)
    __pyx_v_off1 = __pyx_t_3;

    /* "utils.pxd":1332
 * 
 *     cdef int off0, off1
 *     if dt.fold == 1:             # <<<<<<<<<<<<<<
 *         off0 = tz_utcoffset_seconds(tz, dt_replace_fold(dt, 0))
 *         off1 = tz_utcoffset_seconds(tz, dt)
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":1336
 *         off1 = tz_utcoffset_seconds(tz, dt)
 *     else:
 *         off0 = tz_utcoffset_seconds(tz, dt)             # <<<<<<<<<<<<<<
 *         off1 = tz_utcoffset_seconds(tz, dt_replace_fold(dt, 1))
 * 
 */
  /*else*/ {
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.dt = __pyx_v_dt;
    __pyx_t_3 = __pyx_f_7cytimes_5utils_tz_utcoffset_seconds(__pyx_v_tz, &__pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-200000))) __PYX_ERR(5, 1336, __pyx_L1_error)
    __pyx_v_off0 = __pyx_t_3;

    /* "utils.pxd":1337
 *     else:
 *         off0 = tz_utcoffset_seconds(tz, dt)
 *         off1 = tz_utcoffset_seconds(tz, dt_replace_fold(dt, 1))             # <<<<<<<<<<<<<<
 * 
 *     if off0 == off1:
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_replace_fold(__pyx_v_dt, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.dt = ((PyDateTime_DateTime *)__pyx_t_1);
    __pyx_t_3 = __pyx_f_7cytimes_5utils_tz_utcoffset_seconds(__pyx_v_tz, &__pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-200000))) __PYX_ERR(5, 1337, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_off1 = __pyx_t_3;
  }
  __pyx_L4:;

  /* "utils.pxd":1339
 *         off1 = tz_utcoffset_seconds(tz, dt_replace_fold(dt, 1))
 * 
 *     if off0 == off1:             # <<<<<<<<<<<<<<
 *         return dt
 * 
 */
  __pyx_t_2 = (__pyx_v_off0 == __pyx_v_off1);
  if (__pyx_t_2) {

    /* "utils.pxd":1340
 * 
 *     if off0 == off1:
 *         return dt             # <<<<<<<<<<<<<<
 * 
 *     if off1 > off0:
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_dt);
    __pyx_r = __pyx_v_dt;
    goto __pyx_L0;

    /* "utils.pxd":1339
 *         off1 = tz_utcoffset_seconds(tz, dt_replace_fold(dt, 1))
 * 
 *     if off0 == off1:             # <<<<<<<<<<<<<<
 *         return dt
 * 
 */
  }

  /* "utils.pxd":1342
 *         return dt
 * 
 *     if off1 > off0:             # <<<<<<<<<<<<<<
 *         return dt_add(dt, 0, off1 - off0, 0)
 * 
 */
  __pyx_t_2 = (__pyx_v_off1 > __pyx_v_off0);
  if (__pyx_t_2) {

    /* "utils.pxd":1343
 * 
 *     if off1 > off0:
 *         return dt_add(dt, 0, off1 - off0, 0)             # <<<<<<<<<<<<<<
 * 
 *     raise ValueError("datetime '%s' is ambiguous." % dt)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5.__pyx_n = 3;
    __pyx_t_5.days = 0;
    __pyx_t_5.seconds = (__pyx_v_off1 - __pyx_v_off0);
    __pyx_t_5.microseconds = 0;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_add(__pyx_v_dt, &__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "utils.pxd":1342
 *         return dt
 * 
 *     if off1 > off0:             # <<<<<<<<<<<<<<
 *         return dt_add(dt, 0, off1 - off0, 0)
 * 
 */
  }

  /* "utils.pxd":1345
 *         return dt_add(dt, 0, off1 - off0, 0)
 * 
 *     raise ValueError("datetime '%s' is ambiguous." % dt)             # <<<<<<<<<<<<<<
 * 
 * # . conversion: to
 */
  __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_datetime_s_is_ambiguous, ((PyObject *)__pyx_v_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __PYX_ERR(5, 1345, __pyx_L1_error)

  /* "utils.pxd":1321
 *     return tz_utcoffset(dt.tzinfo, dt)
 * 
 * cdef inline datetime.datetime dt_normalize_tz(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Normalize the datetime to its tzinfo `<'datetime.datetime'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cytimes.utils.dt_normalize_tz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1348
 * 
 * # . conversion: to
 * cdef inline tm dt_to_tm(datetime.datetime dt, bint utc=False) except *:             # <<<<<<<<<<<<<<
 *     """Convert datetime to `<'struct:tm'>`.
 * 
 */

static CYTHON_INLINE struct tm __pyx_f_7cytimes_5utils_dt_to_tm(PyDateTime_DateTime *__pyx_v_dt, struct __pyx_opt_args_7cytimes_5utils_dt_to_tm *__pyx_optional_args) {
  int __pyx_v_utc = ((int)0);
  PyObject *__pyx_v_tz = 0;
  int __pyx_v_yy;
  int __pyx_v_mm;
  int __pyx_v_dd;
  int __pyx_v_isdst;
  PyDateTime_Delta *__pyx_v_utc_off = NULL;
  PyDateTime_Delta *__pyx_v_dst_off = NULL;
  struct tm __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils_dt_add __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_tz_dst __pyx_t_8;
  struct tm __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_tm", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_utc = __pyx_optional_args->utc;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_dt);

  /* "utils.pxd":1355
 *     """
 *     cdef:
 *         object tz = dt.tzinfo             # <<<<<<<<<<<<<<
 *         int yy, mm, dd, isdst
 * 
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "utils.pxd":1359
 * 
 *     # No timezone
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         isdst = 0 if utc else -1
 *         yy, mm, dd = dt.year, dt.month, dt.day
 */
  __pyx_t_2 = (__pyx_v_tz == Py_None);
  if (__pyx_t_2) {

    /* "utils.pxd":1360
 *     # No timezone
 *     if tz is None:
 *         isdst = 0 if utc else -1             # <<<<<<<<<<<<<<
 *         yy, mm, dd = dt.year, dt.month, dt.day
 * 
 */
    if (__pyx_v_utc) {
      __pyx_t_3 = 0;
    } else {
      __pyx_t_3 = -1;
    }
    __pyx_v_isdst = __pyx_t_3;

    /* "utils.pxd":1361
 *     if tz is None:
 *         isdst = 0 if utc else -1
 *         yy, mm, dd = dt.year, dt.month, dt.day             # <<<<<<<<<<<<<<
 * 
 *     # Has timezone
 */
    __pyx_t_3 = __pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt);
    __pyx_t_4 = __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt);
    __pyx_t_5 = __pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt);
    __pyx_v_yy = __pyx_t_3;
    __pyx_v_mm = __pyx_t_4;
    __pyx_v_dd = __pyx_t_5;

    /* "utils.pxd":1359
 * 
 *     # No timezone
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         isdst = 0 if utc else -1
 *         yy, mm, dd = dt.year, dt.month, dt.day
 */
    goto __pyx_L3;
  }

  /* "utils.pxd":1365
 *     # Has timezone
 *     else:
 *         if utc:             # <<<<<<<<<<<<<<
 *             utc_off = tz_utcoffset(tz, dt)
 *             if utc_off is not None:
 */
  /*else*/ {
    if (__pyx_v_utc) {

      /* "utils.pxd":1366
 *     else:
 *         if utc:
 *             utc_off = tz_utcoffset(tz, dt)             # <<<<<<<<<<<<<<
 *             if utc_off is not None:
 *                 dt = dt_add(
 */
      __pyx_t_6.__pyx_n = 1;
      __pyx_t_6.dt = __pyx_v_dt;
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_utcoffset(__pyx_v_tz, &__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1366, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_utc_off = ((PyDateTime_Delta *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "utils.pxd":1367
 *         if utc:
 *             utc_off = tz_utcoffset(tz, dt)
 *             if utc_off is not None:             # <<<<<<<<<<<<<<
 *                 dt = dt_add(
 *                     dt,
 */
      __pyx_t_2 = (((PyObject *)__pyx_v_utc_off) != Py_None);
      if (__pyx_t_2) {

        /* "utils.pxd":1368
 *             utc_off = tz_utcoffset(tz, dt)
 *             if utc_off is not None:
 *                 dt = dt_add(             # <<<<<<<<<<<<<<
 *                     dt,
 *                     -datetime.timedelta_days(utc_off),
 */
        __pyx_t_7.__pyx_n = 3;
        __pyx_t_7.days = (-__pyx_f_7cpython_8datetime_timedelta_days(((PyObject *)__pyx_v_utc_off)));
        __pyx_t_7.seconds = (-__pyx_f_7cpython_8datetime_timedelta_seconds(((PyObject *)__pyx_v_utc_off)));
        __pyx_t_7.microseconds = (-__pyx_f_7cpython_8datetime_timedelta_microseconds(((PyObject *)__pyx_v_utc_off)));
        __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_add(__pyx_v_dt, &__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1368, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_1));
        __pyx_t_1 = 0;

        /* "utils.pxd":1367
 *         if utc:
 *             utc_off = tz_utcoffset(tz, dt)
 *             if utc_off is not None:             # <<<<<<<<<<<<<<
 *                 dt = dt_add(
 *                     dt,
 */
      }

      /* "utils.pxd":1374
 *                     -datetime.timedelta_microseconds(utc_off),
 *                 )
 *             isdst = 0             # <<<<<<<<<<<<<<
 *         else:
 *             dst_off = tz_dst(tz, dt)
 */
      __pyx_v_isdst = 0;

      /* "utils.pxd":1365
 *     # Has timezone
 *     else:
 *         if utc:             # <<<<<<<<<<<<<<
 *             utc_off = tz_utcoffset(tz, dt)
 *             if utc_off is not None:
 */
      goto __pyx_L4;
    }

    /* "utils.pxd":1376
 *             isdst = 0
 *         else:
 *             dst_off = tz_dst(tz, dt)             # <<<<<<<<<<<<<<
 *             if dst_off is not None:
 *                 isdst = 1 if dst_off else 0
 */
    /*else*/ {
      __pyx_t_8.__pyx_n = 1;
      __pyx_t_8.dt = __pyx_v_dt;
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_dst(__pyx_v_tz, &__pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1376, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_dst_off = ((PyDateTime_Delta *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "utils.pxd":1377
 *         else:
 *             dst_off = tz_dst(tz, dt)
 *             if dst_off is not None:             # <<<<<<<<<<<<<<
 *                 isdst = 1 if dst_off else 0
 *             else:
 */
      __pyx_t_2 = (((PyObject *)__pyx_v_dst_off) != Py_None);
      if (__pyx_t_2) {

        /* "utils.pxd":1378
 *             dst_off = tz_dst(tz, dt)
 *             if dst_off is not None:
 *                 isdst = 1 if dst_off else 0             # <<<<<<<<<<<<<<
 *             else:
 *                 isdst = -1
 */
        __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_dst_off)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(5, 1378, __pyx_L1_error)
        if (__pyx_t_2) {
          __pyx_t_5 = 1;
        } else {
          __pyx_t_5 = 0;
        }
        __pyx_v_isdst = __pyx_t_5;

        /* "utils.pxd":1377
 *         else:
 *             dst_off = tz_dst(tz, dt)
 *             if dst_off is not None:             # <<<<<<<<<<<<<<
 *                 isdst = 1 if dst_off else 0
 *             else:
 */
        goto __pyx_L6;
      }

      /* "utils.pxd":1380
 *                 isdst = 1 if dst_off else 0
 *             else:
 *                 isdst = -1             # <<<<<<<<<<<<<<
 *         yy, mm, dd = dt.year, dt.month, dt.day
 * 
 */
      /*else*/ {
        __pyx_v_isdst = -1;
      }
      __pyx_L6:;
    }
    __pyx_L4:;

    /* "utils.pxd":1381
 *             else:
 *                 isdst = -1
 *         yy, mm, dd = dt.year, dt.month, dt.day             # <<<<<<<<<<<<<<
 * 
 *     # New 'struct:tm'
 */
    __pyx_t_5 = __pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt);
    __pyx_t_4 = __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt);
    __pyx_t_3 = __pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt);
    __pyx_v_yy = __pyx_t_5;
    __pyx_v_mm = __pyx_t_4;
    __pyx_v_dd = __pyx_t_3;
  }
  __pyx_L3:;

  /* "utils.pxd":1385
 *     # New 'struct:tm'
 *     return tm(
 *         dt.second, dt.minute, dt.hour,  # sec, min, hour             # <<<<<<<<<<<<<<
 *         dd, mm, yy,  # day, mon, year
 *         ymd_weekday(yy, mm, dd),  # wday
 */
  __pyx_t_9.tm_sec = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);
  __pyx_t_9.tm_min = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);
  __pyx_t_9.tm_hour = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);

  /* "utils.pxd":1386
 *     return tm(
 *         dt.second, dt.minute, dt.hour,  # sec, min, hour
 *         dd, mm, yy,  # day, mon, year             # <<<<<<<<<<<<<<
 *         ymd_weekday(yy, mm, dd),  # wday
 *         days_bf_month(yy, mm) + dd,  # yday
 */
  __pyx_t_9.tm_mday = __pyx_v_dd;
  __pyx_t_9.tm_mon = __pyx_v_mm;
  __pyx_t_9.tm_year = __pyx_v_yy;

  /* "utils.pxd":1387
 *         dt.second, dt.minute, dt.hour,  # sec, min, hour
 *         dd, mm, yy,  # day, mon, year
 *         ymd_weekday(yy, mm, dd),  # wday             # <<<<<<<<<<<<<<
 *         days_bf_month(yy, mm) + dd,  # yday
 *         isdst,  # isdst
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_ymd_weekday(__pyx_v_yy, __pyx_v_mm, __pyx_v_dd); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 1387, __pyx_L1_error)
  __pyx_t_9.tm_wday = __pyx_t_3;

  /* "utils.pxd":1388
 *         dd, mm, yy,  # day, mon, year
 *         ymd_weekday(yy, mm, dd),  # wday
 *         days_bf_month(yy, mm) + dd,  # yday             # <<<<<<<<<<<<<<
 *         isdst,  # isdst
 *     )
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_yy, __pyx_v_mm); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 1388, __pyx_L1_error)
  __pyx_t_9.tm_yday = (__pyx_t_3 + __pyx_v_dd);

  /* "utils.pxd":1389
 *         ymd_weekday(yy, mm, dd),  # wday
 *         days_bf_month(yy, mm) + dd,  # yday
 *         isdst,  # isdst             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_9.tm_isdst = __pyx_v_isdst;
  __pyx_r = __pyx_t_9;
  goto __pyx_L0;

  /* "utils.pxd":1348
 * 
 * # . conversion: to
 * cdef inline tm dt_to_tm(datetime.datetime dt, bint utc=False) except *:             # <<<<<<<<<<<<<<
 *     """Convert datetime to `<'struct:tm'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt_to_tm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XDECREF((PyObject *)__pyx_v_utc_off);
  __Pyx_XDECREF((PyObject *)__pyx_v_dst_off);
  __Pyx_XDECREF((PyObject *)__pyx_v_dt);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1392
 *     )
 * 
 * cdef inline str dt_to_ctime(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Convert datetime to string in C time format `<'str'>`.
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_dt_to_ctime(PyDateTime_DateTime *__pyx_v_dt) {
  int __pyx_v_yy;
  int __pyx_v_mm;
  int __pyx_v_dd;
  int __pyx_v_wkd;
  PyObject *__pyx_v_weekday = 0;
  PyObject *__pyx_v_month = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_ctime", 1);

  /* "utils.pxd":1401
 * 
 *     # Weekday
 *     yy, mm, dd = dt.year, dt.month, dt.day             # <<<<<<<<<<<<<<
 *     wkd = ymd_weekday(yy, mm, dd)
 *     if wkd == 0:
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt);
  __pyx_t_2 = __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt);
  __pyx_t_3 = __pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt);
  __pyx_v_yy = __pyx_t_1;
  __pyx_v_mm = __pyx_t_2;
  __pyx_v_dd = __pyx_t_3;

  /* "utils.pxd":1402
 *     # Weekday
 *     yy, mm, dd = dt.year, dt.month, dt.day
 *     wkd = ymd_weekday(yy, mm, dd)             # <<<<<<<<<<<<<<
 *     if wkd == 0:
 *         weekday = "Mon"
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_ymd_weekday(__pyx_v_yy, __pyx_v_mm, __pyx_v_dd); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 1402, __pyx_L1_error)
  __pyx_v_wkd = __pyx_t_3;

  /* "utils.pxd":1403
 *     yy, mm, dd = dt.year, dt.month, dt.day
 *     wkd = ymd_weekday(yy, mm, dd)
 *     if wkd == 0:             # <<<<<<<<<<<<<<
 *         weekday = "Mon"
 *     elif wkd == 1:
 */
  switch (__pyx_v_wkd) {
    case 0:

    /* "utils.pxd":1404
 *     wkd = ymd_weekday(yy, mm, dd)
 *     if wkd == 0:
 *         weekday = "Mon"             # <<<<<<<<<<<<<<
 *     elif wkd == 1:
 *         weekday = "Tue"
 */
    __Pyx_INCREF(__pyx_n_u_Mon);
    __pyx_v_weekday = __pyx_n_u_Mon;

    /* "utils.pxd":1403
 *     yy, mm, dd = dt.year, dt.month, dt.day
 *     wkd = ymd_weekday(yy, mm, dd)
 *     if wkd == 0:             # <<<<<<<<<<<<<<
 *         weekday = "Mon"
 *     elif wkd == 1:
 */
    break;
    case 1:

    /* "utils.pxd":1406
 *         weekday = "Mon"
 *     elif wkd == 1:
 *         weekday = "Tue"             # <<<<<<<<<<<<<<
 *     elif wkd == 2:
 *         weekday = "Wed"
 */
    __Pyx_INCREF(__pyx_n_u_Tue);
    __pyx_v_weekday = __pyx_n_u_Tue;

    /* "utils.pxd":1405
 *     if wkd == 0:
 *         weekday = "Mon"
 *     elif wkd == 1:             # <<<<<<<<<<<<<<
 *         weekday = "Tue"
 *     elif wkd == 2:
 */
    break;
    case 2:

    /* "utils.pxd":1408
 *         weekday = "Tue"
 *     elif wkd == 2:
 *         weekday = "Wed"             # <<<<<<<<<<<<<<
 *     elif wkd == 3:
 *         weekday = "Thu"
 */
    __Pyx_INCREF(__pyx_n_u_Wed);
    __pyx_v_weekday = __pyx_n_u_Wed;

    /* "utils.pxd":1407
 *     elif wkd == 1:
 *         weekday = "Tue"
 *     elif wkd == 2:             # <<<<<<<<<<<<<<
 *         weekday = "Wed"
 *     elif wkd == 3:
 */
    break;
    case 3:

    /* "utils.pxd":1410
 *         weekday = "Wed"
 *     elif wkd == 3:
 *         weekday = "Thu"             # <<<<<<<<<<<<<<
 *     elif wkd == 4:
 *         weekday = "Fri"
 */
    __Pyx_INCREF(__pyx_n_u_Thu);
    __pyx_v_weekday = __pyx_n_u_Thu;

    /* "utils.pxd":1409
 *     elif wkd == 2:
 *         weekday = "Wed"
 *     elif wkd == 3:             # <<<<<<<<<<<<<<
 *         weekday = "Thu"
 *     elif wkd == 4:
 */
    break;
    case 4:

    /* "utils.pxd":1412
 *         weekday = "Thu"
 *     elif wkd == 4:
 *         weekday = "Fri"             # <<<<<<<<<<<<<<
 *     elif wkd == 5:
 *         weekday = "Sat"
 */
    __Pyx_INCREF(__pyx_n_u_Fri);
    __pyx_v_weekday = __pyx_n_u_Fri;

    /* "utils.pxd":1411
 *     elif wkd == 3:
 *         weekday = "Thu"
 *     elif wkd == 4:             # <<<<<<<<<<<<<<
 *         weekday = "Fri"
 *     elif wkd == 5:
 */
    break;
    case 5:

    /* "utils.pxd":1414
 *         weekday = "Fri"
 *     elif wkd == 5:
 *         weekday = "Sat"             # <<<<<<<<<<<<<<
 *     else:
 *         weekday = "Sun"
 */
    __Pyx_INCREF(__pyx_n_u_Sat);
    __pyx_v_weekday = __pyx_n_u_Sat;

    /* "utils.pxd":1413
 *     elif wkd == 4:
 *         weekday = "Fri"
 *     elif wkd == 5:             # <<<<<<<<<<<<<<
 *         weekday = "Sat"
 *     else:
 */
    break;
    default:

    /* "utils.pxd":1416
 *         weekday = "Sat"
 *     else:
 *         weekday = "Sun"             # <<<<<<<<<<<<<<
 * 
 *     # Month
 */
    __Pyx_INCREF(__pyx_n_u_Sun);
    __pyx_v_weekday = __pyx_n_u_Sun;
    break;
  }

  /* "utils.pxd":1419
 * 
 *     # Month
 *     if mm == 1:             # <<<<<<<<<<<<<<
 *         month = "Jan"
 *     elif mm == 2:
 */
  switch (__pyx_v_mm) {
    case 1:

    /* "utils.pxd":1420
 *     # Month
 *     if mm == 1:
 *         month = "Jan"             # <<<<<<<<<<<<<<
 *     elif mm == 2:
 *         month = "Feb"
 */
    __Pyx_INCREF(__pyx_n_u_Jan);
    __pyx_v_month = __pyx_n_u_Jan;

    /* "utils.pxd":1419
 * 
 *     # Month
 *     if mm == 1:             # <<<<<<<<<<<<<<
 *         month = "Jan"
 *     elif mm == 2:
 */
    break;
    case 2:

    /* "utils.pxd":1422
 *         month = "Jan"
 *     elif mm == 2:
 *         month = "Feb"             # <<<<<<<<<<<<<<
 *     elif mm == 3:
 *         month = "Mar"
 */
    __Pyx_INCREF(__pyx_n_u_Feb);
    __pyx_v_month = __pyx_n_u_Feb;

    /* "utils.pxd":1421
 *     if mm == 1:
 *         month = "Jan"
 *     elif mm == 2:             # <<<<<<<<<<<<<<
 *         month = "Feb"
 *     elif mm == 3:
 */
    break;
    case 3:

    /* "utils.pxd":1424
 *         month = "Feb"
 *     elif mm == 3:
 *         month = "Mar"             # <<<<<<<<<<<<<<
 *     elif mm == 4:
 *         month = "Apr"
 */
    __Pyx_INCREF(__pyx_n_u_Mar);
    __pyx_v_month = __pyx_n_u_Mar;

    /* "utils.pxd":1423
 *     elif mm == 2:
 *         month = "Feb"
 *     elif mm == 3:             # <<<<<<<<<<<<<<
 *         month = "Mar"
 *     elif mm == 4:
 */
    break;
    case 4:

    /* "utils.pxd":1426
 *         month = "Mar"
 *     elif mm == 4:
 *         month = "Apr"             # <<<<<<<<<<<<<<
 *     elif mm == 5:
 *         month = "May"
 */
    __Pyx_INCREF(__pyx_n_u_Apr);
    __pyx_v_month = __pyx_n_u_Apr;

    /* "utils.pxd":1425
 *     elif mm == 3:
 *         month = "Mar"
 *     elif mm == 4:             # <<<<<<<<<<<<<<
 *         month = "Apr"
 *     elif mm == 5:
 */
    break;
    case 5:

    /* "utils.pxd":1428
 *         month = "Apr"
 *     elif mm == 5:
 *         month = "May"             # <<<<<<<<<<<<<<
 *     elif mm == 6:
 *         month = "Jun"
 */
    __Pyx_INCREF(__pyx_n_u_May);
    __pyx_v_month = __pyx_n_u_May;

    /* "utils.pxd":1427
 *     elif mm == 4:
 *         month = "Apr"
 *     elif mm == 5:             # <<<<<<<<<<<<<<
 *         month = "May"
 *     elif mm == 6:
 */
    break;
    case 6:

    /* "utils.pxd":1430
 *         month = "May"
 *     elif mm == 6:
 *         month = "Jun"             # <<<<<<<<<<<<<<
 *     elif mm == 7:
 *         month = "Jul"
 */
    __Pyx_INCREF(__pyx_n_u_Jun);
    __pyx_v_month = __pyx_n_u_Jun;

    /* "utils.pxd":1429
 *     elif mm == 5:
 *         month = "May"
 *     elif mm == 6:             # <<<<<<<<<<<<<<
 *         month = "Jun"
 *     elif mm == 7:
 */
    break;
    case 7:

    /* "utils.pxd":1432
 *         month = "Jun"
 *     elif mm == 7:
 *         month = "Jul"             # <<<<<<<<<<<<<<
 *     elif mm == 8:
 *         month = "Aug"
 */
    __Pyx_INCREF(__pyx_n_u_Jul);
    __pyx_v_month = __pyx_n_u_Jul;

    /* "utils.pxd":1431
 *     elif mm == 6:
 *         month = "Jun"
 *     elif mm == 7:             # <<<<<<<<<<<<<<
 *         month = "Jul"
 *     elif mm == 8:
 */
    break;
    case 8:

    /* "utils.pxd":1434
 *         month = "Jul"
 *     elif mm == 8:
 *         month = "Aug"             # <<<<<<<<<<<<<<
 *     elif mm == 9:
 *         month = "Sep"
 */
    __Pyx_INCREF(__pyx_n_u_Aug);
    __pyx_v_month = __pyx_n_u_Aug;

    /* "utils.pxd":1433
 *     elif mm == 7:
 *         month = "Jul"
 *     elif mm == 8:             # <<<<<<<<<<<<<<
 *         month = "Aug"
 *     elif mm == 9:
 */
    break;
    case 9:

    /* "utils.pxd":1436
 *         month = "Aug"
 *     elif mm == 9:
 *         month = "Sep"             # <<<<<<<<<<<<<<
 *     elif mm == 10:
 *         month = "Oct"
 */
    __Pyx_INCREF(__pyx_n_u_Sep);
    __pyx_v_month = __pyx_n_u_Sep;

    /* "utils.pxd":1435
 *     elif mm == 8:
 *         month = "Aug"
 *     elif mm == 9:             # <<<<<<<<<<<<<<
 *         month = "Sep"
 *     elif mm == 10:
 */
    break;
    case 10:

    /* "utils.pxd":1438
 *         month = "Sep"
 *     elif mm == 10:
 *         month = "Oct"             # <<<<<<<<<<<<<<
 *     elif mm == 11:
 *         month = "Nov"
 */
    __Pyx_INCREF(__pyx_n_u_Oct);
    __pyx_v_month = __pyx_n_u_Oct;

    /* "utils.pxd":1437
 *     elif mm == 9:
 *         month = "Sep"
 *     elif mm == 10:             # <<<<<<<<<<<<<<
 *         month = "Oct"
 *     elif mm == 11:
 */
    break;
    case 11:

    /* "utils.pxd":1440
 *         month = "Oct"
 *     elif mm == 11:
 *         month = "Nov"             # <<<<<<<<<<<<<<
 *     else:
 *         month = "Dec"
 */
    __Pyx_INCREF(__pyx_n_u_Nov);
    __pyx_v_month = __pyx_n_u_Nov;

    /* "utils.pxd":1439
 *     elif mm == 10:
 *         month = "Oct"
 *     elif mm == 11:             # <<<<<<<<<<<<<<
 *         month = "Nov"
 *     else:
 */
    break;
    default:

    /* "utils.pxd":1442
 *         month = "Nov"
 *     else:
 *         month = "Dec"             # <<<<<<<<<<<<<<
 * 
 *     # Fromat
 */
    __Pyx_INCREF(__pyx_n_u_Dec);
    __pyx_v_month = __pyx_n_u_Dec;
    break;
  }

  /* "utils.pxd":1445
 * 
 *     # Fromat
 *     return "%s %s %2d %02d:%02d:%02d %04d" % (             # <<<<<<<<<<<<<<
 *         weekday, month, dd, dt.hour, dt.minute, dt.second, yy
 *     )
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyTuple_New(13); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 0;
  __pyx_t_6 = 127;

  /* "utils.pxd":1446
 *     # Fromat
 *     return "%s %s %2d %02d:%02d:%02d %04d" % (
 *         weekday, month, dd, dt.hour, dt.minute, dt.second, yy             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __Pyx_INCREF(__pyx_v_weekday);
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_weekday) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_weekday) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_weekday);
  __Pyx_GIVEREF(__pyx_v_weekday);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_weekday);
  __Pyx_INCREF(__pyx_kp_u__10);
  __pyx_t_5 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__10);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_kp_u__10);
  __Pyx_INCREF(__pyx_v_month);
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_month) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_month) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_month);
  __Pyx_GIVEREF(__pyx_v_month);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_month);
  __Pyx_INCREF(__pyx_kp_u__10);
  __pyx_t_5 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__10);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_kp_u__10);
  __pyx_t_7 = __Pyx_PyUnicode_From_int(__pyx_v_dd, 2, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u__10);
  __pyx_t_5 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__10);
  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_kp_u__10);
  __pyx_t_7 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u__11);
  __pyx_t_5 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__11);
  PyTuple_SET_ITEM(__pyx_t_4, 7, __pyx_kp_u__11);
  __pyx_t_7 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_4, 8, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u__11);
  __pyx_t_5 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__11);
  PyTuple_SET_ITEM(__pyx_t_4, 9, __pyx_kp_u__11);
  __pyx_t_7 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_4, 10, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u__10);
  __pyx_t_5 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__10);
  PyTuple_SET_ITEM(__pyx_t_4, 11, __pyx_kp_u__10);
  __pyx_t_7 = __Pyx_PyUnicode_From_int(__pyx_v_yy, 4, '0', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_4, 12, __pyx_t_7);
  __pyx_t_7 = 0;

  /* "utils.pxd":1445
 * 
 *     # Fromat
 *     return "%s %s %2d %02d:%02d:%02d %04d" % (             # <<<<<<<<<<<<<<
 *         weekday, month, dd, dt.hour, dt.minute, dt.second, yy
 *     )
 */
  __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_4, 13, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1392
 *     )
 * 
 * cdef inline str dt_to_ctime(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Convert datetime to string in C time format `<'str'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytimes.utils.dt_to_ctime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_weekday);
  __Pyx_XDECREF(__pyx_v_month);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1449
 *     )
 * 
 * cdef inline str dt_to_strformat(datetime.datetime dt, str fmt):             # <<<<<<<<<<<<<<
 *     """Convert datetime to string according to the given format `<'str'>`.
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_dt_to_strformat(PyDateTime_DateTime *__pyx_v_dt, PyObject *__pyx_v_fmt) {
  PyObject *__pyx_v_fmt_l = 0;
  Py_ssize_t __pyx_v_size;
  Py_ssize_t __pyx_v_idx;
  PyObject *__pyx_v_frepl = 0;
  PyObject *__pyx_v_zrepl = 0;
  PyObject *__pyx_v_Zrepl = 0;
  Py_UCS4 __pyx_v_ch;
  PyObject *__pyx_v_utcfmt = NULL;
  PyObject *__pyx_v_tzname = NULL;
  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;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  int __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcformat __pyx_t_9;
  struct tm __pyx_t_10;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_tm __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_strformat", 1);

  /* "utils.pxd":1456
 *     """
 *     cdef:
 *         list fmt_l = []             # <<<<<<<<<<<<<<
 *         Py_ssize_t size, idx
 *         str frepl, zrepl, Zrepl
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_fmt_l = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":1462
 * 
 *     # Escape format
 *     size, idx = str_len(fmt), 0             # <<<<<<<<<<<<<<
 *     frepl, zrepl, Zrepl = None, None, None
 *     while idx < size:
 */
  __pyx_t_2 = PyUnicode_GET_LENGTH(__pyx_v_fmt);
  __pyx_t_3 = 0;
  __pyx_v_size = __pyx_t_2;
  __pyx_v_idx = __pyx_t_3;

  /* "utils.pxd":1463
 *     # Escape format
 *     size, idx = str_len(fmt), 0
 *     frepl, zrepl, Zrepl = None, None, None             # <<<<<<<<<<<<<<
 *     while idx < size:
 *         ch = str_read(fmt, idx)
 */
  __pyx_t_1 = Py_None;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_4 = Py_None;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = Py_None;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_v_frepl = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_v_zrepl = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_v_Zrepl = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "utils.pxd":1464
 *     size, idx = str_len(fmt), 0
 *     frepl, zrepl, Zrepl = None, None, None
 *     while idx < size:             # <<<<<<<<<<<<<<
 *         ch = str_read(fmt, idx)
 *         idx += 1
 */
  while (1) {
    __pyx_t_6 = (__pyx_v_idx < __pyx_v_size);
    if (!__pyx_t_6) break;

    /* "utils.pxd":1465
 *     frepl, zrepl, Zrepl = None, None, None
 *     while idx < size:
 *         ch = str_read(fmt, idx)             # <<<<<<<<<<<<<<
 *         idx += 1
 *         # Format identifier: '%'
 */
    __pyx_t_7 = PyUnicode_ReadChar(__pyx_v_fmt, __pyx_v_idx); if (unlikely(__pyx_t_7 == ((Py_UCS4)-1))) __PYX_ERR(5, 1465, __pyx_L1_error)
    __pyx_v_ch = __pyx_t_7;

    /* "utils.pxd":1466
 *     while idx < size:
 *         ch = str_read(fmt, idx)
 *         idx += 1             # <<<<<<<<<<<<<<
 *         # Format identifier: '%'
 *         if ch == "%":
 */
    __pyx_v_idx = (__pyx_v_idx + 1);

    /* "utils.pxd":1468
 *         idx += 1
 *         # Format identifier: '%'
 *         if ch == "%":             # <<<<<<<<<<<<<<
 *             if idx < size:
 *                 ch = str_read(fmt, idx)
 */
    __pyx_t_6 = (__pyx_v_ch == 37);
    if (__pyx_t_6) {

      /* "utils.pxd":1469
 *         # Format identifier: '%'
 *         if ch == "%":
 *             if idx < size:             # <<<<<<<<<<<<<<
 *                 ch = str_read(fmt, idx)
 *                 idx += 1
 */
      __pyx_t_6 = (__pyx_v_idx < __pyx_v_size);
      if (__pyx_t_6) {

        /* "utils.pxd":1470
 *         if ch == "%":
 *             if idx < size:
 *                 ch = str_read(fmt, idx)             # <<<<<<<<<<<<<<
 *                 idx += 1
 *                 # . fraction replacement
 */
        __pyx_t_7 = PyUnicode_ReadChar(__pyx_v_fmt, __pyx_v_idx); if (unlikely(__pyx_t_7 == ((Py_UCS4)-1))) __PYX_ERR(5, 1470, __pyx_L1_error)
        __pyx_v_ch = __pyx_t_7;

        /* "utils.pxd":1471
 *             if idx < size:
 *                 ch = str_read(fmt, idx)
 *                 idx += 1             # <<<<<<<<<<<<<<
 *                 # . fraction replacement
 *                 if ch == "f":
 */
        __pyx_v_idx = (__pyx_v_idx + 1);

        /* "utils.pxd":1473
 *                 idx += 1
 *                 # . fraction replacement
 *                 if ch == "f":             # <<<<<<<<<<<<<<
 *                     if frepl is None:
 *                         frepl = "%06d" % dt.microsecond
 */
        switch (__pyx_v_ch) {
          case 0x66:

          /* "utils.pxd":1474
 *                 # . fraction replacement
 *                 if ch == "f":
 *                     if frepl is None:             # <<<<<<<<<<<<<<
 *                         frepl = "%06d" % dt.microsecond
 *                     fmt_l.append(frepl)
 */
          __pyx_t_6 = (__pyx_v_frepl == ((PyObject*)Py_None));
          if (__pyx_t_6) {

            /* "utils.pxd":1475
 *                 if ch == "f":
 *                     if frepl is None:
 *                         frepl = "%06d" % dt.microsecond             # <<<<<<<<<<<<<<
 *                     fmt_l.append(frepl)
 *                 # . utc offset replacement
 */
            __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1475, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_06d, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1475, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF_SET(__pyx_v_frepl, ((PyObject*)__pyx_t_4));
            __pyx_t_4 = 0;

            /* "utils.pxd":1474
 *                 # . fraction replacement
 *                 if ch == "f":
 *                     if frepl is None:             # <<<<<<<<<<<<<<
 *                         frepl = "%06d" % dt.microsecond
 *                     fmt_l.append(frepl)
 */
          }

          /* "utils.pxd":1476
 *                     if frepl is None:
 *                         frepl = "%06d" % dt.microsecond
 *                     fmt_l.append(frepl)             # <<<<<<<<<<<<<<
 *                 # . utc offset replacement
 *                 elif ch == "z":
 */
          __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_fmt_l, __pyx_v_frepl); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 1476, __pyx_L1_error)

          /* "utils.pxd":1473
 *                 idx += 1
 *                 # . fraction replacement
 *                 if ch == "f":             # <<<<<<<<<<<<<<
 *                     if frepl is None:
 *                         frepl = "%06d" % dt.microsecond
 */
          break;
          case 0x7A:

          /* "utils.pxd":1479
 *                 # . utc offset replacement
 *                 elif ch == "z":
 *                     if zrepl is None:             # <<<<<<<<<<<<<<
 *                         utcfmt = tz_utcformat(dt.tzinfo, dt)
 *                         zrepl = "" if utcfmt is None else utcfmt
 */
          __pyx_t_6 = (__pyx_v_zrepl == ((PyObject*)Py_None));
          if (__pyx_t_6) {

            /* "utils.pxd":1480
 *                 elif ch == "z":
 *                     if zrepl is None:
 *                         utcfmt = tz_utcformat(dt.tzinfo, dt)             # <<<<<<<<<<<<<<
 *                         zrepl = "" if utcfmt is None else utcfmt
 *                     fmt_l.append(zrepl)
 */
            __pyx_t_4 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1480, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_9.__pyx_n = 1;
            __pyx_t_9.dt = __pyx_v_dt;
            __pyx_t_5 = __pyx_f_7cytimes_5utils_tz_utcformat(__pyx_t_4, &__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1480, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_XDECREF_SET(__pyx_v_utcfmt, ((PyObject*)__pyx_t_5));
            __pyx_t_5 = 0;

            /* "utils.pxd":1481
 *                     if zrepl is None:
 *                         utcfmt = tz_utcformat(dt.tzinfo, dt)
 *                         zrepl = "" if utcfmt is None else utcfmt             # <<<<<<<<<<<<<<
 *                     fmt_l.append(zrepl)
 *                 # . timezone name replacement
 */
            __pyx_t_6 = (__pyx_v_utcfmt == ((PyObject*)Py_None));
            if (__pyx_t_6) {
              __Pyx_INCREF(__pyx_kp_u__12);
              __pyx_t_5 = __pyx_kp_u__12;
            } else {
              __Pyx_INCREF(__pyx_v_utcfmt);
              __pyx_t_5 = __pyx_v_utcfmt;
            }
            __Pyx_DECREF_SET(__pyx_v_zrepl, ((PyObject*)__pyx_t_5));
            __pyx_t_5 = 0;

            /* "utils.pxd":1479
 *                 # . utc offset replacement
 *                 elif ch == "z":
 *                     if zrepl is None:             # <<<<<<<<<<<<<<
 *                         utcfmt = tz_utcformat(dt.tzinfo, dt)
 *                         zrepl = "" if utcfmt is None else utcfmt
 */
          }

          /* "utils.pxd":1482
 *                         utcfmt = tz_utcformat(dt.tzinfo, dt)
 *                         zrepl = "" if utcfmt is None else utcfmt
 *                     fmt_l.append(zrepl)             # <<<<<<<<<<<<<<
 *                 # . timezone name replacement
 *                 elif ch == "Z":
 */
          __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_fmt_l, __pyx_v_zrepl); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 1482, __pyx_L1_error)

          /* "utils.pxd":1478
 *                     fmt_l.append(frepl)
 *                 # . utc offset replacement
 *                 elif ch == "z":             # <<<<<<<<<<<<<<
 *                     if zrepl is None:
 *                         utcfmt = tz_utcformat(dt.tzinfo, dt)
 */
          break;
          case 90:

          /* "utils.pxd":1485
 *                 # . timezone name replacement
 *                 elif ch == "Z":
 *                     if Zrepl is None:             # <<<<<<<<<<<<<<
 *                         tzname = dt_tzname(dt)
 *                         Zrepl = "" if tzname is None else tzname
 */
          __pyx_t_6 = (__pyx_v_Zrepl == ((PyObject*)Py_None));
          if (__pyx_t_6) {

            /* "utils.pxd":1486
 *                 elif ch == "Z":
 *                     if Zrepl is None:
 *                         tzname = dt_tzname(dt)             # <<<<<<<<<<<<<<
 *                         Zrepl = "" if tzname is None else tzname
 *                     fmt_l.append(Zrepl)
 */
            __pyx_t_5 = __pyx_f_7cytimes_5utils_dt_tzname(__pyx_v_dt); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1486, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_XDECREF_SET(__pyx_v_tzname, ((PyObject*)__pyx_t_5));
            __pyx_t_5 = 0;

            /* "utils.pxd":1487
 *                     if Zrepl is None:
 *                         tzname = dt_tzname(dt)
 *                         Zrepl = "" if tzname is None else tzname             # <<<<<<<<<<<<<<
 *                     fmt_l.append(Zrepl)
 *                 # . not applicable
 */
            __pyx_t_6 = (__pyx_v_tzname == ((PyObject*)Py_None));
            if (__pyx_t_6) {
              __Pyx_INCREF(__pyx_kp_u__12);
              __pyx_t_5 = __pyx_kp_u__12;
            } else {
              __Pyx_INCREF(__pyx_v_tzname);
              __pyx_t_5 = __pyx_v_tzname;
            }
            __Pyx_DECREF_SET(__pyx_v_Zrepl, ((PyObject*)__pyx_t_5));
            __pyx_t_5 = 0;

            /* "utils.pxd":1485
 *                 # . timezone name replacement
 *                 elif ch == "Z":
 *                     if Zrepl is None:             # <<<<<<<<<<<<<<
 *                         tzname = dt_tzname(dt)
 *                         Zrepl = "" if tzname is None else tzname
 */
          }

          /* "utils.pxd":1488
 *                         tzname = dt_tzname(dt)
 *                         Zrepl = "" if tzname is None else tzname
 *                     fmt_l.append(Zrepl)             # <<<<<<<<<<<<<<
 *                 # . not applicable
 *                 else:
 */
          __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_fmt_l, __pyx_v_Zrepl); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 1488, __pyx_L1_error)

          /* "utils.pxd":1484
 *                     fmt_l.append(zrepl)
 *                 # . timezone name replacement
 *                 elif ch == "Z":             # <<<<<<<<<<<<<<
 *                     if Zrepl is None:
 *                         tzname = dt_tzname(dt)
 */
          break;
          default:

          /* "utils.pxd":1491
 *                 # . not applicable
 *                 else:
 *                     fmt_l.append("%")             # <<<<<<<<<<<<<<
 *                     fmt_l.append(str_chr(ch))
 *             # eof
 */
          __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_fmt_l, __pyx_kp_u__13); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 1491, __pyx_L1_error)

          /* "utils.pxd":1492
 *                 else:
 *                     fmt_l.append("%")
 *                     fmt_l.append(str_chr(ch))             # <<<<<<<<<<<<<<
 *             # eof
 *             else:
 */
          __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_v_ch); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1492, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_fmt_l, __pyx_t_5); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 1492, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          break;
        }

        /* "utils.pxd":1469
 *         # Format identifier: '%'
 *         if ch == "%":
 *             if idx < size:             # <<<<<<<<<<<<<<
 *                 ch = str_read(fmt, idx)
 *                 idx += 1
 */
        goto __pyx_L6;
      }

      /* "utils.pxd":1495
 *             # eof
 *             else:
 *                 fmt_l.append("%")             # <<<<<<<<<<<<<<
 *         # Normal character
 *         else:
 */
      /*else*/ {
        __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_fmt_l, __pyx_kp_u__13); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 1495, __pyx_L1_error)
      }
      __pyx_L6:;

      /* "utils.pxd":1468
 *         idx += 1
 *         # Format identifier: '%'
 *         if ch == "%":             # <<<<<<<<<<<<<<
 *             if idx < size:
 *                 ch = str_read(fmt, idx)
 */
      goto __pyx_L5;
    }

    /* "utils.pxd":1498
 *         # Normal character
 *         else:
 *             fmt_l.append(str_chr(ch))             # <<<<<<<<<<<<<<
 * 
 *     # Format to string
 */
    /*else*/ {
      __pyx_t_5 = PyUnicode_FromOrdinal(__pyx_v_ch); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1498, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_fmt_l, __pyx_t_5); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 1498, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_L5:;
  }

  /* "utils.pxd":1501
 * 
 *     # Format to string
 *     return tm_strftime(dt_to_tm(dt, False), "".join(fmt_l))             # <<<<<<<<<<<<<<
 * 
 * cdef inline str dt_to_isoformat(datetime.datetime dt, str sep="T", bint utc=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_11.__pyx_n = 1;
  __pyx_t_11.utc = 0;
  __pyx_t_10 = __pyx_f_7cytimes_5utils_dt_to_tm(__pyx_v_dt, &__pyx_t_11); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1501, __pyx_L1_error)
  __pyx_t_5 = PyUnicode_Join(__pyx_kp_u__12, __pyx_v_fmt_l); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __pyx_f_7cytimes_5utils_tm_strftime(__pyx_t_10, ((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1449
 *     )
 * 
 * cdef inline str dt_to_strformat(datetime.datetime dt, str fmt):             # <<<<<<<<<<<<<<
 *     """Convert datetime to string according to the given format `<'str'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils.dt_to_strformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fmt_l);
  __Pyx_XDECREF(__pyx_v_frepl);
  __Pyx_XDECREF(__pyx_v_zrepl);
  __Pyx_XDECREF(__pyx_v_Zrepl);
  __Pyx_XDECREF(__pyx_v_utcfmt);
  __Pyx_XDECREF(__pyx_v_tzname);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1503
 *     return tm_strftime(dt_to_tm(dt, False), "".join(fmt_l))
 * 
 * cdef inline str dt_to_isoformat(datetime.datetime dt, str sep="T", bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert datetime to string in ISO format `<'str'>`.
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_dt_to_isoformat(PyDateTime_DateTime *__pyx_v_dt, struct __pyx_opt_args_7cytimes_5utils_dt_to_isoformat *__pyx_optional_args) {
  PyObject *__pyx_v_sep = ((PyObject*)__pyx_n_u_T);
  int __pyx_v_utc = ((int)0);
  int __pyx_v_us;
  PyObject *__pyx_v_utc_fmt = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcformat __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_isoformat", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_sep = __pyx_optional_args->sep;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_utc = __pyx_optional_args->utc;
      }
    }
  }

  /* "utils.pxd":1510
 *     """
 *     cdef:
 *         int us = dt.microsecond             # <<<<<<<<<<<<<<
 *         str utc_fmt = tz_utcformat(dt.tzinfo, dt) if utc else None
 * 
 */
  __pyx_v_us = __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt);

  /* "utils.pxd":1511
 *     cdef:
 *         int us = dt.microsecond
 *         str utc_fmt = tz_utcformat(dt.tzinfo, dt) if utc else None             # <<<<<<<<<<<<<<
 * 
 *     if us == 0:
 */
  if (__pyx_v_utc) {
    __pyx_t_2 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.dt = __pyx_v_dt;
    __pyx_t_3 = __pyx_f_7cytimes_5utils_tz_utcformat(__pyx_t_2, &__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(5, 1511, __pyx_L1_error)
  __pyx_v_utc_fmt = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":1513
 *         str utc_fmt = tz_utcformat(dt.tzinfo, dt) if utc else None
 * 
 *     if us == 0:             # <<<<<<<<<<<<<<
 *         if utc_fmt is None:
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d" % (
 */
  __pyx_t_5 = (__pyx_v_us == 0);
  if (__pyx_t_5) {

    /* "utils.pxd":1514
 * 
 *     if us == 0:
 *         if utc_fmt is None:             # <<<<<<<<<<<<<<
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d" % (
 *                 dt.year, dt.month, dt.day, sep,
 */
    __pyx_t_5 = (__pyx_v_utc_fmt == ((PyObject*)Py_None));
    if (__pyx_t_5) {

      /* "utils.pxd":1515
 *     if us == 0:
 *         if utc_fmt is None:
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d" % (             # <<<<<<<<<<<<<<
 *                 dt.year, dt.month, dt.day, sep,
 *                 dt.hour, dt.minute, dt.second,
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyTuple_New(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1515, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = 0;
      __pyx_t_7 = 127;

      /* "utils.pxd":1516
 *         if utc_fmt is None:
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d" % (
 *                 dt.year, dt.month, dt.day, sep,             # <<<<<<<<<<<<<<
 *                 dt.hour, dt.minute, dt.second,
 *             )
 */
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), 4, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__9);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__9);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__9);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__9);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__9);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__9);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyUnicode_Unicode(__pyx_v_sep); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_7;
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "utils.pxd":1517
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d" % (
 *                 dt.year, dt.month, dt.day, sep,
 *                 dt.hour, dt.minute, dt.second,             # <<<<<<<<<<<<<<
 *             )
 *         return "%04d-%02d-%02d%s%02d:%02d:%02d%s" % (
 */
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1517, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_kp_u__11);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1517, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_kp_u__11);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1517, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "utils.pxd":1515
 *     if us == 0:
 *         if utc_fmt is None:
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d" % (             # <<<<<<<<<<<<<<
 *                 dt.year, dt.month, dt.day, sep,
 *                 dt.hour, dt.minute, dt.second,
 */
      __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 11, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1515, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_r = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "utils.pxd":1514
 * 
 *     if us == 0:
 *         if utc_fmt is None:             # <<<<<<<<<<<<<<
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d" % (
 *                 dt.year, dt.month, dt.day, sep,
 */
    }

    /* "utils.pxd":1519
 *                 dt.hour, dt.minute, dt.second,
 *             )
 *         return "%04d-%02d-%02d%s%02d:%02d:%02d%s" % (             # <<<<<<<<<<<<<<
 *             dt.year, dt.month, dt.day, sep,
 *             dt.hour, dt.minute, dt.second, utc_fmt,
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(12); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;

    /* "utils.pxd":1520
 *             )
 *         return "%04d-%02d-%02d%s%02d:%02d:%02d%s" % (
 *             dt.year, dt.month, dt.day, sep,             # <<<<<<<<<<<<<<
 *             dt.hour, dt.minute, dt.second, utc_fmt,
 *         )
 */
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), 4, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__9);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__9);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u__9);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__9);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__9);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_kp_u__9);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_sep); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "utils.pxd":1521
 *         return "%04d-%02d-%02d%s%02d:%02d:%02d%s" % (
 *             dt.year, dt.month, dt.day, sep,
 *             dt.hour, dt.minute, dt.second, utc_fmt,             # <<<<<<<<<<<<<<
 *         )
 *     else:
 */
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_kp_u__11);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 8, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_3, 9, __pyx_kp_u__11);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 10, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_utc_fmt); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 11, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "utils.pxd":1519
 *                 dt.hour, dt.minute, dt.second,
 *             )
 *         return "%04d-%02d-%02d%s%02d:%02d:%02d%s" % (             # <<<<<<<<<<<<<<
 *             dt.year, dt.month, dt.day, sep,
 *             dt.hour, dt.minute, dt.second, utc_fmt,
 */
    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 12, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "utils.pxd":1513
 *         str utc_fmt = tz_utcformat(dt.tzinfo, dt) if utc else None
 * 
 *     if us == 0:             # <<<<<<<<<<<<<<
 *         if utc_fmt is None:
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d" % (
 */
  }

  /* "utils.pxd":1524
 *         )
 *     else:
 *         if utc_fmt is None:             # <<<<<<<<<<<<<<
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d.%06d" % (
 *                 dt.year, dt.month, dt.day, sep,
 */
  /*else*/ {
    __pyx_t_5 = (__pyx_v_utc_fmt == ((PyObject*)Py_None));
    if (__pyx_t_5) {

      /* "utils.pxd":1525
 *     else:
 *         if utc_fmt is None:
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d.%06d" % (             # <<<<<<<<<<<<<<
 *                 dt.year, dt.month, dt.day, sep,
 *                 dt.hour, dt.minute, dt.second, us,
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyTuple_New(13); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = 0;
      __pyx_t_7 = 127;

      /* "utils.pxd":1526
 *         if utc_fmt is None:
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d.%06d" % (
 *                 dt.year, dt.month, dt.day, sep,             # <<<<<<<<<<<<<<
 *                 dt.hour, dt.minute, dt.second, us,
 *             )
 */
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), 4, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1526, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__9);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__9);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__9);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1526, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__9);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__9);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__9);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1526, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyUnicode_Unicode(__pyx_v_sep); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1526, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_7;
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "utils.pxd":1527
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d.%06d" % (
 *                 dt.year, dt.month, dt.day, sep,
 *                 dt.hour, dt.minute, dt.second, us,             # <<<<<<<<<<<<<<
 *             )
 *         return "%04d-%02d-%02d%s%02d:%02d:%02d.%06d%s" % (
 */
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1527, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_kp_u__11);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1527, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_kp_u__11);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1527, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__14);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__14);
      PyTuple_SET_ITEM(__pyx_t_1, 11, __pyx_kp_u__14);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_us, 6, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1527, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 12, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "utils.pxd":1525
 *     else:
 *         if utc_fmt is None:
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d.%06d" % (             # <<<<<<<<<<<<<<
 *                 dt.year, dt.month, dt.day, sep,
 *                 dt.hour, dt.minute, dt.second, us,
 */
      __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 13, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_r = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "utils.pxd":1524
 *         )
 *     else:
 *         if utc_fmt is None:             # <<<<<<<<<<<<<<
 *             return "%04d-%02d-%02d%s%02d:%02d:%02d.%06d" % (
 *                 dt.year, dt.month, dt.day, sep,
 */
    }

    /* "utils.pxd":1529
 *                 dt.hour, dt.minute, dt.second, us,
 *             )
 *         return "%04d-%02d-%02d%s%02d:%02d:%02d.%06d%s" % (             # <<<<<<<<<<<<<<
 *             dt.year, dt.month, dt.day, sep,
 *             dt.hour, dt.minute, dt.second, us, utc_fmt,
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(14); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;

    /* "utils.pxd":1530
 *             )
 *         return "%04d-%02d-%02d%s%02d:%02d:%02d.%06d%s" % (
 *             dt.year, dt.month, dt.day, sep,             # <<<<<<<<<<<<<<
 *             dt.hour, dt.minute, dt.second, us, utc_fmt,
 *         )
 */
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), 4, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__9);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__9);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u__9);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__9);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__9);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_kp_u__9);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_sep); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "utils.pxd":1531
 *         return "%04d-%02d-%02d%s%02d:%02d:%02d.%06d%s" % (
 *             dt.year, dt.month, dt.day, sep,
 *             dt.hour, dt.minute, dt.second, us, utc_fmt,             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_kp_u__11);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 8, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_3, 9, __pyx_kp_u__11);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 10, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__14);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__14);
    PyTuple_SET_ITEM(__pyx_t_3, 11, __pyx_kp_u__14);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_us, 6, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 12, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_utc_fmt); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 13, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "utils.pxd":1529
 *                 dt.hour, dt.minute, dt.second, us,
 *             )
 *         return "%04d-%02d-%02d%s%02d:%02d:%02d.%06d%s" % (             # <<<<<<<<<<<<<<
 *             dt.year, dt.month, dt.day, sep,
 *             dt.hour, dt.minute, dt.second, us, utc_fmt,
 */
    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 14, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "utils.pxd":1503
 *     return tm_strftime(dt_to_tm(dt, False), "".join(fmt_l))
 * 
 * cdef inline str dt_to_isoformat(datetime.datetime dt, str sep="T", bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert datetime to string in ISO format `<'str'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.dt_to_isoformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_utc_fmt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1534
 *         )
 * 
 * cdef inline long long dt_to_us(datetime.datetime dt, bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert datetime to `EPOCH` microseconds `<'int'>`.
 * 
 */

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_dt_to_us(PyDateTime_DateTime *__pyx_v_dt, struct __pyx_opt_args_7cytimes_5utils_dt_to_us *__pyx_optional_args) {
  int __pyx_v_utc = ((int)0);
  PY_LONG_LONG __pyx_v_ordinal;
  PY_LONG_LONG __pyx_v_hh;
  PY_LONG_LONG __pyx_v_mi;
  PY_LONG_LONG __pyx_v_ss;
  PY_LONG_LONG __pyx_v_us;
  PyDateTime_Delta *__pyx_v_utc_off = NULL;
  PY_LONG_LONG __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_ordinal __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PY_LONG_LONG __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_us", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_utc = __pyx_optional_args->utc;
    }
  }

  /* "utils.pxd":1541
 *     """
 *     cdef:
 *         long long ordinal = dt_to_ordinal(dt, False)             # <<<<<<<<<<<<<<
 *         long long hh = dt.hour
 *         long long mi = dt.minute
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.utc = 0;
  __pyx_t_1 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 1541, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_1;

  /* "utils.pxd":1542
 *     cdef:
 *         long long ordinal = dt_to_ordinal(dt, False)
 *         long long hh = dt.hour             # <<<<<<<<<<<<<<
 *         long long mi = dt.minute
 *         long long ss = dt.second
 */
  __pyx_v_hh = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);

  /* "utils.pxd":1543
 *         long long ordinal = dt_to_ordinal(dt, False)
 *         long long hh = dt.hour
 *         long long mi = dt.minute             # <<<<<<<<<<<<<<
 *         long long ss = dt.second
 *         long long us = dt.microsecond
 */
  __pyx_v_mi = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);

  /* "utils.pxd":1544
 *         long long hh = dt.hour
 *         long long mi = dt.minute
 *         long long ss = dt.second             # <<<<<<<<<<<<<<
 *         long long us = dt.microsecond
 * 
 */
  __pyx_v_ss = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);

  /* "utils.pxd":1545
 *         long long mi = dt.minute
 *         long long ss = dt.second
 *         long long us = dt.microsecond             # <<<<<<<<<<<<<<
 * 
 *     us += (
 */
  __pyx_v_us = __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt);

  /* "utils.pxd":1547
 *         long long us = dt.microsecond
 * 
 *     us += (             # <<<<<<<<<<<<<<
 *         (ordinal - EPOCH_DAY) * US_DAY
 *         + hh * US_HOUR
 */
  __pyx_v_us = (__pyx_v_us + (((((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_US_DAY) + (__pyx_v_hh * __pyx_v_7cytimes_5utils_US_HOUR)) + (__pyx_v_mi * __pyx_v_7cytimes_5utils_US_MINUTE)) + (__pyx_v_ss * __pyx_v_7cytimes_5utils_US_SECOND)));

  /* "utils.pxd":1553
 *         + ss * US_SECOND
 *     )
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:
 */
  if (__pyx_v_utc) {

    /* "utils.pxd":1554
 *     )
 *     if utc:
 *         utc_off = dt_utcoffset(dt)             # <<<<<<<<<<<<<<
 *         if utc_off is not None:
 *             us -= td_to_us(utc_off)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_utcoffset(__pyx_v_dt)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_utc_off = ((PyDateTime_Delta *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "utils.pxd":1555
 *     if utc:
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             us -= td_to_us(utc_off)
 *     return us
 */
    __pyx_t_4 = (((PyObject *)__pyx_v_utc_off) != Py_None);
    if (__pyx_t_4) {

      /* "utils.pxd":1556
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:
 *             us -= td_to_us(utc_off)             # <<<<<<<<<<<<<<
 *     return us
 * 
 */
      __pyx_t_5 = __pyx_f_7cytimes_5utils_td_to_us(__pyx_v_utc_off); if (unlikely(__pyx_t_5 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 1556, __pyx_L1_error)
      __pyx_v_us = (__pyx_v_us - __pyx_t_5);

      /* "utils.pxd":1555
 *     if utc:
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             us -= td_to_us(utc_off)
 *     return us
 */
    }

    /* "utils.pxd":1553
 *         + ss * US_SECOND
 *     )
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:
 */
  }

  /* "utils.pxd":1557
 *         if utc_off is not None:
 *             us -= td_to_us(utc_off)
 *     return us             # <<<<<<<<<<<<<<
 * 
 * cdef inline double dt_to_seconds(datetime.datetime dt, bint utc=False):
 */
  __pyx_r = __pyx_v_us;
  goto __pyx_L0;

  /* "utils.pxd":1534
 *         )
 * 
 * cdef inline long long dt_to_us(datetime.datetime dt, bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert datetime to `EPOCH` microseconds `<'int'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.dt_to_us", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_utc_off);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1559
 *     return us
 * 
 * cdef inline double dt_to_seconds(datetime.datetime dt, bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert datetime to `EPOCH` seconds `<'float'>`.
 * 
 */

static CYTHON_INLINE double __pyx_f_7cytimes_5utils_dt_to_seconds(PyDateTime_DateTime *__pyx_v_dt, struct __pyx_opt_args_7cytimes_5utils_dt_to_seconds *__pyx_optional_args) {
  int __pyx_v_utc = ((int)0);
  double __pyx_v_ordinal;
  double __pyx_v_hh;
  double __pyx_v_mi;
  double __pyx_v_ss;
  double __pyx_v_us;
  PyDateTime_Delta *__pyx_v_utc_off = NULL;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_ordinal __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  double __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_seconds", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_utc = __pyx_optional_args->utc;
    }
  }

  /* "utils.pxd":1566
 *     """
 *     cdef:
 *         double ordinal = dt_to_ordinal(dt, False)             # <<<<<<<<<<<<<<
 *         double hh = dt.hour
 *         double mi = dt.minute
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.utc = 0;
  __pyx_t_1 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 1566, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_1;

  /* "utils.pxd":1567
 *     cdef:
 *         double ordinal = dt_to_ordinal(dt, False)
 *         double hh = dt.hour             # <<<<<<<<<<<<<<
 *         double mi = dt.minute
 *         double ss = dt.second
 */
  __pyx_v_hh = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);

  /* "utils.pxd":1568
 *         double ordinal = dt_to_ordinal(dt, False)
 *         double hh = dt.hour
 *         double mi = dt.minute             # <<<<<<<<<<<<<<
 *         double ss = dt.second
 *         double us = dt.microsecond
 */
  __pyx_v_mi = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);

  /* "utils.pxd":1569
 *         double hh = dt.hour
 *         double mi = dt.minute
 *         double ss = dt.second             # <<<<<<<<<<<<<<
 *         double us = dt.microsecond
 * 
 */
  __pyx_v_ss = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);

  /* "utils.pxd":1570
 *         double mi = dt.minute
 *         double ss = dt.second
 *         double us = dt.microsecond             # <<<<<<<<<<<<<<
 * 
 *     ss += (
 */
  __pyx_v_us = __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt);

  /* "utils.pxd":1572
 *         double us = dt.microsecond
 * 
 *     ss += (             # <<<<<<<<<<<<<<
 *         (ordinal - EPOCH_DAY) * SS_DAY
 *         + hh * SS_HOUR
 */
  __pyx_v_ss = (__pyx_v_ss + (((((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_SS_DAY) + (__pyx_v_hh * __pyx_v_7cytimes_5utils_SS_HOUR)) + (__pyx_v_mi * __pyx_v_7cytimes_5utils_SS_MINUTE)) + (__pyx_v_us / 1000000.0)));

  /* "utils.pxd":1578
 *         + us / 1_000_000
 *     )
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:
 */
  if (__pyx_v_utc) {

    /* "utils.pxd":1579
 *     )
 *     if utc:
 *         utc_off = dt_utcoffset(dt)             # <<<<<<<<<<<<<<
 *         if utc_off is not None:
 *             ss -= td_to_seconds(utc_off)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_utcoffset(__pyx_v_dt)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_utc_off = ((PyDateTime_Delta *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "utils.pxd":1580
 *     if utc:
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             ss -= td_to_seconds(utc_off)
 *     return ss
 */
    __pyx_t_4 = (((PyObject *)__pyx_v_utc_off) != Py_None);
    if (__pyx_t_4) {

      /* "utils.pxd":1581
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:
 *             ss -= td_to_seconds(utc_off)             # <<<<<<<<<<<<<<
 *     return ss
 * 
 */
      __pyx_t_5 = __pyx_f_7cytimes_5utils_td_to_seconds(__pyx_v_utc_off); if (unlikely(__pyx_t_5 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(5, 1581, __pyx_L1_error)
      __pyx_v_ss = (__pyx_v_ss - __pyx_t_5);

      /* "utils.pxd":1580
 *     if utc:
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             ss -= td_to_seconds(utc_off)
 *     return ss
 */
    }

    /* "utils.pxd":1578
 *         + us / 1_000_000
 *     )
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:
 */
  }

  /* "utils.pxd":1582
 *         if utc_off is not None:
 *             ss -= td_to_seconds(utc_off)
 *     return ss             # <<<<<<<<<<<<<<
 * 
 * cdef inline int dt_to_ordinal(datetime.datetime dt, bint utc=False) except -1:
 */
  __pyx_r = __pyx_v_ss;
  goto __pyx_L0;

  /* "utils.pxd":1559
 *     return us
 * 
 * cdef inline double dt_to_seconds(datetime.datetime dt, bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert datetime to `EPOCH` seconds `<'float'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.dt_to_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_utc_off);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1584
 *     return ss
 * 
 * cdef inline int dt_to_ordinal(datetime.datetime dt, bint utc=False) except -1:             # <<<<<<<<<<<<<<
 *     """Convert datetime to Gregorian ordinal days `<'int'>`.
 * 
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_dt_to_ordinal(PyDateTime_DateTime *__pyx_v_dt, struct __pyx_opt_args_7cytimes_5utils_dt_to_ordinal *__pyx_optional_args) {
  int __pyx_v_utc = ((int)0);
  int __pyx_v_ordinal;
  int __pyx_v_seconds;
  PyDateTime_Delta *__pyx_v_utc_off = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_ordinal", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_utc = __pyx_optional_args->utc;
    }
  }

  /* "utils.pxd":1591
 *     """
 *     cdef int ordinal, seconds
 *     ordinal = ymd_to_ordinal(dt.year, dt.month, dt.day)             # <<<<<<<<<<<<<<
 * 
 *     if utc:
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_ymd_to_ordinal(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 1591, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_1;

  /* "utils.pxd":1593
 *     ordinal = ymd_to_ordinal(dt.year, dt.month, dt.day)
 * 
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:
 */
  if (__pyx_v_utc) {

    /* "utils.pxd":1594
 * 
 *     if utc:
 *         utc_off = dt_utcoffset(dt)             # <<<<<<<<<<<<<<
 *         if utc_off is not None:
 *             seconds = dt.hour * SS_HOUR + dt.minute * SS_MINUTE + dt.second
 */
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_utcoffset(__pyx_v_dt)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_utc_off = ((PyDateTime_Delta *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "utils.pxd":1595
 *     if utc:
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             seconds = dt.hour * SS_HOUR + dt.minute * SS_MINUTE + dt.second
 *             seconds -= (
 */
    __pyx_t_3 = (((PyObject *)__pyx_v_utc_off) != Py_None);
    if (__pyx_t_3) {

      /* "utils.pxd":1596
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:
 *             seconds = dt.hour * SS_HOUR + dt.minute * SS_MINUTE + dt.second             # <<<<<<<<<<<<<<
 *             seconds -= (
 *                 datetime.timedelta_days(utc_off) * SS_DAY
 */
      __pyx_v_seconds = (((__pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt) * __pyx_v_7cytimes_5utils_SS_HOUR) + (__pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt) * __pyx_v_7cytimes_5utils_SS_MINUTE)) + __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt));

      /* "utils.pxd":1597
 *         if utc_off is not None:
 *             seconds = dt.hour * SS_HOUR + dt.minute * SS_MINUTE + dt.second
 *             seconds -= (             # <<<<<<<<<<<<<<
 *                 datetime.timedelta_days(utc_off) * SS_DAY
 *                 + datetime.timedelta_seconds(utc_off)
 */
      __pyx_v_seconds = (__pyx_v_seconds - ((__pyx_f_7cpython_8datetime_timedelta_days(((PyObject *)__pyx_v_utc_off)) * __pyx_v_7cytimes_5utils_SS_DAY) + __pyx_f_7cpython_8datetime_timedelta_seconds(((PyObject *)__pyx_v_utc_off))));

      /* "utils.pxd":1602
 *             )
 *             # UTC offset move 1 day backward
 *             if seconds < 0:             # <<<<<<<<<<<<<<
 *                 ordinal -= 1
 *             # UTC offset move 1 day forward
 */
      __pyx_t_3 = (__pyx_v_seconds < 0);
      if (__pyx_t_3) {

        /* "utils.pxd":1603
 *             # UTC offset move 1 day backward
 *             if seconds < 0:
 *                 ordinal -= 1             # <<<<<<<<<<<<<<
 *             # UTC offset move 1 day forward
 *             elif seconds >= SS_DAY:
 */
        __pyx_v_ordinal = (__pyx_v_ordinal - 1);

        /* "utils.pxd":1602
 *             )
 *             # UTC offset move 1 day backward
 *             if seconds < 0:             # <<<<<<<<<<<<<<
 *                 ordinal -= 1
 *             # UTC offset move 1 day forward
 */
        goto __pyx_L5;
      }

      /* "utils.pxd":1605
 *                 ordinal -= 1
 *             # UTC offset move 1 day forward
 *             elif seconds >= SS_DAY:             # <<<<<<<<<<<<<<
 *                 ordinal += 1
 *     return ordinal
 */
      __pyx_t_3 = (__pyx_v_seconds >= __pyx_v_7cytimes_5utils_SS_DAY);
      if (__pyx_t_3) {

        /* "utils.pxd":1606
 *             # UTC offset move 1 day forward
 *             elif seconds >= SS_DAY:
 *                 ordinal += 1             # <<<<<<<<<<<<<<
 *     return ordinal
 * 
 */
        __pyx_v_ordinal = (__pyx_v_ordinal + 1);

        /* "utils.pxd":1605
 *                 ordinal -= 1
 *             # UTC offset move 1 day forward
 *             elif seconds >= SS_DAY:             # <<<<<<<<<<<<<<
 *                 ordinal += 1
 *     return ordinal
 */
      }
      __pyx_L5:;

      /* "utils.pxd":1595
 *     if utc:
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             seconds = dt.hour * SS_HOUR + dt.minute * SS_MINUTE + dt.second
 *             seconds -= (
 */
    }

    /* "utils.pxd":1593
 *     ordinal = ymd_to_ordinal(dt.year, dt.month, dt.day)
 * 
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = dt_utcoffset(dt)
 *         if utc_off is not None:
 */
  }

  /* "utils.pxd":1607
 *             elif seconds >= SS_DAY:
 *                 ordinal += 1
 *     return ordinal             # <<<<<<<<<<<<<<
 * 
 * cdef inline long long dt_to_posix(datetime.datetime dt):
 */
  __pyx_r = __pyx_v_ordinal;
  goto __pyx_L0;

  /* "utils.pxd":1584
 *     return ss
 * 
 * cdef inline int dt_to_ordinal(datetime.datetime dt, bint utc=False) except -1:             # <<<<<<<<<<<<<<
 *     """Convert datetime to Gregorian ordinal days `<'int'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.dt_to_ordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_utc_off);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1609
 *     return ordinal
 * 
 * cdef inline long long dt_to_posix(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Convert datetime to POSIX Time (seconds) `<'int'>`."""
 *     # Compute 'EPOCH' seconds
 */

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_dt_to_posix(PyDateTime_DateTime *__pyx_v_dt) {
  PY_LONG_LONG __pyx_v_ordinal;
  PY_LONG_LONG __pyx_v_hh;
  PY_LONG_LONG __pyx_v_mi;
  PY_LONG_LONG __pyx_v_ss;
  PY_LONG_LONG __pyx_v_t;
  PY_LONG_LONG __pyx_v_adj1;
  PY_LONG_LONG __pyx_v_adj2;
  PY_LONG_LONG __pyx_v_u1;
  PY_LONG_LONG __pyx_v_u2;
  PY_LONG_LONG __pyx_v_t1;
  PY_LONG_LONG __pyx_v_t2;
  PY_LONG_LONG __pyx_r;
  int __pyx_t_1;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_ordinal __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PY_LONG_LONG __pyx_t_5;
  int __pyx_t_6;
  PY_LONG_LONG __pyx_t_7;
  PY_LONG_LONG __pyx_t_8;
  PY_LONG_LONG __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "utils.pxd":1613
 *     # Compute 'EPOCH' seconds
 *     cdef long long ordinal, hh, mi, ss, t
 *     ordinal = dt_to_ordinal(dt, False)             # <<<<<<<<<<<<<<
 *     hh, mi, ss = dt.hour, dt.minute, dt.second
 *     t = (ordinal - EPOCH_DAY) * SS_DAY + hh * SS_HOUR + mi * SS_MINUTE + ss
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.utc = 0;
  __pyx_t_1 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 1613, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_1;

  /* "utils.pxd":1614
 *     cdef long long ordinal, hh, mi, ss, t
 *     ordinal = dt_to_ordinal(dt, False)
 *     hh, mi, ss = dt.hour, dt.minute, dt.second             # <<<<<<<<<<<<<<
 *     t = (ordinal - EPOCH_DAY) * SS_DAY + hh * SS_HOUR + mi * SS_MINUTE + ss
 * 
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);
  __pyx_t_3 = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);
  __pyx_t_4 = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);
  __pyx_v_hh = __pyx_t_1;
  __pyx_v_mi = __pyx_t_3;
  __pyx_v_ss = __pyx_t_4;

  /* "utils.pxd":1615
 *     ordinal = dt_to_ordinal(dt, False)
 *     hh, mi, ss = dt.hour, dt.minute, dt.second
 *     t = (ordinal - EPOCH_DAY) * SS_DAY + hh * SS_HOUR + mi * SS_MINUTE + ss             # <<<<<<<<<<<<<<
 * 
 *     # Adjustment for Daylight Saving
 */
  __pyx_v_t = (((((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_SS_DAY) + (__pyx_v_hh * __pyx_v_7cytimes_5utils_SS_HOUR)) + (__pyx_v_mi * __pyx_v_7cytimes_5utils_SS_MINUTE)) + __pyx_v_ss);

  /* "utils.pxd":1619
 *     # Adjustment for Daylight Saving
 *     cdef long long adj1, adj2, u1, u2, t1, t2
 *     adj1 = ts_localtime(t) - t             # <<<<<<<<<<<<<<
 *     u1 = t - adj1
 *     t1 = ts_localtime(u1)
 */
  __pyx_t_5 = __pyx_f_7cytimes_5utils_ts_localtime(__pyx_v_t); if (unlikely(__pyx_t_5 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 1619, __pyx_L1_error)
  __pyx_v_adj1 = (__pyx_t_5 - __pyx_v_t);

  /* "utils.pxd":1620
 *     cdef long long adj1, adj2, u1, u2, t1, t2
 *     adj1 = ts_localtime(t) - t
 *     u1 = t - adj1             # <<<<<<<<<<<<<<
 *     t1 = ts_localtime(u1)
 *     if t == t1:
 */
  __pyx_v_u1 = (__pyx_v_t - __pyx_v_adj1);

  /* "utils.pxd":1621
 *     adj1 = ts_localtime(t) - t
 *     u1 = t - adj1
 *     t1 = ts_localtime(u1)             # <<<<<<<<<<<<<<
 *     if t == t1:
 *         # We found one solution, but it may not be the one we need.
 */
  __pyx_t_5 = __pyx_f_7cytimes_5utils_ts_localtime(__pyx_v_u1); if (unlikely(__pyx_t_5 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 1621, __pyx_L1_error)
  __pyx_v_t1 = __pyx_t_5;

  /* "utils.pxd":1622
 *     u1 = t - adj1
 *     t1 = ts_localtime(u1)
 *     if t == t1:             # <<<<<<<<<<<<<<
 *         # We found one solution, but it may not be the one we need.
 *         # Look for an earlier solution (if `fold` is 0), or a later
 */
  __pyx_t_6 = (__pyx_v_t == __pyx_v_t1);
  if (__pyx_t_6) {

    /* "utils.pxd":1626
 *         # Look for an earlier solution (if `fold` is 0), or a later
 *         # one (if `fold` is 1).
 *         u2 = u1 - SS_DAY if dt.fold == 0 else u1 + SS_DAY             # <<<<<<<<<<<<<<
 *         adj2 = ts_localtime(u2) - u2
 *         if adj1 == adj2:
 */
    __pyx_t_6 = (__pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt) == 0);
    if (__pyx_t_6) {
      __pyx_t_5 = (__pyx_v_u1 - __pyx_v_7cytimes_5utils_SS_DAY);
    } else {
      __pyx_t_5 = (__pyx_v_u1 + __pyx_v_7cytimes_5utils_SS_DAY);
    }
    __pyx_v_u2 = __pyx_t_5;

    /* "utils.pxd":1627
 *         # one (if `fold` is 1).
 *         u2 = u1 - SS_DAY if dt.fold == 0 else u1 + SS_DAY
 *         adj2 = ts_localtime(u2) - u2             # <<<<<<<<<<<<<<
 *         if adj1 == adj2:
 *             return u1
 */
    __pyx_t_5 = __pyx_f_7cytimes_5utils_ts_localtime(__pyx_v_u2); if (unlikely(__pyx_t_5 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 1627, __pyx_L1_error)
    __pyx_v_adj2 = (__pyx_t_5 - __pyx_v_u2);

    /* "utils.pxd":1628
 *         u2 = u1 - SS_DAY if dt.fold == 0 else u1 + SS_DAY
 *         adj2 = ts_localtime(u2) - u2
 *         if adj1 == adj2:             # <<<<<<<<<<<<<<
 *             return u1
 *     else:
 */
    __pyx_t_6 = (__pyx_v_adj1 == __pyx_v_adj2);
    if (__pyx_t_6) {

      /* "utils.pxd":1629
 *         adj2 = ts_localtime(u2) - u2
 *         if adj1 == adj2:
 *             return u1             # <<<<<<<<<<<<<<
 *     else:
 *         adj2 = t1 - u1
 */
      __pyx_r = __pyx_v_u1;
      goto __pyx_L0;

      /* "utils.pxd":1628
 *         u2 = u1 - SS_DAY if dt.fold == 0 else u1 + SS_DAY
 *         adj2 = ts_localtime(u2) - u2
 *         if adj1 == adj2:             # <<<<<<<<<<<<<<
 *             return u1
 *     else:
 */
    }

    /* "utils.pxd":1622
 *     u1 = t - adj1
 *     t1 = ts_localtime(u1)
 *     if t == t1:             # <<<<<<<<<<<<<<
 *         # We found one solution, but it may not be the one we need.
 *         # Look for an earlier solution (if `fold` is 0), or a later
 */
    goto __pyx_L3;
  }

  /* "utils.pxd":1631
 *             return u1
 *     else:
 *         adj2 = t1 - u1             # <<<<<<<<<<<<<<
 * 
 *     # Final adjustment
 */
  /*else*/ {
    __pyx_v_adj2 = (__pyx_v_t1 - __pyx_v_u1);
  }
  __pyx_L3:;

  /* "utils.pxd":1634
 * 
 *     # Final adjustment
 *     u2 = t - adj2             # <<<<<<<<<<<<<<
 *     t2 = ts_localtime(u2)
 *     if t == t2:
 */
  __pyx_v_u2 = (__pyx_v_t - __pyx_v_adj2);

  /* "utils.pxd":1635
 *     # Final adjustment
 *     u2 = t - adj2
 *     t2 = ts_localtime(u2)             # <<<<<<<<<<<<<<
 *     if t == t2:
 *         return u2
 */
  __pyx_t_5 = __pyx_f_7cytimes_5utils_ts_localtime(__pyx_v_u2); if (unlikely(__pyx_t_5 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 1635, __pyx_L1_error)
  __pyx_v_t2 = __pyx_t_5;

  /* "utils.pxd":1636
 *     u2 = t - adj2
 *     t2 = ts_localtime(u2)
 *     if t == t2:             # <<<<<<<<<<<<<<
 *         return u2
 *     if t == t1:
 */
  __pyx_t_6 = (__pyx_v_t == __pyx_v_t2);
  if (__pyx_t_6) {

    /* "utils.pxd":1637
 *     t2 = ts_localtime(u2)
 *     if t == t2:
 *         return u2             # <<<<<<<<<<<<<<
 *     if t == t1:
 *         return u1
 */
    __pyx_r = __pyx_v_u2;
    goto __pyx_L0;

    /* "utils.pxd":1636
 *     u2 = t - adj2
 *     t2 = ts_localtime(u2)
 *     if t == t2:             # <<<<<<<<<<<<<<
 *         return u2
 *     if t == t1:
 */
  }

  /* "utils.pxd":1638
 *     if t == t2:
 *         return u2
 *     if t == t1:             # <<<<<<<<<<<<<<
 *         return u1
 *     # We have found both offsets adj1 and adj2,
 */
  __pyx_t_6 = (__pyx_v_t == __pyx_v_t1);
  if (__pyx_t_6) {

    /* "utils.pxd":1639
 *         return u2
 *     if t == t1:
 *         return u1             # <<<<<<<<<<<<<<
 *     # We have found both offsets adj1 and adj2,
 *     # but neither t - adj1 nor t - adj2 is the
 */
    __pyx_r = __pyx_v_u1;
    goto __pyx_L0;

    /* "utils.pxd":1638
 *     if t == t2:
 *         return u2
 *     if t == t1:             # <<<<<<<<<<<<<<
 *         return u1
 *     # We have found both offsets adj1 and adj2,
 */
  }

  /* "utils.pxd":1643
 *     # but neither t - adj1 nor t - adj2 is the
 *     # solution. This means t is in the gap.
 *     return max(u1, u2) if dt.fold == 0 else min(u1, u2)             # <<<<<<<<<<<<<<
 * 
 * cdef inline double dt_to_ts(datetime.datetime dt):
 */
  __pyx_t_6 = (__pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt) == 0);
  if (__pyx_t_6) {
    __pyx_t_7 = __pyx_v_u2;
    __pyx_t_8 = __pyx_v_u1;
    __pyx_t_10 = (__pyx_t_7 > __pyx_t_8);
    if (__pyx_t_10) {
      __pyx_t_9 = __pyx_t_7;
    } else {
      __pyx_t_9 = __pyx_t_8;
    }
    __pyx_t_5 = __pyx_t_9;
  } else {
    __pyx_t_9 = __pyx_v_u2;
    __pyx_t_7 = __pyx_v_u1;
    __pyx_t_10 = (__pyx_t_9 < __pyx_t_7);
    if (__pyx_t_10) {
      __pyx_t_8 = __pyx_t_9;
    } else {
      __pyx_t_8 = __pyx_t_7;
    }
    __pyx_t_5 = __pyx_t_8;
  }
  __pyx_r = __pyx_t_5;
  goto __pyx_L0;

  /* "utils.pxd":1609
 *     return ordinal
 * 
 * cdef inline long long dt_to_posix(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Convert datetime to POSIX Time (seconds) `<'int'>`."""
 *     # Compute 'EPOCH' seconds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.dt_to_posix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":1645
 *     return max(u1, u2) if dt.fold == 0 else min(u1, u2)
 * 
 * cdef inline double dt_to_ts(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Convert datetime to `EPOCH` timestamp `<'float'>`.
 * 
 */

static CYTHON_INLINE double __pyx_f_7cytimes_5utils_dt_to_ts(PyDateTime_DateTime *__pyx_v_dt) {
  double __pyx_v_ts;
  PyDateTime_Delta *__pyx_v_utc_off = NULL;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  double __pyx_t_3;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_seconds __pyx_t_4;
  PY_LONG_LONG __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_ts", 1);

  /* "utils.pxd":1653
 *     # With timezone
 *     cdef double ts
 *     utc_off = dt_utcoffset(dt)             # <<<<<<<<<<<<<<
 *     if utc_off is not None:
 *         ts = dt_to_seconds(dt, False)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_utcoffset(__pyx_v_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_utc_off = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":1654
 *     cdef double ts
 *     utc_off = dt_utcoffset(dt)
 *     if utc_off is not None:             # <<<<<<<<<<<<<<
 *         ts = dt_to_seconds(dt, False)
 *         ts -= td_to_seconds(utc_off)
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_utc_off) != Py_None);
  if (__pyx_t_2) {

    /* "utils.pxd":1655
 *     utc_off = dt_utcoffset(dt)
 *     if utc_off is not None:
 *         ts = dt_to_seconds(dt, False)             # <<<<<<<<<<<<<<
 *         ts -= td_to_seconds(utc_off)
 *         return ts
 */
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.utc = 0;
    __pyx_t_3 = __pyx_f_7cytimes_5utils_dt_to_seconds(__pyx_v_dt, &__pyx_t_4); if (unlikely(__pyx_t_3 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(5, 1655, __pyx_L1_error)
    __pyx_v_ts = __pyx_t_3;

    /* "utils.pxd":1656
 *     if utc_off is not None:
 *         ts = dt_to_seconds(dt, False)
 *         ts -= td_to_seconds(utc_off)             # <<<<<<<<<<<<<<
 *         return ts
 * 
 */
    __pyx_t_3 = __pyx_f_7cytimes_5utils_td_to_seconds(__pyx_v_utc_off); if (unlikely(__pyx_t_3 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(5, 1656, __pyx_L1_error)
    __pyx_v_ts = (__pyx_v_ts - __pyx_t_3);

    /* "utils.pxd":1657
 *         ts = dt_to_seconds(dt, False)
 *         ts -= td_to_seconds(utc_off)
 *         return ts             # <<<<<<<<<<<<<<
 * 
 *     # Without timezone
 */
    __pyx_r = __pyx_v_ts;
    goto __pyx_L0;

    /* "utils.pxd":1654
 *     cdef double ts
 *     utc_off = dt_utcoffset(dt)
 *     if utc_off is not None:             # <<<<<<<<<<<<<<
 *         ts = dt_to_seconds(dt, False)
 *         ts -= td_to_seconds(utc_off)
 */
  }

  /* "utils.pxd":1660
 * 
 *     # Without timezone
 *     ts = <double> dt_to_posix(dt)             # <<<<<<<<<<<<<<
 *     return ts + (<double> dt.microsecond) / 1_000_000
 * 
 */
  __pyx_t_5 = __pyx_f_7cytimes_5utils_dt_to_posix(__pyx_v_dt); if (unlikely(__pyx_t_5 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 1660, __pyx_L1_error)
  __pyx_v_ts = ((double)__pyx_t_5);

  /* "utils.pxd":1661
 *     # Without timezone
 *     ts = <double> dt_to_posix(dt)
 *     return ts + (<double> dt.microsecond) / 1_000_000             # <<<<<<<<<<<<<<
 * 
 * cdef inline long long dt_as_epoch(datetime.datetime dt, str unit, bint utc=False):
 */
  __pyx_r = (__pyx_v_ts + (((double)__pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt)) / 1000000.0));
  goto __pyx_L0;

  /* "utils.pxd":1645
 *     return max(u1, u2) if dt.fold == 0 else min(u1, u2)
 * 
 * cdef inline double dt_to_ts(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Convert datetime to `EPOCH` timestamp `<'float'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt_to_ts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_utc_off);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1663
 *     return ts + (<double> dt.microsecond) / 1_000_000
 * 
 * cdef inline long long dt_as_epoch(datetime.datetime dt, str unit, bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert datetime to `EPOCH` integer according to the given unit resolution `<'int'>`.
 * 
 */

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_dt_as_epoch(PyDateTime_DateTime *__pyx_v_dt, PyObject *__pyx_v_unit, struct __pyx_opt_args_7cytimes_5utils_dt_as_epoch *__pyx_optional_args) {
  int __pyx_v_utc = ((int)0);
  Py_ssize_t __pyx_v_size;
  PY_LONG_LONG __pyx_v_ordinal;
  PY_LONG_LONG __pyx_v_hh;
  PY_LONG_LONG __pyx_v_mi;
  PY_LONG_LONG __pyx_v_ss;
  PY_LONG_LONG __pyx_v_us;
  Py_UCS4 __pyx_v_ch;
  PyDateTime_Delta *__pyx_v_utc_off = NULL;
  PY_LONG_LONG __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset __pyx_t_3;
  int __pyx_t_4;
  struct __pyx_opt_args_7cytimes_5utils_dt_add __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_ordinal __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_as_epoch", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_utc = __pyx_optional_args->utc;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_dt);

  /* "utils.pxd":1672
 *     """
 *     cdef:
 *         Py_ssize_t size = str_len(unit)             # <<<<<<<<<<<<<<
 *         long long ordinal, hh, mi, ss, us
 *         Py_UCS4 ch
 */
  __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_unit);

  /* "utils.pxd":1677
 * 
 *     # Adjustment for UTC
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = tz_utcoffset(dt.tzinfo, dt)
 *         if utc_off is not None:
 */
  if (__pyx_v_utc) {

    /* "utils.pxd":1678
 *     # Adjustment for UTC
 *     if utc:
 *         utc_off = tz_utcoffset(dt.tzinfo, dt)             # <<<<<<<<<<<<<<
 *         if utc_off is not None:
 *             dt = dt_add(
 */
    __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3.__pyx_n = 1;
    __pyx_t_3.dt = __pyx_v_dt;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_utcoffset(__pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_utc_off = ((PyDateTime_Delta *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "utils.pxd":1679
 *     if utc:
 *         utc_off = tz_utcoffset(dt.tzinfo, dt)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             dt = dt_add(
 *                 dt,
 */
    __pyx_t_4 = (((PyObject *)__pyx_v_utc_off) != Py_None);
    if (__pyx_t_4) {

      /* "utils.pxd":1680
 *         utc_off = tz_utcoffset(dt.tzinfo, dt)
 *         if utc_off is not None:
 *             dt = dt_add(             # <<<<<<<<<<<<<<
 *                 dt,
 *                 -datetime.timedelta_days(utc_off),
 */
      __pyx_t_5.__pyx_n = 3;
      __pyx_t_5.days = (-__pyx_f_7cpython_8datetime_timedelta_days(((PyObject *)__pyx_v_utc_off)));
      __pyx_t_5.seconds = (-__pyx_f_7cpython_8datetime_timedelta_seconds(((PyObject *)__pyx_v_utc_off)));
      __pyx_t_5.microseconds = (-__pyx_f_7cpython_8datetime_timedelta_microseconds(((PyObject *)__pyx_v_utc_off)));
      __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_add(__pyx_v_dt, &__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1680, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "utils.pxd":1679
 *     if utc:
 *         utc_off = tz_utcoffset(dt.tzinfo, dt)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             dt = dt_add(
 *                 dt,
 */
    }

    /* "utils.pxd":1677
 * 
 *     # Adjustment for UTC
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = tz_utcoffset(dt.tzinfo, dt)
 *         if utc_off is not None:
 */
  }

  /* "utils.pxd":1688
 * 
 *     # Unit: 's', 'm', 'h', 'D', 'W', 'M', 'Q', 'Y'
 *     if size == 1:             # <<<<<<<<<<<<<<
 *         ch = str_read(unit, 0)
 *         # . second
 */
  __pyx_t_4 = (__pyx_v_size == 1);
  if (__pyx_t_4) {

    /* "utils.pxd":1689
 *     # Unit: 's', 'm', 'h', 'D', 'W', 'M', 'Q', 'Y'
 *     if size == 1:
 *         ch = str_read(unit, 0)             # <<<<<<<<<<<<<<
 *         # . second
 *         if ch == "s":
 */
    __pyx_t_6 = PyUnicode_ReadChar(__pyx_v_unit, 0); if (unlikely(__pyx_t_6 == ((Py_UCS4)-1))) __PYX_ERR(5, 1689, __pyx_L1_error)
    __pyx_v_ch = __pyx_t_6;

    /* "utils.pxd":1691
 *         ch = str_read(unit, 0)
 *         # . second
 *         if ch == "s":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss = dt.hour, dt.minute, dt.second
 */
    __pyx_t_4 = (__pyx_v_ch == 0x73);
    if (__pyx_t_4) {

      /* "utils.pxd":1692
 *         # . second
 *         if ch == "s":
 *             ordinal = dt_to_ordinal(dt, False)             # <<<<<<<<<<<<<<
 *             hh, mi, ss = dt.hour, dt.minute, dt.second
 *             return (ordinal - EPOCH_DAY) * SS_DAY + hh * SS_HOUR + mi * SS_MINUTE + ss
 */
      __pyx_t_8.__pyx_n = 1;
      __pyx_t_8.utc = 0;
      __pyx_t_7 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 1692, __pyx_L1_error)
      __pyx_v_ordinal = __pyx_t_7;

      /* "utils.pxd":1693
 *         if ch == "s":
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss = dt.hour, dt.minute, dt.second             # <<<<<<<<<<<<<<
 *             return (ordinal - EPOCH_DAY) * SS_DAY + hh * SS_HOUR + mi * SS_MINUTE + ss
 *         # . minute
 */
      __pyx_t_7 = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);
      __pyx_t_9 = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);
      __pyx_t_10 = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);
      __pyx_v_hh = __pyx_t_7;
      __pyx_v_mi = __pyx_t_9;
      __pyx_v_ss = __pyx_t_10;

      /* "utils.pxd":1694
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss = dt.hour, dt.minute, dt.second
 *             return (ordinal - EPOCH_DAY) * SS_DAY + hh * SS_HOUR + mi * SS_MINUTE + ss             # <<<<<<<<<<<<<<
 *         # . minute
 *         if ch == "m":
 */
      __pyx_r = (((((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_SS_DAY) + (__pyx_v_hh * __pyx_v_7cytimes_5utils_SS_HOUR)) + (__pyx_v_mi * __pyx_v_7cytimes_5utils_SS_MINUTE)) + __pyx_v_ss);
      goto __pyx_L0;

      /* "utils.pxd":1691
 *         ch = str_read(unit, 0)
 *         # . second
 *         if ch == "s":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss = dt.hour, dt.minute, dt.second
 */
    }

    /* "utils.pxd":1696
 *             return (ordinal - EPOCH_DAY) * SS_DAY + hh * SS_HOUR + mi * SS_MINUTE + ss
 *         # . minute
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi = dt.hour, dt.minute
 */
    __pyx_t_4 = (__pyx_v_ch == 0x6D);
    if (__pyx_t_4) {

      /* "utils.pxd":1697
 *         # . minute
 *         if ch == "m":
 *             ordinal = dt_to_ordinal(dt, False)             # <<<<<<<<<<<<<<
 *             hh, mi = dt.hour, dt.minute
 *             return (ordinal - EPOCH_DAY) * 1_440 + hh * 60 + mi
 */
      __pyx_t_8.__pyx_n = 1;
      __pyx_t_8.utc = 0;
      __pyx_t_10 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_8); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(5, 1697, __pyx_L1_error)
      __pyx_v_ordinal = __pyx_t_10;

      /* "utils.pxd":1698
 *         if ch == "m":
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi = dt.hour, dt.minute             # <<<<<<<<<<<<<<
 *             return (ordinal - EPOCH_DAY) * 1_440 + hh * 60 + mi
 *         # . hour
 */
      __pyx_t_10 = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);
      __pyx_t_9 = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);
      __pyx_v_hh = __pyx_t_10;
      __pyx_v_mi = __pyx_t_9;

      /* "utils.pxd":1699
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi = dt.hour, dt.minute
 *             return (ordinal - EPOCH_DAY) * 1_440 + hh * 60 + mi             # <<<<<<<<<<<<<<
 *         # . hour
 *         if ch == "h":
 */
      __pyx_r = ((((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * 0x5A0) + (__pyx_v_hh * 60)) + __pyx_v_mi);
      goto __pyx_L0;

      /* "utils.pxd":1696
 *             return (ordinal - EPOCH_DAY) * SS_DAY + hh * SS_HOUR + mi * SS_MINUTE + ss
 *         # . minute
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi = dt.hour, dt.minute
 */
    }

    /* "utils.pxd":1701
 *             return (ordinal - EPOCH_DAY) * 1_440 + hh * 60 + mi
 *         # . hour
 *         if ch == "h":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             return (ordinal - EPOCH_DAY) * 24 + dt.hour
 */
    __pyx_t_4 = (__pyx_v_ch == 0x68);
    if (__pyx_t_4) {

      /* "utils.pxd":1702
 *         # . hour
 *         if ch == "h":
 *             ordinal = dt_to_ordinal(dt, False)             # <<<<<<<<<<<<<<
 *             return (ordinal - EPOCH_DAY) * 24 + dt.hour
 *         # . day
 */
      __pyx_t_8.__pyx_n = 1;
      __pyx_t_8.utc = 0;
      __pyx_t_9 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1702, __pyx_L1_error)
      __pyx_v_ordinal = __pyx_t_9;

      /* "utils.pxd":1703
 *         if ch == "h":
 *             ordinal = dt_to_ordinal(dt, False)
 *             return (ordinal - EPOCH_DAY) * 24 + dt.hour             # <<<<<<<<<<<<<<
 *         # . day
 *         if ch == "D":
 */
      __pyx_r = (((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * 24) + __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt));
      goto __pyx_L0;

      /* "utils.pxd":1701
 *             return (ordinal - EPOCH_DAY) * 1_440 + hh * 60 + mi
 *         # . hour
 *         if ch == "h":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             return (ordinal - EPOCH_DAY) * 24 + dt.hour
 */
    }

    /* "utils.pxd":1705
 *             return (ordinal - EPOCH_DAY) * 24 + dt.hour
 *         # . day
 *         if ch == "D":             # <<<<<<<<<<<<<<
 *             return dt_to_ordinal(dt, False) - EPOCH_DAY
 *         # . week
 */
    __pyx_t_4 = (__pyx_v_ch == 68);
    if (__pyx_t_4) {

      /* "utils.pxd":1706
 *         # . day
 *         if ch == "D":
 *             return dt_to_ordinal(dt, False) - EPOCH_DAY             # <<<<<<<<<<<<<<
 *         # . week
 *         if ch == "W":
 */
      __pyx_t_8.__pyx_n = 1;
      __pyx_t_8.utc = 0;
      __pyx_t_9 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1706, __pyx_L1_error)
      __pyx_r = (__pyx_t_9 - __pyx_v_7cytimes_5utils_EPOCH_DAY);
      goto __pyx_L0;

      /* "utils.pxd":1705
 *             return (ordinal - EPOCH_DAY) * 24 + dt.hour
 *         # . day
 *         if ch == "D":             # <<<<<<<<<<<<<<
 *             return dt_to_ordinal(dt, False) - EPOCH_DAY
 *         # . week
 */
    }

    /* "utils.pxd":1708
 *             return dt_to_ordinal(dt, False) - EPOCH_DAY
 *         # . week
 *         if ch == "W":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             return (ordinal - EPOCH_DAY) // 7
 */
    __pyx_t_4 = (__pyx_v_ch == 87);
    if (__pyx_t_4) {

      /* "utils.pxd":1709
 *         # . week
 *         if ch == "W":
 *             ordinal = dt_to_ordinal(dt, False)             # <<<<<<<<<<<<<<
 *             return (ordinal - EPOCH_DAY) // 7
 *         # . month
 */
      __pyx_t_8.__pyx_n = 1;
      __pyx_t_8.utc = 0;
      __pyx_t_9 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1709, __pyx_L1_error)
      __pyx_v_ordinal = __pyx_t_9;

      /* "utils.pxd":1710
 *         if ch == "W":
 *             ordinal = dt_to_ordinal(dt, False)
 *             return (ordinal - EPOCH_DAY) // 7             # <<<<<<<<<<<<<<
 *         # . month
 *         if ch == "M":
 */
      __pyx_r = __Pyx_div_PY_LONG_LONG((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY), 7);
      goto __pyx_L0;

      /* "utils.pxd":1708
 *             return dt_to_ordinal(dt, False) - EPOCH_DAY
 *         # . week
 *         if ch == "W":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             return (ordinal - EPOCH_DAY) // 7
 */
    }

    /* "utils.pxd":1712
 *             return (ordinal - EPOCH_DAY) // 7
 *         # . month
 *         if ch == "M":             # <<<<<<<<<<<<<<
 *             return (dt.year - EPOCH_YEAR) * 12 + dt.month - 1
 *         # . quarter
 */
    __pyx_t_4 = (__pyx_v_ch == 77);
    if (__pyx_t_4) {

      /* "utils.pxd":1713
 *         # . month
 *         if ch == "M":
 *             return (dt.year - EPOCH_YEAR) * 12 + dt.month - 1             # <<<<<<<<<<<<<<
 *         # . quarter
 *         if ch == "Q":
 */
      __pyx_r = ((((__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt) - __pyx_v_7cytimes_5utils_EPOCH_YEAR) * 12) + __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt)) - 1);
      goto __pyx_L0;

      /* "utils.pxd":1712
 *             return (ordinal - EPOCH_DAY) // 7
 *         # . month
 *         if ch == "M":             # <<<<<<<<<<<<<<
 *             return (dt.year - EPOCH_YEAR) * 12 + dt.month - 1
 *         # . quarter
 */
    }

    /* "utils.pxd":1715
 *             return (dt.year - EPOCH_YEAR) * 12 + dt.month - 1
 *         # . quarter
 *         if ch == "Q":             # <<<<<<<<<<<<<<
 *             return (dt.year - EPOCH_YEAR) * 4 + quarter_of_month(dt.month) - 1
 *         # . year
 */
    __pyx_t_4 = (__pyx_v_ch == 81);
    if (__pyx_t_4) {

      /* "utils.pxd":1716
 *         # . quarter
 *         if ch == "Q":
 *             return (dt.year - EPOCH_YEAR) * 4 + quarter_of_month(dt.month) - 1             # <<<<<<<<<<<<<<
 *         # . year
 *         if ch == "Y":
 */
      __pyx_t_9 = __pyx_f_7cytimes_5utils_quarter_of_month(__pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1716, __pyx_L1_error)
      __pyx_r = ((((__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt) - __pyx_v_7cytimes_5utils_EPOCH_YEAR) * 4) + __pyx_t_9) - 1);
      goto __pyx_L0;

      /* "utils.pxd":1715
 *             return (dt.year - EPOCH_YEAR) * 12 + dt.month - 1
 *         # . quarter
 *         if ch == "Q":             # <<<<<<<<<<<<<<
 *             return (dt.year - EPOCH_YEAR) * 4 + quarter_of_month(dt.month) - 1
 *         # . year
 */
    }

    /* "utils.pxd":1718
 *             return (dt.year - EPOCH_YEAR) * 4 + quarter_of_month(dt.month) - 1
 *         # . year
 *         if ch == "Y":             # <<<<<<<<<<<<<<
 *             return dt.year - EPOCH_YEAR
 * 
 */
    __pyx_t_4 = (__pyx_v_ch == 89);
    if (__pyx_t_4) {

      /* "utils.pxd":1719
 *         # . year
 *         if ch == "Y":
 *             return dt.year - EPOCH_YEAR             # <<<<<<<<<<<<<<
 * 
 *     # Unit: 'ns', 'us', 'ms'
 */
      __pyx_r = (__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt) - __pyx_v_7cytimes_5utils_EPOCH_YEAR);
      goto __pyx_L0;

      /* "utils.pxd":1718
 *             return (dt.year - EPOCH_YEAR) * 4 + quarter_of_month(dt.month) - 1
 *         # . year
 *         if ch == "Y":             # <<<<<<<<<<<<<<
 *             return dt.year - EPOCH_YEAR
 * 
 */
    }

    /* "utils.pxd":1688
 * 
 *     # Unit: 's', 'm', 'h', 'D', 'W', 'M', 'Q', 'Y'
 *     if size == 1:             # <<<<<<<<<<<<<<
 *         ch = str_read(unit, 0)
 *         # . second
 */
    goto __pyx_L5;
  }

  /* "utils.pxd":1722
 * 
 *     # Unit: 'ns', 'us', 'ms'
 *     elif size == 2 and str_read(unit, 1) == "s":             # <<<<<<<<<<<<<<
 *         ch = str_read(unit, 0)
 *         # . nanosecond
 */
  __pyx_t_11 = (__pyx_v_size == 2);
  if (__pyx_t_11) {
  } else {
    __pyx_t_4 = __pyx_t_11;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_t_6 = PyUnicode_ReadChar(__pyx_v_unit, 1); if (unlikely(__pyx_t_6 == ((Py_UCS4)-1))) __PYX_ERR(5, 1722, __pyx_L1_error)
  __pyx_t_11 = (__pyx_t_6 == 0x73);
  __pyx_t_4 = __pyx_t_11;
  __pyx_L14_bool_binop_done:;
  if (__pyx_t_4) {

    /* "utils.pxd":1723
 *     # Unit: 'ns', 'us', 'ms'
 *     elif size == 2 and str_read(unit, 1) == "s":
 *         ch = str_read(unit, 0)             # <<<<<<<<<<<<<<
 *         # . nanosecond
 *         if ch == "n":
 */
    __pyx_t_6 = PyUnicode_ReadChar(__pyx_v_unit, 0); if (unlikely(__pyx_t_6 == ((Py_UCS4)-1))) __PYX_ERR(5, 1723, __pyx_L1_error)
    __pyx_v_ch = __pyx_t_6;

    /* "utils.pxd":1725
 *         ch = str_read(unit, 0)
 *         # . nanosecond
 *         if ch == "n":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond
 */
    __pyx_t_4 = (__pyx_v_ch == 0x6E);
    if (__pyx_t_4) {

      /* "utils.pxd":1726
 *         # . nanosecond
 *         if ch == "n":
 *             ordinal = dt_to_ordinal(dt, False)             # <<<<<<<<<<<<<<
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond
 *             return (
 */
      __pyx_t_8.__pyx_n = 1;
      __pyx_t_8.utc = 0;
      __pyx_t_9 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1726, __pyx_L1_error)
      __pyx_v_ordinal = __pyx_t_9;

      /* "utils.pxd":1727
 *         if ch == "n":
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond             # <<<<<<<<<<<<<<
 *             return (
 *                 (ordinal - EPOCH_DAY) * NS_DAY
 */
      __pyx_t_9 = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);
      __pyx_t_10 = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);
      __pyx_t_7 = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);
      __pyx_t_12 = __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt);
      __pyx_v_hh = __pyx_t_9;
      __pyx_v_mi = __pyx_t_10;
      __pyx_v_ss = __pyx_t_7;
      __pyx_v_us = __pyx_t_12;

      /* "utils.pxd":1733
 *                 + mi * NS_MINUTE
 *                 + ss * NS_SECOND
 *                 + us * NS_MICROSECOND             # <<<<<<<<<<<<<<
 *             )
 *         # . microsecond
 */
      __pyx_r = ((((((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_NS_DAY) + (__pyx_v_hh * __pyx_v_7cytimes_5utils_NS_HOUR)) + (__pyx_v_mi * __pyx_v_7cytimes_5utils_NS_MINUTE)) + (__pyx_v_ss * __pyx_v_7cytimes_5utils_NS_SECOND)) + (__pyx_v_us * __pyx_v_7cytimes_5utils_NS_MICROSECOND));
      goto __pyx_L0;

      /* "utils.pxd":1725
 *         ch = str_read(unit, 0)
 *         # . nanosecond
 *         if ch == "n":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond
 */
    }

    /* "utils.pxd":1736
 *             )
 *         # . microsecond
 *         if ch == "u":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond
 */
    __pyx_t_4 = (__pyx_v_ch == 0x75);
    if (__pyx_t_4) {

      /* "utils.pxd":1737
 *         # . microsecond
 *         if ch == "u":
 *             ordinal = dt_to_ordinal(dt, False)             # <<<<<<<<<<<<<<
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond
 *             return (
 */
      __pyx_t_8.__pyx_n = 1;
      __pyx_t_8.utc = 0;
      __pyx_t_12 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_8); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(5, 1737, __pyx_L1_error)
      __pyx_v_ordinal = __pyx_t_12;

      /* "utils.pxd":1738
 *         if ch == "u":
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond             # <<<<<<<<<<<<<<
 *             return (
 *                 (ordinal - EPOCH_DAY) * US_DAY
 */
      __pyx_t_12 = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);
      __pyx_t_7 = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);
      __pyx_t_10 = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);
      __pyx_t_9 = __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt);
      __pyx_v_hh = __pyx_t_12;
      __pyx_v_mi = __pyx_t_7;
      __pyx_v_ss = __pyx_t_10;
      __pyx_v_us = __pyx_t_9;

      /* "utils.pxd":1744
 *                 + mi * US_MINUTE
 *                 + ss * US_SECOND
 *                 + us             # <<<<<<<<<<<<<<
 *             )
 *         # . millisecond
 */
      __pyx_r = ((((((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_US_DAY) + (__pyx_v_hh * __pyx_v_7cytimes_5utils_US_HOUR)) + (__pyx_v_mi * __pyx_v_7cytimes_5utils_US_MINUTE)) + (__pyx_v_ss * __pyx_v_7cytimes_5utils_US_SECOND)) + __pyx_v_us);
      goto __pyx_L0;

      /* "utils.pxd":1736
 *             )
 *         # . microsecond
 *         if ch == "u":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond
 */
    }

    /* "utils.pxd":1747
 *             )
 *         # . millisecond
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond
 */
    __pyx_t_4 = (__pyx_v_ch == 0x6D);
    if (__pyx_t_4) {

      /* "utils.pxd":1748
 *         # . millisecond
 *         if ch == "m":
 *             ordinal = dt_to_ordinal(dt, False)             # <<<<<<<<<<<<<<
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond
 *             return (
 */
      __pyx_t_8.__pyx_n = 1;
      __pyx_t_8.utc = 0;
      __pyx_t_9 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1748, __pyx_L1_error)
      __pyx_v_ordinal = __pyx_t_9;

      /* "utils.pxd":1749
 *         if ch == "m":
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond             # <<<<<<<<<<<<<<
 *             return (
 *                 (ordinal - EPOCH_DAY) * MS_DAY
 */
      __pyx_t_9 = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);
      __pyx_t_10 = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);
      __pyx_t_7 = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);
      __pyx_t_12 = __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt);
      __pyx_v_hh = __pyx_t_9;
      __pyx_v_mi = __pyx_t_10;
      __pyx_v_ss = __pyx_t_7;
      __pyx_v_us = __pyx_t_12;

      /* "utils.pxd":1755
 *                 + mi * MS_MINUTE
 *                 + ss * MS_SECOND
 *                 + us // 1_000             # <<<<<<<<<<<<<<
 *             )
 * 
 */
      __pyx_r = ((((((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_MS_DAY) + (__pyx_v_hh * __pyx_v_7cytimes_5utils_MS_HOUR)) + (__pyx_v_mi * __pyx_v_7cytimes_5utils_MS_MINUTE)) + (__pyx_v_ss * __pyx_v_7cytimes_5utils_MS_SECOND)) + __Pyx_div_PY_LONG_LONG(__pyx_v_us, 0x3E8));
      goto __pyx_L0;

      /* "utils.pxd":1747
 *             )
 *         # . millisecond
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             ordinal = dt_to_ordinal(dt, False)
 *             hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond
 */
    }

    /* "utils.pxd":1722
 * 
 *     # Unit: 'ns', 'us', 'ms'
 *     elif size == 2 and str_read(unit, 1) == "s":             # <<<<<<<<<<<<<<
 *         ch = str_read(unit, 0)
 *         # . nanosecond
 */
    goto __pyx_L5;
  }

  /* "utils.pxd":1759
 * 
 *     # Unit: 'min' for pandas compatibility
 *     elif size == 3 and unit == "min":             # <<<<<<<<<<<<<<
 *         ordinal = dt_to_ordinal(dt, False)
 *         return (ordinal - EPOCH_DAY) * 1_440 + dt.hour * 60 + dt.minute
 */
  __pyx_t_11 = (__pyx_v_size == 3);
  if (__pyx_t_11) {
  } else {
    __pyx_t_4 = __pyx_t_11;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_min, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(5, 1759, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_11;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_4) {

    /* "utils.pxd":1760
 *     # Unit: 'min' for pandas compatibility
 *     elif size == 3 and unit == "min":
 *         ordinal = dt_to_ordinal(dt, False)             # <<<<<<<<<<<<<<
 *         return (ordinal - EPOCH_DAY) * 1_440 + dt.hour * 60 + dt.minute
 * 
 */
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.utc = 0;
    __pyx_t_12 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_8); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(5, 1760, __pyx_L1_error)
    __pyx_v_ordinal = __pyx_t_12;

    /* "utils.pxd":1761
 *     elif size == 3 and unit == "min":
 *         ordinal = dt_to_ordinal(dt, False)
 *         return (ordinal - EPOCH_DAY) * 1_440 + dt.hour * 60 + dt.minute             # <<<<<<<<<<<<<<
 * 
 *     # Unsupported unit
 */
    __pyx_r = ((((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) * 0x5A0) + (__pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt) * 60)) + __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt));
    goto __pyx_L0;

    /* "utils.pxd":1759
 * 
 *     # Unit: 'min' for pandas compatibility
 *     elif size == 3 and unit == "min":             # <<<<<<<<<<<<<<
 *         ordinal = dt_to_ordinal(dt, False)
 *         return (ordinal - EPOCH_DAY) * 1_440 + dt.hour * 60 + dt.minute
 */
  }
  __pyx_L5:;

  /* "utils.pxd":1764
 * 
 *     # Unsupported unit
 *     raise ValueError("unsupported datetime unit '%s'." % unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline long long dt_as_epoch_iso_W(datetime.datetime dt, int weekday, bint utc=False):
 */
  __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_unsupported_datetime_unit_s, __pyx_v_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(5, 1764, __pyx_L1_error)

  /* "utils.pxd":1663
 *     return ts + (<double> dt.microsecond) / 1_000_000
 * 
 * cdef inline long long dt_as_epoch(datetime.datetime dt, str unit, bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert datetime to `EPOCH` integer according to the given unit resolution `<'int'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.dt_as_epoch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_utc_off);
  __Pyx_XDECREF((PyObject *)__pyx_v_dt);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1766
 *     raise ValueError("unsupported datetime unit '%s'." % unit)
 * 
 * cdef inline long long dt_as_epoch_iso_W(datetime.datetime dt, int weekday, bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert datetime to `EPOCH` integer under 'W' (weeks) resolution `<'int'>`.
 * 
 */

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_dt_as_epoch_iso_W(PyDateTime_DateTime *__pyx_v_dt, int __pyx_v_weekday, struct __pyx_opt_args_7cytimes_5utils_dt_as_epoch_iso_W *__pyx_optional_args) {
  int __pyx_v_utc = ((int)0);
  int __pyx_v_ordinal;
  int __pyx_v_wkd_off;
  PY_LONG_LONG __pyx_r;
  int __pyx_t_1;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_ordinal __pyx_t_2;
  long __pyx_t_3;
  long __pyx_t_4;
  long __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_utc = __pyx_optional_args->utc;
    }
  }

  /* "utils.pxd":1779
 *     substracts 'utcoffset' from the result.
 *     """
 *     cdef int ordinal = dt_to_ordinal(dt, utc)             # <<<<<<<<<<<<<<
 *     cdef int wkd_off = 4 - min(max(weekday, 1), 7)
 *     return (ordinal - EPOCH_DAY + wkd_off) // 7
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.utc = __pyx_v_utc;
  __pyx_t_1 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 1779, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_1;

  /* "utils.pxd":1780
 *     """
 *     cdef int ordinal = dt_to_ordinal(dt, utc)
 *     cdef int wkd_off = 4 - min(max(weekday, 1), 7)             # <<<<<<<<<<<<<<
 *     return (ordinal - EPOCH_DAY + wkd_off) // 7
 * 
 */
  __pyx_t_3 = 7;
  __pyx_t_4 = 1;
  __pyx_t_1 = __pyx_v_weekday;
  __pyx_t_6 = (__pyx_t_4 > __pyx_t_1);
  if (__pyx_t_6) {
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_1;
  }
  __pyx_t_4 = __pyx_t_5;
  __pyx_t_6 = (__pyx_t_3 < __pyx_t_4);
  if (__pyx_t_6) {
    __pyx_t_5 = __pyx_t_3;
  } else {
    __pyx_t_5 = __pyx_t_4;
  }
  __pyx_v_wkd_off = (4 - __pyx_t_5);

  /* "utils.pxd":1781
 *     cdef int ordinal = dt_to_ordinal(dt, utc)
 *     cdef int wkd_off = 4 - min(max(weekday, 1), 7)
 *     return (ordinal - EPOCH_DAY + wkd_off) // 7             # <<<<<<<<<<<<<<
 * 
 * # . conversion: from
 */
  __pyx_r = __Pyx_div_PY_LONG_LONG(((__pyx_v_ordinal - __pyx_v_7cytimes_5utils_EPOCH_DAY) + __pyx_v_wkd_off), 7);
  goto __pyx_L0;

  /* "utils.pxd":1766
 *     raise ValueError("unsupported datetime unit '%s'." % unit)
 * 
 * cdef inline long long dt_as_epoch_iso_W(datetime.datetime dt, int weekday, bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert datetime to `EPOCH` integer under 'W' (weeks) resolution `<'int'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.dt_as_epoch_iso_W", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":1784
 * 
 * # . conversion: from
 * cdef inline datetime.datetime dt_fr_us(long long val, object tz=None):             # <<<<<<<<<<<<<<
 *     """Create datetime from `EPOCH` microseconds (int) `<'datetime.datetime'>`."""
 *     # Compute ymd & hmsf
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_fr_us(PY_LONG_LONG __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils_dt_fr_us *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  __pyx_t_7cytimes_5utils_ymd __pyx_v__ymd;
  __pyx_t_7cytimes_5utils_hmsf __pyx_v__hmsf;
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PY_LONG_LONG __pyx_t_1;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_2;
  __pyx_t_7cytimes_5utils_hmsf __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_fr_us", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "utils.pxd":1787
 *     """Create datetime from `EPOCH` microseconds (int) `<'datetime.datetime'>`."""
 *     # Compute ymd & hmsf
 *     val += EPOCH_MICROSECOND             # <<<<<<<<<<<<<<
 *     _ymd = ymd_fr_ordinal(math_floor_div(val, US_DAY))
 *     _hmsf = hmsf_fr_us(val)
 */
  __pyx_v_val = (__pyx_v_val + __pyx_v_7cytimes_5utils_EPOCH_MICROSECOND);

  /* "utils.pxd":1788
 *     # Compute ymd & hmsf
 *     val += EPOCH_MICROSECOND
 *     _ymd = ymd_fr_ordinal(math_floor_div(val, US_DAY))             # <<<<<<<<<<<<<<
 *     _hmsf = hmsf_fr_us(val)
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_val, __pyx_v_7cytimes_5utils_US_DAY, NULL); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 1788, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1788, __pyx_L1_error)
  __pyx_v__ymd = __pyx_t_2;

  /* "utils.pxd":1789
 *     val += EPOCH_MICROSECOND
 *     _ymd = ymd_fr_ordinal(math_floor_div(val, US_DAY))
 *     _hmsf = hmsf_fr_us(val)             # <<<<<<<<<<<<<<
 * 
 *     # New datetime
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_hmsf_fr_us(__pyx_v_val); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1789, __pyx_L1_error)
  __pyx_v__hmsf = __pyx_t_3;

  /* "utils.pxd":1792
 * 
 *     # New datetime
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         _ymd.year, _ymd.month, _ymd.day,
 *         _hmsf.hour, _hmsf.minute, _hmsf.second,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "utils.pxd":1795
 *         _ymd.year, _ymd.month, _ymd.day,
 *         _hmsf.hour, _hmsf.minute, _hmsf.second,
 *         _hmsf.microsecond, tz, 0             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.fold = 0;
  __pyx_t_4 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_v__ymd.year, __pyx_v__ymd.month, __pyx_v__ymd.day, __pyx_v__hmsf.hour, __pyx_v__hmsf.minute, __pyx_v__hmsf.second, __pyx_v__hmsf.microsecond, __pyx_v_tz, &__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1784
 * 
 * # . conversion: from
 * cdef inline datetime.datetime dt_fr_us(long long val, object tz=None):             # <<<<<<<<<<<<<<
 *     """Create datetime from `EPOCH` microseconds (int) `<'datetime.datetime'>`."""
 *     # Compute ymd & hmsf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils.dt_fr_us", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1798
 *     )
 * 
 * cdef inline datetime.datetime dt_fr_seconds(double val, object tz=None):             # <<<<<<<<<<<<<<
 *     """Create datetime from `EPOCH` seconds (float) `<'datetime.datetime'>`."""
 *     return dt_fr_us(<long long> int(val * US_SECOND), tz)
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_fr_seconds(double __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils_dt_fr_seconds *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt_fr_us __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_fr_seconds", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "utils.pxd":1800
 * cdef inline datetime.datetime dt_fr_seconds(double val, object tz=None):
 *     """Create datetime from `EPOCH` seconds (float) `<'datetime.datetime'>`."""
 *     return dt_fr_us(<long long> int(val * US_SECOND), tz)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.datetime dt_fr_ordinal(int val, object tz=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.tz = __pyx_v_tz;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_us(((PY_LONG_LONG)((PY_LONG_LONG)(__pyx_v_val * __pyx_v_7cytimes_5utils_US_SECOND))), &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1798
 *     )
 * 
 * cdef inline datetime.datetime dt_fr_seconds(double val, object tz=None):             # <<<<<<<<<<<<<<
 *     """Create datetime from `EPOCH` seconds (float) `<'datetime.datetime'>`."""
 *     return dt_fr_us(<long long> int(val * US_SECOND), tz)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt_fr_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1802
 *     return dt_fr_us(<long long> int(val * US_SECOND), tz)
 * 
 * cdef inline datetime.datetime dt_fr_ordinal(int val, object tz=None):             # <<<<<<<<<<<<<<
 *     """Create datetime from Gregorian ordinal days (int) `<'datetime.datetime'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_fr_ordinal(int __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils_dt_fr_ordinal *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  __pyx_t_7cytimes_5utils_ymd __pyx_v__ymd;
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_t_7cytimes_5utils_ymd __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_fr_ordinal", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "utils.pxd":1808
 *     >>> datetime.datetime.fromordinal(val).replace(tzinfo=tz)
 *     """
 *     _ymd = ymd_fr_ordinal(val)             # <<<<<<<<<<<<<<
 *     return datetime.datetime_new(_ymd.year, _ymd.month, _ymd.day, 0, 0, 0, 0, tz, 0)
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal(__pyx_v_val); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1808, __pyx_L1_error)
  __pyx_v__ymd = __pyx_t_1;

  /* "utils.pxd":1809
 *     """
 *     _ymd = ymd_fr_ordinal(val)
 *     return datetime.datetime_new(_ymd.year, _ymd.month, _ymd.day, 0, 0, 0, 0, tz, 0)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.datetime dt_fr_ts(double val, object tz=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.fold = 0;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_v__ymd.year, __pyx_v__ymd.month, __pyx_v__ymd.day, 0, 0, 0, 0, __pyx_v_tz, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1802
 *     return dt_fr_us(<long long> int(val * US_SECOND), tz)
 * 
 * cdef inline datetime.datetime dt_fr_ordinal(int val, object tz=None):             # <<<<<<<<<<<<<<
 *     """Create datetime from Gregorian ordinal days (int) `<'datetime.datetime'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.dt_fr_ordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1811
 *     return datetime.datetime_new(_ymd.year, _ymd.month, _ymd.day, 0, 0, 0, 0, tz, 0)
 * 
 * cdef inline datetime.datetime dt_fr_ts(double val, object tz=None):             # <<<<<<<<<<<<<<
 *     """Create datetime from `EPOCH` timestamp (float) `<'datetime.datetime'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_fr_ts(double __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils_dt_fr_ts *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_fr_ts", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "utils.pxd":1817
 *     >>> datetime.datetime.fromtimestamp(val, tz)
 *     """
 *     return datetime.datetime_from_timestamp(val, tz)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.datetime dt_combine(datetime.date date=None, datetime.time time=None, tz: object = None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.tz = __pyx_v_tz;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_from_timestamp(__pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1811
 *     return datetime.datetime_new(_ymd.year, _ymd.month, _ymd.day, 0, 0, 0, 0, tz, 0)
 * 
 * cdef inline datetime.datetime dt_fr_ts(double val, object tz=None):             # <<<<<<<<<<<<<<
 *     """Create datetime from `EPOCH` timestamp (float) `<'datetime.datetime'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.dt_fr_ts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1819
 *     return datetime.datetime_from_timestamp(val, tz)
 * 
 * cdef inline datetime.datetime dt_combine(datetime.date date=None, datetime.time time=None, tz: object = None):             # <<<<<<<<<<<<<<
 *     """Create datetime by combining date & time `<'datetime.datetime'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_combine(struct __pyx_opt_args_7cytimes_5utils_dt_combine *__pyx_optional_args) {
  PyDateTime_Date *__pyx_v_date = ((PyDateTime_Date *)Py_None);
  PyDateTime_Time *__pyx_v_time = ((PyDateTime_Time *)Py_None);
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  int __pyx_v_yy;
  int __pyx_v_mm;
  int __pyx_v_dd;
  struct tm __pyx_v__tm;
  int __pyx_v_hh;
  int __pyx_v_mi;
  int __pyx_v_ss;
  int __pyx_v_us;
  int __pyx_v_fold;
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  struct tm __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_combine", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_date = __pyx_optional_args->date;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_time = __pyx_optional_args->time;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_tz = __pyx_optional_args->tz;
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_tz);

  /* "utils.pxd":1827
 *     # Date
 *     cdef int yy, mm, dd
 *     if date is None:             # <<<<<<<<<<<<<<
 *         _tm = tm_localtime(unix_time())
 *         yy, mm, dd = _tm.tm_year, _tm.tm_mon, _tm.tm_mday
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_date) == Py_None);
  if (__pyx_t_1) {

    /* "utils.pxd":1828
 *     cdef int yy, mm, dd
 *     if date is None:
 *         _tm = tm_localtime(unix_time())             # <<<<<<<<<<<<<<
 *         yy, mm, dd = _tm.tm_year, _tm.tm_mon, _tm.tm_mday
 *     else:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_tm_localtime(__pyx_f_7cpython_4time_time()); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1828, __pyx_L1_error)
    __pyx_v__tm = __pyx_t_2;

    /* "utils.pxd":1829
 *     if date is None:
 *         _tm = tm_localtime(unix_time())
 *         yy, mm, dd = _tm.tm_year, _tm.tm_mon, _tm.tm_mday             # <<<<<<<<<<<<<<
 *     else:
 *         yy, mm, dd = date.year, date.month, date.day
 */
    __pyx_t_3 = __pyx_v__tm.tm_year;
    __pyx_t_4 = __pyx_v__tm.tm_mon;
    __pyx_t_5 = __pyx_v__tm.tm_mday;
    __pyx_v_yy = __pyx_t_3;
    __pyx_v_mm = __pyx_t_4;
    __pyx_v_dd = __pyx_t_5;

    /* "utils.pxd":1827
 *     # Date
 *     cdef int yy, mm, dd
 *     if date is None:             # <<<<<<<<<<<<<<
 *         _tm = tm_localtime(unix_time())
 *         yy, mm, dd = _tm.tm_year, _tm.tm_mon, _tm.tm_mday
 */
    goto __pyx_L3;
  }

  /* "utils.pxd":1831
 *         yy, mm, dd = _tm.tm_year, _tm.tm_mon, _tm.tm_mday
 *     else:
 *         yy, mm, dd = date.year, date.month, date.day             # <<<<<<<<<<<<<<
 * 
 *     # Time
 */
  /*else*/ {
    __pyx_t_5 = __pyx_f_7cpython_8datetime_4date_4year_year(__pyx_v_date);
    __pyx_t_4 = __pyx_f_7cpython_8datetime_4date_5month_month(__pyx_v_date);
    __pyx_t_3 = __pyx_f_7cpython_8datetime_4date_3day_day(__pyx_v_date);
    __pyx_v_yy = __pyx_t_5;
    __pyx_v_mm = __pyx_t_4;
    __pyx_v_dd = __pyx_t_3;
  }
  __pyx_L3:;

  /* "utils.pxd":1835
 *     # Time
 *     cdef int hh, mi, ss, us, fold
 *     if time is None:             # <<<<<<<<<<<<<<
 *         hh, mi, ss, us, fold = 0, 0, 0, 0, 0
 *     else:
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_time) == Py_None);
  if (__pyx_t_1) {

    /* "utils.pxd":1836
 *     cdef int hh, mi, ss, us, fold
 *     if time is None:
 *         hh, mi, ss, us, fold = 0, 0, 0, 0, 0             # <<<<<<<<<<<<<<
 *     else:
 *         hh, mi, ss, us, fold = time.hour, time.minute, time.second, time.microsecond, time.fold
 */
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_v_hh = __pyx_t_3;
    __pyx_v_mi = __pyx_t_4;
    __pyx_v_ss = __pyx_t_5;
    __pyx_v_us = __pyx_t_6;
    __pyx_v_fold = __pyx_t_7;

    /* "utils.pxd":1835
 *     # Time
 *     cdef int hh, mi, ss, us, fold
 *     if time is None:             # <<<<<<<<<<<<<<
 *         hh, mi, ss, us, fold = 0, 0, 0, 0, 0
 *     else:
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":1838
 *         hh, mi, ss, us, fold = 0, 0, 0, 0, 0
 *     else:
 *         hh, mi, ss, us, fold = time.hour, time.minute, time.second, time.microsecond, time.fold             # <<<<<<<<<<<<<<
 *         if tz is None:
 *             tz = time.tzinfo
 */
  /*else*/ {
    __pyx_t_7 = __pyx_f_7cpython_8datetime_4time_4hour_hour(__pyx_v_time);
    __pyx_t_6 = __pyx_f_7cpython_8datetime_4time_6minute_minute(__pyx_v_time);
    __pyx_t_5 = __pyx_f_7cpython_8datetime_4time_6second_second(__pyx_v_time);
    __pyx_t_4 = __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(__pyx_v_time);
    __pyx_t_3 = __pyx_f_7cpython_8datetime_4time_4fold_fold(__pyx_v_time);
    __pyx_v_hh = __pyx_t_7;
    __pyx_v_mi = __pyx_t_6;
    __pyx_v_ss = __pyx_t_5;
    __pyx_v_us = __pyx_t_4;
    __pyx_v_fold = __pyx_t_3;

    /* "utils.pxd":1839
 *     else:
 *         hh, mi, ss, us, fold = time.hour, time.minute, time.second, time.microsecond, time.fold
 *         if tz is None:             # <<<<<<<<<<<<<<
 *             tz = time.tzinfo
 * 
 */
    __pyx_t_1 = (__pyx_v_tz == Py_None);
    if (__pyx_t_1) {

      /* "utils.pxd":1840
 *         hh, mi, ss, us, fold = time.hour, time.minute, time.second, time.microsecond, time.fold
 *         if tz is None:
 *             tz = time.tzinfo             # <<<<<<<<<<<<<<
 * 
 *     # Combine
 */
      __pyx_t_8 = __pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(__pyx_v_time); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 1840, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "utils.pxd":1839
 *     else:
 *         hh, mi, ss, us, fold = time.hour, time.minute, time.second, time.microsecond, time.fold
 *         if tz is None:             # <<<<<<<<<<<<<<
 *             tz = time.tzinfo
 * 
 */
    }
  }
  __pyx_L4:;

  /* "utils.pxd":1843
 * 
 *     # Combine
 *     return datetime.datetime_new(yy, mm, dd, hh, mi, ss, us, tz, fold)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.datetime dt_fr_date(datetime.date date, object tz=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_9.__pyx_n = 1;
  __pyx_t_9.fold = __pyx_v_fold;
  __pyx_t_8 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_v_yy, __pyx_v_mm, __pyx_v_dd, __pyx_v_hh, __pyx_v_mi, __pyx_v_ss, __pyx_v_us, __pyx_v_tz, &__pyx_t_9)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 1843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_8);
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1819
 *     return datetime.datetime_from_timestamp(val, tz)
 * 
 * cdef inline datetime.datetime dt_combine(datetime.date date=None, datetime.time time=None, tz: object = None):             # <<<<<<<<<<<<<<
 *     """Create datetime by combining date & time `<'datetime.datetime'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cytimes.utils.dt_combine", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1845
 *     return datetime.datetime_new(yy, mm, dd, hh, mi, ss, us, tz, fold)
 * 
 * cdef inline datetime.datetime dt_fr_date(datetime.date date, object tz=None):             # <<<<<<<<<<<<<<
 *     """Create datetime from date (include subclass) `<'datetime.datetime'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_fr_date(PyDateTime_Date *__pyx_v_date, struct __pyx_opt_args_7cytimes_5utils_dt_fr_date *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_fr_date", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "utils.pxd":1850
 *     #### All time fields are set to 0.
 *     """
 *     return datetime.datetime_new(date.year, date.month, date.day, 0, 0, 0, 0, tz, 0)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.datetime dt_fr_time(datetime.time time):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fold = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_f_7cpython_8datetime_4date_4year_year(__pyx_v_date), __pyx_f_7cpython_8datetime_4date_5month_month(__pyx_v_date), __pyx_f_7cpython_8datetime_4date_3day_day(__pyx_v_date), 0, 0, 0, 0, __pyx_v_tz, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1845
 *     return datetime.datetime_new(yy, mm, dd, hh, mi, ss, us, tz, fold)
 * 
 * cdef inline datetime.datetime dt_fr_date(datetime.date date, object tz=None):             # <<<<<<<<<<<<<<
 *     """Create datetime from date (include subclass) `<'datetime.datetime'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt_fr_date", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1852
 *     return datetime.datetime_new(date.year, date.month, date.day, 0, 0, 0, 0, tz, 0)
 * 
 * cdef inline datetime.datetime dt_fr_time(datetime.time time):             # <<<<<<<<<<<<<<
 *     """Create datetime from time (include subclass) `<'datetime.datetime'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_fr_time(PyDateTime_Time *__pyx_v_time) {
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_fr_time", 1);

  /* "utils.pxd":1857
 *     #### Date fields are set to 1970-01-01.
 *     """
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         1970, 1, 1,
 *         time.hour, time.minute, time.second,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "utils.pxd":1860
 *         1970, 1, 1,
 *         time.hour, time.minute, time.second,
 *         time.microsecond, time.tzinfo, time.fold             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(__pyx_v_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "utils.pxd":1857
 *     #### Date fields are set to 1970-01-01.
 *     """
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         1970, 1, 1,
 *         time.hour, time.minute, time.second,
 */
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.fold = __pyx_f_7cpython_8datetime_4time_4fold_fold(__pyx_v_time);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(0x7B2, 1, 1, __pyx_f_7cpython_8datetime_4time_4hour_hour(__pyx_v_time), __pyx_f_7cpython_8datetime_4time_6minute_minute(__pyx_v_time), __pyx_f_7cpython_8datetime_4time_6second_second(__pyx_v_time), __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(__pyx_v_time), __pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1852
 *     return datetime.datetime_new(date.year, date.month, date.day, 0, 0, 0, 0, tz, 0)
 * 
 * cdef inline datetime.datetime dt_fr_time(datetime.time time):             # <<<<<<<<<<<<<<
 *     """Create datetime from time (include subclass) `<'datetime.datetime'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.dt_fr_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1863
 *     )
 * 
 * cdef inline datetime.datetime dt_fr_dt(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Create datetime from another datetime (include subclass) `<'datetime.datetime'>`."""
 *     return datetime.datetime_new(
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_fr_dt(PyDateTime_DateTime *__pyx_v_dt) {
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_fr_dt", 1);

  /* "utils.pxd":1865
 * cdef inline datetime.datetime dt_fr_dt(datetime.datetime dt):
 *     """Create datetime from another datetime (include subclass) `<'datetime.datetime'>`."""
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "utils.pxd":1868
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 *         dt.microsecond, dt.tzinfo, dt.fold             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "utils.pxd":1865
 * cdef inline datetime.datetime dt_fr_dt(datetime.datetime dt):
 *     """Create datetime from another datetime (include subclass) `<'datetime.datetime'>`."""
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 */
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.fold = __pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt), __pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1863
 *     )
 * 
 * cdef inline datetime.datetime dt_fr_dt(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Create datetime from another datetime (include subclass) `<'datetime.datetime'>`."""
 *     return datetime.datetime_new(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.dt_fr_dt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1872
 * 
 * # . manipulation
 * cdef inline datetime.datetime dt_add(datetime.datetime dt, int days=0, int seconds=0, int microseconds=0):             # <<<<<<<<<<<<<<
 *     """Add delta to datetime `<'datetime.datetime'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_add(PyDateTime_DateTime *__pyx_v_dt, struct __pyx_opt_args_7cytimes_5utils_dt_add *__pyx_optional_args) {
  int __pyx_v_days = ((int)0);
  int __pyx_v_seconds = ((int)0);
  int __pyx_v_microseconds = ((int)0);
  PY_LONG_LONG __pyx_v_dd;
  PY_LONG_LONG __pyx_v_hh;
  PY_LONG_LONG __pyx_v_mi;
  PY_LONG_LONG __pyx_v_ss;
  PY_LONG_LONG __pyx_v_us;
  __pyx_t_7cytimes_5utils_ymd __pyx_v__ymd;
  __pyx_t_7cytimes_5utils_hmsf __pyx_v__hmsf;
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_ordinal __pyx_t_4;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PY_LONG_LONG __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_us __pyx_t_10;
  __pyx_t_7cytimes_5utils_hmsf __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_add", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_days = __pyx_optional_args->days;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_seconds = __pyx_optional_args->seconds;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_microseconds = __pyx_optional_args->microseconds;
        }
      }
    }
  }

  /* "utils.pxd":1880
 *     # Fast-path
 *     cdef long long dd, hh, mi, ss, us
 *     if seconds == 0 and microseconds == 0:             # <<<<<<<<<<<<<<
 *         # No adjustment
 *         if days == 0:
 */
  __pyx_t_2 = (__pyx_v_seconds == 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_microseconds == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "utils.pxd":1882
 *     if seconds == 0 and microseconds == 0:
 *         # No adjustment
 *         if days == 0:             # <<<<<<<<<<<<<<
 *             return dt  # exit
 * 
 */
    __pyx_t_1 = (__pyx_v_days == 0);
    if (__pyx_t_1) {

      /* "utils.pxd":1883
 *         # No adjustment
 *         if days == 0:
 *             return dt  # exit             # <<<<<<<<<<<<<<
 * 
 *         # Add 'day' delta
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_dt);
      __pyx_r = __pyx_v_dt;
      goto __pyx_L0;

      /* "utils.pxd":1882
 *     if seconds == 0 and microseconds == 0:
 *         # No adjustment
 *         if days == 0:             # <<<<<<<<<<<<<<
 *             return dt  # exit
 * 
 */
    }

    /* "utils.pxd":1886
 * 
 *         # Add 'day' delta
 *         _ymd = ymd_fr_ordinal(dt_to_ordinal(dt, False) + days)             # <<<<<<<<<<<<<<
 *         hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond
 * 
 */
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.utc = 0;
    __pyx_t_3 = __pyx_f_7cytimes_5utils_dt_to_ordinal(__pyx_v_dt, &__pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 1886, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal((__pyx_t_3 + __pyx_v_days)); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1886, __pyx_L1_error)
    __pyx_v__ymd = __pyx_t_5;

    /* "utils.pxd":1887
 *         # Add 'day' delta
 *         _ymd = ymd_fr_ordinal(dt_to_ordinal(dt, False) + days)
 *         hh, mi, ss, us = dt.hour, dt.minute, dt.second, dt.microsecond             # <<<<<<<<<<<<<<
 * 
 *     # Compute full delta
 */
    __pyx_t_3 = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);
    __pyx_t_6 = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);
    __pyx_t_7 = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);
    __pyx_t_8 = __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt);
    __pyx_v_hh = __pyx_t_3;
    __pyx_v_mi = __pyx_t_6;
    __pyx_v_ss = __pyx_t_7;
    __pyx_v_us = __pyx_t_8;

    /* "utils.pxd":1880
 *     # Fast-path
 *     cdef long long dd, hh, mi, ss, us
 *     if seconds == 0 and microseconds == 0:             # <<<<<<<<<<<<<<
 *         # No adjustment
 *         if days == 0:
 */
    goto __pyx_L3;
  }

  /* "utils.pxd":1892
 *     else:
 *         # Add 'us' delta
 *         dd, ss, us = days, seconds, microseconds             # <<<<<<<<<<<<<<
 *         us += dd * US_DAY + ss * US_SECOND
 *         us += dt_to_us(dt, False) + EPOCH_MICROSECOND
 */
  /*else*/ {
    __pyx_t_8 = __pyx_v_days;
    __pyx_t_7 = __pyx_v_seconds;
    __pyx_t_6 = __pyx_v_microseconds;
    __pyx_v_dd = __pyx_t_8;
    __pyx_v_ss = __pyx_t_7;
    __pyx_v_us = __pyx_t_6;

    /* "utils.pxd":1893
 *         # Add 'us' delta
 *         dd, ss, us = days, seconds, microseconds
 *         us += dd * US_DAY + ss * US_SECOND             # <<<<<<<<<<<<<<
 *         us += dt_to_us(dt, False) + EPOCH_MICROSECOND
 *         _ymd = ymd_fr_ordinal(math_floor_div(us, US_DAY))
 */
    __pyx_v_us = (__pyx_v_us + ((__pyx_v_dd * __pyx_v_7cytimes_5utils_US_DAY) + (__pyx_v_ss * __pyx_v_7cytimes_5utils_US_SECOND)));

    /* "utils.pxd":1894
 *         dd, ss, us = days, seconds, microseconds
 *         us += dd * US_DAY + ss * US_SECOND
 *         us += dt_to_us(dt, False) + EPOCH_MICROSECOND             # <<<<<<<<<<<<<<
 *         _ymd = ymd_fr_ordinal(math_floor_div(us, US_DAY))
 *         _hmsf = hmsf_fr_us(us)
 */
    __pyx_t_10.__pyx_n = 1;
    __pyx_t_10.utc = 0;
    __pyx_t_9 = __pyx_f_7cytimes_5utils_dt_to_us(__pyx_v_dt, &__pyx_t_10); if (unlikely(__pyx_t_9 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 1894, __pyx_L1_error)
    __pyx_v_us = (__pyx_v_us + (__pyx_t_9 + __pyx_v_7cytimes_5utils_EPOCH_MICROSECOND));

    /* "utils.pxd":1895
 *         us += dd * US_DAY + ss * US_SECOND
 *         us += dt_to_us(dt, False) + EPOCH_MICROSECOND
 *         _ymd = ymd_fr_ordinal(math_floor_div(us, US_DAY))             # <<<<<<<<<<<<<<
 *         _hmsf = hmsf_fr_us(us)
 *         hh, mi, ss, us = _hmsf.hour, _hmsf.minute, _hmsf.second, _hmsf.microsecond
 */
    __pyx_t_9 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_us, __pyx_v_7cytimes_5utils_US_DAY, NULL); if (unlikely(__pyx_t_9 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 1895, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal(__pyx_t_9); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1895, __pyx_L1_error)
    __pyx_v__ymd = __pyx_t_5;

    /* "utils.pxd":1896
 *         us += dt_to_us(dt, False) + EPOCH_MICROSECOND
 *         _ymd = ymd_fr_ordinal(math_floor_div(us, US_DAY))
 *         _hmsf = hmsf_fr_us(us)             # <<<<<<<<<<<<<<
 *         hh, mi, ss, us = _hmsf.hour, _hmsf.minute, _hmsf.second, _hmsf.microsecond
 * 
 */
    __pyx_t_11 = __pyx_f_7cytimes_5utils_hmsf_fr_us(__pyx_v_us); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1896, __pyx_L1_error)
    __pyx_v__hmsf = __pyx_t_11;

    /* "utils.pxd":1897
 *         _ymd = ymd_fr_ordinal(math_floor_div(us, US_DAY))
 *         _hmsf = hmsf_fr_us(us)
 *         hh, mi, ss, us = _hmsf.hour, _hmsf.minute, _hmsf.second, _hmsf.microsecond             # <<<<<<<<<<<<<<
 * 
 *     # New datetime
 */
    __pyx_t_6 = __pyx_v__hmsf.hour;
    __pyx_t_7 = __pyx_v__hmsf.minute;
    __pyx_t_8 = __pyx_v__hmsf.second;
    __pyx_t_3 = __pyx_v__hmsf.microsecond;
    __pyx_v_hh = __pyx_t_6;
    __pyx_v_mi = __pyx_t_7;
    __pyx_v_ss = __pyx_t_8;
    __pyx_v_us = __pyx_t_3;
  }
  __pyx_L3:;

  /* "utils.pxd":1900
 * 
 *     # New datetime
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         _ymd.year, _ymd.month, _ymd.day,
 *         hh, mi, ss, us, dt.tzinfo, dt.fold,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "utils.pxd":1902
 *     return datetime.datetime_new(
 *         _ymd.year, _ymd.month, _ymd.day,
 *         hh, mi, ss, us, dt.tzinfo, dt.fold,             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_12 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 1902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);

  /* "utils.pxd":1900
 * 
 *     # New datetime
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         _ymd.year, _ymd.month, _ymd.day,
 *         hh, mi, ss, us, dt.tzinfo, dt.fold,
 */
  __pyx_t_14.__pyx_n = 1;
  __pyx_t_14.fold = __pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt);
  __pyx_t_13 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_v__ymd.year, __pyx_v__ymd.month, __pyx_v__ymd.day, __pyx_v_hh, __pyx_v_mi, __pyx_v_ss, __pyx_v_us, __pyx_t_12, &__pyx_t_14)); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 1900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_13);
  __pyx_t_13 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1872
 * 
 * # . manipulation
 * cdef inline datetime.datetime dt_add(datetime.datetime dt, int days=0, int seconds=0, int microseconds=0):             # <<<<<<<<<<<<<<
 *     """Add delta to datetime `<'datetime.datetime'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("cytimes.utils.dt_add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1905
 *     )
 * 
 * cdef inline datetime.datetime dt_replace_tz(datetime.datetime dt, object tz):             # <<<<<<<<<<<<<<
 *     """Replace the datetime timezone `<'datetime.datetime'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_replace_tz(PyDateTime_DateTime *__pyx_v_dt, PyObject *__pyx_v_tz) {
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_replace_tz", 1);

  /* "utils.pxd":1912
 *     """
 *     # Same tzinfo
 *     if tz is datetime.datetime_tzinfo(dt):             # <<<<<<<<<<<<<<
 *         return dt
 * 
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_datetime_tzinfo(((PyObject *)__pyx_v_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_v_tz == __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "utils.pxd":1913
 *     # Same tzinfo
 *     if tz is datetime.datetime_tzinfo(dt):
 *         return dt             # <<<<<<<<<<<<<<
 * 
 *     # New datetime
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_dt);
    __pyx_r = __pyx_v_dt;
    goto __pyx_L0;

    /* "utils.pxd":1912
 *     """
 *     # Same tzinfo
 *     if tz is datetime.datetime_tzinfo(dt):             # <<<<<<<<<<<<<<
 *         return dt
 * 
 */
  }

  /* "utils.pxd":1916
 * 
 *     # New datetime
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "utils.pxd":1919
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 *         dt.microsecond, tz, dt.fold,             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.fold = __pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt), __pyx_v_tz, &__pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1905
 *     )
 * 
 * cdef inline datetime.datetime dt_replace_tz(datetime.datetime dt, object tz):             # <<<<<<<<<<<<<<
 *     """Replace the datetime timezone `<'datetime.datetime'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt_replace_tz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1922
 *     )
 * 
 * cdef inline datetime.datetime dt_replace_fold(datetime.datetime dt, int fold):             # <<<<<<<<<<<<<<
 *     """Replace the datetime fold `<'datetime.datetime'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_replace_fold(PyDateTime_DateTime *__pyx_v_dt, int __pyx_v_fold) {
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_replace_fold", 1);

  /* "utils.pxd":1929
 *     """
 *     # Same fold
 *     if fold not in (0, 1) or fold == dt.fold:             # <<<<<<<<<<<<<<
 *         return dt
 * 
 */
  switch (__pyx_v_fold) {
    case 0:
    case 1:
    __pyx_t_2 = 0;
    break;
    default:
    __pyx_t_2 = 1;
    break;
  }
  __pyx_t_3 = __pyx_t_2;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_fold == __pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt));
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "utils.pxd":1930
 *     # Same fold
 *     if fold not in (0, 1) or fold == dt.fold:
 *         return dt             # <<<<<<<<<<<<<<
 * 
 *     # New datetime
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_dt);
    __pyx_r = __pyx_v_dt;
    goto __pyx_L0;

    /* "utils.pxd":1929
 *     """
 *     # Same fold
 *     if fold not in (0, 1) or fold == dt.fold:             # <<<<<<<<<<<<<<
 *         return dt
 * 
 */
  }

  /* "utils.pxd":1933
 * 
 *     # New datetime
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "utils.pxd":1936
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 *         dt.microsecond, dt.tzinfo, fold,             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_4 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "utils.pxd":1933
 * 
 *     # New datetime
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 */
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.fold = __pyx_v_fold;
  __pyx_t_5 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt), __pyx_t_4, &__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_5);
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1922
 *     )
 * 
 * cdef inline datetime.datetime dt_replace_fold(datetime.datetime dt, int fold):             # <<<<<<<<<<<<<<
 *     """Replace the datetime fold `<'datetime.datetime'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils.dt_replace_fold", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1939
 *     )
 * 
 * cdef inline datetime.datetime dt_astimezone(datetime.datetime dt, object tz=None):             # <<<<<<<<<<<<<<
 *     """Convert the datetime timezone `<'datetime.datetime'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt_astimezone(PyDateTime_DateTime *__pyx_v_dt, struct __pyx_opt_args_7cytimes_5utils_dt_astimezone *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  PyObject *__pyx_v_mytz = NULL;
  PyDateTime_Delta *__pyx_v_myoffset = NULL;
  PY_LONG_LONG __pyx_v_us;
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  struct __pyx_opt_args_7cytimes_5utils_tz_local __pyx_t_3;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PY_LONG_LONG __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_us __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_dt_fr_us __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  unsigned int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_astimezone", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_dt);
  __Pyx_INCREF(__pyx_v_tz);

  /* "utils.pxd":1945
 *     >>> dt.astimezone(tz)
 *     """
 *     mytz = datetime.datetime_tzinfo(dt)             # <<<<<<<<<<<<<<
 *     if tz is None:
 *         tz = tz_local(dt)
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_datetime_tzinfo(((PyObject *)__pyx_v_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_mytz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "utils.pxd":1946
 *     """
 *     mytz = datetime.datetime_tzinfo(dt)
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         tz = tz_local(dt)
 *         if mytz is None:
 */
  __pyx_t_2 = (__pyx_v_tz == Py_None);
  if (__pyx_t_2) {

    /* "utils.pxd":1947
 *     mytz = datetime.datetime_tzinfo(dt)
 *     if tz is None:
 *         tz = tz_local(dt)             # <<<<<<<<<<<<<<
 *         if mytz is None:
 *             # since 'dt' is timezone-naive, we
 */
    __pyx_t_3.__pyx_n = 1;
    __pyx_t_3.dt = __pyx_v_dt;
    __pyx_t_1 = __pyx_f_7cytimes_5utils_tz_local(&__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1947, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "utils.pxd":1948
 *     if tz is None:
 *         tz = tz_local(dt)
 *         if mytz is None:             # <<<<<<<<<<<<<<
 *             # since 'dt' is timezone-naive, we
 *             # simply localize to the local timezone.
 */
    __pyx_t_2 = (__pyx_v_mytz == Py_None);
    if (__pyx_t_2) {

      /* "utils.pxd":1951
 *             # since 'dt' is timezone-naive, we
 *             # simply localize to the local timezone.
 *             return dt_replace_tz(dt, tz)  # exit             # <<<<<<<<<<<<<<
 * 
 *     if mytz is None:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_replace_tz(__pyx_v_dt, __pyx_v_tz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1951, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1);
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "utils.pxd":1948
 *     if tz is None:
 *         tz = tz_local(dt)
 *         if mytz is None:             # <<<<<<<<<<<<<<
 *             # since 'dt' is timezone-naive, we
 *             # simply localize to the local timezone.
 */
    }

    /* "utils.pxd":1946
 *     """
 *     mytz = datetime.datetime_tzinfo(dt)
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         tz = tz_local(dt)
 *         if mytz is None:
 */
  }

  /* "utils.pxd":1953
 *             return dt_replace_tz(dt, tz)  # exit
 * 
 *     if mytz is None:             # <<<<<<<<<<<<<<
 *         mytz = tz_local(dt)
 *         if mytz is tz:
 */
  __pyx_t_2 = (__pyx_v_mytz == Py_None);
  if (__pyx_t_2) {

    /* "utils.pxd":1954
 * 
 *     if mytz is None:
 *         mytz = tz_local(dt)             # <<<<<<<<<<<<<<
 *         if mytz is tz:
 *             # Since 'dt' is timezone-naive, we
 */
    __pyx_t_3.__pyx_n = 1;
    __pyx_t_3.dt = __pyx_v_dt;
    __pyx_t_1 = __pyx_f_7cytimes_5utils_tz_local(&__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1954, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_mytz, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "utils.pxd":1955
 *     if mytz is None:
 *         mytz = tz_local(dt)
 *         if mytz is tz:             # <<<<<<<<<<<<<<
 *             # Since 'dt' is timezone-naive, we
 *             # simply localize to the target timezone.
 */
    __pyx_t_2 = (__pyx_v_mytz == __pyx_v_tz);
    if (__pyx_t_2) {

      /* "utils.pxd":1958
 *             # Since 'dt' is timezone-naive, we
 *             # simply localize to the target timezone.
 *             return dt_replace_tz(dt, tz)  # exit             # <<<<<<<<<<<<<<
 *         myoffset = tz_utcoffset(mytz, dt)
 *     elif mytz is tz:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_replace_tz(__pyx_v_dt, __pyx_v_tz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1958, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1);
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "utils.pxd":1955
 *     if mytz is None:
 *         mytz = tz_local(dt)
 *         if mytz is tz:             # <<<<<<<<<<<<<<
 *             # Since 'dt' is timezone-naive, we
 *             # simply localize to the target timezone.
 */
    }

    /* "utils.pxd":1959
 *             # simply localize to the target timezone.
 *             return dt_replace_tz(dt, tz)  # exit
 *         myoffset = tz_utcoffset(mytz, dt)             # <<<<<<<<<<<<<<
 *     elif mytz is tz:
 *         return dt  # exit
 */
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.dt = __pyx_v_dt;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_utcoffset(__pyx_v_mytz, &__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_myoffset = ((PyDateTime_Delta *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "utils.pxd":1953
 *             return dt_replace_tz(dt, tz)  # exit
 * 
 *     if mytz is None:             # <<<<<<<<<<<<<<
 *         mytz = tz_local(dt)
 *         if mytz is tz:
 */
    goto __pyx_L5;
  }

  /* "utils.pxd":1960
 *             return dt_replace_tz(dt, tz)  # exit
 *         myoffset = tz_utcoffset(mytz, dt)
 *     elif mytz is tz:             # <<<<<<<<<<<<<<
 *         return dt  # exit
 *     else:
 */
  __pyx_t_2 = (__pyx_v_mytz == __pyx_v_tz);
  if (__pyx_t_2) {

    /* "utils.pxd":1961
 *         myoffset = tz_utcoffset(mytz, dt)
 *     elif mytz is tz:
 *         return dt  # exit             # <<<<<<<<<<<<<<
 *     else:
 *         myoffset = tz_utcoffset(mytz, dt)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_dt);
    __pyx_r = __pyx_v_dt;
    goto __pyx_L0;

    /* "utils.pxd":1960
 *             return dt_replace_tz(dt, tz)  # exit
 *         myoffset = tz_utcoffset(mytz, dt)
 *     elif mytz is tz:             # <<<<<<<<<<<<<<
 *         return dt  # exit
 *     else:
 */
  }

  /* "utils.pxd":1963
 *         return dt  # exit
 *     else:
 *         myoffset = tz_utcoffset(mytz, dt)             # <<<<<<<<<<<<<<
 *         if myoffset is None:
 *             mytz = tz_local(dt_replace_tz(dt, None))
 */
  /*else*/ {
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.dt = __pyx_v_dt;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_utcoffset(__pyx_v_mytz, &__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1963, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_myoffset = ((PyDateTime_Delta *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "utils.pxd":1964
 *     else:
 *         myoffset = tz_utcoffset(mytz, dt)
 *         if myoffset is None:             # <<<<<<<<<<<<<<
 *             mytz = tz_local(dt_replace_tz(dt, None))
 *             if mytz is tz:
 */
    __pyx_t_2 = (((PyObject *)__pyx_v_myoffset) == Py_None);
    if (__pyx_t_2) {

      /* "utils.pxd":1965
 *         myoffset = tz_utcoffset(mytz, dt)
 *         if myoffset is None:
 *             mytz = tz_local(dt_replace_tz(dt, None))             # <<<<<<<<<<<<<<
 *             if mytz is tz:
 *                 return dt  # exit
 */
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_replace_tz(__pyx_v_dt, Py_None)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1965, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3.__pyx_n = 1;
      __pyx_t_3.dt = ((PyDateTime_DateTime *)__pyx_t_1);
      __pyx_t_5 = __pyx_f_7cytimes_5utils_tz_local(&__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1965, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF_SET(__pyx_v_mytz, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "utils.pxd":1966
 *         if myoffset is None:
 *             mytz = tz_local(dt_replace_tz(dt, None))
 *             if mytz is tz:             # <<<<<<<<<<<<<<
 *                 return dt  # exit
 *             myoffset = tz_utcoffset(mytz, dt)
 */
      __pyx_t_2 = (__pyx_v_mytz == __pyx_v_tz);
      if (__pyx_t_2) {

        /* "utils.pxd":1967
 *             mytz = tz_local(dt_replace_tz(dt, None))
 *             if mytz is tz:
 *                 return dt  # exit             # <<<<<<<<<<<<<<
 *             myoffset = tz_utcoffset(mytz, dt)
 * 
 */
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __Pyx_INCREF((PyObject *)__pyx_v_dt);
        __pyx_r = __pyx_v_dt;
        goto __pyx_L0;

        /* "utils.pxd":1966
 *         if myoffset is None:
 *             mytz = tz_local(dt_replace_tz(dt, None))
 *             if mytz is tz:             # <<<<<<<<<<<<<<
 *                 return dt  # exit
 *             myoffset = tz_utcoffset(mytz, dt)
 */
      }

      /* "utils.pxd":1968
 *             if mytz is tz:
 *                 return dt  # exit
 *             myoffset = tz_utcoffset(mytz, dt)             # <<<<<<<<<<<<<<
 * 
 *     # Convert to UTC time
 */
      __pyx_t_4.__pyx_n = 1;
      __pyx_t_4.dt = __pyx_v_dt;
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_utcoffset(__pyx_v_mytz, &__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1968, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF_SET(__pyx_v_myoffset, ((PyDateTime_Delta *)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "utils.pxd":1964
 *     else:
 *         myoffset = tz_utcoffset(mytz, dt)
 *         if myoffset is None:             # <<<<<<<<<<<<<<
 *             mytz = tz_local(dt_replace_tz(dt, None))
 *             if mytz is tz:
 */
    }
  }
  __pyx_L5:;

  /* "utils.pxd":1971
 * 
 *     # Convert to UTC time
 *     cdef long long us = dt_to_us(dt, False)             # <<<<<<<<<<<<<<
 *     us -= td_to_us(myoffset)
 *     dt = dt_fr_us(us, tz)
 */
  __pyx_t_7.__pyx_n = 1;
  __pyx_t_7.utc = 0;
  __pyx_t_6 = __pyx_f_7cytimes_5utils_dt_to_us(__pyx_v_dt, &__pyx_t_7); if (unlikely(__pyx_t_6 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 1971, __pyx_L1_error)
  __pyx_v_us = __pyx_t_6;

  /* "utils.pxd":1972
 *     # Convert to UTC time
 *     cdef long long us = dt_to_us(dt, False)
 *     us -= td_to_us(myoffset)             # <<<<<<<<<<<<<<
 *     dt = dt_fr_us(us, tz)
 * 
 */
  __pyx_t_6 = __pyx_f_7cytimes_5utils_td_to_us(__pyx_v_myoffset); if (unlikely(__pyx_t_6 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 1972, __pyx_L1_error)
  __pyx_v_us = (__pyx_v_us - __pyx_t_6);

  /* "utils.pxd":1973
 *     cdef long long us = dt_to_us(dt, False)
 *     us -= td_to_us(myoffset)
 *     dt = dt_fr_us(us, tz)             # <<<<<<<<<<<<<<
 * 
 *     # Convert from UTC to tz's local time
 */
  __pyx_t_8.__pyx_n = 1;
  __pyx_t_8.tz = __pyx_v_tz;
  __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_us(__pyx_v_us, &__pyx_t_8)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_5));
  __pyx_t_5 = 0;

  /* "utils.pxd":1976
 * 
 *     # Convert from UTC to tz's local time
 *     return tz.fromutc(dt)             # <<<<<<<<<<<<<<
 * 
 * # datetime.time ----------------------------------------------------------------------------------------
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_fromutc); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = NULL;
  __pyx_t_10 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_10 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, ((PyObject *)__pyx_v_dt)};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1976, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(5, 1976, __pyx_L1_error)
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_5);
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1939
 *     )
 * 
 * cdef inline datetime.datetime dt_astimezone(datetime.datetime dt, object tz=None):             # <<<<<<<<<<<<<<
 *     """Convert the datetime timezone `<'datetime.datetime'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("cytimes.utils.dt_astimezone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_mytz);
  __Pyx_XDECREF((PyObject *)__pyx_v_myoffset);
  __Pyx_XDECREF((PyObject *)__pyx_v_dt);
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1980
 * # datetime.time ----------------------------------------------------------------------------------------
 * # . generate
 * cdef inline datetime.time time_new(             # <<<<<<<<<<<<<<
 *     int hour=0, int minute=0, int second=0,
 *     int microsecond=0, object tz=None, int fold=0,
 */

static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cytimes_5utils_time_new(struct __pyx_opt_args_7cytimes_5utils_time_new *__pyx_optional_args) {
  int __pyx_v_hour = ((int)0);
  int __pyx_v_minute = ((int)0);
  int __pyx_v_second = ((int)0);
  int __pyx_v_microsecond = ((int)0);

  /* "utils.pxd":1982
 * cdef inline datetime.time time_new(
 *     int hour=0, int minute=0, int second=0,
 *     int microsecond=0, object tz=None, int fold=0,             # <<<<<<<<<<<<<<
 * ):
 *     """Create a new time `<'datetime.time'>`.
 */
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  int __pyx_v_fold = ((int)0);
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  long __pyx_t_2;
  int __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_time_new __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_new", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_hour = __pyx_optional_args->hour;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_minute = __pyx_optional_args->minute;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_second = __pyx_optional_args->second;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_microsecond = __pyx_optional_args->microsecond;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_tz = __pyx_optional_args->tz;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_fold = __pyx_optional_args->fold;
              }
            }
          }
        }
      }
    }
  }

  /* "utils.pxd":1989
 *     >>> datetime.time(hour, minute, second, microsecond, tz, fold)
 *     """
 *     hour = min(max(hour, 0), 23)             # <<<<<<<<<<<<<<
 *     minute = min(max(minute, 0), 59)
 *     second = min(max(second, 0), 59)
 */
  __pyx_t_1 = 23;
  __pyx_t_2 = 0;
  __pyx_t_3 = __pyx_v_hour;
  __pyx_t_5 = (__pyx_t_2 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = (__pyx_t_1 < __pyx_t_2);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_hour = __pyx_t_4;

  /* "utils.pxd":1990
 *     """
 *     hour = min(max(hour, 0), 23)
 *     minute = min(max(minute, 0), 59)             # <<<<<<<<<<<<<<
 *     second = min(max(second, 0), 59)
 *     microsecond = min(max(microsecond, 0), 999_999)
 */
  __pyx_t_4 = 59;
  __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_v_minute;
  __pyx_t_5 = (__pyx_t_1 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_2 = __pyx_t_1;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  __pyx_t_1 = __pyx_t_2;
  __pyx_t_5 = (__pyx_t_4 < __pyx_t_1);
  if (__pyx_t_5) {
    __pyx_t_2 = __pyx_t_4;
  } else {
    __pyx_t_2 = __pyx_t_1;
  }
  __pyx_v_minute = __pyx_t_2;

  /* "utils.pxd":1991
 *     hour = min(max(hour, 0), 23)
 *     minute = min(max(minute, 0), 59)
 *     second = min(max(second, 0), 59)             # <<<<<<<<<<<<<<
 *     microsecond = min(max(microsecond, 0), 999_999)
 *     return datetime.time_new(
 */
  __pyx_t_2 = 59;
  __pyx_t_4 = 0;
  __pyx_t_3 = __pyx_v_second;
  __pyx_t_5 = (__pyx_t_4 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_1 = __pyx_t_4;
  } else {
    __pyx_t_1 = __pyx_t_3;
  }
  __pyx_t_4 = __pyx_t_1;
  __pyx_t_5 = (__pyx_t_2 < __pyx_t_4);
  if (__pyx_t_5) {
    __pyx_t_1 = __pyx_t_2;
  } else {
    __pyx_t_1 = __pyx_t_4;
  }
  __pyx_v_second = __pyx_t_1;

  /* "utils.pxd":1992
 *     minute = min(max(minute, 0), 59)
 *     second = min(max(second, 0), 59)
 *     microsecond = min(max(microsecond, 0), 999_999)             # <<<<<<<<<<<<<<
 *     return datetime.time_new(
 *         hour, minute, second, microsecond,
 */
  __pyx_t_1 = 0xF423F;
  __pyx_t_2 = 0;
  __pyx_t_3 = __pyx_v_microsecond;
  __pyx_t_5 = (__pyx_t_2 > __pyx_t_3);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = (__pyx_t_1 < __pyx_t_2);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __pyx_v_microsecond = __pyx_t_4;

  /* "utils.pxd":1993
 *     second = min(max(second, 0), 59)
 *     microsecond = min(max(microsecond, 0), 999_999)
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         hour, minute, second, microsecond,
 *         tz, 1 if fold == 1 else 0,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "utils.pxd":1995
 *     return datetime.time_new(
 *         hour, minute, second, microsecond,
 *         tz, 1 if fold == 1 else 0,             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_5 = (__pyx_v_fold == 1);
  if (__pyx_t_5) {
    __pyx_t_3 = 1;
  } else {
    __pyx_t_3 = 0;
  }

  /* "utils.pxd":1993
 *     second = min(max(second, 0), 59)
 *     microsecond = min(max(microsecond, 0), 999_999)
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         hour, minute, second, microsecond,
 *         tz, 1 if fold == 1 else 0,
 */
  __pyx_t_7.__pyx_n = 1;
  __pyx_t_7.fold = __pyx_t_3;
  __pyx_t_6 = ((PyObject *)__pyx_f_7cpython_8datetime_time_new(__pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_tz, &__pyx_t_7)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = ((PyDateTime_Time *)__pyx_t_6);
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1980
 * # datetime.time ----------------------------------------------------------------------------------------
 * # . generate
 * cdef inline datetime.time time_new(             # <<<<<<<<<<<<<<
 *     int hour=0, int minute=0, int second=0,
 *     int microsecond=0, object tz=None, int fold=0,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cytimes.utils.time_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":1998
 *     )
 * 
 * cdef inline datetime.time time_now(object tz=None):             # <<<<<<<<<<<<<<
 *     """Get the current time `<'datetime.time'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cytimes_5utils_time_now(struct __pyx_opt_args_7cytimes_5utils_time_now *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  double __pyx_v_ts;
  PY_LONG_LONG __pyx_v_us;
  struct tm __pyx_v__tm;
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp __pyx_t_4;
  struct tm __pyx_t_5;
  struct __pyx_opt_args_7cpython_8datetime_time_new __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_now", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "utils.pxd":2005
 *     """
 *     # With timezone
 *     if tz is not None:             # <<<<<<<<<<<<<<
 *         return time_fr_dt(datetime.datetime_from_timestamp(unix_time(), tz))
 * 
 */
  __pyx_t_1 = (__pyx_v_tz != Py_None);
  if (__pyx_t_1) {

    /* "utils.pxd":2006
 *     # With timezone
 *     if tz is not None:
 *         return time_fr_dt(datetime.datetime_from_timestamp(unix_time(), tz))             # <<<<<<<<<<<<<<
 * 
 *     # Without timezone
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_f_7cpython_4time_time()); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.tz = __pyx_v_tz;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_from_timestamp(__pyx_t_2, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_time_fr_dt(((PyDateTime_DateTime *)__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((PyDateTime_Time *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "utils.pxd":2005
 *     """
 *     # With timezone
 *     if tz is not None:             # <<<<<<<<<<<<<<
 *         return time_fr_dt(datetime.datetime_from_timestamp(unix_time(), tz))
 * 
 */
  }

  /* "utils.pxd":2009
 * 
 *     # Without timezone
 *     cdef double ts = unix_time()             # <<<<<<<<<<<<<<
 *     cdef long long us = int(ts * 1_000_000)
 *     _tm = tm_localtime(ts)
 */
  __pyx_v_ts = __pyx_f_7cpython_4time_time();

  /* "utils.pxd":2010
 *     # Without timezone
 *     cdef double ts = unix_time()
 *     cdef long long us = int(ts * 1_000_000)             # <<<<<<<<<<<<<<
 *     _tm = tm_localtime(ts)
 *     return datetime.time_new(
 */
  __pyx_v_us = ((PY_LONG_LONG)(__pyx_v_ts * 1000000.0));

  /* "utils.pxd":2011
 *     cdef double ts = unix_time()
 *     cdef long long us = int(ts * 1_000_000)
 *     _tm = tm_localtime(ts)             # <<<<<<<<<<<<<<
 *     return datetime.time_new(
 *         _tm.tm_hour, _tm.tm_min, _tm.tm_sec, us % 1_000_000, None, 0
 */
  __pyx_t_5 = __pyx_f_7cytimes_5utils_tm_localtime(__pyx_v_ts); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 2011, __pyx_L1_error)
  __pyx_v__tm = __pyx_t_5;

  /* "utils.pxd":2012
 *     cdef long long us = int(ts * 1_000_000)
 *     _tm = tm_localtime(ts)
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         _tm.tm_hour, _tm.tm_min, _tm.tm_sec, us % 1_000_000, None, 0
 *     )
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "utils.pxd":2013
 *     _tm = tm_localtime(ts)
 *     return datetime.time_new(
 *         _tm.tm_hour, _tm.tm_min, _tm.tm_sec, us % 1_000_000, None, 0             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.fold = 0;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_time_new(__pyx_v__tm.tm_hour, __pyx_v__tm.tm_min, __pyx_v__tm.tm_sec, __Pyx_mod_PY_LONG_LONG(__pyx_v_us, 0xF4240), Py_None, &__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_Time *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":1998
 *     )
 * 
 * cdef inline datetime.time time_now(object tz=None):             # <<<<<<<<<<<<<<
 *     """Get the current time `<'datetime.time'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.time_now", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2017
 * 
 * # . type check
 * cdef inline bint is_time(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of datetime.time `<'bool'>`.
 * 
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_time(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "utils.pxd":2023
 *     >>> isinstance(obj, datetime.time)
 *     """
 *     return datetime.PyTime_Check(obj)             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_time_exact(object obj) except -1:
 */
  __pyx_r = PyTime_Check(__pyx_v_obj);
  goto __pyx_L0;

  /* "utils.pxd":2017
 * 
 * # . type check
 * cdef inline bint is_time(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of datetime.time `<'bool'>`.
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":2025
 *     return datetime.PyTime_Check(obj)
 * 
 * cdef inline bint is_time_exact(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is the exact datetime.time type `<'bool'>`.
 * 
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_time_exact(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "utils.pxd":2031
 *     >>> type(obj) is datetime.time
 *     """
 *     return datetime.PyTime_CheckExact(obj)             # <<<<<<<<<<<<<<
 * 
 * # . tzinfo
 */
  __pyx_r = PyTime_CheckExact(__pyx_v_obj);
  goto __pyx_L0;

  /* "utils.pxd":2025
 *     return datetime.PyTime_Check(obj)
 * 
 * cdef inline bint is_time_exact(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is the exact datetime.time type `<'bool'>`.
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":2034
 * 
 * # . tzinfo
 * cdef inline str time_tzname(datetime.time time):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'tzname' of the time `<'str/None'>`.
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_time_tzname(PyDateTime_Time *__pyx_v_time) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_name __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_tzname", 1);

  /* "utils.pxd":2040
 *     >>> time.tzname()
 *     """
 *     return tz_name(time.tzinfo, None)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.timedelta time_dst(datetime.time time):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(__pyx_v_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.dt = ((PyDateTime_DateTime *)Py_None);
  __pyx_t_2 = __pyx_f_7cytimes_5utils_tz_name(__pyx_t_1, &__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":2034
 * 
 * # . tzinfo
 * cdef inline str time_tzname(datetime.time time):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'tzname' of the time `<'str/None'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.time_tzname", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2042
 *     return tz_name(time.tzinfo, None)
 * 
 * cdef inline datetime.timedelta time_dst(datetime.time time):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'dst' of the time `<'datetime.timedelta/None'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_time_dst(PyDateTime_Time *__pyx_v_time) {
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_dst __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_dst", 1);

  /* "utils.pxd":2048
 *     >>> time.dst()
 *     """
 *     return tz_dst(time.tzinfo, None)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.timedelta time_utcoffset(datetime.time time):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(__pyx_v_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.dt = ((PyDateTime_DateTime *)Py_None);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_dst(__pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":2042
 *     return tz_name(time.tzinfo, None)
 * 
 * cdef inline datetime.timedelta time_dst(datetime.time time):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'dst' of the time `<'datetime.timedelta/None'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.time_dst", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2050
 *     return tz_dst(time.tzinfo, None)
 * 
 * cdef inline datetime.timedelta time_utcoffset(datetime.time time):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'utcoffset' of the time `<'datetime.timedelta/None'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_time_utcoffset(PyDateTime_Time *__pyx_v_time) {
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_utcoffset", 1);

  /* "utils.pxd":2056
 *     >>> time.utcoffset()
 *     """
 *     return tz_utcoffset(time.tzinfo, None)             # <<<<<<<<<<<<<<
 * 
 * # . conversion
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(__pyx_v_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.dt = ((PyDateTime_DateTime *)Py_None);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_utcoffset(__pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":2050
 *     return tz_dst(time.tzinfo, None)
 * 
 * cdef inline datetime.timedelta time_utcoffset(datetime.time time):             # <<<<<<<<<<<<<<
 *     """Get the tzinfo 'utcoffset' of the time `<'datetime.timedelta/None'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.time_utcoffset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2059
 * 
 * # . conversion
 * cdef inline str time_to_isoformat(datetime.time time, bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert time to string in ISO format `<'str'>`.
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_time_to_isoformat(PyDateTime_Time *__pyx_v_time, struct __pyx_opt_args_7cytimes_5utils_time_to_isoformat *__pyx_optional_args) {
  int __pyx_v_utc = ((int)0);
  int __pyx_v_us;
  PyObject *__pyx_v_utc_fmt = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcformat __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_to_isoformat", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_utc = __pyx_optional_args->utc;
    }
  }

  /* "utils.pxd":2066
 *     """
 *     cdef:
 *         int us = time.microsecond             # <<<<<<<<<<<<<<
 *         str utc_fmt = tz_utcformat(time.tzinfo, None) if utc else None
 * 
 */
  __pyx_v_us = __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(__pyx_v_time);

  /* "utils.pxd":2067
 *     cdef:
 *         int us = time.microsecond
 *         str utc_fmt = tz_utcformat(time.tzinfo, None) if utc else None             # <<<<<<<<<<<<<<
 * 
 *     if us == 0:
 */
  if (__pyx_v_utc) {
    __pyx_t_2 = __pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(__pyx_v_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2067, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.dt = ((PyDateTime_DateTime *)Py_None);
    __pyx_t_3 = __pyx_f_7cytimes_5utils_tz_utcformat(__pyx_t_2, &__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2067, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(5, 2067, __pyx_L1_error)
  __pyx_v_utc_fmt = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":2069
 *         str utc_fmt = tz_utcformat(time.tzinfo, None) if utc else None
 * 
 *     if us == 0:             # <<<<<<<<<<<<<<
 *         if utc_fmt is None:
 *             return "%02d:%02d:%02d" % (time.hour, time.minute, time.second)
 */
  __pyx_t_5 = (__pyx_v_us == 0);
  if (__pyx_t_5) {

    /* "utils.pxd":2070
 * 
 *     if us == 0:
 *         if utc_fmt is None:             # <<<<<<<<<<<<<<
 *             return "%02d:%02d:%02d" % (time.hour, time.minute, time.second)
 *         return "%02d:%02d:%02d%s" % (time.hour, time.minute, time.second, utc_fmt)
 */
    __pyx_t_5 = (__pyx_v_utc_fmt == ((PyObject*)Py_None));
    if (__pyx_t_5) {

      /* "utils.pxd":2071
 *     if us == 0:
 *         if utc_fmt is None:
 *             return "%02d:%02d:%02d" % (time.hour, time.minute, time.second)             # <<<<<<<<<<<<<<
 *         return "%02d:%02d:%02d%s" % (time.hour, time.minute, time.second, utc_fmt)
 *     else:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2071, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = 0;
      __pyx_t_7 = 127;
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_4hour_hour(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2071, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__11);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_6minute_minute(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2071, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__11);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_6second_second(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2071, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2071, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_r = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "utils.pxd":2070
 * 
 *     if us == 0:
 *         if utc_fmt is None:             # <<<<<<<<<<<<<<
 *             return "%02d:%02d:%02d" % (time.hour, time.minute, time.second)
 *         return "%02d:%02d:%02d%s" % (time.hour, time.minute, time.second, utc_fmt)
 */
    }

    /* "utils.pxd":2072
 *         if utc_fmt is None:
 *             return "%02d:%02d:%02d" % (time.hour, time.minute, time.second)
 *         return "%02d:%02d:%02d%s" % (time.hour, time.minute, time.second, utc_fmt)             # <<<<<<<<<<<<<<
 *     else:
 *         if utc_fmt is None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2072, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_4hour_hour(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2072, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u__11);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_6minute_minute(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2072, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_kp_u__11);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_6second_second(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2072, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_utc_fmt); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2072, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 6, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2072, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "utils.pxd":2069
 *         str utc_fmt = tz_utcformat(time.tzinfo, None) if utc else None
 * 
 *     if us == 0:             # <<<<<<<<<<<<<<
 *         if utc_fmt is None:
 *             return "%02d:%02d:%02d" % (time.hour, time.minute, time.second)
 */
  }

  /* "utils.pxd":2074
 *         return "%02d:%02d:%02d%s" % (time.hour, time.minute, time.second, utc_fmt)
 *     else:
 *         if utc_fmt is None:             # <<<<<<<<<<<<<<
 *             return "%02d:%02d:%02d.%06d" % (time.hour, time.minute, time.second, us)
 *         return "%02d:%02d:%02d.%06d%s" % (time.hour, time.minute, time.second, us, utc_fmt)
 */
  /*else*/ {
    __pyx_t_5 = (__pyx_v_utc_fmt == ((PyObject*)Py_None));
    if (__pyx_t_5) {

      /* "utils.pxd":2075
 *     else:
 *         if utc_fmt is None:
 *             return "%02d:%02d:%02d.%06d" % (time.hour, time.minute, time.second, us)             # <<<<<<<<<<<<<<
 *         return "%02d:%02d:%02d.%06d%s" % (time.hour, time.minute, time.second, us, utc_fmt)
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2075, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = 0;
      __pyx_t_7 = 127;
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_4hour_hour(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2075, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__11);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_6minute_minute(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2075, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__11);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_6second_second(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2075, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__14);
      __pyx_t_6 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__14);
      PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u__14);
      __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_us, 6, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2075, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2075, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_r = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "utils.pxd":2074
 *         return "%02d:%02d:%02d%s" % (time.hour, time.minute, time.second, utc_fmt)
 *     else:
 *         if utc_fmt is None:             # <<<<<<<<<<<<<<
 *             return "%02d:%02d:%02d.%06d" % (time.hour, time.minute, time.second, us)
 *         return "%02d:%02d:%02d.%06d%s" % (time.hour, time.minute, time.second, us, utc_fmt)
 */
    }

    /* "utils.pxd":2076
 *         if utc_fmt is None:
 *             return "%02d:%02d:%02d.%06d" % (time.hour, time.minute, time.second, us)
 *         return "%02d:%02d:%02d.%06d%s" % (time.hour, time.minute, time.second, us, utc_fmt)             # <<<<<<<<<<<<<<
 * 
 * cdef inline long long time_to_us(datetime.time time, bint utc=False):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_4hour_hour(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u__11);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_6minute_minute(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_kp_u__11);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_6second_second(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__14);
    __pyx_t_6 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__14);
    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_kp_u__14);
    __pyx_t_1 = __Pyx_PyUnicode_From_int(__pyx_v_us, 6, '0', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_utc_fmt); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 8, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "utils.pxd":2059
 * 
 * # . conversion
 * cdef inline str time_to_isoformat(datetime.time time, bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert time to string in ISO format `<'str'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.time_to_isoformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_utc_fmt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2078
 *         return "%02d:%02d:%02d.%06d%s" % (time.hour, time.minute, time.second, us, utc_fmt)
 * 
 * cdef inline long long time_to_us(datetime.time time, bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert time to microseconds `<'int'>`.
 * 
 */

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_time_to_us(PyDateTime_Time *__pyx_v_time, struct __pyx_opt_args_7cytimes_5utils_time_to_us *__pyx_optional_args) {
  int __pyx_v_utc = ((int)0);
  PY_LONG_LONG __pyx_v_hh;
  PY_LONG_LONG __pyx_v_mi;
  PY_LONG_LONG __pyx_v_ss;
  PY_LONG_LONG __pyx_v_us;
  PyDateTime_Delta *__pyx_v_utc_off = NULL;
  PY_LONG_LONG __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PY_LONG_LONG __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_to_us", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_utc = __pyx_optional_args->utc;
    }
  }

  /* "utils.pxd":2085
 *     """
 *     cdef:
 *         long long hh = time.hour             # <<<<<<<<<<<<<<
 *         long long mi = time.minute
 *         long long ss = time.second
 */
  __pyx_v_hh = __pyx_f_7cpython_8datetime_4time_4hour_hour(__pyx_v_time);

  /* "utils.pxd":2086
 *     cdef:
 *         long long hh = time.hour
 *         long long mi = time.minute             # <<<<<<<<<<<<<<
 *         long long ss = time.second
 *         long long us = time.microsecond
 */
  __pyx_v_mi = __pyx_f_7cpython_8datetime_4time_6minute_minute(__pyx_v_time);

  /* "utils.pxd":2087
 *         long long hh = time.hour
 *         long long mi = time.minute
 *         long long ss = time.second             # <<<<<<<<<<<<<<
 *         long long us = time.microsecond
 * 
 */
  __pyx_v_ss = __pyx_f_7cpython_8datetime_4time_6second_second(__pyx_v_time);

  /* "utils.pxd":2088
 *         long long mi = time.minute
 *         long long ss = time.second
 *         long long us = time.microsecond             # <<<<<<<<<<<<<<
 * 
 *     us += hh * US_HOUR + mi * US_MINUTE + ss * US_SECOND
 */
  __pyx_v_us = __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(__pyx_v_time);

  /* "utils.pxd":2090
 *         long long us = time.microsecond
 * 
 *     us += hh * US_HOUR + mi * US_MINUTE + ss * US_SECOND             # <<<<<<<<<<<<<<
 *     if utc:
 *         utc_off = time_utcoffset(time)
 */
  __pyx_v_us = (__pyx_v_us + (((__pyx_v_hh * __pyx_v_7cytimes_5utils_US_HOUR) + (__pyx_v_mi * __pyx_v_7cytimes_5utils_US_MINUTE)) + (__pyx_v_ss * __pyx_v_7cytimes_5utils_US_SECOND)));

  /* "utils.pxd":2091
 * 
 *     us += hh * US_HOUR + mi * US_MINUTE + ss * US_SECOND
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = time_utcoffset(time)
 *         if utc_off is not None:
 */
  if (__pyx_v_utc) {

    /* "utils.pxd":2092
 *     us += hh * US_HOUR + mi * US_MINUTE + ss * US_SECOND
 *     if utc:
 *         utc_off = time_utcoffset(time)             # <<<<<<<<<<<<<<
 *         if utc_off is not None:
 *             us -= td_to_us(utc_off)
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_time_utcoffset(__pyx_v_time)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2092, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_utc_off = ((PyDateTime_Delta *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "utils.pxd":2093
 *     if utc:
 *         utc_off = time_utcoffset(time)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             us -= td_to_us(utc_off)
 *     return us
 */
    __pyx_t_2 = (((PyObject *)__pyx_v_utc_off) != Py_None);
    if (__pyx_t_2) {

      /* "utils.pxd":2094
 *         utc_off = time_utcoffset(time)
 *         if utc_off is not None:
 *             us -= td_to_us(utc_off)             # <<<<<<<<<<<<<<
 *     return us
 * 
 */
      __pyx_t_3 = __pyx_f_7cytimes_5utils_td_to_us(__pyx_v_utc_off); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 2094, __pyx_L1_error)
      __pyx_v_us = (__pyx_v_us - __pyx_t_3);

      /* "utils.pxd":2093
 *     if utc:
 *         utc_off = time_utcoffset(time)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             us -= td_to_us(utc_off)
 *     return us
 */
    }

    /* "utils.pxd":2091
 * 
 *     us += hh * US_HOUR + mi * US_MINUTE + ss * US_SECOND
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = time_utcoffset(time)
 *         if utc_off is not None:
 */
  }

  /* "utils.pxd":2095
 *         if utc_off is not None:
 *             us -= td_to_us(utc_off)
 *     return us             # <<<<<<<<<<<<<<
 * 
 * cdef inline double time_to_seconds(datetime.time time, bint utc=False):
 */
  __pyx_r = __pyx_v_us;
  goto __pyx_L0;

  /* "utils.pxd":2078
 *         return "%02d:%02d:%02d.%06d%s" % (time.hour, time.minute, time.second, us, utc_fmt)
 * 
 * cdef inline long long time_to_us(datetime.time time, bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert time to microseconds `<'int'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.time_to_us", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_utc_off);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2097
 *     return us
 * 
 * cdef inline double time_to_seconds(datetime.time time, bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert time to seconds `<'float'>`.
 * 
 */

static CYTHON_INLINE double __pyx_f_7cytimes_5utils_time_to_seconds(PyDateTime_Time *__pyx_v_time, struct __pyx_opt_args_7cytimes_5utils_time_to_seconds *__pyx_optional_args) {
  int __pyx_v_utc = ((int)0);
  double __pyx_v_hh;
  double __pyx_v_mi;
  double __pyx_v_ss;
  double __pyx_v_us;
  PyDateTime_Delta *__pyx_v_utc_off = NULL;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  double __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_to_seconds", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_utc = __pyx_optional_args->utc;
    }
  }

  /* "utils.pxd":2104
 *     """
 *     cdef:
 *         double hh = time.hour             # <<<<<<<<<<<<<<
 *         double mi = time.minute
 *         double ss = time.second
 */
  __pyx_v_hh = __pyx_f_7cpython_8datetime_4time_4hour_hour(__pyx_v_time);

  /* "utils.pxd":2105
 *     cdef:
 *         double hh = time.hour
 *         double mi = time.minute             # <<<<<<<<<<<<<<
 *         double ss = time.second
 *         double us = time.microsecond
 */
  __pyx_v_mi = __pyx_f_7cpython_8datetime_4time_6minute_minute(__pyx_v_time);

  /* "utils.pxd":2106
 *         double hh = time.hour
 *         double mi = time.minute
 *         double ss = time.second             # <<<<<<<<<<<<<<
 *         double us = time.microsecond
 * 
 */
  __pyx_v_ss = __pyx_f_7cpython_8datetime_4time_6second_second(__pyx_v_time);

  /* "utils.pxd":2107
 *         double mi = time.minute
 *         double ss = time.second
 *         double us = time.microsecond             # <<<<<<<<<<<<<<
 * 
 *     ss += hh * SS_HOUR + mi * SS_MINUTE + us / 1_000_000
 */
  __pyx_v_us = __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(__pyx_v_time);

  /* "utils.pxd":2109
 *         double us = time.microsecond
 * 
 *     ss += hh * SS_HOUR + mi * SS_MINUTE + us / 1_000_000             # <<<<<<<<<<<<<<
 *     if utc:
 *         utc_off = time_utcoffset(time)
 */
  __pyx_v_ss = (__pyx_v_ss + (((__pyx_v_hh * __pyx_v_7cytimes_5utils_SS_HOUR) + (__pyx_v_mi * __pyx_v_7cytimes_5utils_SS_MINUTE)) + (__pyx_v_us / 1000000.0)));

  /* "utils.pxd":2110
 * 
 *     ss += hh * SS_HOUR + mi * SS_MINUTE + us / 1_000_000
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = time_utcoffset(time)
 *         if utc_off is not None:
 */
  if (__pyx_v_utc) {

    /* "utils.pxd":2111
 *     ss += hh * SS_HOUR + mi * SS_MINUTE + us / 1_000_000
 *     if utc:
 *         utc_off = time_utcoffset(time)             # <<<<<<<<<<<<<<
 *         if utc_off is not None:
 *             ss -= td_to_seconds(utc_off)
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_time_utcoffset(__pyx_v_time)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_utc_off = ((PyDateTime_Delta *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "utils.pxd":2112
 *     if utc:
 *         utc_off = time_utcoffset(time)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             ss -= td_to_seconds(utc_off)
 *     return ss
 */
    __pyx_t_2 = (((PyObject *)__pyx_v_utc_off) != Py_None);
    if (__pyx_t_2) {

      /* "utils.pxd":2113
 *         utc_off = time_utcoffset(time)
 *         if utc_off is not None:
 *             ss -= td_to_seconds(utc_off)             # <<<<<<<<<<<<<<
 *     return ss
 * 
 */
      __pyx_t_3 = __pyx_f_7cytimes_5utils_td_to_seconds(__pyx_v_utc_off); if (unlikely(__pyx_t_3 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(5, 2113, __pyx_L1_error)
      __pyx_v_ss = (__pyx_v_ss - __pyx_t_3);

      /* "utils.pxd":2112
 *     if utc:
 *         utc_off = time_utcoffset(time)
 *         if utc_off is not None:             # <<<<<<<<<<<<<<
 *             ss -= td_to_seconds(utc_off)
 *     return ss
 */
    }

    /* "utils.pxd":2110
 * 
 *     ss += hh * SS_HOUR + mi * SS_MINUTE + us / 1_000_000
 *     if utc:             # <<<<<<<<<<<<<<
 *         utc_off = time_utcoffset(time)
 *         if utc_off is not None:
 */
  }

  /* "utils.pxd":2114
 *         if utc_off is not None:
 *             ss -= td_to_seconds(utc_off)
 *     return ss             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.time time_fr_us(long long val, object tz=None):
 */
  __pyx_r = __pyx_v_ss;
  goto __pyx_L0;

  /* "utils.pxd":2097
 *     return us
 * 
 * cdef inline double time_to_seconds(datetime.time time, bint utc=False):             # <<<<<<<<<<<<<<
 *     """Convert time to seconds `<'float'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.time_to_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_utc_off);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2116
 *     return ss
 * 
 * cdef inline datetime.time time_fr_us(long long val, object tz=None):             # <<<<<<<<<<<<<<
 *     """Create time from microseconds (int) `<'datetime.time'>`."""
 *     _hmsf = hmsf_fr_us(val)
 */

static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cytimes_5utils_time_fr_us(PY_LONG_LONG __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils_time_fr_us *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  __pyx_t_7cytimes_5utils_hmsf __pyx_v__hmsf;
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_t_7cytimes_5utils_hmsf __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_time_new __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_fr_us", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "utils.pxd":2118
 * cdef inline datetime.time time_fr_us(long long val, object tz=None):
 *     """Create time from microseconds (int) `<'datetime.time'>`."""
 *     _hmsf = hmsf_fr_us(val)             # <<<<<<<<<<<<<<
 *     return datetime.time_new(
 *         _hmsf.hour, _hmsf.minute, _hmsf.second, _hmsf.microsecond, tz, 0
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_hmsf_fr_us(__pyx_v_val); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 2118, __pyx_L1_error)
  __pyx_v__hmsf = __pyx_t_1;

  /* "utils.pxd":2119
 *     """Create time from microseconds (int) `<'datetime.time'>`."""
 *     _hmsf = hmsf_fr_us(val)
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         _hmsf.hour, _hmsf.minute, _hmsf.second, _hmsf.microsecond, tz, 0
 *     )
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "utils.pxd":2120
 *     _hmsf = hmsf_fr_us(val)
 *     return datetime.time_new(
 *         _hmsf.hour, _hmsf.minute, _hmsf.second, _hmsf.microsecond, tz, 0             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.fold = 0;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_time_new(__pyx_v__hmsf.hour, __pyx_v__hmsf.minute, __pyx_v__hmsf.second, __pyx_v__hmsf.microsecond, __pyx_v_tz, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_Time *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":2116
 *     return ss
 * 
 * cdef inline datetime.time time_fr_us(long long val, object tz=None):             # <<<<<<<<<<<<<<
 *     """Create time from microseconds (int) `<'datetime.time'>`."""
 *     _hmsf = hmsf_fr_us(val)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.time_fr_us", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2123
 *     )
 * 
 * cdef inline datetime.time time_fr_seconds(double val, object tz=None):             # <<<<<<<<<<<<<<
 *     """Create time from seconds (float) `<'datetime.time'>`."""
 *     return time_fr_us(<long long> int(val * US_SECOND), tz)
 */

static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cytimes_5utils_time_fr_seconds(double __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils_time_fr_seconds *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_time_fr_us __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_fr_seconds", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "utils.pxd":2125
 * cdef inline datetime.time time_fr_seconds(double val, object tz=None):
 *     """Create time from seconds (float) `<'datetime.time'>`."""
 *     return time_fr_us(<long long> int(val * US_SECOND), tz)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.time time_fr_time(datetime.time time):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.tz = __pyx_v_tz;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_time_fr_us(((PY_LONG_LONG)((PY_LONG_LONG)(__pyx_v_val * __pyx_v_7cytimes_5utils_US_SECOND))), &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Time *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "utils.pxd":2123
 *     )
 * 
 * cdef inline datetime.time time_fr_seconds(double val, object tz=None):             # <<<<<<<<<<<<<<
 *     """Create time from seconds (float) `<'datetime.time'>`."""
 *     return time_fr_us(<long long> int(val * US_SECOND), tz)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.time_fr_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2127
 *     return time_fr_us(<long long> int(val * US_SECOND), tz)
 * 
 * cdef inline datetime.time time_fr_time(datetime.time time):             # <<<<<<<<<<<<<<
 *     """Create time from another time (include subclass) `<'datetime.time'>`."""
 *     return datetime.time_new(
 */

static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cytimes_5utils_time_fr_time(PyDateTime_Time *__pyx_v_time) {
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_time_new __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_fr_time", 1);

  /* "utils.pxd":2129
 * cdef inline datetime.time time_fr_time(datetime.time time):
 *     """Create time from another time (include subclass) `<'datetime.time'>`."""
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         time.hour, time.minute, time.second,
 *         time.microsecond, time.tzinfo, time.fold
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "utils.pxd":2131
 *     return datetime.time_new(
 *         time.hour, time.minute, time.second,
 *         time.microsecond, time.tzinfo, time.fold             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(__pyx_v_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "utils.pxd":2129
 * cdef inline datetime.time time_fr_time(datetime.time time):
 *     """Create time from another time (include subclass) `<'datetime.time'>`."""
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         time.hour, time.minute, time.second,
 *         time.microsecond, time.tzinfo, time.fold
 */
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.fold = __pyx_f_7cpython_8datetime_4time_4fold_fold(__pyx_v_time);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_time_new(__pyx_f_7cpython_8datetime_4time_4hour_hour(__pyx_v_time), __pyx_f_7cpython_8datetime_4time_6minute_minute(__pyx_v_time), __pyx_f_7cpython_8datetime_4time_6second_second(__pyx_v_time), __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(__pyx_v_time), __pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_Time *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":2127
 *     return time_fr_us(<long long> int(val * US_SECOND), tz)
 * 
 * cdef inline datetime.time time_fr_time(datetime.time time):             # <<<<<<<<<<<<<<
 *     """Create time from another time (include subclass) `<'datetime.time'>`."""
 *     return datetime.time_new(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.time_fr_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2134
 *     )
 * 
 * cdef inline datetime.time time_fr_dt(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Create time from datetime (include subclass) `<'datetime.time'>`."""
 *     return datetime.time_new(
 */

static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cytimes_5utils_time_fr_dt(PyDateTime_DateTime *__pyx_v_dt) {
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_time_new __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_fr_dt", 1);

  /* "utils.pxd":2136
 * cdef inline datetime.time time_fr_dt(datetime.datetime dt):
 *     """Create time from datetime (include subclass) `<'datetime.time'>`."""
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         dt.hour, dt.minute, dt.second,
 *         dt.microsecond, dt.tzinfo, dt.fold
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "utils.pxd":2138
 *     return datetime.time_new(
 *         dt.hour, dt.minute, dt.second,
 *         dt.microsecond, dt.tzinfo, dt.fold             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "utils.pxd":2136
 * cdef inline datetime.time time_fr_dt(datetime.datetime dt):
 *     """Create time from datetime (include subclass) `<'datetime.time'>`."""
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         dt.hour, dt.minute, dt.second,
 *         dt.microsecond, dt.tzinfo, dt.fold
 */
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.fold = __pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_time_new(__pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt), __pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_Time *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":2134
 *     )
 * 
 * cdef inline datetime.time time_fr_dt(datetime.datetime dt):             # <<<<<<<<<<<<<<
 *     """Create time from datetime (include subclass) `<'datetime.time'>`."""
 *     return datetime.time_new(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.time_fr_dt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2143
 * # datetime.timedelta -----------------------------------------------------------------------------------
 * # . generate
 * cdef inline datetime.timedelta td_new(int days=0, int seconds=0, int microseconds=0):             # <<<<<<<<<<<<<<
 *     """Create a new timedelta `<'datetime.timedelta'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_td_new(struct __pyx_opt_args_7cytimes_5utils_td_new *__pyx_optional_args) {
  int __pyx_v_days = ((int)0);
  int __pyx_v_seconds = ((int)0);
  int __pyx_v_microseconds = ((int)0);
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("td_new", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_days = __pyx_optional_args->days;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_seconds = __pyx_optional_args->seconds;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_microseconds = __pyx_optional_args->microseconds;
        }
      }
    }
  }

  /* "utils.pxd":2149
 *     >>> datetime.timedelta(days, seconds, microseconds)
 *     """
 *     return datetime.timedelta_new(days, seconds, microseconds)             # <<<<<<<<<<<<<<
 * 
 * # . type check
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_seconds, __pyx_v_microseconds)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "utils.pxd":2143
 * # datetime.timedelta -----------------------------------------------------------------------------------
 * # . generate
 * cdef inline datetime.timedelta td_new(int days=0, int seconds=0, int microseconds=0):             # <<<<<<<<<<<<<<
 *     """Create a new timedelta `<'datetime.timedelta'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.td_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2152
 * 
 * # . type check
 * cdef inline bint is_td(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of datetime.timedelta `<'bool'>`.
 * 
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_td(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "utils.pxd":2158
 *     >>> isinstance(obj, datetime.timedelta)
 *     """
 *     return datetime.PyDelta_Check(obj)             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_td_exact(object obj) except -1:
 */
  __pyx_r = PyDelta_Check(__pyx_v_obj);
  goto __pyx_L0;

  /* "utils.pxd":2152
 * 
 * # . type check
 * cdef inline bint is_td(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of datetime.timedelta `<'bool'>`.
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":2160
 *     return datetime.PyDelta_Check(obj)
 * 
 * cdef inline bint is_td_exact(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is the exact datetime.timedelta type `<'bool'>`.
 * 
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_td_exact(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "utils.pxd":2166
 *     >>> type(obj) is datetime.timedelta
 *     """
 *     return datetime.PyDelta_CheckExact(obj)             # <<<<<<<<<<<<<<
 * 
 * # . conversion
 */
  __pyx_r = PyDelta_CheckExact(__pyx_v_obj);
  goto __pyx_L0;

  /* "utils.pxd":2160
 *     return datetime.PyDelta_Check(obj)
 * 
 * cdef inline bint is_td_exact(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is the exact datetime.timedelta type `<'bool'>`.
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":2169
 * 
 * # . conversion
 * cdef inline str td_to_isoformat(datetime.timedelta td):             # <<<<<<<<<<<<<<
 *     """Convert timedelta to string in ISO format `<'str'>`."""
 *     cdef:
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_td_to_isoformat(PyDateTime_Delta *__pyx_v_td) {
  PY_LONG_LONG __pyx_v_days;
  PY_LONG_LONG __pyx_v_hours;
  PY_LONG_LONG __pyx_v_minutes;
  PY_LONG_LONG __pyx_v_seconds;
  PY_LONG_LONG __pyx_v_us;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PY_LONG_LONG __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("td_to_isoformat", 1);

  /* "utils.pxd":2172
 *     """Convert timedelta to string in ISO format `<'str'>`."""
 *     cdef:
 *         long long days = td.day             # <<<<<<<<<<<<<<
 *         long long hours, minutes
 *         long long seconds = days * SS_DAY + td.second
 */
  __pyx_v_days = __pyx_f_7cpython_8datetime_9timedelta_3day_day(__pyx_v_td);

  /* "utils.pxd":2174
 *         long long days = td.day
 *         long long hours, minutes
 *         long long seconds = days * SS_DAY + td.second             # <<<<<<<<<<<<<<
 *         long long us = td.microsecond
 * 
 */
  __pyx_v_seconds = ((__pyx_v_days * __pyx_v_7cytimes_5utils_SS_DAY) + __pyx_f_7cpython_8datetime_9timedelta_6second_second(__pyx_v_td));

  /* "utils.pxd":2175
 *         long long hours, minutes
 *         long long seconds = days * SS_DAY + td.second
 *         long long us = td.microsecond             # <<<<<<<<<<<<<<
 * 
 *     # Positive timedelta
 */
  __pyx_v_us = __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(__pyx_v_td);

  /* "utils.pxd":2178
 * 
 *     # Positive timedelta
 *     if seconds >= 0:             # <<<<<<<<<<<<<<
 *         hours = math_floor_div(seconds, SS_HOUR)
 *         seconds -= hours * SS_HOUR
 */
  __pyx_t_1 = (__pyx_v_seconds >= 0);
  if (__pyx_t_1) {

    /* "utils.pxd":2179
 *     # Positive timedelta
 *     if seconds >= 0:
 *         hours = math_floor_div(seconds, SS_HOUR)             # <<<<<<<<<<<<<<
 *         seconds -= hours * SS_HOUR
 *         minutes = math_floor_div(seconds, SS_MINUTE)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_seconds, __pyx_v_7cytimes_5utils_SS_HOUR, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 2179, __pyx_L1_error)
    __pyx_v_hours = __pyx_t_2;

    /* "utils.pxd":2180
 *     if seconds >= 0:
 *         hours = math_floor_div(seconds, SS_HOUR)
 *         seconds -= hours * SS_HOUR             # <<<<<<<<<<<<<<
 *         minutes = math_floor_div(seconds, SS_MINUTE)
 *         seconds -= minutes * SS_MINUTE
 */
    __pyx_v_seconds = (__pyx_v_seconds - (__pyx_v_hours * __pyx_v_7cytimes_5utils_SS_HOUR));

    /* "utils.pxd":2181
 *         hours = math_floor_div(seconds, SS_HOUR)
 *         seconds -= hours * SS_HOUR
 *         minutes = math_floor_div(seconds, SS_MINUTE)             # <<<<<<<<<<<<<<
 *         seconds -= minutes * SS_MINUTE
 *         if us == 0:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_seconds, __pyx_v_7cytimes_5utils_SS_MINUTE, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 2181, __pyx_L1_error)
    __pyx_v_minutes = __pyx_t_2;

    /* "utils.pxd":2182
 *         seconds -= hours * SS_HOUR
 *         minutes = math_floor_div(seconds, SS_MINUTE)
 *         seconds -= minutes * SS_MINUTE             # <<<<<<<<<<<<<<
 *         if us == 0:
 *             return "%02d:%02d:%02d" % (hours, minutes, seconds)
 */
    __pyx_v_seconds = (__pyx_v_seconds - (__pyx_v_minutes * __pyx_v_7cytimes_5utils_SS_MINUTE));

    /* "utils.pxd":2183
 *         minutes = math_floor_div(seconds, SS_MINUTE)
 *         seconds -= minutes * SS_MINUTE
 *         if us == 0:             # <<<<<<<<<<<<<<
 *             return "%02d:%02d:%02d" % (hours, minutes, seconds)
 *         return "%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)
 */
    __pyx_t_1 = (__pyx_v_us == 0);
    if (__pyx_t_1) {

      /* "utils.pxd":2184
 *         seconds -= minutes * SS_MINUTE
 *         if us == 0:
 *             return "%02d:%02d:%02d" % (hours, minutes, seconds)             # <<<<<<<<<<<<<<
 *         return "%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = 0;
      __pyx_t_5 = 127;
      __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_hours, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u__11);
      __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_kp_u__11);
      __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_seconds, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = ((PyObject*)__pyx_t_6);
      __pyx_t_6 = 0;
      goto __pyx_L0;

      /* "utils.pxd":2183
 *         minutes = math_floor_div(seconds, SS_MINUTE)
 *         seconds -= minutes * SS_MINUTE
 *         if us == 0:             # <<<<<<<<<<<<<<
 *             return "%02d:%02d:%02d" % (hours, minutes, seconds)
 *         return "%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)
 */
    }

    /* "utils.pxd":2185
 *         if us == 0:
 *             return "%02d:%02d:%02d" % (hours, minutes, seconds)
 *         return "%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)             # <<<<<<<<<<<<<<
 * 
 *     # Negative w/o microseconds
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_hours, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_kp_u__11);
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_kp_u__11);
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_seconds, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u__14);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__14);
    PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_kp_u__14);
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_us, 6, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_6, 7, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":2178
 * 
 *     # Positive timedelta
 *     if seconds >= 0:             # <<<<<<<<<<<<<<
 *         hours = math_floor_div(seconds, SS_HOUR)
 *         seconds -= hours * SS_HOUR
 */
  }

  /* "utils.pxd":2188
 * 
 *     # Negative w/o microseconds
 *     if us == 0:             # <<<<<<<<<<<<<<
 *         seconds = -seconds
 *         if seconds >= SS_HOUR:
 */
  __pyx_t_1 = (__pyx_v_us == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":2189
 *     # Negative w/o microseconds
 *     if us == 0:
 *         seconds = -seconds             # <<<<<<<<<<<<<<
 *         if seconds >= SS_HOUR:
 *             hours = math_floor_div(seconds, SS_HOUR)
 */
    __pyx_v_seconds = (-__pyx_v_seconds);

    /* "utils.pxd":2190
 *     if us == 0:
 *         seconds = -seconds
 *         if seconds >= SS_HOUR:             # <<<<<<<<<<<<<<
 *             hours = math_floor_div(seconds, SS_HOUR)
 *             seconds -= hours * SS_HOUR
 */
    __pyx_t_1 = (__pyx_v_seconds >= __pyx_v_7cytimes_5utils_SS_HOUR);
    if (__pyx_t_1) {

      /* "utils.pxd":2191
 *         seconds = -seconds
 *         if seconds >= SS_HOUR:
 *             hours = math_floor_div(seconds, SS_HOUR)             # <<<<<<<<<<<<<<
 *             seconds -= hours * SS_HOUR
 *             minutes = math_floor_div(seconds, SS_MINUTE)
 */
      __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_seconds, __pyx_v_7cytimes_5utils_SS_HOUR, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 2191, __pyx_L1_error)
      __pyx_v_hours = __pyx_t_2;

      /* "utils.pxd":2192
 *         if seconds >= SS_HOUR:
 *             hours = math_floor_div(seconds, SS_HOUR)
 *             seconds -= hours * SS_HOUR             # <<<<<<<<<<<<<<
 *             minutes = math_floor_div(seconds, SS_MINUTE)
 *             seconds -= minutes * SS_MINUTE
 */
      __pyx_v_seconds = (__pyx_v_seconds - (__pyx_v_hours * __pyx_v_7cytimes_5utils_SS_HOUR));

      /* "utils.pxd":2193
 *             hours = math_floor_div(seconds, SS_HOUR)
 *             seconds -= hours * SS_HOUR
 *             minutes = math_floor_div(seconds, SS_MINUTE)             # <<<<<<<<<<<<<<
 *             seconds -= minutes * SS_MINUTE
 *             return "-%02d:%02d:%02d" % (hours, minutes, seconds)
 */
      __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_seconds, __pyx_v_7cytimes_5utils_SS_MINUTE, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 2193, __pyx_L1_error)
      __pyx_v_minutes = __pyx_t_2;

      /* "utils.pxd":2194
 *             seconds -= hours * SS_HOUR
 *             minutes = math_floor_div(seconds, SS_MINUTE)
 *             seconds -= minutes * SS_MINUTE             # <<<<<<<<<<<<<<
 *             return "-%02d:%02d:%02d" % (hours, minutes, seconds)
 *         if seconds >= SS_MINUTE:
 */
      __pyx_v_seconds = (__pyx_v_seconds - (__pyx_v_minutes * __pyx_v_7cytimes_5utils_SS_MINUTE));

      /* "utils.pxd":2195
 *             minutes = math_floor_div(seconds, SS_MINUTE)
 *             seconds -= minutes * SS_MINUTE
 *             return "-%02d:%02d:%02d" % (hours, minutes, seconds)             # <<<<<<<<<<<<<<
 *         if seconds >= SS_MINUTE:
 *             minutes = math_floor_div(seconds, SS_MINUTE)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2195, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = 0;
      __pyx_t_5 = 127;
      __Pyx_INCREF(__pyx_kp_u__9);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__9);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u__9);
      __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_hours, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2195, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__11);
      __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2195, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__11);
      __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_seconds, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2195, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 6, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2195, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = ((PyObject*)__pyx_t_6);
      __pyx_t_6 = 0;
      goto __pyx_L0;

      /* "utils.pxd":2190
 *     if us == 0:
 *         seconds = -seconds
 *         if seconds >= SS_HOUR:             # <<<<<<<<<<<<<<
 *             hours = math_floor_div(seconds, SS_HOUR)
 *             seconds -= hours * SS_HOUR
 */
    }

    /* "utils.pxd":2196
 *             seconds -= minutes * SS_MINUTE
 *             return "-%02d:%02d:%02d" % (hours, minutes, seconds)
 *         if seconds >= SS_MINUTE:             # <<<<<<<<<<<<<<
 *             minutes = math_floor_div(seconds, SS_MINUTE)
 *             seconds -= minutes * SS_MINUTE
 */
    __pyx_t_1 = (__pyx_v_seconds >= __pyx_v_7cytimes_5utils_SS_MINUTE);
    if (__pyx_t_1) {

      /* "utils.pxd":2197
 *             return "-%02d:%02d:%02d" % (hours, minutes, seconds)
 *         if seconds >= SS_MINUTE:
 *             minutes = math_floor_div(seconds, SS_MINUTE)             # <<<<<<<<<<<<<<
 *             seconds -= minutes * SS_MINUTE
 *             return "-00:%02d:%02d" % (minutes, seconds)
 */
      __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_seconds, __pyx_v_7cytimes_5utils_SS_MINUTE, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 2197, __pyx_L1_error)
      __pyx_v_minutes = __pyx_t_2;

      /* "utils.pxd":2198
 *         if seconds >= SS_MINUTE:
 *             minutes = math_floor_div(seconds, SS_MINUTE)
 *             seconds -= minutes * SS_MINUTE             # <<<<<<<<<<<<<<
 *             return "-00:%02d:%02d" % (minutes, seconds)
 *         return "-00:00:%02d" % seconds
 */
      __pyx_v_seconds = (__pyx_v_seconds - (__pyx_v_minutes * __pyx_v_7cytimes_5utils_SS_MINUTE));

      /* "utils.pxd":2199
 *             minutes = math_floor_div(seconds, SS_MINUTE)
 *             seconds -= minutes * SS_MINUTE
 *             return "-00:%02d:%02d" % (minutes, seconds)             # <<<<<<<<<<<<<<
 *         return "-00:00:%02d" % seconds
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = 0;
      __pyx_t_5 = 127;
      __Pyx_INCREF(__pyx_kp_u_00);
      __pyx_t_4 += 4;
      __Pyx_GIVEREF(__pyx_kp_u_00);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_00);
      __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_INCREF(__pyx_kp_u__11);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__11);
      PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u__11);
      __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_seconds, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_6, 4, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_r = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "utils.pxd":2196
 *             seconds -= minutes * SS_MINUTE
 *             return "-%02d:%02d:%02d" % (hours, minutes, seconds)
 *         if seconds >= SS_MINUTE:             # <<<<<<<<<<<<<<
 *             minutes = math_floor_div(seconds, SS_MINUTE)
 *             seconds -= minutes * SS_MINUTE
 */
    }

    /* "utils.pxd":2200
 *             seconds -= minutes * SS_MINUTE
 *             return "-00:%02d:%02d" % (minutes, seconds)
 *         return "-00:00:%02d" % seconds             # <<<<<<<<<<<<<<
 * 
 *     # Negative w/t microseconds
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_seconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2200, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_00_00_02d, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2200, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "utils.pxd":2188
 * 
 *     # Negative w/o microseconds
 *     if us == 0:             # <<<<<<<<<<<<<<
 *         seconds = -seconds
 *         if seconds >= SS_HOUR:
 */
  }

  /* "utils.pxd":2203
 * 
 *     # Negative w/t microseconds
 *     us = -(seconds * US_SECOND + us)             # <<<<<<<<<<<<<<
 *     if us >= US_HOUR:
 *         hours = math_floor_div(us, US_HOUR)
 */
  __pyx_v_us = (-((__pyx_v_seconds * __pyx_v_7cytimes_5utils_US_SECOND) + __pyx_v_us));

  /* "utils.pxd":2204
 *     # Negative w/t microseconds
 *     us = -(seconds * US_SECOND + us)
 *     if us >= US_HOUR:             # <<<<<<<<<<<<<<
 *         hours = math_floor_div(us, US_HOUR)
 *         us -= hours * US_HOUR
 */
  __pyx_t_1 = (__pyx_v_us >= __pyx_v_7cytimes_5utils_US_HOUR);
  if (__pyx_t_1) {

    /* "utils.pxd":2205
 *     us = -(seconds * US_SECOND + us)
 *     if us >= US_HOUR:
 *         hours = math_floor_div(us, US_HOUR)             # <<<<<<<<<<<<<<
 *         us -= hours * US_HOUR
 *         minutes = math_floor_div(us, US_MINUTE)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_us, __pyx_v_7cytimes_5utils_US_HOUR, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 2205, __pyx_L1_error)
    __pyx_v_hours = __pyx_t_2;

    /* "utils.pxd":2206
 *     if us >= US_HOUR:
 *         hours = math_floor_div(us, US_HOUR)
 *         us -= hours * US_HOUR             # <<<<<<<<<<<<<<
 *         minutes = math_floor_div(us, US_MINUTE)
 *         us -= minutes * US_MINUTE
 */
    __pyx_v_us = (__pyx_v_us - (__pyx_v_hours * __pyx_v_7cytimes_5utils_US_HOUR));

    /* "utils.pxd":2207
 *         hours = math_floor_div(us, US_HOUR)
 *         us -= hours * US_HOUR
 *         minutes = math_floor_div(us, US_MINUTE)             # <<<<<<<<<<<<<<
 *         us -= minutes * US_MINUTE
 *         seconds = math_floor_div(us, US_SECOND)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_us, __pyx_v_7cytimes_5utils_US_MINUTE, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 2207, __pyx_L1_error)
    __pyx_v_minutes = __pyx_t_2;

    /* "utils.pxd":2208
 *         us -= hours * US_HOUR
 *         minutes = math_floor_div(us, US_MINUTE)
 *         us -= minutes * US_MINUTE             # <<<<<<<<<<<<<<
 *         seconds = math_floor_div(us, US_SECOND)
 *         us -= seconds * US_SECOND
 */
    __pyx_v_us = (__pyx_v_us - (__pyx_v_minutes * __pyx_v_7cytimes_5utils_US_MINUTE));

    /* "utils.pxd":2209
 *         minutes = math_floor_div(us, US_MINUTE)
 *         us -= minutes * US_MINUTE
 *         seconds = math_floor_div(us, US_SECOND)             # <<<<<<<<<<<<<<
 *         us -= seconds * US_SECOND
 *         return "-%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_us, __pyx_v_7cytimes_5utils_US_SECOND, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 2209, __pyx_L1_error)
    __pyx_v_seconds = __pyx_t_2;

    /* "utils.pxd":2210
 *         us -= minutes * US_MINUTE
 *         seconds = math_floor_div(us, US_SECOND)
 *         us -= seconds * US_SECOND             # <<<<<<<<<<<<<<
 *         return "-%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)
 *     if us >= US_MINUTE:
 */
    __pyx_v_us = (__pyx_v_us - (__pyx_v_seconds * __pyx_v_7cytimes_5utils_US_SECOND));

    /* "utils.pxd":2211
 *         seconds = math_floor_div(us, US_SECOND)
 *         us -= seconds * US_SECOND
 *         return "-%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)             # <<<<<<<<<<<<<<
 *     if us >= US_MINUTE:
 *         minutes = math_floor_div(us, US_MINUTE)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = PyTuple_New(8); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u__9);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__9);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u__9);
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_hours, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u__11);
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_kp_u__11);
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_seconds, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u__14);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__14);
    PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_kp_u__14);
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_us, 6, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 7, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_6, 8, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":2204
 *     # Negative w/t microseconds
 *     us = -(seconds * US_SECOND + us)
 *     if us >= US_HOUR:             # <<<<<<<<<<<<<<
 *         hours = math_floor_div(us, US_HOUR)
 *         us -= hours * US_HOUR
 */
  }

  /* "utils.pxd":2212
 *         us -= seconds * US_SECOND
 *         return "-%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)
 *     if us >= US_MINUTE:             # <<<<<<<<<<<<<<
 *         minutes = math_floor_div(us, US_MINUTE)
 *         us -= minutes * US_MINUTE
 */
  __pyx_t_1 = (__pyx_v_us >= __pyx_v_7cytimes_5utils_US_MINUTE);
  if (__pyx_t_1) {

    /* "utils.pxd":2213
 *         return "-%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)
 *     if us >= US_MINUTE:
 *         minutes = math_floor_div(us, US_MINUTE)             # <<<<<<<<<<<<<<
 *         us -= minutes * US_MINUTE
 *         seconds = math_floor_div(us, US_SECOND)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_us, __pyx_v_7cytimes_5utils_US_MINUTE, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 2213, __pyx_L1_error)
    __pyx_v_minutes = __pyx_t_2;

    /* "utils.pxd":2214
 *     if us >= US_MINUTE:
 *         minutes = math_floor_div(us, US_MINUTE)
 *         us -= minutes * US_MINUTE             # <<<<<<<<<<<<<<
 *         seconds = math_floor_div(us, US_SECOND)
 *         us -= seconds * US_SECOND
 */
    __pyx_v_us = (__pyx_v_us - (__pyx_v_minutes * __pyx_v_7cytimes_5utils_US_MINUTE));

    /* "utils.pxd":2215
 *         minutes = math_floor_div(us, US_MINUTE)
 *         us -= minutes * US_MINUTE
 *         seconds = math_floor_div(us, US_SECOND)             # <<<<<<<<<<<<<<
 *         us -= seconds * US_SECOND
 *         return "-00:%02d:%02d.%06d" % (minutes, seconds, us)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_us, __pyx_v_7cytimes_5utils_US_SECOND, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 2215, __pyx_L1_error)
    __pyx_v_seconds = __pyx_t_2;

    /* "utils.pxd":2216
 *         us -= minutes * US_MINUTE
 *         seconds = math_floor_div(us, US_SECOND)
 *         us -= seconds * US_SECOND             # <<<<<<<<<<<<<<
 *         return "-00:%02d:%02d.%06d" % (minutes, seconds, us)
 *     if us >= US_SECOND:
 */
    __pyx_v_us = (__pyx_v_us - (__pyx_v_seconds * __pyx_v_7cytimes_5utils_US_SECOND));

    /* "utils.pxd":2217
 *         seconds = math_floor_div(us, US_SECOND)
 *         us -= seconds * US_SECOND
 *         return "-00:%02d:%02d.%06d" % (minutes, seconds, us)             # <<<<<<<<<<<<<<
 *     if us >= US_SECOND:
 *         seconds = math_floor_div(us, US_SECOND)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u_00);
    __pyx_t_4 += 4;
    __Pyx_GIVEREF(__pyx_kp_u_00);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_00);
    __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__11);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__11);
    __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_seconds, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_kp_u__14);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__14);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__14);
    __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_us, 6, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 6, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "utils.pxd":2212
 *         us -= seconds * US_SECOND
 *         return "-%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)
 *     if us >= US_MINUTE:             # <<<<<<<<<<<<<<
 *         minutes = math_floor_div(us, US_MINUTE)
 *         us -= minutes * US_MINUTE
 */
  }

  /* "utils.pxd":2218
 *         us -= seconds * US_SECOND
 *         return "-00:%02d:%02d.%06d" % (minutes, seconds, us)
 *     if us >= US_SECOND:             # <<<<<<<<<<<<<<
 *         seconds = math_floor_div(us, US_SECOND)
 *         us -= seconds * US_SECOND
 */
  __pyx_t_1 = (__pyx_v_us >= __pyx_v_7cytimes_5utils_US_SECOND);
  if (__pyx_t_1) {

    /* "utils.pxd":2219
 *         return "-00:%02d:%02d.%06d" % (minutes, seconds, us)
 *     if us >= US_SECOND:
 *         seconds = math_floor_div(us, US_SECOND)             # <<<<<<<<<<<<<<
 *         us -= seconds * US_SECOND
 *         return "-00:00:%02d.%06d" % (seconds, us)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_us, __pyx_v_7cytimes_5utils_US_SECOND, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 2219, __pyx_L1_error)
    __pyx_v_seconds = __pyx_t_2;

    /* "utils.pxd":2220
 *     if us >= US_SECOND:
 *         seconds = math_floor_div(us, US_SECOND)
 *         us -= seconds * US_SECOND             # <<<<<<<<<<<<<<
 *         return "-00:00:%02d.%06d" % (seconds, us)
 *     return "-00:00:00.%06d" % us
 */
    __pyx_v_us = (__pyx_v_us - (__pyx_v_seconds * __pyx_v_7cytimes_5utils_US_SECOND));

    /* "utils.pxd":2221
 *         seconds = math_floor_div(us, US_SECOND)
 *         us -= seconds * US_SECOND
 *         return "-00:00:%02d.%06d" % (seconds, us)             # <<<<<<<<<<<<<<
 *     return "-00:00:00.%06d" % us
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u_00_00);
    __pyx_t_4 += 7;
    __Pyx_GIVEREF(__pyx_kp_u_00_00);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_00_00);
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_seconds, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u__14);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__14);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u__14);
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_us, 6, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_6, 4, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":2218
 *         us -= seconds * US_SECOND
 *         return "-00:%02d:%02d.%06d" % (minutes, seconds, us)
 *     if us >= US_SECOND:             # <<<<<<<<<<<<<<
 *         seconds = math_floor_div(us, US_SECOND)
 *         us -= seconds * US_SECOND
 */
  }

  /* "utils.pxd":2222
 *         us -= seconds * US_SECOND
 *         return "-00:00:%02d.%06d" % (seconds, us)
 *     return "-00:00:00.%06d" % us             # <<<<<<<<<<<<<<
 * 
 * cdef inline str td_to_utcformat(datetime.timedelta td):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_us); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_00_00_00_06d, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "utils.pxd":2169
 * 
 * # . conversion
 * cdef inline str td_to_isoformat(datetime.timedelta td):             # <<<<<<<<<<<<<<
 *     """Convert timedelta to string in ISO format `<'str'>`."""
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cytimes.utils.td_to_isoformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2224
 *     return "-00:00:00.%06d" % us
 * 
 * cdef inline str td_to_utcformat(datetime.timedelta td):             # <<<<<<<<<<<<<<
 *     """Convert timedelta to string in UTC format ('+/-HH:MM') `<'str'>`."""
 *     cdef:
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_td_to_utcformat(PyDateTime_Delta *__pyx_v_td) {
  PY_LONG_LONG __pyx_v_days;
  PY_LONG_LONG __pyx_v_hours;
  PY_LONG_LONG __pyx_v_minutes;
  PY_LONG_LONG __pyx_v_seconds;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PY_LONG_LONG __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("td_to_utcformat", 1);

  /* "utils.pxd":2227
 *     """Convert timedelta to string in UTC format ('+/-HH:MM') `<'str'>`."""
 *     cdef:
 *         long long days = td.day             # <<<<<<<<<<<<<<
 *         long long hours, minutes
 *         long long seconds = days * SS_DAY + td.second
 */
  __pyx_v_days = __pyx_f_7cpython_8datetime_9timedelta_3day_day(__pyx_v_td);

  /* "utils.pxd":2229
 *         long long days = td.day
 *         long long hours, minutes
 *         long long seconds = days * SS_DAY + td.second             # <<<<<<<<<<<<<<
 *     # Positive timedelta
 *     if seconds >= 0:
 */
  __pyx_v_seconds = ((__pyx_v_days * __pyx_v_7cytimes_5utils_SS_DAY) + __pyx_f_7cpython_8datetime_9timedelta_6second_second(__pyx_v_td));

  /* "utils.pxd":2231
 *         long long seconds = days * SS_DAY + td.second
 *     # Positive timedelta
 *     if seconds >= 0:             # <<<<<<<<<<<<<<
 *         hours = math_floor_div(seconds, SS_HOUR)
 *         minutes = math_floor_div(seconds - hours * SS_HOUR, SS_MINUTE)
 */
  __pyx_t_1 = (__pyx_v_seconds >= 0);
  if (__pyx_t_1) {

    /* "utils.pxd":2232
 *     # Positive timedelta
 *     if seconds >= 0:
 *         hours = math_floor_div(seconds, SS_HOUR)             # <<<<<<<<<<<<<<
 *         minutes = math_floor_div(seconds - hours * SS_HOUR, SS_MINUTE)
 *         return "+%02d%02d" % (hours, minutes)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_seconds, __pyx_v_7cytimes_5utils_SS_HOUR, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 2232, __pyx_L1_error)
    __pyx_v_hours = __pyx_t_2;

    /* "utils.pxd":2233
 *     if seconds >= 0:
 *         hours = math_floor_div(seconds, SS_HOUR)
 *         minutes = math_floor_div(seconds - hours * SS_HOUR, SS_MINUTE)             # <<<<<<<<<<<<<<
 *         return "+%02d%02d" % (hours, minutes)
 *     # Negative timedelta
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div((__pyx_v_seconds - (__pyx_v_hours * __pyx_v_7cytimes_5utils_SS_HOUR)), __pyx_v_7cytimes_5utils_SS_MINUTE, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 2233, __pyx_L1_error)
    __pyx_v_minutes = __pyx_t_2;

    /* "utils.pxd":2234
 *         hours = math_floor_div(seconds, SS_HOUR)
 *         minutes = math_floor_div(seconds - hours * SS_HOUR, SS_MINUTE)
 *         return "+%02d%02d" % (hours, minutes)             # <<<<<<<<<<<<<<
 *     # Negative timedelta
 *     else:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u__15);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__15);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u__15);
    __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_hours, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "utils.pxd":2231
 *         long long seconds = days * SS_DAY + td.second
 *     # Positive timedelta
 *     if seconds >= 0:             # <<<<<<<<<<<<<<
 *         hours = math_floor_div(seconds, SS_HOUR)
 *         minutes = math_floor_div(seconds - hours * SS_HOUR, SS_MINUTE)
 */
  }

  /* "utils.pxd":2237
 *     # Negative timedelta
 *     else:
 *         seconds = -seconds             # <<<<<<<<<<<<<<
 *         hours = math_floor_div(seconds, SS_HOUR)
 *         minutes = math_floor_div(seconds - hours * SS_HOUR, SS_MINUTE)
 */
  /*else*/ {
    __pyx_v_seconds = (-__pyx_v_seconds);

    /* "utils.pxd":2238
 *     else:
 *         seconds = -seconds
 *         hours = math_floor_div(seconds, SS_HOUR)             # <<<<<<<<<<<<<<
 *         minutes = math_floor_div(seconds - hours * SS_HOUR, SS_MINUTE)
 *         return "-%02d%02d" % (hours, minutes)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_seconds, __pyx_v_7cytimes_5utils_SS_HOUR, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 2238, __pyx_L1_error)
    __pyx_v_hours = __pyx_t_2;

    /* "utils.pxd":2239
 *         seconds = -seconds
 *         hours = math_floor_div(seconds, SS_HOUR)
 *         minutes = math_floor_div(seconds - hours * SS_HOUR, SS_MINUTE)             # <<<<<<<<<<<<<<
 *         return "-%02d%02d" % (hours, minutes)
 * 
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_math_floor_div((__pyx_v_seconds - (__pyx_v_hours * __pyx_v_7cytimes_5utils_SS_HOUR)), __pyx_v_7cytimes_5utils_SS_MINUTE, NULL); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 2239, __pyx_L1_error)
    __pyx_v_minutes = __pyx_t_2;

    /* "utils.pxd":2240
 *         hours = math_floor_div(seconds, SS_HOUR)
 *         minutes = math_floor_div(seconds - hours * SS_HOUR, SS_MINUTE)
 *         return "-%02d%02d" % (hours, minutes)             # <<<<<<<<<<<<<<
 * 
 * cdef inline long long td_to_us(datetime.timedelta td):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u__9);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__9);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u__9);
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_hours, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "utils.pxd":2224
 *     return "-00:00:00.%06d" % us
 * 
 * cdef inline str td_to_utcformat(datetime.timedelta td):             # <<<<<<<<<<<<<<
 *     """Convert timedelta to string in UTC format ('+/-HH:MM') `<'str'>`."""
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cytimes.utils.td_to_utcformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2242
 *         return "-%02d%02d" % (hours, minutes)
 * 
 * cdef inline long long td_to_us(datetime.timedelta td):             # <<<<<<<<<<<<<<
 *     """Convert timedelta to microseconds `<'int'>`."""
 *     cdef:
 */

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_5utils_td_to_us(PyDateTime_Delta *__pyx_v_td) {
  PY_LONG_LONG __pyx_v_days;
  PY_LONG_LONG __pyx_v_seconds;
  PY_LONG_LONG __pyx_v_us;
  PY_LONG_LONG __pyx_r;

  /* "utils.pxd":2245
 *     """Convert timedelta to microseconds `<'int'>`."""
 *     cdef:
 *         long long days = td.day             # <<<<<<<<<<<<<<
 *         long long seconds = td.second
 *         long long us = td.microsecond
 */
  __pyx_v_days = __pyx_f_7cpython_8datetime_9timedelta_3day_day(__pyx_v_td);

  /* "utils.pxd":2246
 *     cdef:
 *         long long days = td.day
 *         long long seconds = td.second             # <<<<<<<<<<<<<<
 *         long long us = td.microsecond
 *     return days * US_DAY + seconds * US_SECOND + us
 */
  __pyx_v_seconds = __pyx_f_7cpython_8datetime_9timedelta_6second_second(__pyx_v_td);

  /* "utils.pxd":2247
 *         long long days = td.day
 *         long long seconds = td.second
 *         long long us = td.microsecond             # <<<<<<<<<<<<<<
 *     return days * US_DAY + seconds * US_SECOND + us
 * 
 */
  __pyx_v_us = __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(__pyx_v_td);

  /* "utils.pxd":2248
 *         long long seconds = td.second
 *         long long us = td.microsecond
 *     return days * US_DAY + seconds * US_SECOND + us             # <<<<<<<<<<<<<<
 * 
 * cdef inline double td_to_seconds(datetime.timedelta td):
 */
  __pyx_r = (((__pyx_v_days * __pyx_v_7cytimes_5utils_US_DAY) + (__pyx_v_seconds * __pyx_v_7cytimes_5utils_US_SECOND)) + __pyx_v_us);
  goto __pyx_L0;

  /* "utils.pxd":2242
 *         return "-%02d%02d" % (hours, minutes)
 * 
 * cdef inline long long td_to_us(datetime.timedelta td):             # <<<<<<<<<<<<<<
 *     """Convert timedelta to microseconds `<'int'>`."""
 *     cdef:
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":2250
 *     return days * US_DAY + seconds * US_SECOND + us
 * 
 * cdef inline double td_to_seconds(datetime.timedelta td):             # <<<<<<<<<<<<<<
 *     """Convert timedelta to seconds `<'float'>`."""
 *     cdef:
 */

static CYTHON_INLINE double __pyx_f_7cytimes_5utils_td_to_seconds(PyDateTime_Delta *__pyx_v_td) {
  double __pyx_v_days;
  double __pyx_v_seconds;
  double __pyx_v_us;
  double __pyx_r;

  /* "utils.pxd":2253
 *     """Convert timedelta to seconds `<'float'>`."""
 *     cdef:
 *         double days = td.day             # <<<<<<<<<<<<<<
 *         double seconds = td.second
 *         double us = td.microsecond
 */
  __pyx_v_days = __pyx_f_7cpython_8datetime_9timedelta_3day_day(__pyx_v_td);

  /* "utils.pxd":2254
 *     cdef:
 *         double days = td.day
 *         double seconds = td.second             # <<<<<<<<<<<<<<
 *         double us = td.microsecond
 *     return days * SS_DAY + seconds + us / 1_000_000
 */
  __pyx_v_seconds = __pyx_f_7cpython_8datetime_9timedelta_6second_second(__pyx_v_td);

  /* "utils.pxd":2255
 *         double days = td.day
 *         double seconds = td.second
 *         double us = td.microsecond             # <<<<<<<<<<<<<<
 *     return days * SS_DAY + seconds + us / 1_000_000
 * 
 */
  __pyx_v_us = __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(__pyx_v_td);

  /* "utils.pxd":2256
 *         double seconds = td.second
 *         double us = td.microsecond
 *     return days * SS_DAY + seconds + us / 1_000_000             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.timedelta td_fr_us(long long val):
 */
  __pyx_r = (((__pyx_v_days * __pyx_v_7cytimes_5utils_SS_DAY) + __pyx_v_seconds) + (__pyx_v_us / 1000000.0));
  goto __pyx_L0;

  /* "utils.pxd":2250
 *     return days * US_DAY + seconds * US_SECOND + us
 * 
 * cdef inline double td_to_seconds(datetime.timedelta td):             # <<<<<<<<<<<<<<
 *     """Convert timedelta to seconds `<'float'>`."""
 *     cdef:
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":2258
 *     return days * SS_DAY + seconds + us / 1_000_000
 * 
 * cdef inline datetime.timedelta td_fr_us(long long val):             # <<<<<<<<<<<<<<
 *     """Create timedelta from microseconds (int) `<'datetime.timedelta'>`."""
 *     cdef long long days, seconds
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_td_fr_us(PY_LONG_LONG __pyx_v_val) {
  PY_LONG_LONG __pyx_v_days;
  PY_LONG_LONG __pyx_v_seconds;
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PY_LONG_LONG __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("td_fr_us", 1);

  /* "utils.pxd":2261
 *     """Create timedelta from microseconds (int) `<'datetime.timedelta'>`."""
 *     cdef long long days, seconds
 *     days = math_floor_div(val, US_DAY)             # <<<<<<<<<<<<<<
 *     val -= days * US_DAY
 *     seconds = math_floor_div(val, US_SECOND)
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_val, __pyx_v_7cytimes_5utils_US_DAY, NULL); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 2261, __pyx_L1_error)
  __pyx_v_days = __pyx_t_1;

  /* "utils.pxd":2262
 *     cdef long long days, seconds
 *     days = math_floor_div(val, US_DAY)
 *     val -= days * US_DAY             # <<<<<<<<<<<<<<
 *     seconds = math_floor_div(val, US_SECOND)
 *     val -= seconds * US_SECOND
 */
  __pyx_v_val = (__pyx_v_val - (__pyx_v_days * __pyx_v_7cytimes_5utils_US_DAY));

  /* "utils.pxd":2263
 *     days = math_floor_div(val, US_DAY)
 *     val -= days * US_DAY
 *     seconds = math_floor_div(val, US_SECOND)             # <<<<<<<<<<<<<<
 *     val -= seconds * US_SECOND
 *     return datetime.timedelta_new(days, seconds, val)
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_val, __pyx_v_7cytimes_5utils_US_SECOND, NULL); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 2263, __pyx_L1_error)
  __pyx_v_seconds = __pyx_t_1;

  /* "utils.pxd":2264
 *     val -= days * US_DAY
 *     seconds = math_floor_div(val, US_SECOND)
 *     val -= seconds * US_SECOND             # <<<<<<<<<<<<<<
 *     return datetime.timedelta_new(days, seconds, val)
 * 
 */
  __pyx_v_val = (__pyx_v_val - (__pyx_v_seconds * __pyx_v_7cytimes_5utils_US_SECOND));

  /* "utils.pxd":2265
 *     seconds = math_floor_div(val, US_SECOND)
 *     val -= seconds * US_SECOND
 *     return datetime.timedelta_new(days, seconds, val)             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.timedelta td_fr_seconds(double val):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_v_days, __pyx_v_seconds, __pyx_v_val)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":2258
 *     return days * SS_DAY + seconds + us / 1_000_000
 * 
 * cdef inline datetime.timedelta td_fr_us(long long val):             # <<<<<<<<<<<<<<
 *     """Create timedelta from microseconds (int) `<'datetime.timedelta'>`."""
 *     cdef long long days, seconds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.td_fr_us", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2267
 *     return datetime.timedelta_new(days, seconds, val)
 * 
 * cdef inline datetime.timedelta td_fr_seconds(double val):             # <<<<<<<<<<<<<<
 *     """Create timedelta from seconds (float) `<'datetime.timedelta'>`."""
 *     return td_fr_us(<long long> int(val * US_SECOND))
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_td_fr_seconds(double __pyx_v_val) {
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("td_fr_seconds", 1);

  /* "utils.pxd":2269
 * cdef inline datetime.timedelta td_fr_seconds(double val):
 *     """Create timedelta from seconds (float) `<'datetime.timedelta'>`."""
 *     return td_fr_us(<long long> int(val * US_SECOND))             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.timedelta td_fr_td(datetime.timedelta td):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_td_fr_us(((PY_LONG_LONG)((PY_LONG_LONG)(__pyx_v_val * __pyx_v_7cytimes_5utils_US_SECOND))))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "utils.pxd":2267
 *     return datetime.timedelta_new(days, seconds, val)
 * 
 * cdef inline datetime.timedelta td_fr_seconds(double val):             # <<<<<<<<<<<<<<
 *     """Create timedelta from seconds (float) `<'datetime.timedelta'>`."""
 *     return td_fr_us(<long long> int(val * US_SECOND))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.td_fr_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2271
 *     return td_fr_us(<long long> int(val * US_SECOND))
 * 
 * cdef inline datetime.timedelta td_fr_td(datetime.timedelta td):             # <<<<<<<<<<<<<<
 *     """Create timedelta from another timedelta (include subclass) `<'datetime.timedelta'>`."""
 *     return datetime.timedelta_new(td.day, td.second, td.microsecond)
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_td_fr_td(PyDateTime_Delta *__pyx_v_td) {
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("td_fr_td", 1);

  /* "utils.pxd":2273
 * cdef inline datetime.timedelta td_fr_td(datetime.timedelta td):
 *     """Create timedelta from another timedelta (include subclass) `<'datetime.timedelta'>`."""
 *     return datetime.timedelta_new(td.day, td.second, td.microsecond)             # <<<<<<<<<<<<<<
 * 
 * # datetime.tzinfo --------------------------------------------------------------------------------------
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_f_7cpython_8datetime_9timedelta_3day_day(__pyx_v_td), __pyx_f_7cpython_8datetime_9timedelta_6second_second(__pyx_v_td), __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(__pyx_v_td))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "utils.pxd":2271
 *     return td_fr_us(<long long> int(val * US_SECOND))
 * 
 * cdef inline datetime.timedelta td_fr_td(datetime.timedelta td):             # <<<<<<<<<<<<<<
 *     """Create timedelta from another timedelta (include subclass) `<'datetime.timedelta'>`."""
 *     return datetime.timedelta_new(td.day, td.second, td.microsecond)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.td_fr_td", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2277
 * # datetime.tzinfo --------------------------------------------------------------------------------------
 * # . generate
 * cdef inline object tz_new(int hours=0, int minites=0, int seconds=0):             # <<<<<<<<<<<<<<
 *     """Create a new timezone `<'datetime.timezone'>`.
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_tz_new(struct __pyx_opt_args_7cytimes_5utils_tz_new *__pyx_optional_args) {
  int __pyx_v_hours = ((int)0);
  int __pyx_v_minites = ((int)0);
  int __pyx_v_seconds = ((int)0);
  PY_LONG_LONG __pyx_v_offset;
  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_7cpython_8datetime_timezone_new __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tz_new", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_hours = __pyx_optional_args->hours;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_minites = __pyx_optional_args->minites;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_seconds = __pyx_optional_args->seconds;
        }
      }
    }
  }

  /* "utils.pxd":2283
 *     >>> datetime.timezone(datetime.timedelta(hours=hours, minutes=minites))
 *     """
 *     cdef long long offset = hours * 3_600 + minites * 60 + seconds             # <<<<<<<<<<<<<<
 *     if not -86_340 <= offset <= 86_340:
 *         raise ValueError(
 */
  __pyx_v_offset = (((__pyx_v_hours * 0xE10) + (__pyx_v_minites * 60)) + __pyx_v_seconds);

  /* "utils.pxd":2284
 *     """
 *     cdef long long offset = hours * 3_600 + minites * 60 + seconds
 *     if not -86_340 <= offset <= 86_340:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "timezone offset '%s' (seconds) out of range, "
 */
  __pyx_t_1 = (-86340LL <= __pyx_v_offset);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_offset <= 0x15144);
  }
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {

    /* "utils.pxd":2287
 *         raise ValueError(
 *             "timezone offset '%s' (seconds) out of range, "
 *             "must between -86340 and 86340." % offset             # <<<<<<<<<<<<<<
 *         )
 *     return datetime.timezone_new(datetime.timedelta_new(0, offset, 0), None)
 */
    __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_timezone_offset_s_seconds_out_of, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 2287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "utils.pxd":2285
 *     cdef long long offset = hours * 3_600 + minites * 60 + seconds
 *     if not -86_340 <= offset <= 86_340:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "timezone offset '%s' (seconds) out of range, "
 *             "must between -86340 and 86340." % offset
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(5, 2285, __pyx_L1_error)

    /* "utils.pxd":2284
 *     """
 *     cdef long long offset = hours * 3_600 + minites * 60 + seconds
 *     if not -86_340 <= offset <= 86_340:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "timezone offset '%s' (seconds) out of range, "
 */
  }

  /* "utils.pxd":2289
 *             "must between -86340 and 86340." % offset
 *         )
 *     return datetime.timezone_new(datetime.timedelta_new(0, offset, 0), None)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object tz_local(datetime.datetime dt=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(0, __pyx_v_offset, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.name = Py_None;
  __pyx_t_4 = __pyx_f_7cpython_8datetime_timezone_new(__pyx_t_3, &__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 2289, __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;

  /* "utils.pxd":2277
 * # datetime.tzinfo --------------------------------------------------------------------------------------
 * # . generate
 * cdef inline object tz_new(int hours=0, int minites=0, int seconds=0):             # <<<<<<<<<<<<<<
 *     """Create a new timezone `<'datetime.timezone'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils.tz_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2291
 *     return datetime.timezone_new(datetime.timedelta_new(0, offset, 0), None)
 * 
 * cdef inline object tz_local(datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Get the local timezone `<'datetime.timezone'>`."""
 *     return _LOCAL_TZ
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_tz_local(struct __pyx_opt_args_7cytimes_5utils_tz_local *__pyx_optional_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tz_local", 1);
  if (__pyx_optional_args) {
  }

  /* "utils.pxd":2293
 * cdef inline object tz_local(datetime.datetime dt=None):
 *     """Get the local timezone `<'datetime.timezone'>`."""
 *     return _LOCAL_TZ             # <<<<<<<<<<<<<<
 * 
 * cdef inline int tz_local_seconds(datetime.datetime dt=None) except -200_000:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_7cytimes_5utils__LOCAL_TZ);
  __pyx_r = __pyx_v_7cytimes_5utils__LOCAL_TZ;
  goto __pyx_L0;

  /* "utils.pxd":2291
 *     return datetime.timezone_new(datetime.timedelta_new(0, offset, 0), None)
 * 
 * cdef inline object tz_local(datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Get the local timezone `<'datetime.timezone'>`."""
 *     return _LOCAL_TZ
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2295
 *     return _LOCAL_TZ
 * 
 * cdef inline int tz_local_seconds(datetime.datetime dt=None) except -200_000:             # <<<<<<<<<<<<<<
 *     """Get the local timezone offset in total seconds `<'int'>`."""
 *     # Convert to timestamp
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_tz_local_seconds(struct __pyx_opt_args_7cytimes_5utils_tz_local_seconds *__pyx_optional_args) {
  PyDateTime_DateTime *__pyx_v_dt = ((PyDateTime_DateTime *)Py_None);
  double __pyx_v_ts;
  PY_LONG_LONG __pyx_v_ts1;
  PY_LONG_LONG __pyx_v_ts2;
  struct tm __pyx_v_loc;
  struct tm __pyx_v_gmt;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PY_LONG_LONG __pyx_t_3;
  int __pyx_t_4;
  double __pyx_t_5;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_seconds __pyx_t_6;
  struct tm __pyx_t_7;
  struct tm __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tz_local_seconds", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_dt = __pyx_optional_args->dt;
    }
  }

  /* "utils.pxd":2302
 *         long long ts1, ts2
 * 
 *     if dt is not None:             # <<<<<<<<<<<<<<
 *         if dt.tzinfo is None:
 *             ts1 = dt_to_posix(dt)
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_dt) != Py_None);
  if (__pyx_t_1) {

    /* "utils.pxd":2303
 * 
 *     if dt is not None:
 *         if dt.tzinfo is None:             # <<<<<<<<<<<<<<
 *             ts1 = dt_to_posix(dt)
 *             # . detect gap
 */
    __pyx_t_2 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = (__pyx_t_2 == Py_None);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "utils.pxd":2304
 *     if dt is not None:
 *         if dt.tzinfo is None:
 *             ts1 = dt_to_posix(dt)             # <<<<<<<<<<<<<<
 *             # . detect gap
 *             ts2 = dt_to_posix(dt_replace_fold(dt, 1-dt.fold))
 */
      __pyx_t_3 = __pyx_f_7cytimes_5utils_dt_to_posix(__pyx_v_dt); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 2304, __pyx_L1_error)
      __pyx_v_ts1 = __pyx_t_3;

      /* "utils.pxd":2306
 *             ts1 = dt_to_posix(dt)
 *             # . detect gap
 *             ts2 = dt_to_posix(dt_replace_fold(dt, 1-dt.fold))             # <<<<<<<<<<<<<<
 *             if ts2 != ts1 and (ts2 > ts1) == dt.fold:
 *                 ts = ts2
 */
      __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_replace_fold(__pyx_v_dt, (1 - __pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2306, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __pyx_f_7cytimes_5utils_dt_to_posix(((PyDateTime_DateTime *)__pyx_t_2)); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 2306, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_ts2 = __pyx_t_3;

      /* "utils.pxd":2307
 *             # . detect gap
 *             ts2 = dt_to_posix(dt_replace_fold(dt, 1-dt.fold))
 *             if ts2 != ts1 and (ts2 > ts1) == dt.fold:             # <<<<<<<<<<<<<<
 *                 ts = ts2
 *             else:
 */
      __pyx_t_4 = (__pyx_v_ts2 != __pyx_v_ts1);
      if (__pyx_t_4) {
      } else {
        __pyx_t_1 = __pyx_t_4;
        goto __pyx_L6_bool_binop_done;
      }
      __pyx_t_4 = ((__pyx_v_ts2 > __pyx_v_ts1) == __pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt));
      __pyx_t_1 = __pyx_t_4;
      __pyx_L6_bool_binop_done:;
      if (__pyx_t_1) {

        /* "utils.pxd":2308
 *             ts2 = dt_to_posix(dt_replace_fold(dt, 1-dt.fold))
 *             if ts2 != ts1 and (ts2 > ts1) == dt.fold:
 *                 ts = ts2             # <<<<<<<<<<<<<<
 *             else:
 *                 ts = ts1
 */
        __pyx_v_ts = __pyx_v_ts2;

        /* "utils.pxd":2307
 *             # . detect gap
 *             ts2 = dt_to_posix(dt_replace_fold(dt, 1-dt.fold))
 *             if ts2 != ts1 and (ts2 > ts1) == dt.fold:             # <<<<<<<<<<<<<<
 *                 ts = ts2
 *             else:
 */
        goto __pyx_L5;
      }

      /* "utils.pxd":2310
 *                 ts = ts2
 *             else:
 *                 ts = ts1             # <<<<<<<<<<<<<<
 *         else:
 *             ts = dt_to_seconds(dt, True)
 */
      /*else*/ {
        __pyx_v_ts = __pyx_v_ts1;
      }
      __pyx_L5:;

      /* "utils.pxd":2303
 * 
 *     if dt is not None:
 *         if dt.tzinfo is None:             # <<<<<<<<<<<<<<
 *             ts1 = dt_to_posix(dt)
 *             # . detect gap
 */
      goto __pyx_L4;
    }

    /* "utils.pxd":2312
 *                 ts = ts1
 *         else:
 *             ts = dt_to_seconds(dt, True)             # <<<<<<<<<<<<<<
 *     else:
 *         ts = unix_time()
 */
    /*else*/ {
      __pyx_t_6.__pyx_n = 1;
      __pyx_t_6.utc = 1;
      __pyx_t_5 = __pyx_f_7cytimes_5utils_dt_to_seconds(__pyx_v_dt, &__pyx_t_6); if (unlikely(__pyx_t_5 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(5, 2312, __pyx_L1_error)
      __pyx_v_ts = __pyx_t_5;
    }
    __pyx_L4:;

    /* "utils.pxd":2302
 *         long long ts1, ts2
 * 
 *     if dt is not None:             # <<<<<<<<<<<<<<
 *         if dt.tzinfo is None:
 *             ts1 = dt_to_posix(dt)
 */
    goto __pyx_L3;
  }

  /* "utils.pxd":2314
 *             ts = dt_to_seconds(dt, True)
 *     else:
 *         ts = unix_time()             # <<<<<<<<<<<<<<
 * 
 *     # Compute offset
 */
  /*else*/ {
    __pyx_v_ts = __pyx_f_7cpython_4time_time();
  }
  __pyx_L3:;

  /* "utils.pxd":2317
 * 
 *     # Compute offset
 *     loc, gmt = tm_localtime(ts), tm_gmtime(ts)             # <<<<<<<<<<<<<<
 *     return (
 *         (loc.tm_mday - gmt.tm_mday) * SS_DAY
 */
  __pyx_t_7 = __pyx_f_7cytimes_5utils_tm_localtime(__pyx_v_ts); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 2317, __pyx_L1_error)
  __pyx_t_8 = __pyx_f_7cytimes_5utils_tm_gmtime(__pyx_v_ts); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 2317, __pyx_L1_error)
  __pyx_v_loc = __pyx_t_7;
  __pyx_v_gmt = __pyx_t_8;

  /* "utils.pxd":2322
 *         + (loc.tm_hour - gmt.tm_hour) * SS_HOUR
 *         + (loc.tm_min - gmt.tm_min) * SS_MINUTE
 *         + (loc.tm_sec - gmt.tm_sec)             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_r = (((((__pyx_v_loc.tm_mday - __pyx_v_gmt.tm_mday) * __pyx_v_7cytimes_5utils_SS_DAY) + ((__pyx_v_loc.tm_hour - __pyx_v_gmt.tm_hour) * __pyx_v_7cytimes_5utils_SS_HOUR)) + ((__pyx_v_loc.tm_min - __pyx_v_gmt.tm_min) * __pyx_v_7cytimes_5utils_SS_MINUTE)) + (__pyx_v_loc.tm_sec - __pyx_v_gmt.tm_sec));
  goto __pyx_L0;

  /* "utils.pxd":2295
 *     return _LOCAL_TZ
 * 
 * cdef inline int tz_local_seconds(datetime.datetime dt=None) except -200_000:             # <<<<<<<<<<<<<<
 *     """Get the local timezone offset in total seconds `<'int'>`."""
 *     # Convert to timestamp
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.tz_local_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -200000;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2328
 * 
 * # . type check
 * cdef inline bint is_tz(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of datetime.tzinfo `<'bool'>`.
 * 
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_tz(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "utils.pxd":2334
 *     >>> isinstance(obj, datetime.tzinfo)
 *     """
 *     return datetime.PyTZInfo_Check(obj)             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_tz_exact(object obj) except -1:
 */
  __pyx_r = PyTZInfo_Check(__pyx_v_obj);
  goto __pyx_L0;

  /* "utils.pxd":2328
 * 
 * # . type check
 * cdef inline bint is_tz(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of datetime.tzinfo `<'bool'>`.
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":2336
 *     return datetime.PyTZInfo_Check(obj)
 * 
 * cdef inline bint is_tz_exact(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is the exact datetime.tzinfo type `<'bool'>`.
 * 
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_tz_exact(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "utils.pxd":2342
 *     >>> type(obj) is datetime.date
 *     """
 *     return datetime.PyTZInfo_CheckExact(obj)             # <<<<<<<<<<<<<<
 * 
 * # . access
 */
  __pyx_r = PyTZInfo_CheckExact(__pyx_v_obj);
  goto __pyx_L0;

  /* "utils.pxd":2336
 *     return datetime.PyTZInfo_Check(obj)
 * 
 * cdef inline bint is_tz_exact(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is the exact datetime.tzinfo type `<'bool'>`.
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":2345
 * 
 * # . access
 * cdef inline str tz_name(object tz, datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Access the name of the tzinfo `<'str/None'>`.
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_tz_name(PyObject *__pyx_v_tz, struct __pyx_opt_args_7cytimes_5utils_tz_name *__pyx_optional_args) {
  PyDateTime_DateTime *__pyx_v_dt = ((PyDateTime_DateTime *)Py_None);
  PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tz_name", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_dt = __pyx_optional_args->dt;
    }
  }

  /* "utils.pxd":2351
 *     >>> tz.tzname(dt)
 *     """
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  __pyx_t_1 = (__pyx_v_tz == Py_None);
  if (__pyx_t_1) {

    /* "utils.pxd":2352
 *     """
 *     if tz is None:
 *         return None             # <<<<<<<<<<<<<<
 *     try:
 *         return tz.tzname(dt)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "utils.pxd":2351
 *     >>> tz.tzname(dt)
 *     """
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  }

  /* "utils.pxd":2353
 *     if tz is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         return tz.tzname(dt)
 *     except Exception as err:
 */
  {
    __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:*/ {

      /* "utils.pxd":2354
 *         return None
 *     try:
 *         return tz.tzname(dt)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *         if not is_tz(tz):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_tzname); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2354, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(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_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, ((PyObject *)__pyx_v_dt)};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2354, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(5, 2354, __pyx_L4_error)
      __pyx_r = ((PyObject*)__pyx_t_5);
      __pyx_t_5 = 0;
      goto __pyx_L8_try_return;

      /* "utils.pxd":2353
 *     if tz is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         return tz.tzname(dt)
 *     except Exception as err:
 */
    }
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "utils.pxd":2355
 *     try:
 *         return tz.tzname(dt)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_9) {
      __Pyx_AddTraceback("cytimes.utils.tz_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(5, 2355, __pyx_L6_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "utils.pxd":2356
 *         return tz.tzname(dt)
 *     except Exception as err:
 *         if not is_tz(tz):             # <<<<<<<<<<<<<<
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 *         raise err
 */
        __pyx_t_1 = __pyx_f_7cytimes_5utils_is_tz(__pyx_v_tz); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 2356, __pyx_L15_error)
        __pyx_t_10 = (!__pyx_t_1);
        if (unlikely(__pyx_t_10)) {

          /* "utils.pxd":2357
 *     except Exception as err:
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err             # <<<<<<<<<<<<<<
 *         raise err
 * 
 */
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_expects_datetime_tzinfo_got_s, ((PyObject *)Py_TYPE(__pyx_v_tz))); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 2357, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 2357, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_Raise(__pyx_t_12, 0, 0, __pyx_v_err);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __PYX_ERR(5, 2357, __pyx_L15_error)

          /* "utils.pxd":2356
 *         return tz.tzname(dt)
 *     except Exception as err:
 *         if not is_tz(tz):             # <<<<<<<<<<<<<<
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 *         raise err
 */
        }

        /* "utils.pxd":2358
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 *         raise err             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.timedelta tz_dst(object tz, datetime.datetime dt=None):
 */
        __Pyx_Raise(__pyx_v_err, 0, 0, 0);
        __PYX_ERR(5, 2358, __pyx_L15_error)
      }

      /* "utils.pxd":2355
 *     try:
 *         return tz.tzname(dt)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 */
      /*finally:*/ {
        __pyx_L15_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_9 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L6_except_error;
        }
      }
    }
    goto __pyx_L6_except_error;

    /* "utils.pxd":2353
 *     if tz is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         return tz.tzname(dt)
 *     except Exception as err:
 */
    __pyx_L6_except_error:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L8_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;
  }

  /* "utils.pxd":2345
 * 
 * # . access
 * cdef inline str tz_name(object tz, datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Access the name of the tzinfo `<'str/None'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cytimes.utils.tz_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2360
 *         raise err
 * 
 * cdef inline datetime.timedelta tz_dst(object tz, datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Access the 'dst' of the tzinfo `<'datetime.timedelta'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_tz_dst(PyObject *__pyx_v_tz, struct __pyx_opt_args_7cytimes_5utils_tz_dst *__pyx_optional_args) {
  PyDateTime_DateTime *__pyx_v_dt = ((PyDateTime_DateTime *)Py_None);
  PyObject *__pyx_v_err = NULL;
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tz_dst", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_dt = __pyx_optional_args->dt;
    }
  }

  /* "utils.pxd":2366
 *     >>> tz.dst(dt)
 *     """
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  __pyx_t_1 = (__pyx_v_tz == Py_None);
  if (__pyx_t_1) {

    /* "utils.pxd":2367
 *     """
 *     if tz is None:
 *         return None             # <<<<<<<<<<<<<<
 *     try:
 *         return tz.dst(dt)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_r = ((PyDateTime_Delta *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "utils.pxd":2366
 *     >>> tz.dst(dt)
 *     """
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  }

  /* "utils.pxd":2368
 *     if tz is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         return tz.dst(dt)
 *     except Exception as err:
 */
  {
    __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:*/ {

      /* "utils.pxd":2369
 *         return None
 *     try:
 *         return tz.dst(dt)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *         if not is_tz(tz):
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_dst); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2369, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(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_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, ((PyObject *)__pyx_v_dt)};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2369, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(5, 2369, __pyx_L4_error)
      __pyx_r = ((PyDateTime_Delta *)__pyx_t_5);
      __pyx_t_5 = 0;
      goto __pyx_L8_try_return;

      /* "utils.pxd":2368
 *     if tz is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         return tz.dst(dt)
 *     except Exception as err:
 */
    }
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "utils.pxd":2370
 *     try:
 *         return tz.dst(dt)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_9) {
      __Pyx_AddTraceback("cytimes.utils.tz_dst", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(5, 2370, __pyx_L6_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "utils.pxd":2371
 *         return tz.dst(dt)
 *     except Exception as err:
 *         if not is_tz(tz):             # <<<<<<<<<<<<<<
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 *         raise err
 */
        __pyx_t_1 = __pyx_f_7cytimes_5utils_is_tz(__pyx_v_tz); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 2371, __pyx_L15_error)
        __pyx_t_10 = (!__pyx_t_1);
        if (unlikely(__pyx_t_10)) {

          /* "utils.pxd":2372
 *     except Exception as err:
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err             # <<<<<<<<<<<<<<
 *         raise err
 * 
 */
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_expects_datetime_tzinfo_got_s, ((PyObject *)Py_TYPE(__pyx_v_tz))); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 2372, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 2372, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_Raise(__pyx_t_12, 0, 0, __pyx_v_err);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __PYX_ERR(5, 2372, __pyx_L15_error)

          /* "utils.pxd":2371
 *         return tz.dst(dt)
 *     except Exception as err:
 *         if not is_tz(tz):             # <<<<<<<<<<<<<<
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 *         raise err
 */
        }

        /* "utils.pxd":2373
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 *         raise err             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.timedelta tz_utcoffset(object tz, datetime.datetime dt=None):
 */
        __Pyx_Raise(__pyx_v_err, 0, 0, 0);
        __PYX_ERR(5, 2373, __pyx_L15_error)
      }

      /* "utils.pxd":2370
 *     try:
 *         return tz.dst(dt)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 */
      /*finally:*/ {
        __pyx_L15_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_9 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L6_except_error;
        }
      }
    }
    goto __pyx_L6_except_error;

    /* "utils.pxd":2368
 *     if tz is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         return tz.dst(dt)
 *     except Exception as err:
 */
    __pyx_L6_except_error:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L8_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;
  }

  /* "utils.pxd":2360
 *         raise err
 * 
 * cdef inline datetime.timedelta tz_dst(object tz, datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Access the 'dst' of the tzinfo `<'datetime.timedelta'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cytimes.utils.tz_dst", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2375
 *         raise err
 * 
 * cdef inline datetime.timedelta tz_utcoffset(object tz, datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Access the 'utcoffset' of the tzinfo `<'datetime.timedelta'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_tz_utcoffset(PyObject *__pyx_v_tz, struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset *__pyx_optional_args) {
  PyDateTime_DateTime *__pyx_v_dt = ((PyDateTime_DateTime *)Py_None);
  PyObject *__pyx_v_err = NULL;
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tz_utcoffset", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_dt = __pyx_optional_args->dt;
    }
  }

  /* "utils.pxd":2381
 *     >>> tz.utcoffset(dt)
 *     """
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  __pyx_t_1 = (__pyx_v_tz == Py_None);
  if (__pyx_t_1) {

    /* "utils.pxd":2382
 *     """
 *     if tz is None:
 *         return None             # <<<<<<<<<<<<<<
 *     try:
 *         return tz.utcoffset(dt)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_r = ((PyDateTime_Delta *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "utils.pxd":2381
 *     >>> tz.utcoffset(dt)
 *     """
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  }

  /* "utils.pxd":2383
 *     if tz is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         return tz.utcoffset(dt)
 *     except Exception as err:
 */
  {
    __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:*/ {

      /* "utils.pxd":2384
 *         return None
 *     try:
 *         return tz.utcoffset(dt)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *         if not is_tz(tz):
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_utcoffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2384, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(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_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, ((PyObject *)__pyx_v_dt)};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2384, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(5, 2384, __pyx_L4_error)
      __pyx_r = ((PyDateTime_Delta *)__pyx_t_5);
      __pyx_t_5 = 0;
      goto __pyx_L8_try_return;

      /* "utils.pxd":2383
 *     if tz is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         return tz.utcoffset(dt)
 *     except Exception as err:
 */
    }
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "utils.pxd":2385
 *     try:
 *         return tz.utcoffset(dt)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_9) {
      __Pyx_AddTraceback("cytimes.utils.tz_utcoffset", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(5, 2385, __pyx_L6_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "utils.pxd":2386
 *         return tz.utcoffset(dt)
 *     except Exception as err:
 *         if not is_tz(tz):             # <<<<<<<<<<<<<<
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 *         raise err
 */
        __pyx_t_1 = __pyx_f_7cytimes_5utils_is_tz(__pyx_v_tz); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 2386, __pyx_L15_error)
        __pyx_t_10 = (!__pyx_t_1);
        if (unlikely(__pyx_t_10)) {

          /* "utils.pxd":2387
 *     except Exception as err:
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err             # <<<<<<<<<<<<<<
 *         raise err
 * 
 */
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_expects_datetime_tzinfo_got_s, ((PyObject *)Py_TYPE(__pyx_v_tz))); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 2387, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 2387, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_Raise(__pyx_t_12, 0, 0, __pyx_v_err);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __PYX_ERR(5, 2387, __pyx_L15_error)

          /* "utils.pxd":2386
 *         return tz.utcoffset(dt)
 *     except Exception as err:
 *         if not is_tz(tz):             # <<<<<<<<<<<<<<
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 *         raise err
 */
        }

        /* "utils.pxd":2388
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 *         raise err             # <<<<<<<<<<<<<<
 * 
 * cdef inline int tz_utcoffset_seconds(object tz, datetime.datetime dt=None) except -200_000:
 */
        __Pyx_Raise(__pyx_v_err, 0, 0, 0);
        __PYX_ERR(5, 2388, __pyx_L15_error)
      }

      /* "utils.pxd":2385
 *     try:
 *         return tz.utcoffset(dt)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         if not is_tz(tz):
 *             raise TypeError("expects 'datetime.tzinfo', got %s." % type(tz)) from err
 */
      /*finally:*/ {
        __pyx_L15_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_9 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L6_except_error;
        }
      }
    }
    goto __pyx_L6_except_error;

    /* "utils.pxd":2383
 *     if tz is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         return tz.utcoffset(dt)
 *     except Exception as err:
 */
    __pyx_L6_except_error:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L8_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;
  }

  /* "utils.pxd":2375
 *         raise err
 * 
 * cdef inline datetime.timedelta tz_utcoffset(object tz, datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Access the 'utcoffset' of the tzinfo `<'datetime.timedelta'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cytimes.utils.tz_utcoffset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2390
 *         raise err
 * 
 * cdef inline int tz_utcoffset_seconds(object tz, datetime.datetime dt=None) except -200_000:             # <<<<<<<<<<<<<<
 *     """Access the 'utcoffset' of the tzinfo in total seconds `<'int'>`.
 * 
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_tz_utcoffset_seconds(PyObject *__pyx_v_tz, struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset_seconds *__pyx_optional_args) {
  PyDateTime_DateTime *__pyx_v_dt = ((PyDateTime_DateTime *)Py_None);
  PyDateTime_Delta *__pyx_v_offset = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tz_utcoffset_seconds", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_dt = __pyx_optional_args->dt;
    }
  }

  /* "utils.pxd":2398
 *     >>> tz.utcoffset(dt).total_seconds()
 *     """
 *     offset = tz_utcoffset(tz, dt)             # <<<<<<<<<<<<<<
 *     if offset is None:
 *         return -100_000
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.dt = __pyx_v_dt;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_utcoffset(__pyx_v_tz, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_offset = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":2399
 *     """
 *     offset = tz_utcoffset(tz, dt)
 *     if offset is None:             # <<<<<<<<<<<<<<
 *         return -100_000
 *     return datetime.timedelta_days(offset) * SS_DAY + datetime.timedelta_seconds(offset)
 */
  __pyx_t_3 = (((PyObject *)__pyx_v_offset) == Py_None);
  if (__pyx_t_3) {

    /* "utils.pxd":2400
 *     offset = tz_utcoffset(tz, dt)
 *     if offset is None:
 *         return -100_000             # <<<<<<<<<<<<<<
 *     return datetime.timedelta_days(offset) * SS_DAY + datetime.timedelta_seconds(offset)
 * 
 */
    __pyx_r = -100000;
    goto __pyx_L0;

    /* "utils.pxd":2399
 *     """
 *     offset = tz_utcoffset(tz, dt)
 *     if offset is None:             # <<<<<<<<<<<<<<
 *         return -100_000
 *     return datetime.timedelta_days(offset) * SS_DAY + datetime.timedelta_seconds(offset)
 */
  }

  /* "utils.pxd":2401
 *     if offset is None:
 *         return -100_000
 *     return datetime.timedelta_days(offset) * SS_DAY + datetime.timedelta_seconds(offset)             # <<<<<<<<<<<<<<
 * 
 * cdef inline str tz_utcformat(object tz, datetime.datetime dt=None):
 */
  __pyx_r = ((__pyx_f_7cpython_8datetime_timedelta_days(((PyObject *)__pyx_v_offset)) * __pyx_v_7cytimes_5utils_SS_DAY) + __pyx_f_7cpython_8datetime_timedelta_seconds(((PyObject *)__pyx_v_offset)));
  goto __pyx_L0;

  /* "utils.pxd":2390
 *         raise err
 * 
 * cdef inline int tz_utcoffset_seconds(object tz, datetime.datetime dt=None) except -200_000:             # <<<<<<<<<<<<<<
 *     """Access the 'utcoffset' of the tzinfo in total seconds `<'int'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.tz_utcoffset_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -200000;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_offset);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2403
 *     return datetime.timedelta_days(offset) * SS_DAY + datetime.timedelta_seconds(offset)
 * 
 * cdef inline str tz_utcformat(object tz, datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Access tzinfo as string in UTC format ('+/-HH:MM') `<'str/None'>`."""
 *     utc_off = tz_utcoffset(tz, dt)
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_tz_utcformat(PyObject *__pyx_v_tz, struct __pyx_opt_args_7cytimes_5utils_tz_utcformat *__pyx_optional_args) {
  PyDateTime_DateTime *__pyx_v_dt = ((PyDateTime_DateTime *)Py_None);
  PyDateTime_Delta *__pyx_v_utc_off = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_utcoffset __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tz_utcformat", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_dt = __pyx_optional_args->dt;
    }
  }

  /* "utils.pxd":2405
 * cdef inline str tz_utcformat(object tz, datetime.datetime dt=None):
 *     """Access tzinfo as string in UTC format ('+/-HH:MM') `<'str/None'>`."""
 *     utc_off = tz_utcoffset(tz, dt)             # <<<<<<<<<<<<<<
 *     if utc_off is None:
 *         return None
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.dt = __pyx_v_dt;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_tz_utcoffset(__pyx_v_tz, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_utc_off = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":2406
 *     """Access tzinfo as string in UTC format ('+/-HH:MM') `<'str/None'>`."""
 *     utc_off = tz_utcoffset(tz, dt)
 *     if utc_off is None:             # <<<<<<<<<<<<<<
 *         return None
 *     return td_to_utcformat(utc_off)
 */
  __pyx_t_3 = (((PyObject *)__pyx_v_utc_off) == Py_None);
  if (__pyx_t_3) {

    /* "utils.pxd":2407
 *     utc_off = tz_utcoffset(tz, dt)
 *     if utc_off is None:
 *         return None             # <<<<<<<<<<<<<<
 *     return td_to_utcformat(utc_off)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "utils.pxd":2406
 *     """Access tzinfo as string in UTC format ('+/-HH:MM') `<'str/None'>`."""
 *     utc_off = tz_utcoffset(tz, dt)
 *     if utc_off is None:             # <<<<<<<<<<<<<<
 *         return None
 *     return td_to_utcformat(utc_off)
 */
  }

  /* "utils.pxd":2408
 *     if utc_off is None:
 *         return None
 *     return td_to_utcformat(utc_off)             # <<<<<<<<<<<<<<
 * 
 * # NumPy: share -----------------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cytimes_5utils_td_to_utcformat(__pyx_v_utc_off); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "utils.pxd":2403
 *     return datetime.timedelta_days(offset) * SS_DAY + datetime.timedelta_seconds(offset)
 * 
 * cdef inline str tz_utcformat(object tz, datetime.datetime dt=None):             # <<<<<<<<<<<<<<
 *     """Access tzinfo as string in UTC format ('+/-HH:MM') `<'str/None'>`."""
 *     utc_off = tz_utcoffset(tz, dt)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.tz_utcformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_utc_off);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2412
 * # NumPy: share -----------------------------------------------------------------------------------------
 * # . time unit
 * cdef inline str map_nptime_unit_int2str(int unit):             # <<<<<<<<<<<<<<
 *     """Map numpy datetime64/timedelta64 unit from integer
 *     to the corresponding string representation `<'str'>`."""
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_5utils_map_nptime_unit_int2str(int __pyx_v_unit) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map_nptime_unit_int2str", 1);

  /* "utils.pxd":2416
 *     to the corresponding string representation `<'str'>`."""
 *     # Common units
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         return "ns"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "utils.pxd":2417
 *     # Common units
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         return "ns"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         return "us"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_ns);
    __pyx_r = __pyx_n_u_ns;
    goto __pyx_L0;

    /* "utils.pxd":2416
 *     to the corresponding string representation `<'str'>`."""
 *     # Common units
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         return "ns"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
  }

  /* "utils.pxd":2418
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         return "ns"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *         return "us"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "utils.pxd":2419
 *         return "ns"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         return "us"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         return "ms"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_us);
    __pyx_r = __pyx_n_u_us;
    goto __pyx_L0;

    /* "utils.pxd":2418
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         return "ns"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *         return "us"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
  }

  /* "utils.pxd":2420
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         return "us"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *         return "ms"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "utils.pxd":2421
 *         return "us"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         return "ms"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         return "s"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_ms);
    __pyx_r = __pyx_n_u_ms;
    goto __pyx_L0;

    /* "utils.pxd":2420
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         return "us"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *         return "ms"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 */
  }

  /* "utils.pxd":2422
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         return "ms"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *         return "s"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "utils.pxd":2423
 *         return "ms"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         return "s"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         return "m"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_s);
    __pyx_r = __pyx_n_u_s;
    goto __pyx_L0;

    /* "utils.pxd":2422
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         return "ms"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *         return "s"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 */
  }

  /* "utils.pxd":2424
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         return "s"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *         return "m"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "utils.pxd":2425
 *         return "s"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         return "m"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         return "h"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_m);
    __pyx_r = __pyx_n_u_m;
    goto __pyx_L0;

    /* "utils.pxd":2424
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         return "s"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *         return "m"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 */
  }

  /* "utils.pxd":2426
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         return "m"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:             # <<<<<<<<<<<<<<
 *         return "h"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "utils.pxd":2427
 *         return "m"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         return "h"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 *         return "D"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_h);
    __pyx_r = __pyx_n_u_h;
    goto __pyx_L0;

    /* "utils.pxd":2426
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         return "m"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:             # <<<<<<<<<<<<<<
 *         return "h"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 */
  }

  /* "utils.pxd":2428
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         return "h"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:             # <<<<<<<<<<<<<<
 *         return "D"
 * 
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_1) {

    /* "utils.pxd":2429
 *         return "h"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 *         return "D"             # <<<<<<<<<<<<<<
 * 
 *     # Uncommon units
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_D);
    __pyx_r = __pyx_n_u_D;
    goto __pyx_L0;

    /* "utils.pxd":2428
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         return "h"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:             # <<<<<<<<<<<<<<
 *         return "D"
 * 
 */
  }

  /* "utils.pxd":2432
 * 
 *     # Uncommon units
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:             # <<<<<<<<<<<<<<
 *         return "Y"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "utils.pxd":2433
 *     # Uncommon units
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:
 *         return "Y"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 *         return "M"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_Y);
    __pyx_r = __pyx_n_u_Y;
    goto __pyx_L0;

    /* "utils.pxd":2432
 * 
 *     # Uncommon units
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:             # <<<<<<<<<<<<<<
 *         return "Y"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 */
  }

  /* "utils.pxd":2434
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:
 *         return "Y"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:             # <<<<<<<<<<<<<<
 *         return "M"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "utils.pxd":2435
 *         return "Y"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 *         return "M"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:
 *         return "W"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_M);
    __pyx_r = __pyx_n_u_M;
    goto __pyx_L0;

    /* "utils.pxd":2434
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:
 *         return "Y"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:             # <<<<<<<<<<<<<<
 *         return "M"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:
 */
  }

  /* "utils.pxd":2436
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 *         return "M"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:             # <<<<<<<<<<<<<<
 *         return "W"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "utils.pxd":2437
 *         return "M"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:
 *         return "W"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:
 *         return "ps"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_W);
    __pyx_r = __pyx_n_u_W;
    goto __pyx_L0;

    /* "utils.pxd":2436
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 *         return "M"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:             # <<<<<<<<<<<<<<
 *         return "W"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:
 */
  }

  /* "utils.pxd":2438
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:
 *         return "W"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:             # <<<<<<<<<<<<<<
 *         return "ps"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_1) {

    /* "utils.pxd":2439
 *         return "W"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:
 *         return "ps"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:
 *         return "fs"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_ps);
    __pyx_r = __pyx_n_u_ps;
    goto __pyx_L0;

    /* "utils.pxd":2438
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:
 *         return "W"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:             # <<<<<<<<<<<<<<
 *         return "ps"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:
 */
  }

  /* "utils.pxd":2440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:
 *         return "ps"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:             # <<<<<<<<<<<<<<
 *         return "fs"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_1) {

    /* "utils.pxd":2441
 *         return "ps"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:
 *         return "fs"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:
 *         return "as"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_fs);
    __pyx_r = __pyx_n_u_fs;
    goto __pyx_L0;

    /* "utils.pxd":2440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:
 *         return "ps"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:             # <<<<<<<<<<<<<<
 *         return "fs"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:
 */
  }

  /* "utils.pxd":2442
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:
 *         return "fs"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:             # <<<<<<<<<<<<<<
 *         return "as"
 *     # if unit == np.NPY_DATETIMEUNIT.NPY_FR_B:
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_1) {

    /* "utils.pxd":2443
 *         return "fs"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:
 *         return "as"             # <<<<<<<<<<<<<<
 *     # if unit == np.NPY_DATETIMEUNIT.NPY_FR_B:
 *     #     return "B"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_as);
    __pyx_r = __pyx_n_u_as;
    goto __pyx_L0;

    /* "utils.pxd":2442
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:
 *         return "fs"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:             # <<<<<<<<<<<<<<
 *         return "as"
 *     # if unit == np.NPY_DATETIMEUNIT.NPY_FR_B:
 */
  }

  /* "utils.pxd":2448
 * 
 *     # Unsupported unit
 *     raise ValueError("unknown datetime unit '%d'." % unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int map_nptime_unit_str2int(str unit) except -1:
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_datetime_unit_d, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(5, 2448, __pyx_L1_error)

  /* "utils.pxd":2412
 * # NumPy: share -----------------------------------------------------------------------------------------
 * # . time unit
 * cdef inline str map_nptime_unit_int2str(int unit):             # <<<<<<<<<<<<<<
 *     """Map numpy datetime64/timedelta64 unit from integer
 *     to the corresponding string representation `<'str'>`."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.map_nptime_unit_int2str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2450
 *     raise ValueError("unknown datetime unit '%d'." % unit)
 * 
 * cdef inline int map_nptime_unit_str2int(str unit) except -1:             # <<<<<<<<<<<<<<
 *     """Map numpy datetime64/timedelta64 unit from string
 *     representation to the corresponding integer `<'int'>`."""
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(PyObject *__pyx_v_unit) {
  Py_ssize_t __pyx_v_size;
  Py_UCS4 __pyx_v_ch;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_UCS4 __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map_nptime_unit_str2int", 1);

  /* "utils.pxd":2454
 *     representation to the corresponding integer `<'int'>`."""
 *     cdef:
 *         Py_ssize_t size = str_len(unit)             # <<<<<<<<<<<<<<
 *         Py_UCS4 ch
 * 
 */
  __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_unit);

  /* "utils.pxd":2458
 * 
 *     # Unit: 's', 'm', 'h', 'D', 'Y', 'M', 'W', 'B'
 *     if size == 1:             # <<<<<<<<<<<<<<
 *         # Common units
 *         ch = str_read(unit, 0)
 */
  __pyx_t_1 = (__pyx_v_size == 1);
  if (__pyx_t_1) {

    /* "utils.pxd":2460
 *     if size == 1:
 *         # Common units
 *         ch = str_read(unit, 0)             # <<<<<<<<<<<<<<
 *         if ch == "s":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_s
 */
    __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_unit, 0); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(5, 2460, __pyx_L1_error)
    __pyx_v_ch = __pyx_t_2;

    /* "utils.pxd":2461
 *         # Common units
 *         ch = str_read(unit, 0)
 *         if ch == "s":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_s
 *         if ch == "m":
 */
    __pyx_t_1 = (__pyx_v_ch == 0x73);
    if (__pyx_t_1) {

      /* "utils.pxd":2462
 *         ch = str_read(unit, 0)
 *         if ch == "s":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_s             # <<<<<<<<<<<<<<
 *         if ch == "m":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_m
 */
      __pyx_r = NPY_FR_s;
      goto __pyx_L0;

      /* "utils.pxd":2461
 *         # Common units
 *         ch = str_read(unit, 0)
 *         if ch == "s":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_s
 *         if ch == "m":
 */
    }

    /* "utils.pxd":2463
 *         if ch == "s":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_s
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_m
 *         if ch == "h":
 */
    __pyx_t_1 = (__pyx_v_ch == 0x6D);
    if (__pyx_t_1) {

      /* "utils.pxd":2464
 *             return np.NPY_DATETIMEUNIT.NPY_FR_s
 *         if ch == "m":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_m             # <<<<<<<<<<<<<<
 *         if ch == "h":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_h
 */
      __pyx_r = NPY_FR_m;
      goto __pyx_L0;

      /* "utils.pxd":2463
 *         if ch == "s":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_s
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_m
 *         if ch == "h":
 */
    }

    /* "utils.pxd":2465
 *         if ch == "m":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_m
 *         if ch == "h":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_h
 *         if ch == "D":
 */
    __pyx_t_1 = (__pyx_v_ch == 0x68);
    if (__pyx_t_1) {

      /* "utils.pxd":2466
 *             return np.NPY_DATETIMEUNIT.NPY_FR_m
 *         if ch == "h":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_h             # <<<<<<<<<<<<<<
 *         if ch == "D":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_D
 */
      __pyx_r = NPY_FR_h;
      goto __pyx_L0;

      /* "utils.pxd":2465
 *         if ch == "m":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_m
 *         if ch == "h":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_h
 *         if ch == "D":
 */
    }

    /* "utils.pxd":2467
 *         if ch == "h":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_h
 *         if ch == "D":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_D
 *         # Uncommon units
 */
    __pyx_t_1 = (__pyx_v_ch == 68);
    if (__pyx_t_1) {

      /* "utils.pxd":2468
 *             return np.NPY_DATETIMEUNIT.NPY_FR_h
 *         if ch == "D":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_D             # <<<<<<<<<<<<<<
 *         # Uncommon units
 *         if ch == "Y":
 */
      __pyx_r = NPY_FR_D;
      goto __pyx_L0;

      /* "utils.pxd":2467
 *         if ch == "h":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_h
 *         if ch == "D":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_D
 *         # Uncommon units
 */
    }

    /* "utils.pxd":2470
 *             return np.NPY_DATETIMEUNIT.NPY_FR_D
 *         # Uncommon units
 *         if ch == "Y":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_Y
 *         if ch == "M":
 */
    __pyx_t_1 = (__pyx_v_ch == 89);
    if (__pyx_t_1) {

      /* "utils.pxd":2471
 *         # Uncommon units
 *         if ch == "Y":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_Y             # <<<<<<<<<<<<<<
 *         if ch == "M":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_M
 */
      __pyx_r = NPY_FR_Y;
      goto __pyx_L0;

      /* "utils.pxd":2470
 *             return np.NPY_DATETIMEUNIT.NPY_FR_D
 *         # Uncommon units
 *         if ch == "Y":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_Y
 *         if ch == "M":
 */
    }

    /* "utils.pxd":2472
 *         if ch == "Y":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_Y
 *         if ch == "M":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_M
 *         if ch == "W":
 */
    __pyx_t_1 = (__pyx_v_ch == 77);
    if (__pyx_t_1) {

      /* "utils.pxd":2473
 *             return np.NPY_DATETIMEUNIT.NPY_FR_Y
 *         if ch == "M":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_M             # <<<<<<<<<<<<<<
 *         if ch == "W":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_W
 */
      __pyx_r = NPY_FR_M;
      goto __pyx_L0;

      /* "utils.pxd":2472
 *         if ch == "Y":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_Y
 *         if ch == "M":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_M
 *         if ch == "W":
 */
    }

    /* "utils.pxd":2474
 *         if ch == "M":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_M
 *         if ch == "W":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_W
 *         # if ch == "B":
 */
    __pyx_t_1 = (__pyx_v_ch == 87);
    if (__pyx_t_1) {

      /* "utils.pxd":2475
 *             return np.NPY_DATETIMEUNIT.NPY_FR_M
 *         if ch == "W":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_W             # <<<<<<<<<<<<<<
 *         # if ch == "B":
 *         #     return np.NPY_DATETIMEUNIT.NPY_FR_B
 */
      __pyx_r = NPY_FR_W;
      goto __pyx_L0;

      /* "utils.pxd":2474
 *         if ch == "M":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_M
 *         if ch == "W":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_W
 *         # if ch == "B":
 */
    }

    /* "utils.pxd":2458
 * 
 *     # Unit: 's', 'm', 'h', 'D', 'Y', 'M', 'W', 'B'
 *     if size == 1:             # <<<<<<<<<<<<<<
 *         # Common units
 *         ch = str_read(unit, 0)
 */
    goto __pyx_L3;
  }

  /* "utils.pxd":2480
 * 
 *     # Unit: 'ns', 'us', 'ms', 'ps', 'fs', 'as'
 *     elif size == 2 and str_read(unit, 1) == "s":             # <<<<<<<<<<<<<<
 *         # Common units
 *         ch = str_read(unit, 0)
 */
  __pyx_t_3 = (__pyx_v_size == 2);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_unit, 1); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(5, 2480, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 == 0x73);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L11_bool_binop_done:;
  if (__pyx_t_1) {

    /* "utils.pxd":2482
 *     elif size == 2 and str_read(unit, 1) == "s":
 *         # Common units
 *         ch = str_read(unit, 0)             # <<<<<<<<<<<<<<
 *         if ch == "n":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ns
 */
    __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_unit, 0); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(5, 2482, __pyx_L1_error)
    __pyx_v_ch = __pyx_t_2;

    /* "utils.pxd":2483
 *         # Common units
 *         ch = str_read(unit, 0)
 *         if ch == "n":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ns
 *         if ch == "u":
 */
    __pyx_t_1 = (__pyx_v_ch == 0x6E);
    if (__pyx_t_1) {

      /* "utils.pxd":2484
 *         ch = str_read(unit, 0)
 *         if ch == "n":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ns             # <<<<<<<<<<<<<<
 *         if ch == "u":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_us
 */
      __pyx_r = NPY_FR_ns;
      goto __pyx_L0;

      /* "utils.pxd":2483
 *         # Common units
 *         ch = str_read(unit, 0)
 *         if ch == "n":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ns
 *         if ch == "u":
 */
    }

    /* "utils.pxd":2485
 *         if ch == "n":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ns
 *         if ch == "u":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_us
 *         if ch == "m":
 */
    __pyx_t_1 = (__pyx_v_ch == 0x75);
    if (__pyx_t_1) {

      /* "utils.pxd":2486
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ns
 *         if ch == "u":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_us             # <<<<<<<<<<<<<<
 *         if ch == "m":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ms
 */
      __pyx_r = NPY_FR_us;
      goto __pyx_L0;

      /* "utils.pxd":2485
 *         if ch == "n":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ns
 *         if ch == "u":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_us
 *         if ch == "m":
 */
    }

    /* "utils.pxd":2487
 *         if ch == "u":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_us
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ms
 *         # Uncommon units
 */
    __pyx_t_1 = (__pyx_v_ch == 0x6D);
    if (__pyx_t_1) {

      /* "utils.pxd":2488
 *             return np.NPY_DATETIMEUNIT.NPY_FR_us
 *         if ch == "m":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ms             # <<<<<<<<<<<<<<
 *         # Uncommon units
 *         if ch == "p":
 */
      __pyx_r = NPY_FR_ms;
      goto __pyx_L0;

      /* "utils.pxd":2487
 *         if ch == "u":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_us
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ms
 *         # Uncommon units
 */
    }

    /* "utils.pxd":2490
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ms
 *         # Uncommon units
 *         if ch == "p":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ps
 *         if ch == "f":
 */
    __pyx_t_1 = (__pyx_v_ch == 0x70);
    if (__pyx_t_1) {

      /* "utils.pxd":2491
 *         # Uncommon units
 *         if ch == "p":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ps             # <<<<<<<<<<<<<<
 *         if ch == "f":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_fs
 */
      __pyx_r = NPY_FR_ps;
      goto __pyx_L0;

      /* "utils.pxd":2490
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ms
 *         # Uncommon units
 *         if ch == "p":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ps
 *         if ch == "f":
 */
    }

    /* "utils.pxd":2492
 *         if ch == "p":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ps
 *         if ch == "f":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_fs
 *         if ch == "a":
 */
    __pyx_t_1 = (__pyx_v_ch == 0x66);
    if (__pyx_t_1) {

      /* "utils.pxd":2493
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ps
 *         if ch == "f":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_fs             # <<<<<<<<<<<<<<
 *         if ch == "a":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_as
 */
      __pyx_r = NPY_FR_fs;
      goto __pyx_L0;

      /* "utils.pxd":2492
 *         if ch == "p":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_ps
 *         if ch == "f":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_fs
 *         if ch == "a":
 */
    }

    /* "utils.pxd":2494
 *         if ch == "f":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_fs
 *         if ch == "a":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_as
 * 
 */
    __pyx_t_1 = (__pyx_v_ch == 97);
    if (__pyx_t_1) {

      /* "utils.pxd":2495
 *             return np.NPY_DATETIMEUNIT.NPY_FR_fs
 *         if ch == "a":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_as             # <<<<<<<<<<<<<<
 * 
 *     # Unit: 'min' for pandas compatibility
 */
      __pyx_r = NPY_FR_as;
      goto __pyx_L0;

      /* "utils.pxd":2494
 *         if ch == "f":
 *             return np.NPY_DATETIMEUNIT.NPY_FR_fs
 *         if ch == "a":             # <<<<<<<<<<<<<<
 *             return np.NPY_DATETIMEUNIT.NPY_FR_as
 * 
 */
    }

    /* "utils.pxd":2480
 * 
 *     # Unit: 'ns', 'us', 'ms', 'ps', 'fs', 'as'
 *     elif size == 2 and str_read(unit, 1) == "s":             # <<<<<<<<<<<<<<
 *         # Common units
 *         ch = str_read(unit, 0)
 */
    goto __pyx_L3;
  }

  /* "utils.pxd":2498
 * 
 *     # Unit: 'min' for pandas compatibility
 *     elif size == 3 and unit == "min":             # <<<<<<<<<<<<<<
 *         return np.NPY_DATETIMEUNIT.NPY_FR_m
 * 
 */
  __pyx_t_3 = (__pyx_v_size == 3);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_min, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(5, 2498, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_1) {

    /* "utils.pxd":2499
 *     # Unit: 'min' for pandas compatibility
 *     elif size == 3 and unit == "min":
 *         return np.NPY_DATETIMEUNIT.NPY_FR_m             # <<<<<<<<<<<<<<
 * 
 *     # Unsupported unit
 */
    __pyx_r = NPY_FR_m;
    goto __pyx_L0;

    /* "utils.pxd":2498
 * 
 *     # Unit: 'min' for pandas compatibility
 *     elif size == 3 and unit == "min":             # <<<<<<<<<<<<<<
 *         return np.NPY_DATETIMEUNIT.NPY_FR_m
 * 
 */
  }
  __pyx_L3:;

  /* "utils.pxd":2502
 * 
 *     # Unsupported unit
 *     raise ValueError("unknown datetime unit '%s'." % unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int get_arr_nptime_unit(np.ndarray arr) except -1:
 */
  __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_unknown_datetime_unit_s, __pyx_v_unit); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 2502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __PYX_ERR(5, 2502, __pyx_L1_error)

  /* "utils.pxd":2450
 *     raise ValueError("unknown datetime unit '%d'." % unit)
 * 
 * cdef inline int map_nptime_unit_str2int(str unit) except -1:             # <<<<<<<<<<<<<<
 *     """Map numpy datetime64/timedelta64 unit from string
 *     representation to the corresponding integer `<'int'>`."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils.map_nptime_unit_str2int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2504
 *     raise ValueError("unknown datetime unit '%s'." % unit)
 * 
 * cdef inline int get_arr_nptime_unit(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Get ndarray[datetime64/timedelta64] unit from the,
 *     returns the unit in `<'int'>`."""
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_get_arr_nptime_unit(PyArrayObject *__pyx_v_arr) {
  int __pyx_v_dtype;
  int __pyx_v_ndim;
  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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_arr_nptime_unit", 1);

  /* "utils.pxd":2507
 *     """Get ndarray[datetime64/timedelta64] unit from the,
 *     returns the unit in `<'int'>`."""
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype not in (np.NPY_TYPES.NPY_DATETIME, np.NPY_TYPES.NPY_TIMEDELTA):
 *         raise TypeError("expects np.ndarray[datetime64/timedelta64], got '%s'." % arr.dtype)
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "utils.pxd":2508
 *     returns the unit in `<'int'>`."""
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype not in (np.NPY_TYPES.NPY_DATETIME, np.NPY_TYPES.NPY_TIMEDELTA):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects np.ndarray[datetime64/timedelta64], got '%s'." % arr.dtype)
 * 
 */
  switch (__pyx_v_dtype) {
    case NPY_DATETIME:
    case NPY_TIMEDELTA:
    __pyx_t_1 = 0;
    break;
    default:
    __pyx_t_1 = 1;
    break;
  }
  __pyx_t_2 = __pyx_t_1;
  if (unlikely(__pyx_t_2)) {

    /* "utils.pxd":2509
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype not in (np.NPY_TYPES.NPY_DATETIME, np.NPY_TYPES.NPY_TIMEDELTA):
 *         raise TypeError("expects np.ndarray[datetime64/timedelta64], got '%s'." % arr.dtype)             # <<<<<<<<<<<<<<
 * 
 *     cdef int ndim = arr.ndim
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_expects_np_ndarray_datetime64_ti, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 2509, __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_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(5, 2509, __pyx_L1_error)

    /* "utils.pxd":2508
 *     returns the unit in `<'int'>`."""
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype not in (np.NPY_TYPES.NPY_DATETIME, np.NPY_TYPES.NPY_TIMEDELTA):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects np.ndarray[datetime64/timedelta64], got '%s'." % arr.dtype)
 * 
 */
  }

  /* "utils.pxd":2511
 *         raise TypeError("expects np.ndarray[datetime64/timedelta64], got '%s'." % arr.dtype)
 * 
 *     cdef int ndim = arr.ndim             # <<<<<<<<<<<<<<
 *     cdef np.NPY_DATETIMEUNIT unit
 *     if ndim == 1:
 */
  __pyx_v_ndim = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr);

  /* "utils.pxd":2513
 *     cdef int ndim = arr.ndim
 *     cdef np.NPY_DATETIMEUNIT unit
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return parse_arr_nptime_unit(arr)
 */
  __pyx_t_2 = (__pyx_v_ndim == 1);
  if (__pyx_t_2) {

    /* "utils.pxd":2514
 *     cdef np.NPY_DATETIMEUNIT unit
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]) == 0);
    if (__pyx_t_2) {

      /* "utils.pxd":2515
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 *             return parse_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *         return np.get_datetime64_unit(arr[0])
 *     if ndim == 2:
 */
      __pyx_t_5 = __pyx_f_7cytimes_5utils_parse_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(5, 2515, __pyx_L1_error)
      __pyx_r = __pyx_t_5;
      goto __pyx_L0;

      /* "utils.pxd":2514
 *     cdef np.NPY_DATETIMEUNIT unit
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0])
 */
    }

    /* "utils.pxd":2516
 *         if arr.shape[0] == 0:
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0])             # <<<<<<<<<<<<<<
 *     if ndim == 2:
 *         if arr.shape[1] == 0:
 */
    __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_arr), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":2513
 *     cdef int ndim = arr.ndim
 *     cdef np.NPY_DATETIMEUNIT unit
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return parse_arr_nptime_unit(arr)
 */
  }

  /* "utils.pxd":2517
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0])
 *     if ndim == 2:             # <<<<<<<<<<<<<<
 *         if arr.shape[1] == 0:
 *             return parse_arr_nptime_unit(arr)
 */
  __pyx_t_2 = (__pyx_v_ndim == 2);
  if (__pyx_t_2) {

    /* "utils.pxd":2518
 *         return np.get_datetime64_unit(arr[0])
 *     if ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[1]) == 0);
    if (__pyx_t_2) {

      /* "utils.pxd":2519
 *     if ndim == 2:
 *         if arr.shape[1] == 0:
 *             return parse_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *         return np.get_datetime64_unit(arr[0, 0])
 *     if ndim == 3:
 */
      __pyx_t_5 = __pyx_f_7cytimes_5utils_parse_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(5, 2519, __pyx_L1_error)
      __pyx_r = __pyx_t_5;
      goto __pyx_L0;

      /* "utils.pxd":2518
 *         return np.get_datetime64_unit(arr[0])
 *     if ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0])
 */
    }

    /* "utils.pxd":2520
 *         if arr.shape[1] == 0:
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0])             # <<<<<<<<<<<<<<
 *     if ndim == 3:
 *         if arr.shape[2] == 0:
 */
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__16); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":2517
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0])
 *     if ndim == 2:             # <<<<<<<<<<<<<<
 *         if arr.shape[1] == 0:
 *             return parse_arr_nptime_unit(arr)
 */
  }

  /* "utils.pxd":2521
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0])
 *     if ndim == 3:             # <<<<<<<<<<<<<<
 *         if arr.shape[2] == 0:
 *             return parse_arr_nptime_unit(arr)
 */
  __pyx_t_2 = (__pyx_v_ndim == 3);
  if (__pyx_t_2) {

    /* "utils.pxd":2522
 *         return np.get_datetime64_unit(arr[0, 0])
 *     if ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0, 0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[2]) == 0);
    if (__pyx_t_2) {

      /* "utils.pxd":2523
 *     if ndim == 3:
 *         if arr.shape[2] == 0:
 *             return parse_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *         return np.get_datetime64_unit(arr[0, 0, 0])
 *     if ndim == 4:
 */
      __pyx_t_5 = __pyx_f_7cytimes_5utils_parse_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(5, 2523, __pyx_L1_error)
      __pyx_r = __pyx_t_5;
      goto __pyx_L0;

      /* "utils.pxd":2522
 *         return np.get_datetime64_unit(arr[0, 0])
 *     if ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0, 0])
 */
    }

    /* "utils.pxd":2524
 *         if arr.shape[2] == 0:
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0, 0])             # <<<<<<<<<<<<<<
 *     if ndim == 4:
 *         if arr.shape[3] == 0:
 */
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__17); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":2521
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0])
 *     if ndim == 3:             # <<<<<<<<<<<<<<
 *         if arr.shape[2] == 0:
 *             return parse_arr_nptime_unit(arr)
 */
  }

  /* "utils.pxd":2525
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0, 0])
 *     if ndim == 4:             # <<<<<<<<<<<<<<
 *         if arr.shape[3] == 0:
 *             return parse_arr_nptime_unit(arr)
 */
  __pyx_t_2 = (__pyx_v_ndim == 4);
  if (__pyx_t_2) {

    /* "utils.pxd":2526
 *         return np.get_datetime64_unit(arr[0, 0, 0])
 *     if ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0, 0, 0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[3]) == 0);
    if (__pyx_t_2) {

      /* "utils.pxd":2527
 *     if ndim == 4:
 *         if arr.shape[3] == 0:
 *             return parse_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *         return np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     # Invalid
 */
      __pyx_t_5 = __pyx_f_7cytimes_5utils_parse_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(5, 2527, __pyx_L1_error)
      __pyx_r = __pyx_t_5;
      goto __pyx_L0;

      /* "utils.pxd":2526
 *         return np.get_datetime64_unit(arr[0, 0, 0])
 *     if ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0, 0, 0])
 */
    }

    /* "utils.pxd":2528
 *         if arr.shape[3] == 0:
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0, 0, 0])             # <<<<<<<<<<<<<<
 *     # Invalid
 *     raise ValueError("support <'ndarray'> with 1-4 dimensions, got ndim '%d'." % ndim)
 */
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__18); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":2525
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0, 0])
 *     if ndim == 4:             # <<<<<<<<<<<<<<
 *         if arr.shape[3] == 0:
 *             return parse_arr_nptime_unit(arr)
 */
  }

  /* "utils.pxd":2530
 *         return np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     # Invalid
 *     raise ValueError("support <'ndarray'> with 1-4 dimensions, got ndim '%d'." % ndim)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int parse_arr_nptime_unit(np.ndarray arr) except -1:
 */
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_support_ndarray_with_1_4_dimensi, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 2530, __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_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_ERR(5, 2530, __pyx_L1_error)

  /* "utils.pxd":2504
 *     raise ValueError("unknown datetime unit '%s'." % unit)
 * 
 * cdef inline int get_arr_nptime_unit(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Get ndarray[datetime64/timedelta64] unit from the,
 *     returns the unit in `<'int'>`."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils.get_arr_nptime_unit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2532
 *     raise ValueError("support <'ndarray'> with 1-4 dimensions, got ndim '%d'." % ndim)
 * 
 * cdef inline int parse_arr_nptime_unit(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Parse ndarray[datetime64/timedelta64] unit from the,
 *     returns the unit in `<'int'>`."""
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_parse_arr_nptime_unit(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_v_dtype_str = 0;
  Py_ssize_t __pyx_v_size;
  PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  char const *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_arr_nptime_unit", 1);

  /* "utils.pxd":2536
 *     returns the unit in `<'int'>`."""
 *     # Validate
 *     if np.PyArray_TYPE(arr) not in (np.NPY_TYPES.NPY_DATETIME, np.NPY_TYPES.NPY_TIMEDELTA):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects 'np.ndarray[datetime64/timedelta64]', got '%s'." % arr.dtype)
 * 
 */
  __pyx_t_1 = PyArray_TYPE(__pyx_v_arr);
  __pyx_t_3 = (__pyx_t_1 != NPY_DATETIME);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_t_1 != NPY_TIMEDELTA);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  __pyx_t_3 = __pyx_t_2;
  if (unlikely(__pyx_t_3)) {

    /* "utils.pxd":2537
 *     # Validate
 *     if np.PyArray_TYPE(arr) not in (np.NPY_TYPES.NPY_DATETIME, np.NPY_TYPES.NPY_TIMEDELTA):
 *         raise TypeError("expects 'np.ndarray[datetime64/timedelta64]', got '%s'." % arr.dtype)             # <<<<<<<<<<<<<<
 * 
 *     # Prase
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 2537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_expects_np_ndarray_datetime64_ti_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 2537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(5, 2537, __pyx_L1_error)

    /* "utils.pxd":2536
 *     returns the unit in `<'int'>`."""
 *     # Validate
 *     if np.PyArray_TYPE(arr) not in (np.NPY_TYPES.NPY_DATETIME, np.NPY_TYPES.NPY_TIMEDELTA):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects 'np.ndarray[datetime64/timedelta64]', got '%s'." % arr.dtype)
 * 
 */
  }

  /* "utils.pxd":2540
 * 
 *     # Prase
 *     cdef str dtype_str = arr.dtype.str             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t size = str_len(dtype_str)
 *     if size < 6:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 2540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_str); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_5))) __PYX_ERR(5, 2540, __pyx_L1_error)
  __pyx_v_dtype_str = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "utils.pxd":2541
 *     # Prase
 *     cdef str dtype_str = arr.dtype.str
 *     cdef Py_ssize_t size = str_len(dtype_str)             # <<<<<<<<<<<<<<
 *     if size < 6:
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str)
 */
  __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_dtype_str);

  /* "utils.pxd":2542
 *     cdef str dtype_str = arr.dtype.str
 *     cdef Py_ssize_t size = str_len(dtype_str)
 *     if size < 6:             # <<<<<<<<<<<<<<
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str)
 *     try:
 */
  __pyx_t_3 = (__pyx_v_size < 6);
  if (unlikely(__pyx_t_3)) {

    /* "utils.pxd":2543
 *     cdef Py_ssize_t size = str_len(dtype_str)
 *     if size < 6:
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str)             # <<<<<<<<<<<<<<
 *     try:
 *         return map_nptime_unit_str2int(str_substr(dtype_str, 4, size - 1))
 */
    __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_unable_to_parse_datetime_unit_fr, __pyx_v_dtype_str); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 2543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(5, 2543, __pyx_L1_error)

    /* "utils.pxd":2542
 *     cdef str dtype_str = arr.dtype.str
 *     cdef Py_ssize_t size = str_len(dtype_str)
 *     if size < 6:             # <<<<<<<<<<<<<<
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str)
 *     try:
 */
  }

  /* "utils.pxd":2544
 *     if size < 6:
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str)
 *     try:             # <<<<<<<<<<<<<<
 *         return map_nptime_unit_str2int(str_substr(dtype_str, 4, size - 1))
 *     except ValueError as err:
 */
  {
    __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:*/ {

      /* "utils.pxd":2545
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str)
 *     try:
 *         return map_nptime_unit_str2int(str_substr(dtype_str, 4, size - 1))             # <<<<<<<<<<<<<<
 *     except ValueError as err:
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str) from err
 */
      __pyx_t_4 = PyUnicode_Substring(__pyx_v_dtype_str, 4, (__pyx_v_size - 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 2545, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(((PyObject*)__pyx_t_4)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 2545, __pyx_L7_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_1;
      goto __pyx_L11_try_return;

      /* "utils.pxd":2544
 *     if size < 6:
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str)
 *     try:             # <<<<<<<<<<<<<<
 *         return map_nptime_unit_str2int(str_substr(dtype_str, 4, size - 1))
 *     except ValueError as err:
 */
    }
    __pyx_L7_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "utils.pxd":2546
 *     try:
 *         return map_nptime_unit_str2int(str_substr(dtype_str, 4, size - 1))
 *     except ValueError as err:             # <<<<<<<<<<<<<<
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str) from err
 * 
 */
    __pyx_t_1 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_1) {
      __Pyx_AddTraceback("cytimes.utils.parse_arr_nptime_unit", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(5, 2546, __pyx_L9_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_v_err = __pyx_t_5;
      /*try:*/ {

        /* "utils.pxd":2547
 *         return map_nptime_unit_str2int(str_substr(dtype_str, 4, size - 1))
 *     except ValueError as err:
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str) from err             # <<<<<<<<<<<<<<
 * 
 * # NumPy: datetime64 ------------------------------------------------------------------------------------
 */
        __pyx_t_10 = PyUnicode_Format(__pyx_kp_u_unable_to_parse_datetime_unit_fr, __pyx_v_dtype_str); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 2547, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 2547, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_Raise(__pyx_t_11, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __PYX_ERR(5, 2547, __pyx_L18_error)
      }

      /* "utils.pxd":2546
 *     try:
 *         return map_nptime_unit_str2int(str_substr(dtype_str, 4, size - 1))
 *     except ValueError as err:             # <<<<<<<<<<<<<<
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str) from err
 * 
 */
      /*finally:*/ {
        __pyx_L18_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_1 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          }
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __pyx_lineno = __pyx_t_1; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L9_except_error;
        }
      }
    }
    goto __pyx_L9_except_error;

    /* "utils.pxd":2544
 *     if size < 6:
 *         raise ValueError("unable to parse datetime unit from '%s'." % dtype_str)
 *     try:             # <<<<<<<<<<<<<<
 *         return map_nptime_unit_str2int(str_substr(dtype_str, 4, size - 1))
 *     except ValueError as err:
 */
    __pyx_L9_except_error:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L11_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;
  }

  /* "utils.pxd":2532
 *     raise ValueError("support <'ndarray'> with 1-4 dimensions, got ndim '%d'." % ndim)
 * 
 * cdef inline int parse_arr_nptime_unit(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Parse ndarray[datetime64/timedelta64] unit from the,
 *     returns the unit in `<'int'>`."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.utils.parse_arr_nptime_unit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dtype_str);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2551
 * # NumPy: datetime64 ------------------------------------------------------------------------------------
 * # . type check
 * cdef inline bint is_dt64(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of np.datetime64 `<'bool'>`.
 * 
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_dt64(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "utils.pxd":2557
 *     >>> isinstance(obj, np.datetime64)
 *     """
 *     return np.is_datetime64_object(obj)             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint validate_dt64(object obj) except -1:
 */
  __pyx_r = __pyx_f_5numpy_is_datetime64_object(__pyx_v_obj);
  goto __pyx_L0;

  /* "utils.pxd":2551
 * # NumPy: datetime64 ------------------------------------------------------------------------------------
 * # . type check
 * cdef inline bint is_dt64(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of np.datetime64 `<'bool'>`.
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":2559
 *     return np.is_datetime64_object(obj)
 * 
 * cdef inline bint validate_dt64(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Validate if an object is an instance of np.datetime64,
 *     and raises `TypeError` if not."""
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_validate_dt64(PyObject *__pyx_v_obj) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("validate_dt64", 1);

  /* "utils.pxd":2562
 *     """Validate if an object is an instance of np.datetime64,
 *     and raises `TypeError` if not."""
 *     if not np.is_datetime64_object(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects 'np.datetime64', got %s." % type(obj))
 *     return True
 */
  __pyx_t_1 = (!__pyx_f_5numpy_is_datetime64_object(__pyx_v_obj));
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":2563
 *     and raises `TypeError` if not."""
 *     if not np.is_datetime64_object(obj):
 *         raise TypeError("expects 'np.datetime64', got %s." % type(obj))             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
    __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_expects_np_datetime64_got_s, ((PyObject *)Py_TYPE(__pyx_v_obj))); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2563, __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(5, 2563, __pyx_L1_error)

    /* "utils.pxd":2562
 *     """Validate if an object is an instance of np.datetime64,
 *     and raises `TypeError` if not."""
 *     if not np.is_datetime64_object(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects 'np.datetime64', got %s." % type(obj))
 *     return True
 */
  }

  /* "utils.pxd":2564
 *     if not np.is_datetime64_object(obj):
 *         raise TypeError("expects 'np.datetime64', got %s." % type(obj))
 *     return True             # <<<<<<<<<<<<<<
 * 
 * # . conversion
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "utils.pxd":2559
 *     return np.is_datetime64_object(obj)
 * 
 * cdef inline bint validate_dt64(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Validate if an object is an instance of np.datetime64,
 *     and raises `TypeError` if not."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.validate_dt64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2567
 * 
 * # . conversion
 * cdef inline np.npy_int64 dt64_as_int64_us(object dt64, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.datetime64 to int64 under 'us' (microsecond) resolution `<'int'>`.
 * 
 */

static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils_dt64_as_int64_us(PyObject *__pyx_v_dt64, struct __pyx_opt_args_7cytimes_5utils_dt64_as_int64_us *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  NPY_DATETIMEUNIT __pyx_v_unit;
  npy_int64 __pyx_v_val;
  npy_int64 __pyx_r;
  int __pyx_t_1;
  npy_int64 __pyx_t_2;
  struct __pyx_opt_args_7cytimes_5utils__dt64_W_as_int64_D __pyx_t_3;
  struct __pyx_opt_args_7cytimes_5utils__dt64_M_as_int64_D __pyx_t_4;
  struct __pyx_opt_args_7cytimes_5utils__dt64_Y_as_int64_D __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }

  /* "utils.pxd":2574
 *     """
 *     # Get unit & value
 *     validate_dt64(dt64)             # <<<<<<<<<<<<<<
 *     cdef np.NPY_DATETIMEUNIT unit = np.get_datetime64_unit(dt64)
 *     cdef np.npy_int64 val = np.get_datetime64_value(dt64)
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_validate_dt64(__pyx_v_dt64); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 2574, __pyx_L1_error)

  /* "utils.pxd":2575
 *     # Get unit & value
 *     validate_dt64(dt64)
 *     cdef np.NPY_DATETIMEUNIT unit = np.get_datetime64_unit(dt64)             # <<<<<<<<<<<<<<
 *     cdef np.npy_int64 val = np.get_datetime64_value(dt64)
 * 
 */
  __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_v_dt64);

  /* "utils.pxd":2576
 *     validate_dt64(dt64)
 *     cdef np.NPY_DATETIMEUNIT unit = np.get_datetime64_unit(dt64)
 *     cdef np.npy_int64 val = np.get_datetime64_value(dt64)             # <<<<<<<<<<<<<<
 * 
 *     # Conversion
 */
  __pyx_v_val = __pyx_f_5numpy_get_datetime64_value(__pyx_v_dt64);

  /* "utils.pxd":2579
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000 + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "utils.pxd":2580
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000 + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val + offset
 */
    __pyx_r = (__Pyx_div_npy_int64(__pyx_v_val, 0x3E8) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2579
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000 + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "utils.pxd":2581
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000 + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "utils.pxd":2582
 *         return val // 1_000 + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * US_MILLISECOND + offset
 */
    __pyx_r = (__pyx_v_val + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2581
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000 + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "utils.pxd":2583
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * US_MILLISECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "utils.pxd":2584
 *         return val + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * US_MILLISECOND + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * US_SECOND + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_US_MILLISECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2583
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * US_MILLISECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "utils.pxd":2585
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * US_MILLISECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val * US_SECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "utils.pxd":2586
 *         return val * US_MILLISECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * US_SECOND + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * US_MINUTE + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_US_SECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2585
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * US_MILLISECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val * US_SECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "utils.pxd":2587
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * US_SECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * US_MINUTE + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "utils.pxd":2588
 *         return val * US_SECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * US_MINUTE + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_US_MINUTE) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2587
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * US_SECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * US_MINUTE + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "utils.pxd":2589
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * US_MINUTE + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * US_HOUR + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "utils.pxd":2590
 *         return val * US_MINUTE + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * US_DAY + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_US_HOUR) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2589
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * US_MINUTE + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * US_HOUR + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "utils.pxd":2591
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * US_DAY + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_1) {

    /* "utils.pxd":2592
 *         return val * US_HOUR + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * US_DAY + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64_W_as_int64_D(val, US_DAY, offset)
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_US_DAY) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2591
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * US_DAY + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  }

  /* "utils.pxd":2593
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * US_DAY + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64_W_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "utils.pxd":2594
 *         return val * US_DAY + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64_W_as_int64_D(val, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64_M_as_int64_D(val, US_DAY, offset)
 */
    __pyx_t_3.__pyx_n = 2;
    __pyx_t_3.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_3.offset = __pyx_v_offset;
    __pyx_t_2 = __pyx_f_7cytimes_5utils__dt64_W_as_int64_D(__pyx_v_val, &__pyx_t_3); if (unlikely(__pyx_t_2 == ((npy_int64)-1) && PyErr_Occurred())) __PYX_ERR(5, 2594, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "utils.pxd":2593
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * US_DAY + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64_W_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  }

  /* "utils.pxd":2595
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64_W_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64_M_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "utils.pxd":2596
 *         return _dt64_W_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64_M_as_int64_D(val, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64_Y_as_int64_D(val, US_DAY, offset)
 */
    __pyx_t_4.__pyx_n = 2;
    __pyx_t_4.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_2 = __pyx_f_7cytimes_5utils__dt64_M_as_int64_D(__pyx_v_val, &__pyx_t_4); if (unlikely(__pyx_t_2 == ((npy_int64)-1) && PyErr_Occurred())) __PYX_ERR(5, 2596, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "utils.pxd":2595
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64_W_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64_M_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  }

  /* "utils.pxd":2597
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64_M_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64_Y_as_int64_D(val, US_DAY, offset)
 *     # . unsupported
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "utils.pxd":2598
 *         return _dt64_M_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64_Y_as_int64_D(val, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     _raise_dt64_as_int64_unit_error("us", unit)
 */
    __pyx_t_5.__pyx_n = 2;
    __pyx_t_5.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_5.offset = __pyx_v_offset;
    __pyx_t_2 = __pyx_f_7cytimes_5utils__dt64_Y_as_int64_D(__pyx_v_val, &__pyx_t_5); if (unlikely(__pyx_t_2 == ((npy_int64)-1) && PyErr_Occurred())) __PYX_ERR(5, 2598, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "utils.pxd":2597
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64_M_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64_Y_as_int64_D(val, US_DAY, offset)
 *     # . unsupported
 */
  }

  /* "utils.pxd":2600
 *         return _dt64_Y_as_int64_D(val, US_DAY, offset)
 *     # . unsupported
 *     _raise_dt64_as_int64_unit_error("us", unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.npy_int64 _dt64_Y_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64_as_int64_unit_error(__pyx_n_u_us, __pyx_v_unit, NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 2600, __pyx_L1_error)

  /* "utils.pxd":2567
 * 
 * # . conversion
 * cdef inline np.npy_int64 dt64_as_int64_us(object dt64, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.datetime64 to int64 under 'us' (microsecond) resolution `<'int'>`.
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.dt64_as_int64_us", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":2602
 *     _raise_dt64_as_int64_unit_error("us", unit)
 * 
 * cdef inline np.npy_int64 _dt64_Y_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Convert the value of np.datetime64[Y] to int64 under 'D' resolution `<'int'>`."""
 *     cdef:
 */

static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__dt64_Y_as_int64_D(npy_int64 __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils__dt64_Y_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_year;
  npy_int64 __pyx_v_y_1;
  npy_int64 __pyx_v_leaps;
  npy_int64 __pyx_r;
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }

  /* "utils.pxd":2605
 *     """(internal) Convert the value of np.datetime64[Y] to int64 under 'D' resolution `<'int'>`."""
 *     cdef:
 *         np.npy_int64 year = val + EPOCH_YEAR             # <<<<<<<<<<<<<<
 *         # Compute leap years
 *         np.npy_int64 y_1 = year - 1
 */
  __pyx_v_year = (__pyx_v_val + __pyx_v_7cytimes_5utils_EPOCH_YEAR);

  /* "utils.pxd":2607
 *         np.npy_int64 year = val + EPOCH_YEAR
 *         # Compute leap years
 *         np.npy_int64 y_1 = year - 1             # <<<<<<<<<<<<<<
 *         np.npy_int64 leaps = (
 *             (y_1 // 4 - 1970 // 4)
 */
  __pyx_v_y_1 = (__pyx_v_year - 1);

  /* "utils.pxd":2611
 *             (y_1 // 4 - 1970 // 4)
 *             - (y_1 // 100 - 1970 // 100)
 *             + (y_1 // 400 - 1970 // 400)             # <<<<<<<<<<<<<<
 *         )
 *     return (val * 365 + leaps) * factor + offset
 */
  __pyx_v_leaps = (((__Pyx_div_npy_int64(__pyx_v_y_1, 4) - 0x1ec) - (__Pyx_div_npy_int64(__pyx_v_y_1, 0x64) - 0x13)) + (__Pyx_div_npy_int64(__pyx_v_y_1, 0x190) - 0x4));

  /* "utils.pxd":2613
 *             + (y_1 // 400 - 1970 // 400)
 *         )
 *     return (val * 365 + leaps) * factor + offset             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.npy_int64 _dt64_M_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __pyx_r = ((((__pyx_v_val * 0x16D) + __pyx_v_leaps) * __pyx_v_factor) + __pyx_v_offset);
  goto __pyx_L0;

  /* "utils.pxd":2602
 *     _raise_dt64_as_int64_unit_error("us", unit)
 * 
 * cdef inline np.npy_int64 _dt64_Y_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Convert the value of np.datetime64[Y] to int64 under 'D' resolution `<'int'>`."""
 *     cdef:
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":2615
 *     return (val * 365 + leaps) * factor + offset
 * 
 * cdef inline np.npy_int64 _dt64_M_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Convert the value of np.datetime64[M] to int64 under 'D' resolution `<'int'>`."""
 *     cdef:
 */

static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__dt64_M_as_int64_D(npy_int64 __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils__dt64_M_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_year_ep;
  npy_int64 __pyx_v_year;
  npy_int64 __pyx_v_month;
  npy_int64 __pyx_v_y_1;
  npy_int64 __pyx_v_leaps;
  npy_int64 __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }

  /* "utils.pxd":2618
 *     """(internal) Convert the value of np.datetime64[M] to int64 under 'D' resolution `<'int'>`."""
 *     cdef:
 *         np.npy_int64 year_ep = val // 12             # <<<<<<<<<<<<<<
 *         np.npy_int64 year = year_ep + EPOCH_YEAR
 *         np.npy_int64 month = val % 12 + 1
 */
  __pyx_v_year_ep = __Pyx_div_npy_int64(__pyx_v_val, 12);

  /* "utils.pxd":2619
 *     cdef:
 *         np.npy_int64 year_ep = val // 12
 *         np.npy_int64 year = year_ep + EPOCH_YEAR             # <<<<<<<<<<<<<<
 *         np.npy_int64 month = val % 12 + 1
 *         # Compute leap years
 */
  __pyx_v_year = (__pyx_v_year_ep + __pyx_v_7cytimes_5utils_EPOCH_YEAR);

  /* "utils.pxd":2620
 *         np.npy_int64 year_ep = val // 12
 *         np.npy_int64 year = year_ep + EPOCH_YEAR
 *         np.npy_int64 month = val % 12 + 1             # <<<<<<<<<<<<<<
 *         # Compute leap years
 *         np.npy_int64 y_1 = year - 1
 */
  __pyx_v_month = (__Pyx_mod_npy_int64(__pyx_v_val, 12) + 1);

  /* "utils.pxd":2622
 *         np.npy_int64 month = val % 12 + 1
 *         # Compute leap years
 *         np.npy_int64 y_1 = year - 1             # <<<<<<<<<<<<<<
 *         np.npy_int64 leaps = (
 *             (y_1 // 4 - 1970 // 4)
 */
  __pyx_v_y_1 = (__pyx_v_year - 1);

  /* "utils.pxd":2626
 *             (y_1 // 4 - 1970 // 4)
 *             - (y_1 // 100 - 1970 // 100)
 *             + (y_1 // 400 - 1970 // 400)             # <<<<<<<<<<<<<<
 *         )
 *     return (year_ep * 365 + leaps + days_bf_month(year, month)) * factor + offset
 */
  __pyx_v_leaps = (((__Pyx_div_npy_int64(__pyx_v_y_1, 4) - 0x1ec) - (__Pyx_div_npy_int64(__pyx_v_y_1, 0x64) - 0x13)) + (__Pyx_div_npy_int64(__pyx_v_y_1, 0x190) - 0x4));

  /* "utils.pxd":2628
 *             + (y_1 // 400 - 1970 // 400)
 *         )
 *     return (year_ep * 365 + leaps + days_bf_month(year, month)) * factor + offset             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.npy_int64 _dt64_W_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 2628, __pyx_L1_error)
  __pyx_r = (((((__pyx_v_year_ep * 0x16D) + __pyx_v_leaps) + __pyx_t_1) * __pyx_v_factor) + __pyx_v_offset);
  goto __pyx_L0;

  /* "utils.pxd":2615
 *     return (val * 365 + leaps) * factor + offset
 * 
 * cdef inline np.npy_int64 _dt64_M_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Convert the value of np.datetime64[M] to int64 under 'D' resolution `<'int'>`."""
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils._dt64_M_as_int64_D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":2630
 *     return (year_ep * 365 + leaps + days_bf_month(year, month)) * factor + offset
 * 
 * cdef inline np.npy_int64 _dt64_W_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Convert the value of np.datetime64[W] to int64 under 'D' resolution `<'int'>`."""
 *     return val * 7 * factor + offset
 */

static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__dt64_W_as_int64_D(npy_int64 __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils__dt64_W_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_r;
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }

  /* "utils.pxd":2632
 * cdef inline np.npy_int64 _dt64_W_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):
 *     """(internal) Convert the value of np.datetime64[W] to int64 under 'D' resolution `<'int'>`."""
 *     return val * 7 * factor + offset             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.datetime dt64_to_dt(object dt64, tz: object=None):
 */
  __pyx_r = (((__pyx_v_val * 7) * __pyx_v_factor) + __pyx_v_offset);
  goto __pyx_L0;

  /* "utils.pxd":2630
 *     return (year_ep * 365 + leaps + days_bf_month(year, month)) * factor + offset
 * 
 * cdef inline np.npy_int64 _dt64_W_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Convert the value of np.datetime64[W] to int64 under 'D' resolution `<'int'>`."""
 *     return val * 7 * factor + offset
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":2634
 *     return val * 7 * factor + offset
 * 
 * cdef inline datetime.datetime dt64_to_dt(object dt64, tz: object=None):             # <<<<<<<<<<<<<<
 *     """Convert np.datetime64 to datetime `<'datetime.datetime'>`."""
 *     return dt_fr_us(dt64_as_int64_us(dt64, 0), tz)
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cytimes_5utils_dt64_to_dt(PyObject *__pyx_v_dt64, struct __pyx_opt_args_7cytimes_5utils_dt64_to_dt *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  npy_int64 __pyx_t_1;
  struct __pyx_opt_args_7cytimes_5utils_dt64_as_int64_us __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt_fr_us __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64_to_dt", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "utils.pxd":2636
 * cdef inline datetime.datetime dt64_to_dt(object dt64, tz: object=None):
 *     """Convert np.datetime64 to datetime `<'datetime.datetime'>`."""
 *     return dt_fr_us(dt64_as_int64_us(dt64, 0), tz)             # <<<<<<<<<<<<<<
 * 
 * # . errors: internal
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = __pyx_f_7cytimes_5utils_dt64_as_int64_us(__pyx_v_dt64, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((npy_int64)-1) && PyErr_Occurred())) __PYX_ERR(5, 2636, __pyx_L1_error)
  __pyx_t_4.__pyx_n = 1;
  __pyx_t_4.tz = __pyx_v_tz;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_us(__pyx_t_1, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "utils.pxd":2634
 *     return val * 7 * factor + offset
 * 
 * cdef inline datetime.datetime dt64_to_dt(object dt64, tz: object=None):             # <<<<<<<<<<<<<<
 *     """Convert np.datetime64 to datetime `<'datetime.datetime'>`."""
 *     return dt_fr_us(dt64_as_int64_us(dt64, 0), tz)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.dt64_to_dt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2639
 * 
 * # . errors: internal
 * cdef inline bint _raise_dt64_as_int64_unit_error(str reso, int unit, bint is_dt64=True) except -1:             # <<<<<<<<<<<<<<
 *     """(internal) Raise unsupported unit for dt/td_as_int*() function."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils__raise_dt64_as_int64_unit_error(PyObject *__pyx_v_reso, int __pyx_v_unit, struct __pyx_opt_args_7cytimes_5utils__raise_dt64_as_int64_unit_error *__pyx_optional_args) {
  int __pyx_v_is_dt64 = ((int)1);
  PyObject *__pyx_v_obj_type = NULL;
  PyObject *__pyx_v_unit_str = NULL;
  PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  char const *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_raise_dt64_as_int64_unit_error", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_is_dt64 = __pyx_optional_args->is_dt64;
    }
  }

  /* "utils.pxd":2641
 * cdef inline bint _raise_dt64_as_int64_unit_error(str reso, int unit, bint is_dt64=True) except -1:
 *     """(internal) Raise unsupported unit for dt/td_as_int*() function."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"             # <<<<<<<<<<<<<<
 *     try:
 *         unit_str = map_nptime_unit_int2str(unit)
 */
  if (__pyx_v_is_dt64) {
    __Pyx_INCREF(__pyx_n_u_datetime64);
    __pyx_t_1 = __pyx_n_u_datetime64;
  } else {
    __Pyx_INCREF(__pyx_n_u_timedelta64);
    __pyx_t_1 = __pyx_n_u_timedelta64;
  }
  __pyx_v_obj_type = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":2642
 *     """(internal) Raise unsupported unit for dt/td_as_int*() function."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 *     try:             # <<<<<<<<<<<<<<
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:
 */
  {
    __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:*/ {

      /* "utils.pxd":2643
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 *     try:
 *         unit_str = map_nptime_unit_int2str(unit)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *         raise ValueError(
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2643, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_unit_str = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "utils.pxd":2642
 *     """(internal) Raise unsupported unit for dt/td_as_int*() function."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 *     try:             # <<<<<<<<<<<<<<
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:
 */
    }

    /* "utils.pxd":2651
 *         ) from err
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "cannot cast %s[%s] to an integer under '%s' resolution.\n"
 *             "%s with datetime unit '%s' is not supported."
 */
    /*else:*/ {

      /* "utils.pxd":2652
 *     else:
 *         raise ValueError(
 *             "cannot cast %s[%s] to an integer under '%s' resolution.\n"             # <<<<<<<<<<<<<<
 *             "%s with datetime unit '%s' is not supported."
 *             % (obj_type, unit_str, reso, obj_type, unit_str)
 */
      __pyx_t_1 = PyTuple_New(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2652, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = 0;
      __pyx_t_6 = 127;
      __Pyx_INCREF(__pyx_kp_u_cannot_cast);
      __pyx_t_5 += 12;
      __Pyx_GIVEREF(__pyx_kp_u_cannot_cast);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_cannot_cast);

      /* "utils.pxd":2654
 *             "cannot cast %s[%s] to an integer under '%s' resolution.\n"
 *             "%s with datetime unit '%s' is not supported."
 *             % (obj_type, unit_str, reso, obj_type, unit_str)             # <<<<<<<<<<<<<<
 *         )
 * 
 */
      __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_obj_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 2654, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
      __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u__19);
      __pyx_t_5 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__19);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__19);
      __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_unit_str); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 2654, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
      __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u_to_an_integer_under);
      __pyx_t_5 += 23;
      __Pyx_GIVEREF(__pyx_kp_u_to_an_integer_under);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_to_an_integer_under);
      __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_reso); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 2654, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
      __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u_resolution);
      __pyx_t_5 += 14;
      __Pyx_GIVEREF(__pyx_kp_u_resolution);
      PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u_resolution);
      __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_obj_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 2654, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
      __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u_with_datetime_unit);
      __pyx_t_5 += 21;
      __Pyx_GIVEREF(__pyx_kp_u_with_datetime_unit);
      PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u_with_datetime_unit);
      __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_unit_str); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 2654, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
      __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u_is_not_supported);
      __pyx_t_5 += 19;
      __Pyx_GIVEREF(__pyx_kp_u_is_not_supported);
      PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_kp_u_is_not_supported);

      /* "utils.pxd":2652
 *     else:
 *         raise ValueError(
 *             "cannot cast %s[%s] to an integer under '%s' resolution.\n"             # <<<<<<<<<<<<<<
 *             "%s with datetime unit '%s' is not supported."
 *             % (obj_type, unit_str, reso, obj_type, unit_str)
 */
      __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_1, 11, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 2652, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "utils.pxd":2651
 *         ) from err
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "cannot cast %s[%s] to an integer under '%s' resolution.\n"
 *             "%s with datetime unit '%s' is not supported."
 */
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2651, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(5, 2651, __pyx_L5_except_error)
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "utils.pxd":2644
 *     try:
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "cannot cast %s to an integer under '%s' resolution.\n"
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("cytimes.utils._raise_dt64_as_int64_unit_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(5, 2644, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_v_err = __pyx_t_7;
      /*try:*/ {

        /* "utils.pxd":2646
 *     except Exception as err:
 *         raise ValueError(
 *             "cannot cast %s to an integer under '%s' resolution.\n"             # <<<<<<<<<<<<<<
 *             "%s with datetime unit '%d' is not supported."
 *             % (obj_type, reso, obj_type, unit)
 */
        __pyx_t_10 = PyTuple_New(9); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 2646, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_5 = 0;
        __pyx_t_6 = 127;
        __Pyx_INCREF(__pyx_kp_u_cannot_cast);
        __pyx_t_5 += 12;
        __Pyx_GIVEREF(__pyx_kp_u_cannot_cast);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_kp_u_cannot_cast);

        /* "utils.pxd":2648
 *             "cannot cast %s to an integer under '%s' resolution.\n"
 *             "%s with datetime unit '%d' is not supported."
 *             % (obj_type, reso, obj_type, unit)             # <<<<<<<<<<<<<<
 *         ) from err
 *     else:
 */
        __pyx_t_11 = __Pyx_PyUnicode_Unicode(__pyx_v_obj_type); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 2648, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_6;
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11);
        __pyx_t_11 = 0;
        __Pyx_INCREF(__pyx_kp_u_to_an_integer_under_2);
        __pyx_t_5 += 22;
        __Pyx_GIVEREF(__pyx_kp_u_to_an_integer_under_2);
        PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_kp_u_to_an_integer_under_2);
        __pyx_t_11 = __Pyx_PyUnicode_Unicode(__pyx_v_reso); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 2648, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_6;
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_11);
        __pyx_t_11 = 0;
        __Pyx_INCREF(__pyx_kp_u_resolution);
        __pyx_t_5 += 14;
        __Pyx_GIVEREF(__pyx_kp_u_resolution);
        PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_kp_u_resolution);
        __pyx_t_11 = __Pyx_PyUnicode_Unicode(__pyx_v_obj_type); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 2648, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_6;
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_11);
        __pyx_t_11 = 0;
        __Pyx_INCREF(__pyx_kp_u_with_datetime_unit);
        __pyx_t_5 += 21;
        __Pyx_GIVEREF(__pyx_kp_u_with_datetime_unit);
        PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_kp_u_with_datetime_unit);
        __pyx_t_11 = __Pyx_PyUnicode_From_int(__pyx_v_unit, 0, ' ', 'd'); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 2648, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_t_11);
        __pyx_t_11 = 0;
        __Pyx_INCREF(__pyx_kp_u_is_not_supported);
        __pyx_t_5 += 19;
        __Pyx_GIVEREF(__pyx_kp_u_is_not_supported);
        PyTuple_SET_ITEM(__pyx_t_10, 8, __pyx_kp_u_is_not_supported);

        /* "utils.pxd":2646
 *     except Exception as err:
 *         raise ValueError(
 *             "cannot cast %s to an integer under '%s' resolution.\n"             # <<<<<<<<<<<<<<
 *             "%s with datetime unit '%d' is not supported."
 *             % (obj_type, reso, obj_type, unit)
 */
        __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_10, 9, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 2646, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "utils.pxd":2645
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "cannot cast %s to an integer under '%s' resolution.\n"
 *             "%s with datetime unit '%d' is not supported."
 */
        __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 2645, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "utils.pxd":2649
 *             "%s with datetime unit '%d' is not supported."
 *             % (obj_type, reso, obj_type, unit)
 *         ) from err             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
        __Pyx_Raise(__pyx_t_10, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __PYX_ERR(5, 2645, __pyx_L14_error)
      }

      /* "utils.pxd":2644
 *     try:
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "cannot cast %s to an integer under '%s' resolution.\n"
 */
      /*finally:*/ {
        __pyx_L14_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_8 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          }
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "utils.pxd":2642
 *     """(internal) Raise unsupported unit for dt/td_as_int*() function."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 *     try:             # <<<<<<<<<<<<<<
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
  }

  /* "utils.pxd":2639
 * 
 * # . errors: internal
 * cdef inline bint _raise_dt64_as_int64_unit_error(str reso, int unit, bint is_dt64=True) except -1:             # <<<<<<<<<<<<<<
 *     """(internal) Raise unsupported unit for dt/td_as_int*() function."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.utils._raise_dt64_as_int64_unit_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_XDECREF(__pyx_v_obj_type);
  __Pyx_XDECREF(__pyx_v_unit_str);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2659
 * # NumPy: timedelta64 -----------------------------------------------------------------------------------
 * # . type check
 * cdef inline bint is_td64(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of np.timedelta64 `<'bool'>`.
 * 
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_td64(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "utils.pxd":2665
 *     >>> isinstance(obj, np.timedelta64)
 *     """
 *     return np.is_timedelta64_object(obj)             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint validate_td64(object obj) except -1:
 */
  __pyx_r = __pyx_f_5numpy_is_timedelta64_object(__pyx_v_obj);
  goto __pyx_L0;

  /* "utils.pxd":2659
 * # NumPy: timedelta64 -----------------------------------------------------------------------------------
 * # . type check
 * cdef inline bint is_td64(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of np.timedelta64 `<'bool'>`.
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":2667
 *     return np.is_timedelta64_object(obj)
 * 
 * cdef inline bint validate_td64(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Validate if an object is an instance of np.timedelta64,
 *     and raises `TypeError` if not."""
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_validate_td64(PyObject *__pyx_v_obj) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("validate_td64", 1);

  /* "utils.pxd":2670
 *     """Validate if an object is an instance of np.timedelta64,
 *     and raises `TypeError` if not."""
 *     if not np.is_timedelta64_object(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects 'np.timedelta64', got %s." % type(obj))
 *     return True
 */
  __pyx_t_1 = (!__pyx_f_5numpy_is_timedelta64_object(__pyx_v_obj));
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":2671
 *     and raises `TypeError` if not."""
 *     if not np.is_timedelta64_object(obj):
 *         raise TypeError("expects 'np.timedelta64', got %s." % type(obj))             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
    __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_expects_np_timedelta64_got_s, ((PyObject *)Py_TYPE(__pyx_v_obj))); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2671, __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(5, 2671, __pyx_L1_error)

    /* "utils.pxd":2670
 *     """Validate if an object is an instance of np.timedelta64,
 *     and raises `TypeError` if not."""
 *     if not np.is_timedelta64_object(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects 'np.timedelta64', got %s." % type(obj))
 *     return True
 */
  }

  /* "utils.pxd":2672
 *     if not np.is_timedelta64_object(obj):
 *         raise TypeError("expects 'np.timedelta64', got %s." % type(obj))
 *     return True             # <<<<<<<<<<<<<<
 * 
 * # . conversion
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "utils.pxd":2667
 *     return np.is_timedelta64_object(obj)
 * 
 * cdef inline bint validate_td64(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Validate if an object is an instance of np.timedelta64,
 *     and raises `TypeError` if not."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.validate_td64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2675
 * 
 * # . conversion
 * cdef inline np.npy_int64 td64_as_int64_us(object td64, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.timedelta64 to int64 under 'us' (microsecond) resolution `<'int'>`.
 * 
 */

static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils_td64_as_int64_us(PyObject *__pyx_v_td64, struct __pyx_opt_args_7cytimes_5utils_td64_as_int64_us *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  NPY_DATETIMEUNIT __pyx_v_unit;
  npy_int64 __pyx_v_val;
  npy_int64 __pyx_r;
  int __pyx_t_1;
  npy_int64 __pyx_t_2;
  struct __pyx_opt_args_7cytimes_5utils__td64_W_as_int64_D __pyx_t_3;
  struct __pyx_opt_args_7cytimes_5utils__td64_M_as_int64_D __pyx_t_4;
  struct __pyx_opt_args_7cytimes_5utils__td64_Y_as_int64_D __pyx_t_5;
  struct __pyx_opt_args_7cytimes_5utils__raise_dt64_as_int64_unit_error __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }

  /* "utils.pxd":2682
 *     """
 *     # Get unit & value
 *     validate_td64(td64)             # <<<<<<<<<<<<<<
 *     cdef np.NPY_DATETIMEUNIT unit = np.get_datetime64_unit(td64)
 *     cdef np.npy_int64 val = np.get_timedelta64_value(td64)
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_validate_td64(__pyx_v_td64); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 2682, __pyx_L1_error)

  /* "utils.pxd":2683
 *     # Get unit & value
 *     validate_td64(td64)
 *     cdef np.NPY_DATETIMEUNIT unit = np.get_datetime64_unit(td64)             # <<<<<<<<<<<<<<
 *     cdef np.npy_int64 val = np.get_timedelta64_value(td64)
 * 
 */
  __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_v_td64);

  /* "utils.pxd":2684
 *     validate_td64(td64)
 *     cdef np.NPY_DATETIMEUNIT unit = np.get_datetime64_unit(td64)
 *     cdef np.npy_int64 val = np.get_timedelta64_value(td64)             # <<<<<<<<<<<<<<
 * 
 *     # Conversion
 */
  __pyx_v_val = __pyx_f_5numpy_get_timedelta64_value(__pyx_v_td64);

  /* "utils.pxd":2687
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000 + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "utils.pxd":2688
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000 + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val + offset
 */
    __pyx_r = (__Pyx_div_npy_int64(__pyx_v_val, 0x3E8) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2687
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000 + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "utils.pxd":2689
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000 + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "utils.pxd":2690
 *         return val // 1_000 + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * US_MILLISECOND + offset
 */
    __pyx_r = (__pyx_v_val + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2689
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000 + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "utils.pxd":2691
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * US_MILLISECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "utils.pxd":2692
 *         return val + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * US_MILLISECOND + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * US_SECOND + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_US_MILLISECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2691
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * US_MILLISECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "utils.pxd":2693
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * US_MILLISECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val * US_SECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "utils.pxd":2694
 *         return val * US_MILLISECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * US_SECOND + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * US_MINUTE + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_US_SECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2693
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * US_MILLISECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val * US_SECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "utils.pxd":2695
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * US_SECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * US_MINUTE + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "utils.pxd":2696
 *         return val * US_SECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * US_MINUTE + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_US_MINUTE) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2695
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * US_SECOND + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * US_MINUTE + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "utils.pxd":2697
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * US_MINUTE + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * US_HOUR + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "utils.pxd":2698
 *         return val * US_MINUTE + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * US_DAY + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_US_HOUR) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2697
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * US_MINUTE + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * US_HOUR + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "utils.pxd":2699
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * US_DAY + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_1) {

    /* "utils.pxd":2700
 *         return val * US_HOUR + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * US_DAY + offset             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _td64_W_as_int64_D(val, US_DAY, offset)
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_US_DAY) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2699
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * US_DAY + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  }

  /* "utils.pxd":2701
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * US_DAY + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _td64_W_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "utils.pxd":2702
 *         return val * US_DAY + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _td64_W_as_int64_D(val, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _td64_M_as_int64_D(val, US_DAY, offset)
 */
    __pyx_t_3.__pyx_n = 2;
    __pyx_t_3.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_3.offset = __pyx_v_offset;
    __pyx_t_2 = __pyx_f_7cytimes_5utils__td64_W_as_int64_D(__pyx_v_val, &__pyx_t_3); if (unlikely(__pyx_t_2 == ((npy_int64)-1) && PyErr_Occurred())) __PYX_ERR(5, 2702, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "utils.pxd":2701
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * US_DAY + offset
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _td64_W_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  }

  /* "utils.pxd":2703
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _td64_W_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _td64_M_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "utils.pxd":2704
 *         return _td64_W_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _td64_M_as_int64_D(val, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _td64_Y_as_int64_D(val, US_DAY, offset)
 */
    __pyx_t_4.__pyx_n = 2;
    __pyx_t_4.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_2 = __pyx_f_7cytimes_5utils__td64_M_as_int64_D(__pyx_v_val, &__pyx_t_4); if (unlikely(__pyx_t_2 == ((npy_int64)-1) && PyErr_Occurred())) __PYX_ERR(5, 2704, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "utils.pxd":2703
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _td64_W_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _td64_M_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  }

  /* "utils.pxd":2705
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _td64_M_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _td64_Y_as_int64_D(val, US_DAY, offset)
 *     # . unsupported unit
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "utils.pxd":2706
 *         return _td64_M_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _td64_Y_as_int64_D(val, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     # . unsupported unit
 *     _raise_dt64_as_int64_unit_error("us", unit, False)
 */
    __pyx_t_5.__pyx_n = 2;
    __pyx_t_5.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_5.offset = __pyx_v_offset;
    __pyx_t_2 = __pyx_f_7cytimes_5utils__td64_Y_as_int64_D(__pyx_v_val, &__pyx_t_5); if (unlikely(__pyx_t_2 == ((npy_int64)-1) && PyErr_Occurred())) __PYX_ERR(5, 2706, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "utils.pxd":2705
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _td64_M_as_int64_D(val, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _td64_Y_as_int64_D(val, US_DAY, offset)
 *     # . unsupported unit
 */
  }

  /* "utils.pxd":2708
 *         return _td64_Y_as_int64_D(val, US_DAY, offset)
 *     # . unsupported unit
 *     _raise_dt64_as_int64_unit_error("us", unit, False)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.npy_int64 _td64_Y_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.is_dt64 = 0;
  __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64_as_int64_unit_error(__pyx_n_u_us, __pyx_v_unit, &__pyx_t_6); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 2708, __pyx_L1_error)

  /* "utils.pxd":2675
 * 
 * # . conversion
 * cdef inline np.npy_int64 td64_as_int64_us(object td64, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.timedelta64 to int64 under 'us' (microsecond) resolution `<'int'>`.
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.utils.td64_as_int64_us", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":2710
 *     _raise_dt64_as_int64_unit_error("us", unit, False)
 * 
 * cdef inline np.npy_int64 _td64_Y_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Convert the value of np.timedelta[Y] to int64 under 'D' resolution `<'int'>`."""
 *     # Average number of days in a year: 365.2425
 */

static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__td64_Y_as_int64_D(npy_int64 __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils__td64_Y_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_td64_Y_as_int64_D", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }

  /* "utils.pxd":2716
 *     # Multiply by 3652425 and divide by 10000 to represent 365.2425 days/year.
 *     cdef np.npy_int64 days
 *     if factor == 1:  # day             # <<<<<<<<<<<<<<
 *         return val * 3_652_425 // 10_000 + offset  # val * 365.2425
 *     if factor == 24:  # hour
 */
  __pyx_t_1 = (__pyx_v_factor == 1);
  if (__pyx_t_1) {

    /* "utils.pxd":2717
 *     cdef np.npy_int64 days
 *     if factor == 1:  # day
 *         return val * 3_652_425 // 10_000 + offset  # val * 365.2425             # <<<<<<<<<<<<<<
 *     if factor == 24:  # hour
 *         return val * 876_582 // 100 + offset  # val * 8765.82 (365.2425 * 24)
 */
    __pyx_r = (__Pyx_div_npy_int64((__pyx_v_val * 0x37BB49), 0x2710) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2716
 *     # Multiply by 3652425 and divide by 10000 to represent 365.2425 days/year.
 *     cdef np.npy_int64 days
 *     if factor == 1:  # day             # <<<<<<<<<<<<<<
 *         return val * 3_652_425 // 10_000 + offset  # val * 365.2425
 *     if factor == 24:  # hour
 */
  }

  /* "utils.pxd":2718
 *     if factor == 1:  # day
 *         return val * 3_652_425 // 10_000 + offset  # val * 365.2425
 *     if factor == 24:  # hour             # <<<<<<<<<<<<<<
 *         return val * 876_582 // 100 + offset  # val * 8765.82 (365.2425 * 24)
 *     if factor == 1_440:  # minute
 */
  __pyx_t_1 = (__pyx_v_factor == 24);
  if (__pyx_t_1) {

    /* "utils.pxd":2719
 *         return val * 3_652_425 // 10_000 + offset  # val * 365.2425
 *     if factor == 24:  # hour
 *         return val * 876_582 // 100 + offset  # val * 8765.82 (365.2425 * 24)             # <<<<<<<<<<<<<<
 *     if factor == 1_440:  # minute
 *         return val * 5_259_492 // 10 + offset  # val * 525949.2 (365.2425 * 1440)
 */
    __pyx_r = (__Pyx_div_npy_int64((__pyx_v_val * 0xD6026), 0x64) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2718
 *     if factor == 1:  # day
 *         return val * 3_652_425 // 10_000 + offset  # val * 365.2425
 *     if factor == 24:  # hour             # <<<<<<<<<<<<<<
 *         return val * 876_582 // 100 + offset  # val * 8765.82 (365.2425 * 24)
 *     if factor == 1_440:  # minute
 */
  }

  /* "utils.pxd":2720
 *     if factor == 24:  # hour
 *         return val * 876_582 // 100 + offset  # val * 8765.82 (365.2425 * 24)
 *     if factor == 1_440:  # minute             # <<<<<<<<<<<<<<
 *         return val * 5_259_492 // 10 + offset  # val * 525949.2 (365.2425 * 1440)
 *     if factor == SS_DAY:  # second
 */
  __pyx_t_1 = (__pyx_v_factor == 0x5A0);
  if (__pyx_t_1) {

    /* "utils.pxd":2721
 *         return val * 876_582 // 100 + offset  # val * 8765.82 (365.2425 * 24)
 *     if factor == 1_440:  # minute
 *         return val * 5_259_492 // 10 + offset  # val * 525949.2 (365.2425 * 1440)             # <<<<<<<<<<<<<<
 *     if factor == SS_DAY:  # second
 *         return val * TD64_YY_SECOND + offset
 */
    __pyx_r = (__Pyx_div_npy_int64((__pyx_v_val * 0x5040E4), 10) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2720
 *     if factor == 24:  # hour
 *         return val * 876_582 // 100 + offset  # val * 8765.82 (365.2425 * 24)
 *     if factor == 1_440:  # minute             # <<<<<<<<<<<<<<
 *         return val * 5_259_492 // 10 + offset  # val * 525949.2 (365.2425 * 1440)
 *     if factor == SS_DAY:  # second
 */
  }

  /* "utils.pxd":2722
 *     if factor == 1_440:  # minute
 *         return val * 5_259_492 // 10 + offset  # val * 525949.2 (365.2425 * 1440)
 *     if factor == SS_DAY:  # second             # <<<<<<<<<<<<<<
 *         return val * TD64_YY_SECOND + offset
 *     if factor == MS_DAY:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_SS_DAY);
  if (__pyx_t_1) {

    /* "utils.pxd":2723
 *         return val * 5_259_492 // 10 + offset  # val * 525949.2 (365.2425 * 1440)
 *     if factor == SS_DAY:  # second
 *         return val * TD64_YY_SECOND + offset             # <<<<<<<<<<<<<<
 *     if factor == MS_DAY:  # millisecond
 *         return val * TD64_YY_MILLISECOND + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_TD64_YY_SECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2722
 *     if factor == 1_440:  # minute
 *         return val * 5_259_492 // 10 + offset  # val * 525949.2 (365.2425 * 1440)
 *     if factor == SS_DAY:  # second             # <<<<<<<<<<<<<<
 *         return val * TD64_YY_SECOND + offset
 *     if factor == MS_DAY:  # millisecond
 */
  }

  /* "utils.pxd":2724
 *     if factor == SS_DAY:  # second
 *         return val * TD64_YY_SECOND + offset
 *     if factor == MS_DAY:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * TD64_YY_MILLISECOND + offset
 *     if factor == US_DAY:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_MS_DAY);
  if (__pyx_t_1) {

    /* "utils.pxd":2725
 *         return val * TD64_YY_SECOND + offset
 *     if factor == MS_DAY:  # millisecond
 *         return val * TD64_YY_MILLISECOND + offset             # <<<<<<<<<<<<<<
 *     if factor == US_DAY:  # microsecond
 *         return val * TD64_YY_MICROSECOND + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_TD64_YY_MILLISECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2724
 *     if factor == SS_DAY:  # second
 *         return val * TD64_YY_SECOND + offset
 *     if factor == MS_DAY:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * TD64_YY_MILLISECOND + offset
 *     if factor == US_DAY:  # microsecond
 */
  }

  /* "utils.pxd":2726
 *     if factor == MS_DAY:  # millisecond
 *         return val * TD64_YY_MILLISECOND + offset
 *     if factor == US_DAY:  # microsecond             # <<<<<<<<<<<<<<
 *         return val * TD64_YY_MICROSECOND + offset
 *     if factor == NS_DAY:  # nanosecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_US_DAY);
  if (__pyx_t_1) {

    /* "utils.pxd":2727
 *         return val * TD64_YY_MILLISECOND + offset
 *     if factor == US_DAY:  # microsecond
 *         return val * TD64_YY_MICROSECOND + offset             # <<<<<<<<<<<<<<
 *     if factor == NS_DAY:  # nanosecond
 *         return val * TD64_YY_NANOSECOND + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_TD64_YY_MICROSECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2726
 *     if factor == MS_DAY:  # millisecond
 *         return val * TD64_YY_MILLISECOND + offset
 *     if factor == US_DAY:  # microsecond             # <<<<<<<<<<<<<<
 *         return val * TD64_YY_MICROSECOND + offset
 *     if factor == NS_DAY:  # nanosecond
 */
  }

  /* "utils.pxd":2728
 *     if factor == US_DAY:  # microsecond
 *         return val * TD64_YY_MICROSECOND + offset
 *     if factor == NS_DAY:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val * TD64_YY_NANOSECOND + offset
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_NS_DAY);
  if (__pyx_t_1) {

    /* "utils.pxd":2729
 *         return val * TD64_YY_MICROSECOND + offset
 *     if factor == NS_DAY:  # nanosecond
 *         return val * TD64_YY_NANOSECOND + offset             # <<<<<<<<<<<<<<
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)
 * 
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_TD64_YY_NANOSECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2728
 *     if factor == US_DAY:  # microsecond
 *         return val * TD64_YY_MICROSECOND + offset
 *     if factor == NS_DAY:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val * TD64_YY_NANOSECOND + offset
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)
 */
  }

  /* "utils.pxd":2730
 *     if factor == NS_DAY:  # nanosecond
 *         return val * TD64_YY_NANOSECOND + offset
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.npy_int64 _td64_M_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_factor); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unsupported_factor_d_for_timedel, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(5, 2730, __pyx_L1_error)

  /* "utils.pxd":2710
 *     _raise_dt64_as_int64_unit_error("us", unit, False)
 * 
 * cdef inline np.npy_int64 _td64_Y_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Convert the value of np.timedelta[Y] to int64 under 'D' resolution `<'int'>`."""
 *     # Average number of days in a year: 365.2425
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils._td64_Y_as_int64_D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2732
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)
 * 
 * cdef inline np.npy_int64 _td64_M_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Convert the value of np.timedelta[M] to int64 under 'D' resolution `<'int'>`."""
 *     # Average number of days in a month: 30.436875 (365.2425 / 12)
 */

static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__td64_M_as_int64_D(npy_int64 __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils__td64_M_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_td64_M_as_int64_D", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }

  /* "utils.pxd":2738
 *     # Multiply by 30436875 and divide by 1000000 to represent 30.436875 days/month.
 *     cdef np.npy_int64 days
 *     if factor == 1: #  day             # <<<<<<<<<<<<<<
 *         return val * 30_436_875 // 1_000_000 + offset  # val * 30.436875
 *     if factor == 24: #  hour
 */
  __pyx_t_1 = (__pyx_v_factor == 1);
  if (__pyx_t_1) {

    /* "utils.pxd":2739
 *     cdef np.npy_int64 days
 *     if factor == 1: #  day
 *         return val * 30_436_875 // 1_000_000 + offset  # val * 30.436875             # <<<<<<<<<<<<<<
 *     if factor == 24: #  hour
 *         return val * 730_485 // 1_000 + offset  # val * 730.485 (30.436875 * 24)
 */
    __pyx_r = (__Pyx_div_npy_int64((__pyx_v_val * 0x1D06E0B), 0xF4240) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2738
 *     # Multiply by 30436875 and divide by 1000000 to represent 30.436875 days/month.
 *     cdef np.npy_int64 days
 *     if factor == 1: #  day             # <<<<<<<<<<<<<<
 *         return val * 30_436_875 // 1_000_000 + offset  # val * 30.436875
 *     if factor == 24: #  hour
 */
  }

  /* "utils.pxd":2740
 *     if factor == 1: #  day
 *         return val * 30_436_875 // 1_000_000 + offset  # val * 30.436875
 *     if factor == 24: #  hour             # <<<<<<<<<<<<<<
 *         return val * 730_485 // 1_000 + offset  # val * 730.485 (30.436875 * 24)
 *     if factor == 1_440:  # minute
 */
  __pyx_t_1 = (__pyx_v_factor == 24);
  if (__pyx_t_1) {

    /* "utils.pxd":2741
 *         return val * 30_436_875 // 1_000_000 + offset  # val * 30.436875
 *     if factor == 24: #  hour
 *         return val * 730_485 // 1_000 + offset  # val * 730.485 (30.436875 * 24)             # <<<<<<<<<<<<<<
 *     if factor == 1_440:  # minute
 *         return val * 438_291 // 10 + offset  # val * 43829.1 (30.436875 * 1440)
 */
    __pyx_r = (__Pyx_div_npy_int64((__pyx_v_val * 0xB2575), 0x3E8) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2740
 *     if factor == 1: #  day
 *         return val * 30_436_875 // 1_000_000 + offset  # val * 30.436875
 *     if factor == 24: #  hour             # <<<<<<<<<<<<<<
 *         return val * 730_485 // 1_000 + offset  # val * 730.485 (30.436875 * 24)
 *     if factor == 1_440:  # minute
 */
  }

  /* "utils.pxd":2742
 *     if factor == 24: #  hour
 *         return val * 730_485 // 1_000 + offset  # val * 730.485 (30.436875 * 24)
 *     if factor == 1_440:  # minute             # <<<<<<<<<<<<<<
 *         return val * 438_291 // 10 + offset  # val * 43829.1 (30.436875 * 1440)
 *     if factor == SS_DAY:  # second
 */
  __pyx_t_1 = (__pyx_v_factor == 0x5A0);
  if (__pyx_t_1) {

    /* "utils.pxd":2743
 *         return val * 730_485 // 1_000 + offset  # val * 730.485 (30.436875 * 24)
 *     if factor == 1_440:  # minute
 *         return val * 438_291 // 10 + offset  # val * 43829.1 (30.436875 * 1440)             # <<<<<<<<<<<<<<
 *     if factor == SS_DAY:  # second
 *         return val * TD64_MM_SECOND + offset
 */
    __pyx_r = (__Pyx_div_npy_int64((__pyx_v_val * 0x6B013), 10) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2742
 *     if factor == 24: #  hour
 *         return val * 730_485 // 1_000 + offset  # val * 730.485 (30.436875 * 24)
 *     if factor == 1_440:  # minute             # <<<<<<<<<<<<<<
 *         return val * 438_291 // 10 + offset  # val * 43829.1 (30.436875 * 1440)
 *     if factor == SS_DAY:  # second
 */
  }

  /* "utils.pxd":2744
 *     if factor == 1_440:  # minute
 *         return val * 438_291 // 10 + offset  # val * 43829.1 (30.436875 * 1440)
 *     if factor == SS_DAY:  # second             # <<<<<<<<<<<<<<
 *         return val * TD64_MM_SECOND + offset
 *     if factor == MS_DAY:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_SS_DAY);
  if (__pyx_t_1) {

    /* "utils.pxd":2745
 *         return val * 438_291 // 10 + offset  # val * 43829.1 (30.436875 * 1440)
 *     if factor == SS_DAY:  # second
 *         return val * TD64_MM_SECOND + offset             # <<<<<<<<<<<<<<
 *     if factor == MS_DAY:  # millisecond
 *         return val * TD64_MM_MILLISECOND + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_TD64_MM_SECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2744
 *     if factor == 1_440:  # minute
 *         return val * 438_291 // 10 + offset  # val * 43829.1 (30.436875 * 1440)
 *     if factor == SS_DAY:  # second             # <<<<<<<<<<<<<<
 *         return val * TD64_MM_SECOND + offset
 *     if factor == MS_DAY:  # millisecond
 */
  }

  /* "utils.pxd":2746
 *     if factor == SS_DAY:  # second
 *         return val * TD64_MM_SECOND + offset
 *     if factor == MS_DAY:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * TD64_MM_MILLISECOND + offset
 *     if factor == US_DAY:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_MS_DAY);
  if (__pyx_t_1) {

    /* "utils.pxd":2747
 *         return val * TD64_MM_SECOND + offset
 *     if factor == MS_DAY:  # millisecond
 *         return val * TD64_MM_MILLISECOND + offset             # <<<<<<<<<<<<<<
 *     if factor == US_DAY:  # microsecond
 *         return val * TD64_MM_MICROSECOND + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_TD64_MM_MILLISECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2746
 *     if factor == SS_DAY:  # second
 *         return val * TD64_MM_SECOND + offset
 *     if factor == MS_DAY:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * TD64_MM_MILLISECOND + offset
 *     if factor == US_DAY:  # microsecond
 */
  }

  /* "utils.pxd":2748
 *     if factor == MS_DAY:  # millisecond
 *         return val * TD64_MM_MILLISECOND + offset
 *     if factor == US_DAY:  # microsecond             # <<<<<<<<<<<<<<
 *         return val * TD64_MM_MICROSECOND + offset
 *     if factor == NS_DAY:  # nanosecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_US_DAY);
  if (__pyx_t_1) {

    /* "utils.pxd":2749
 *         return val * TD64_MM_MILLISECOND + offset
 *     if factor == US_DAY:  # microsecond
 *         return val * TD64_MM_MICROSECOND + offset             # <<<<<<<<<<<<<<
 *     if factor == NS_DAY:  # nanosecond
 *         return val * TD64_MM_NANOSECOND + offset
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_TD64_MM_MICROSECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2748
 *     if factor == MS_DAY:  # millisecond
 *         return val * TD64_MM_MILLISECOND + offset
 *     if factor == US_DAY:  # microsecond             # <<<<<<<<<<<<<<
 *         return val * TD64_MM_MICROSECOND + offset
 *     if factor == NS_DAY:  # nanosecond
 */
  }

  /* "utils.pxd":2750
 *     if factor == US_DAY:  # microsecond
 *         return val * TD64_MM_MICROSECOND + offset
 *     if factor == NS_DAY:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val * TD64_MM_NANOSECOND + offset
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_NS_DAY);
  if (__pyx_t_1) {

    /* "utils.pxd":2751
 *         return val * TD64_MM_MICROSECOND + offset
 *     if factor == NS_DAY:  # nanosecond
 *         return val * TD64_MM_NANOSECOND + offset             # <<<<<<<<<<<<<<
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)
 * 
 */
    __pyx_r = ((__pyx_v_val * __pyx_v_7cytimes_5utils_TD64_MM_NANOSECOND) + __pyx_v_offset);
    goto __pyx_L0;

    /* "utils.pxd":2750
 *     if factor == US_DAY:  # microsecond
 *         return val * TD64_MM_MICROSECOND + offset
 *     if factor == NS_DAY:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val * TD64_MM_NANOSECOND + offset
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)
 */
  }

  /* "utils.pxd":2752
 *     if factor == NS_DAY:  # nanosecond
 *         return val * TD64_MM_NANOSECOND + offset
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.npy_int64 _td64_W_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_factor); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unsupported_factor_d_for_timedel_2, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(5, 2752, __pyx_L1_error)

  /* "utils.pxd":2732
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)
 * 
 * cdef inline np.npy_int64 _td64_M_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Convert the value of np.timedelta[M] to int64 under 'D' resolution `<'int'>`."""
 *     # Average number of days in a month: 30.436875 (365.2425 / 12)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils._td64_M_as_int64_D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2754
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)
 * 
 * cdef inline np.npy_int64 _td64_W_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Convert the value of np.timedelta[W] to int64 under 'D' resolution `<'int'>`."""
 *     return val * 7 * factor + offset
 */

static CYTHON_INLINE npy_int64 __pyx_f_7cytimes_5utils__td64_W_as_int64_D(npy_int64 __pyx_v_val, struct __pyx_opt_args_7cytimes_5utils__td64_W_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_r;
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }

  /* "utils.pxd":2756
 * cdef inline np.npy_int64 _td64_W_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):
 *     """(internal) Convert the value of np.timedelta[W] to int64 under 'D' resolution `<'int'>`."""
 *     return val * 7 * factor + offset             # <<<<<<<<<<<<<<
 * 
 * cdef inline datetime.timedelta td64_to_td(object td64):
 */
  __pyx_r = (((__pyx_v_val * 7) * __pyx_v_factor) + __pyx_v_offset);
  goto __pyx_L0;

  /* "utils.pxd":2754
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)
 * 
 * cdef inline np.npy_int64 _td64_W_as_int64_D(np.npy_int64 val, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Convert the value of np.timedelta[W] to int64 under 'D' resolution `<'int'>`."""
 *     return val * 7 * factor + offset
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":2758
 *     return val * 7 * factor + offset
 * 
 * cdef inline datetime.timedelta td64_to_td(object td64):             # <<<<<<<<<<<<<<
 *     """Convert np.timedelta64 to timedelta `<'datetime.timedelta'>`.
 * 
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cytimes_5utils_td64_to_td(PyObject *__pyx_v_td64) {
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  npy_int64 __pyx_t_1;
  struct __pyx_opt_args_7cytimes_5utils_td64_as_int64_us __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("td64_to_td", 1);

  /* "utils.pxd":2765
 *     >>> datetime.timedelta(microseconds=int(us))
 *     """
 *     return td_fr_us(td64_as_int64_us(td64, 0))             # <<<<<<<<<<<<<<
 * 
 * # NumPy: ndarray ---------------------------------------------------------------------------------------
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = __pyx_f_7cytimes_5utils_td64_as_int64_us(__pyx_v_td64, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((npy_int64)-1) && PyErr_Occurred())) __PYX_ERR(5, 2765, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_td_fr_us(__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "utils.pxd":2758
 *     return val * 7 * factor + offset
 * 
 * cdef inline datetime.timedelta td64_to_td(object td64):             # <<<<<<<<<<<<<<
 *     """Convert np.timedelta64 to timedelta `<'datetime.timedelta'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.td64_to_td", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2769
 * # NumPy: ndarray ---------------------------------------------------------------------------------------
 * # . type check
 * cdef inline bint is_arr(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of np.ndarray `<'bool'>`.
 * 
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_arr(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "utils.pxd":2775
 *     >>> isinstance(obj, np.ndarray)
 *     """
 *     return np.PyArray_Check(obj)             # <<<<<<<<<<<<<<
 * 
 * # . dtype
 */
  __pyx_r = PyArray_Check(__pyx_v_obj);
  goto __pyx_L0;

  /* "utils.pxd":2769
 * # NumPy: ndarray ---------------------------------------------------------------------------------------
 * # . type check
 * cdef inline bint is_arr(object obj) except -1:             # <<<<<<<<<<<<<<
 *     """Check if an object is an instance of np.ndarray `<'bool'>`.
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":2778
 * 
 * # . dtype
 * cdef inline np.ndarray arr_assure_int64(np.ndarray arr):             # <<<<<<<<<<<<<<
 *     """Assure the given ndarray is dtype of 'int64' `<'ndarray[int64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_assure_int64(PyArrayObject *__pyx_v_arr) {
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_assure_int64", 1);

  /* "utils.pxd":2783
 *     Automatically cast the 'arr' to 'int64' if not the correct dtype.
 *     """
 *     if np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_INT64:             # <<<<<<<<<<<<<<
 *         return arr
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 */
  __pyx_t_1 = (PyArray_TYPE(__pyx_v_arr) == NPY_INT64);
  if (__pyx_t_1) {

    /* "utils.pxd":2784
 *     """
 *     if np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_INT64:
 *         return arr             # <<<<<<<<<<<<<<
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 * 
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "utils.pxd":2783
 *     Automatically cast the 'arr' to 'int64' if not the correct dtype.
 *     """
 *     if np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_INT64:             # <<<<<<<<<<<<<<
 *         return arr
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 */
  }

  /* "utils.pxd":2785
 *     if np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_INT64:
 *         return arr
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_assure_int64_like(np.ndarray arr):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = PyArray_Cast(__pyx_v_arr, NPY_INT64); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 2785, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":2778
 * 
 * # . dtype
 * cdef inline np.ndarray arr_assure_int64(np.ndarray arr):             # <<<<<<<<<<<<<<
 *     """Assure the given ndarray is dtype of 'int64' `<'ndarray[int64]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.arr_assure_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2787
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 * 
 * cdef inline np.ndarray arr_assure_int64_like(np.ndarray arr):             # <<<<<<<<<<<<<<
 *     """Assure the given ndarray is dtype of [int64/datetime64/timedelta64] `<'ndarray'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_assure_int64_like(PyArrayObject *__pyx_v_arr) {
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_assure_int64_like", 1);

  /* "utils.pxd":2794
 *     Automatically cast the 'arr' to 'int64' if not the correct dtype.
 *     """
 *     if np.PyArray_TYPE(arr) in (             # <<<<<<<<<<<<<<
 *         np.NPY_TYPES.NPY_INT64,
 *         np.NPY_TYPES.NPY_DATETIME,
 */
  __pyx_t_1 = PyArray_TYPE(__pyx_v_arr);

  /* "utils.pxd":2795
 *     """
 *     if np.PyArray_TYPE(arr) in (
 *         np.NPY_TYPES.NPY_INT64,             # <<<<<<<<<<<<<<
 *         np.NPY_TYPES.NPY_DATETIME,
 *         np.NPY_TYPES.NPY_TIMEDELTA,
 */
  __pyx_t_3 = (__pyx_t_1 == NPY_INT64);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }

  /* "utils.pxd":2794
 *     Automatically cast the 'arr' to 'int64' if not the correct dtype.
 *     """
 *     if np.PyArray_TYPE(arr) in (             # <<<<<<<<<<<<<<
 *         np.NPY_TYPES.NPY_INT64,
 *         np.NPY_TYPES.NPY_DATETIME,
 */
  __pyx_t_3 = (__pyx_t_1 == NPY_DATETIME);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }

  /* "utils.pxd":2797
 *         np.NPY_TYPES.NPY_INT64,
 *         np.NPY_TYPES.NPY_DATETIME,
 *         np.NPY_TYPES.NPY_TIMEDELTA,             # <<<<<<<<<<<<<<
 *     ):
 *         return arr
 */
  __pyx_t_3 = (__pyx_t_1 == NPY_TIMEDELTA);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;

  /* "utils.pxd":2794
 *     Automatically cast the 'arr' to 'int64' if not the correct dtype.
 *     """
 *     if np.PyArray_TYPE(arr) in (             # <<<<<<<<<<<<<<
 *         np.NPY_TYPES.NPY_INT64,
 *         np.NPY_TYPES.NPY_DATETIME,
 */
  __pyx_t_3 = __pyx_t_2;
  if (__pyx_t_3) {

    /* "utils.pxd":2799
 *         np.NPY_TYPES.NPY_TIMEDELTA,
 *     ):
 *         return arr             # <<<<<<<<<<<<<<
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 * 
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "utils.pxd":2794
 *     Automatically cast the 'arr' to 'int64' if not the correct dtype.
 *     """
 *     if np.PyArray_TYPE(arr) in (             # <<<<<<<<<<<<<<
 *         np.NPY_TYPES.NPY_INT64,
 *         np.NPY_TYPES.NPY_DATETIME,
 */
  }

  /* "utils.pxd":2800
 *     ):
 *         return arr
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_assure_float64(np.ndarray arr):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_4 = PyArray_Cast(__pyx_v_arr, NPY_INT64); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 2800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 2800, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "utils.pxd":2787
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 * 
 * cdef inline np.ndarray arr_assure_int64_like(np.ndarray arr):             # <<<<<<<<<<<<<<
 *     """Assure the given ndarray is dtype of [int64/datetime64/timedelta64] `<'ndarray'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils.arr_assure_int64_like", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2802
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 * 
 * cdef inline np.ndarray arr_assure_float64(np.ndarray arr):             # <<<<<<<<<<<<<<
 *     """Assure the given ndarray is dtype of 'float64' `<'ndarray[int64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_assure_float64(PyArrayObject *__pyx_v_arr) {
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_assure_float64", 1);

  /* "utils.pxd":2807
 *     Automatically cast the 'arr' to 'flaot64' if not the correct dtype.
 *     """
 *     if np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_FLOAT64:             # <<<<<<<<<<<<<<
 *         return arr
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_FLOAT64)
 */
  __pyx_t_1 = (PyArray_TYPE(__pyx_v_arr) == NPY_FLOAT64);
  if (__pyx_t_1) {

    /* "utils.pxd":2808
 *     """
 *     if np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_FLOAT64:
 *         return arr             # <<<<<<<<<<<<<<
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_FLOAT64)
 * 
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "utils.pxd":2807
 *     Automatically cast the 'arr' to 'flaot64' if not the correct dtype.
 *     """
 *     if np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_FLOAT64:             # <<<<<<<<<<<<<<
 *         return arr
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_FLOAT64)
 */
  }

  /* "utils.pxd":2809
 *     if np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_FLOAT64:
 *         return arr
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_FLOAT64)             # <<<<<<<<<<<<<<
 * 
 * # . create
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = PyArray_Cast(__pyx_v_arr, NPY_FLOAT64); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 2809, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":2802
 *     return np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 * 
 * cdef inline np.ndarray arr_assure_float64(np.ndarray arr):             # <<<<<<<<<<<<<<
 *     """Assure the given ndarray is dtype of 'float64' `<'ndarray[int64]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.arr_assure_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2812
 * 
 * # . create
 * cdef inline np.ndarray arr_zero_int64(np.npy_int64 size):             # <<<<<<<<<<<<<<
 *     """Create an 1-dimensional ndarray[int64] filled with zero `<'ndarray[int64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_zero_int64(npy_int64 __pyx_v_size) {
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  npy_intp __pyx_t_3[1];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_zero_int64", 1);

  /* "utils.pxd":2819
 *     """
 *     # Validate
 *     if size < 1:             # <<<<<<<<<<<<<<
 *         raise ValueError("ndarray size must be an integer greater than 0.")
 * 
 */
  __pyx_t_1 = (__pyx_v_size < 1);
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":2820
 *     # Validate
 *     if size < 1:
 *         raise ValueError("ndarray size must be an integer greater than 0.")             # <<<<<<<<<<<<<<
 * 
 *     # New array
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2820, __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(5, 2820, __pyx_L1_error)

    /* "utils.pxd":2819
 *     """
 *     # Validate
 *     if size < 1:             # <<<<<<<<<<<<<<
 *         raise ValueError("ndarray size must be an integer greater than 0.")
 * 
 */
  }

  /* "utils.pxd":2823
 * 
 *     # New array
 *     return np.PyArray_ZEROS(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_full_int64(np.npy_int64 value, np.npy_int64 size):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_2 = PyArray_ZEROS(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 2823, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":2812
 * 
 * # . create
 * cdef inline np.ndarray arr_zero_int64(np.npy_int64 size):             # <<<<<<<<<<<<<<
 *     """Create an 1-dimensional ndarray[int64] filled with zero `<'ndarray[int64]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.arr_zero_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2825
 *     return np.PyArray_ZEROS(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 * 
 * cdef inline np.ndarray arr_full_int64(np.npy_int64 value, np.npy_int64 size):             # <<<<<<<<<<<<<<
 *     """Create a new 1-dimensional ndarray[int64] filled with 'value' `<'ndarray[int64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_full_int64(npy_int64 __pyx_v_value, npy_int64 __pyx_v_size) {
  PyArrayObject *__pyx_v_arr = 0;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_full_int64", 1);

  /* "utils.pxd":2832
 *     """
 *     # Fast-path
 *     if value == 0:             # <<<<<<<<<<<<<<
 *         return arr_zero_int64(size)
 * 
 */
  __pyx_t_1 = (__pyx_v_value == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":2833
 *     # Fast-path
 *     if value == 0:
 *         return arr_zero_int64(size)             # <<<<<<<<<<<<<<
 * 
 *     # Validate
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_zero_int64(__pyx_v_size)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "utils.pxd":2832
 *     """
 *     # Fast-path
 *     if value == 0:             # <<<<<<<<<<<<<<
 *         return arr_zero_int64(size)
 * 
 */
  }

  /* "utils.pxd":2836
 * 
 *     # Validate
 *     if size < 1:             # <<<<<<<<<<<<<<
 *         raise ValueError("ndarray size must be an integer greater than 0.")
 * 
 */
  __pyx_t_1 = (__pyx_v_size < 1);
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":2837
 *     # Validate
 *     if size < 1:
 *         raise ValueError("ndarray size must be an integer greater than 0.")             # <<<<<<<<<<<<<<
 * 
 *     # New array
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2837, __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(5, 2837, __pyx_L1_error)

    /* "utils.pxd":2836
 * 
 *     # Validate
 *     if size < 1:             # <<<<<<<<<<<<<<
 *         raise ValueError("ndarray size must be an integer greater than 0.")
 * 
 */
  }

  /* "utils.pxd":2841
 *     # New array
 *     cdef:
 *         np.ndarray arr = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_2 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 2841, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "utils.pxd":2842
 *     cdef:
 *         np.ndarray arr = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":2845
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         arr_ptr[i] = value
 *     return arr
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":2846
 * 
 *     for i in range(size):
 *         arr_ptr[i] = value             # <<<<<<<<<<<<<<
 *     return arr
 * 
 */
    (__pyx_v_arr_ptr[__pyx_v_i]) = __pyx_v_value;
  }

  /* "utils.pxd":2847
 *     for i in range(size):
 *         arr_ptr[i] = value
 *     return arr             # <<<<<<<<<<<<<<
 * 
 * # . range
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __pyx_r = __pyx_v_arr;
  goto __pyx_L0;

  /* "utils.pxd":2825
 *     return np.PyArray_ZEROS(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 * 
 * cdef inline np.ndarray arr_full_int64(np.npy_int64 value, np.npy_int64 size):             # <<<<<<<<<<<<<<
 *     """Create a new 1-dimensional ndarray[int64] filled with 'value' `<'ndarray[int64]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.arr_full_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2850
 * 
 * # . range
 * cdef inline np.ndarray arr_clip(np.ndarray arr, np.npy_int64 minimum, np.npy_int64 maximum, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Clip the values of an ndarray between 'minimum' and 'maximum' value `<'ndarray[int64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_clip(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_minimum, npy_int64 __pyx_v_maximum, struct __pyx_opt_args_7cytimes_5utils_arr_clip *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_v;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp __pyx_t_2[1];
  npy_int64 __pyx_t_3;
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_clip", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":2860
 *     """
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":2864
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":2865
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_2[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_2, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 2865, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":2866
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i, v
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":2867
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, v
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":2870
 *         np.npy_int64 i, v
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         v = arr_ptr[i]
 *         if v > maximum:
 */
  __pyx_t_3 = __pyx_v_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "utils.pxd":2871
 * 
 *     for i in range(size):
 *         v = arr_ptr[i]             # <<<<<<<<<<<<<<
 *         if v > maximum:
 *             v = maximum
 */
    __pyx_v_v = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "utils.pxd":2872
 *     for i in range(size):
 *         v = arr_ptr[i]
 *         if v > maximum:             # <<<<<<<<<<<<<<
 *             v = maximum
 *         elif v < minimum:
 */
    __pyx_t_6 = (__pyx_v_v > __pyx_v_maximum);
    if (__pyx_t_6) {

      /* "utils.pxd":2873
 *         v = arr_ptr[i]
 *         if v > maximum:
 *             v = maximum             # <<<<<<<<<<<<<<
 *         elif v < minimum:
 *             v = minimum
 */
      __pyx_v_v = __pyx_v_maximum;

      /* "utils.pxd":2872
 *     for i in range(size):
 *         v = arr_ptr[i]
 *         if v > maximum:             # <<<<<<<<<<<<<<
 *             v = maximum
 *         elif v < minimum:
 */
      goto __pyx_L5;
    }

    /* "utils.pxd":2874
 *         if v > maximum:
 *             v = maximum
 *         elif v < minimum:             # <<<<<<<<<<<<<<
 *             v = minimum
 *         res_ptr[i] = v + offset
 */
    __pyx_t_6 = (__pyx_v_v < __pyx_v_minimum);
    if (__pyx_t_6) {

      /* "utils.pxd":2875
 *             v = maximum
 *         elif v < minimum:
 *             v = minimum             # <<<<<<<<<<<<<<
 *         res_ptr[i] = v + offset
 *     return res
 */
      __pyx_v_v = __pyx_v_minimum;

      /* "utils.pxd":2874
 *         if v > maximum:
 *             v = maximum
 *         elif v < minimum:             # <<<<<<<<<<<<<<
 *             v = minimum
 *         res_ptr[i] = v + offset
 */
    }
    __pyx_L5:;

    /* "utils.pxd":2876
 *         elif v < minimum:
 *             v = minimum
 *         res_ptr[i] = v + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__pyx_v_v + __pyx_v_offset);
  }

  /* "utils.pxd":2877
 *             v = minimum
 *         res_ptr[i] = v + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_min(np.ndarray arr, np.npy_int64 value, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":2850
 * 
 * # . range
 * cdef inline np.ndarray arr_clip(np.ndarray arr, np.npy_int64 minimum, np.npy_int64 maximum, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Clip the values of an ndarray between 'minimum' and 'maximum' value `<'ndarray[int64]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.arr_clip", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2879
 *     return res
 * 
 * cdef inline np.ndarray arr_min(np.ndarray arr, np.npy_int64 value, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the minimum values between the ndarray and the 'value `<'ndarray[int64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_min(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_value, struct __pyx_opt_args_7cytimes_5utils_arr_min *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp __pyx_t_2[1];
  npy_int64 __pyx_t_3;
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  npy_int64 __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_min", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":2889
 *     """
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":2893
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":2894
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_2[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_2, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 2894, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":2895
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":2896
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":2899
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = min(arr_ptr[i], value) + offset
 *     return res
 */
  __pyx_t_3 = __pyx_v_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "utils.pxd":2900
 * 
 *     for i in range(size):
 *         res_ptr[i] = min(arr_ptr[i], value) + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_6 = __pyx_v_value;
    __pyx_t_7 = (__pyx_v_arr_ptr[__pyx_v_i]);
    __pyx_t_9 = (__pyx_t_6 < __pyx_t_7);
    if (__pyx_t_9) {
      __pyx_t_8 = __pyx_t_6;
    } else {
      __pyx_t_8 = __pyx_t_7;
    }
    (__pyx_v_res_ptr[__pyx_v_i]) = (__pyx_t_8 + __pyx_v_offset);
  }

  /* "utils.pxd":2901
 *     for i in range(size):
 *         res_ptr[i] = min(arr_ptr[i], value) + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_max(np.ndarray arr, np.npy_int64 value, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":2879
 *     return res
 * 
 * cdef inline np.ndarray arr_min(np.ndarray arr, np.npy_int64 value, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the minimum values between the ndarray and the 'value `<'ndarray[int64]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.arr_min", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2903
 *     return res
 * 
 * cdef inline np.ndarray arr_max(np.ndarray arr, np.npy_int64 value, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the maximum values between the ndarray and the 'value' `<'ndarray[int64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_max(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_value, struct __pyx_opt_args_7cytimes_5utils_arr_max *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp __pyx_t_2[1];
  npy_int64 __pyx_t_3;
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  npy_int64 __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_max", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":2913
 *     """
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":2917
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":2918
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_2[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_2, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 2918, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":2919
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":2920
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":2923
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = max(arr_ptr[i], value) + offset
 *     return res
 */
  __pyx_t_3 = __pyx_v_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "utils.pxd":2924
 * 
 *     for i in range(size):
 *         res_ptr[i] = max(arr_ptr[i], value) + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_6 = __pyx_v_value;
    __pyx_t_7 = (__pyx_v_arr_ptr[__pyx_v_i]);
    __pyx_t_9 = (__pyx_t_6 > __pyx_t_7);
    if (__pyx_t_9) {
      __pyx_t_8 = __pyx_t_6;
    } else {
      __pyx_t_8 = __pyx_t_7;
    }
    (__pyx_v_res_ptr[__pyx_v_i]) = (__pyx_t_8 + __pyx_v_offset);
  }

  /* "utils.pxd":2925
 *     for i in range(size):
 *         res_ptr[i] = max(arr_ptr[i], value) + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_min_arr(np.ndarray arr1, np.ndarray arr2, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":2903
 *     return res
 * 
 * cdef inline np.ndarray arr_max(np.ndarray arr, np.npy_int64 value, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the maximum values between the ndarray and the 'value' `<'ndarray[int64]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.arr_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2927
 *     return res
 * 
 * cdef inline np.ndarray arr_min_arr(np.ndarray arr1, np.ndarray arr2, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the minimum values between two ndarrays `<'ndarray[int64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_min_arr(PyArrayObject *__pyx_v_arr1, PyArrayObject *__pyx_v_arr2, struct __pyx_opt_args_7cytimes_5utils_arr_min_arr *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr1_ptr;
  npy_int64 *__pyx_v_arr2_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  npy_int64 __pyx_t_8;
  npy_int64 __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_min_arr", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr1);
  __Pyx_INCREF((PyObject *)__pyx_v_arr2);

  /* "utils.pxd":2937
 *     """
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]             # <<<<<<<<<<<<<<
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot compare ndarrays with different shapes.")
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr1)[0]);

  /* "utils.pxd":2938
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:             # <<<<<<<<<<<<<<
 *         raise ValueError("cannot compare ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  __pyx_t_1 = (__pyx_v_size != (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr2)[0]));
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":2939
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot compare ndarrays with different shapes.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2939, __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(5, 2939, __pyx_L1_error)

    /* "utils.pxd":2938
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:             # <<<<<<<<<<<<<<
 *         raise ValueError("cannot compare ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  }

  /* "utils.pxd":2940
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot compare ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)             # <<<<<<<<<<<<<<
 *     arr2 = arr_assure_int64_like(arr2)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr1, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "utils.pxd":2941
 *         raise ValueError("cannot compare ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr2, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "utils.pxd":2945
 *     # Compute
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_2 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 2945, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "utils.pxd":2946
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":2947
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 *         np.npy_int64 i
 */
  __pyx_v_arr1_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr1));

  /* "utils.pxd":2948
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr2_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr2));

  /* "utils.pxd":2951
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = min(arr1_ptr[i], arr2_ptr[i]) + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":2952
 * 
 *     for i in range(size):
 *         res_ptr[i] = min(arr1_ptr[i], arr2_ptr[i]) + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_7 = (__pyx_v_arr2_ptr[__pyx_v_i]);
    __pyx_t_8 = (__pyx_v_arr1_ptr[__pyx_v_i]);
    __pyx_t_1 = (__pyx_t_7 < __pyx_t_8);
    if (__pyx_t_1) {
      __pyx_t_9 = __pyx_t_7;
    } else {
      __pyx_t_9 = __pyx_t_8;
    }
    (__pyx_v_res_ptr[__pyx_v_i]) = (__pyx_t_9 + __pyx_v_offset);
  }

  /* "utils.pxd":2953
 *     for i in range(size):
 *         res_ptr[i] = min(arr1_ptr[i], arr2_ptr[i]) + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_max_arr(np.ndarray arr1, np.ndarray arr2, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":2927
 *     return res
 * 
 * cdef inline np.ndarray arr_min_arr(np.ndarray arr1, np.ndarray arr2, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the minimum values between two ndarrays `<'ndarray[int64]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.arr_min_arr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr1);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr2);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2955
 *     return res
 * 
 * cdef inline np.ndarray arr_max_arr(np.ndarray arr1, np.ndarray arr2, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the maxmimum values between two ndarrays `<'ndarray[int64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_max_arr(PyArrayObject *__pyx_v_arr1, PyArrayObject *__pyx_v_arr2, struct __pyx_opt_args_7cytimes_5utils_arr_max_arr *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr1_ptr;
  npy_int64 *__pyx_v_arr2_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  npy_int64 __pyx_t_8;
  npy_int64 __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_max_arr", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr1);
  __Pyx_INCREF((PyObject *)__pyx_v_arr2);

  /* "utils.pxd":2965
 *     """
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]             # <<<<<<<<<<<<<<
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot compare ndarrays with different shapes.")
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr1)[0]);

  /* "utils.pxd":2966
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:             # <<<<<<<<<<<<<<
 *         raise ValueError("cannot compare ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  __pyx_t_1 = (__pyx_v_size != (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr2)[0]));
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":2967
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot compare ndarrays with different shapes.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2967, __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(5, 2967, __pyx_L1_error)

    /* "utils.pxd":2966
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:             # <<<<<<<<<<<<<<
 *         raise ValueError("cannot compare ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  }

  /* "utils.pxd":2968
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot compare ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)             # <<<<<<<<<<<<<<
 *     arr2 = arr_assure_int64_like(arr2)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr1, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "utils.pxd":2969
 *         raise ValueError("cannot compare ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr2, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "utils.pxd":2973
 *     # Compute
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_2 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 2973, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "utils.pxd":2974
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":2975
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 *         np.npy_int64 i
 */
  __pyx_v_arr1_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr1));

  /* "utils.pxd":2976
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr2_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr2));

  /* "utils.pxd":2979
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = max(arr1_ptr[i], arr2_ptr[i]) + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":2980
 * 
 *     for i in range(size):
 *         res_ptr[i] = max(arr1_ptr[i], arr2_ptr[i]) + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_7 = (__pyx_v_arr2_ptr[__pyx_v_i]);
    __pyx_t_8 = (__pyx_v_arr1_ptr[__pyx_v_i]);
    __pyx_t_1 = (__pyx_t_7 > __pyx_t_8);
    if (__pyx_t_1) {
      __pyx_t_9 = __pyx_t_7;
    } else {
      __pyx_t_9 = __pyx_t_8;
    }
    (__pyx_v_res_ptr[__pyx_v_i]) = (__pyx_t_9 + __pyx_v_offset);
  }

  /* "utils.pxd":2981
 *     for i in range(size):
 *         res_ptr[i] = max(arr1_ptr[i], arr2_ptr[i]) + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * # . arithmetic
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":2955
 *     return res
 * 
 * cdef inline np.ndarray arr_max_arr(np.ndarray arr1, np.ndarray arr2, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the maxmimum values between two ndarrays `<'ndarray[int64]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.arr_max_arr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr1);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr2);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":2984
 * 
 * # . arithmetic
 * cdef inline np.ndarray arr_abs(np.ndarray arr, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Compute the absolute values of the ndarray `<'ndarray[int64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_abs(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_arr_abs *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_v;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp __pyx_t_2[1];
  npy_int64 __pyx_t_3;
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_abs", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":2994
 *     """
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":2998
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":2999
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_2[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_2, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 2999, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":3000
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i, v
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3001
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, v
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3004
 *         np.npy_int64 i, v
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         v = arr_ptr[i]
 *         if v < 0:
 */
  __pyx_t_3 = __pyx_v_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "utils.pxd":3005
 * 
 *     for i in range(size):
 *         v = arr_ptr[i]             # <<<<<<<<<<<<<<
 *         if v < 0:
 *             res_ptr[i] = -v + offset
 */
    __pyx_v_v = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "utils.pxd":3006
 *     for i in range(size):
 *         v = arr_ptr[i]
 *         if v < 0:             # <<<<<<<<<<<<<<
 *             res_ptr[i] = -v + offset
 *         else:
 */
    __pyx_t_6 = (__pyx_v_v < 0);
    if (__pyx_t_6) {

      /* "utils.pxd":3007
 *         v = arr_ptr[i]
 *         if v < 0:
 *             res_ptr[i] = -v + offset             # <<<<<<<<<<<<<<
 *         else:
 *             res_ptr[i] = v + offset
 */
      (__pyx_v_res_ptr[__pyx_v_i]) = ((-__pyx_v_v) + __pyx_v_offset);

      /* "utils.pxd":3006
 *     for i in range(size):
 *         v = arr_ptr[i]
 *         if v < 0:             # <<<<<<<<<<<<<<
 *             res_ptr[i] = -v + offset
 *         else:
 */
      goto __pyx_L5;
    }

    /* "utils.pxd":3009
 *             res_ptr[i] = -v + offset
 *         else:
 *             res_ptr[i] = v + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    /*else*/ {
      (__pyx_v_res_ptr[__pyx_v_i]) = (__pyx_v_v + __pyx_v_offset);
    }
    __pyx_L5:;
  }

  /* "utils.pxd":3010
 *         else:
 *             res_ptr[i] = v + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_add(np.ndarray arr, np.npy_int64 value):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":2984
 * 
 * # . arithmetic
 * cdef inline np.ndarray arr_abs(np.ndarray arr, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Compute the absolute values of the ndarray `<'ndarray[int64]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.arr_abs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3012
 *     return res
 * 
 * cdef inline np.ndarray arr_add(np.ndarray arr, np.npy_int64 value):             # <<<<<<<<<<<<<<
 *     """Add the value to the ndarray `<'ndarray[int64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_add(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_value) {
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_add", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3022
 *     """
 *     # Fast-path
 *     if value == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  __pyx_t_1 = (__pyx_v_value == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":3023
 *     # Fast-path
 *     if value == 0:
 *         return arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Validate
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3023, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "utils.pxd":3022
 *     """
 *     # Fast-path
 *     if value == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  }

  /* "utils.pxd":3026
 * 
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3026, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "utils.pxd":3030
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3031
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_2 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3031, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "utils.pxd":3032
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3033
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3036
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr_ptr[i] + value
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":3037
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] + value             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_value);
  }

  /* "utils.pxd":3038
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] + value
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_mul(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3012
 *     return res
 * 
 * cdef inline np.ndarray arr_add(np.ndarray arr, np.npy_int64 value):             # <<<<<<<<<<<<<<
 *     """Add the value to the ndarray `<'ndarray[int64]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.arr_add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3040
 *     return res
 * 
 * cdef inline np.ndarray arr_mul(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Multiply the values of the ndarray by the factor `<'ndarray[int64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_mul(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_arr_mul *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  npy_intp __pyx_t_4[1];
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_mul", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3050
 *     """
 *     # Fast-path
 *     if factor == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  __pyx_t_2 = (__pyx_v_factor == 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_offset == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "utils.pxd":3051
 *     # Fast-path
 *     if factor == 1 and offset == 0:
 *         return arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Validate
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3051, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":3050
 *     """
 *     # Fast-path
 *     if factor == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  }

  /* "utils.pxd":3054
 * 
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3054, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "utils.pxd":3058
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3059
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_4[0] = __pyx_v_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_4, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3059, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "utils.pxd":3060
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3061
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3064
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr_ptr[i] * factor + offset
 *     return res
 */
  __pyx_t_5 = __pyx_v_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "utils.pxd":3065
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] * factor + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (((__pyx_v_arr_ptr[__pyx_v_i]) * __pyx_v_factor) + __pyx_v_offset);
  }

  /* "utils.pxd":3066
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] * factor + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_div(np.ndarray arr, np.npy_float64 factor, np.npy_float64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3040
 *     return res
 * 
 * cdef inline np.ndarray arr_mul(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Multiply the values of the ndarray by the factor `<'ndarray[int64]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.arr_mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3068
 *     return res
 * 
 * cdef inline np.ndarray arr_div(np.ndarray arr, np.npy_float64 factor, np.npy_float64 offset=0):             # <<<<<<<<<<<<<<
 *     """Divides the values of the ndarray by the factor, handling negative
 *     numbers accoring to Python's division semantics `<'ndarray[float64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_div(PyArrayObject *__pyx_v_arr, npy_float64 __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_arr_div *__pyx_optional_args) {
  npy_float64 __pyx_v_offset = ((npy_float64)0.0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_float64 *__pyx_v_res_ptr;
  npy_float64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  npy_intp __pyx_t_4[1];
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_div", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3079
 *     """
 *     # Fast-path
 *     if factor == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_float64(arr)
 * 
 */
  __pyx_t_2 = (__pyx_v_factor == 1.0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_offset == 0.0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "utils.pxd":3080
 *     # Fast-path
 *     if factor == 1 and offset == 0:
 *         return arr_assure_float64(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Validate
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_float64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3080, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":3079
 *     """
 *     # Fast-path
 *     if factor == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_float64(arr)
 * 
 */
  }

  /* "utils.pxd":3083
 * 
 *     # Validate
 *     arr = arr_assure_float64(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_float64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "utils.pxd":3087
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_FLOAT64, 0)
 *         np.npy_float64* res_ptr = <np.npy_float64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3088
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_FLOAT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_float64* res_ptr = <np.npy_float64*> np.PyArray_DATA(res)
 *         np.npy_float64* arr_ptr = <np.npy_float64*> np.PyArray_DATA(arr)
 */
  __pyx_t_4[0] = __pyx_v_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_4, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3088, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "utils.pxd":3089
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_FLOAT64, 0)
 *         np.npy_float64* res_ptr = <np.npy_float64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_float64* arr_ptr = <np.npy_float64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_float64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3090
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_FLOAT64, 0)
 *         np.npy_float64* res_ptr = <np.npy_float64*> np.PyArray_DATA(res)
 *         np.npy_float64* arr_ptr = <np.npy_float64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_float64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3094
 * 
 *     with cython.cdivision(True):
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             res_ptr[i] = arr_ptr[i] / factor + offset
 *     return res
 */
  __pyx_t_5 = __pyx_v_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "utils.pxd":3095
 *     with cython.cdivision(True):
 *         for i in range(size):
 *             res_ptr[i] = arr_ptr[i] / factor + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (((__pyx_v_arr_ptr[__pyx_v_i]) / __pyx_v_factor) + __pyx_v_offset);
  }

  /* "utils.pxd":3096
 *         for i in range(size):
 *             res_ptr[i] = arr_ptr[i] / factor + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_mod(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3068
 *     return res
 * 
 * cdef inline np.ndarray arr_div(np.ndarray arr, np.npy_float64 factor, np.npy_float64 offset=0):             # <<<<<<<<<<<<<<
 *     """Divides the values of the ndarray by the factor, handling negative
 *     numbers accoring to Python's division semantics `<'ndarray[float64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.arr_div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3098
 *     return res
 * 
 * cdef inline np.ndarray arr_mod(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Computes the modulo of the values of the ndarray by the
 *     factor, handling negative numbers according to Python's modulo
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_mod(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_arr_mod *__pyx_optional_args) {
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  int __pyx_v_neg_f;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_r;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_mod", 0);
  if (__pyx_optional_args) {
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3110
 *     """
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero in 'arr_mod()'.")
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":3111
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero in 'arr_mod()'.")
 * 
 */
  __pyx_t_2 = (__pyx_v_factor == 0);
  if (unlikely(__pyx_t_2)) {

    /* "utils.pxd":3112
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero in 'arr_mod()'.")             # <<<<<<<<<<<<<<
 * 
 *     # Prepare for computation
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3112, __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(5, 3112, __pyx_L1_error)

    /* "utils.pxd":3111
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero in 'arr_mod()'.")
 * 
 */
  }

  /* "utils.pxd":3116
 *     # Prepare for computation
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3117
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3117, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":3118
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3119
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         bint neg_f = factor < 0
 *         np.npy_int64 i, r
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3120
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, r
 * 
 */
  __pyx_v_neg_f = (__pyx_v_factor < 0);

  /* "utils.pxd":3124
 * 
 *     with cython.cdivision(True):
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             r = arr_ptr[i] % factor
 *             if r != 0:
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":3125
 *     with cython.cdivision(True):
 *         for i in range(size):
 *             r = arr_ptr[i] % factor             # <<<<<<<<<<<<<<
 *             if r != 0:
 *                 if not neg_f:
 */
    __pyx_v_r = ((__pyx_v_arr_ptr[__pyx_v_i]) % __pyx_v_factor);

    /* "utils.pxd":3126
 *         for i in range(size):
 *             r = arr_ptr[i] % factor
 *             if r != 0:             # <<<<<<<<<<<<<<
 *                 if not neg_f:
 *                     if r < 0:
 */
    __pyx_t_2 = (__pyx_v_r != 0);
    if (__pyx_t_2) {

      /* "utils.pxd":3127
 *             r = arr_ptr[i] % factor
 *             if r != 0:
 *                 if not neg_f:             # <<<<<<<<<<<<<<
 *                     if r < 0:
 *                         r += factor
 */
      __pyx_t_2 = (!__pyx_v_neg_f);
      if (__pyx_t_2) {

        /* "utils.pxd":3128
 *             if r != 0:
 *                 if not neg_f:
 *                     if r < 0:             # <<<<<<<<<<<<<<
 *                         r += factor
 *                 else:
 */
        __pyx_t_2 = (__pyx_v_r < 0);
        if (__pyx_t_2) {

          /* "utils.pxd":3129
 *                 if not neg_f:
 *                     if r < 0:
 *                         r += factor             # <<<<<<<<<<<<<<
 *                 else:
 *                     if r > 0:
 */
          __pyx_v_r = (__pyx_v_r + __pyx_v_factor);

          /* "utils.pxd":3128
 *             if r != 0:
 *                 if not neg_f:
 *                     if r < 0:             # <<<<<<<<<<<<<<
 *                         r += factor
 *                 else:
 */
        }

        /* "utils.pxd":3127
 *             r = arr_ptr[i] % factor
 *             if r != 0:
 *                 if not neg_f:             # <<<<<<<<<<<<<<
 *                     if r < 0:
 *                         r += factor
 */
        goto __pyx_L7;
      }

      /* "utils.pxd":3131
 *                         r += factor
 *                 else:
 *                     if r > 0:             # <<<<<<<<<<<<<<
 *                         r += factor
 *             res_ptr[i] = r
 */
      /*else*/ {
        __pyx_t_2 = (__pyx_v_r > 0);
        if (__pyx_t_2) {

          /* "utils.pxd":3132
 *                 else:
 *                     if r > 0:
 *                         r += factor             # <<<<<<<<<<<<<<
 *             res_ptr[i] = r
 *     return res
 */
          __pyx_v_r = (__pyx_v_r + __pyx_v_factor);

          /* "utils.pxd":3131
 *                         r += factor
 *                 else:
 *                     if r > 0:             # <<<<<<<<<<<<<<
 *                         r += factor
 *             res_ptr[i] = r
 */
        }
      }
      __pyx_L7:;

      /* "utils.pxd":3126
 *         for i in range(size):
 *             r = arr_ptr[i] % factor
 *             if r != 0:             # <<<<<<<<<<<<<<
 *                 if not neg_f:
 *                     if r < 0:
 */
    }

    /* "utils.pxd":3133
 *                     if r > 0:
 *                         r += factor
 *             res_ptr[i] = r             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_v_r;
  }

  /* "utils.pxd":3134
 *                         r += factor
 *             res_ptr[i] = r
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_round_div(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3098
 *     return res
 * 
 * cdef inline np.ndarray arr_mod(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Computes the modulo of the values of the ndarray by the
 *     factor, handling negative numbers according to Python's modulo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.arr_mod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3136
 *     return res
 * 
 * cdef inline np.ndarray arr_round_div(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Divides the values of the ndarray by the factor and rounds to the
 *     nearest integers (half away from zero), handling negative numbers
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_round_div(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_arr_round_div *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  int __pyx_v_neg_f;
  npy_int64 __pyx_v_abs_f;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_n;
  npy_int64 __pyx_v_q;
  npy_int64 __pyx_v_r;
  npy_int64 __pyx_v_abs_r;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  npy_intp __pyx_t_4[1];
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  npy_int64 __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_round_div", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3148
 *     """
 *     # Fast-path
 *     if factor == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  __pyx_t_2 = (__pyx_v_factor == 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_offset == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "utils.pxd":3149
 *     # Fast-path
 *     if factor == 1 and offset == 0:
 *         return arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Validate
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":3148
 *     """
 *     # Fast-path
 *     if factor == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  }

  /* "utils.pxd":3152
 * 
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.arr_round_div()'.")
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "utils.pxd":3153
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.arr_round_div()'.")
 * 
 */
  __pyx_t_1 = (__pyx_v_factor == 0);
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":3154
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.arr_round_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3154, __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(5, 3154, __pyx_L1_error)

    /* "utils.pxd":3153
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.arr_round_div()'.")
 * 
 */
  }

  /* "utils.pxd":3158
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3159
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_4[0] = __pyx_v_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_4, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3159, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "utils.pxd":3160
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3161
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         bint neg_f = factor < 0
 *         np.npy_int64 abs_f = -factor if neg_f else factor
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3162
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0             # <<<<<<<<<<<<<<
 *         np.npy_int64 abs_f = -factor if neg_f else factor
 *         np.npy_int64 i, n, q, r, abs_r
 */
  __pyx_v_neg_f = (__pyx_v_factor < 0);

  /* "utils.pxd":3163
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0
 *         np.npy_int64 abs_f = -factor if neg_f else factor             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, n, q, r, abs_r
 * 
 */
  if (__pyx_v_neg_f) {
    __pyx_t_5 = (-__pyx_v_factor);
  } else {
    __pyx_t_5 = __pyx_v_factor;
  }
  __pyx_v_abs_f = __pyx_t_5;

  /* "utils.pxd":3167
 * 
 *     with cython.cdivision(True):
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             n = arr_ptr[i]
 *             q = n // factor
 */
  __pyx_t_5 = __pyx_v_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "utils.pxd":3168
 *     with cython.cdivision(True):
 *         for i in range(size):
 *             n = arr_ptr[i]             # <<<<<<<<<<<<<<
 *             q = n // factor
 *             r = n % factor
 */
    __pyx_v_n = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "utils.pxd":3169
 *         for i in range(size):
 *             n = arr_ptr[i]
 *             q = n // factor             # <<<<<<<<<<<<<<
 *             r = n % factor
 *             abs_r = -r if r < 0 else r
 */
    __pyx_v_q = (__pyx_v_n / __pyx_v_factor);

    /* "utils.pxd":3170
 *             n = arr_ptr[i]
 *             q = n // factor
 *             r = n % factor             # <<<<<<<<<<<<<<
 *             abs_r = -r if r < 0 else r
 *             if abs_r * 2 >= abs_f:
 */
    __pyx_v_r = (__pyx_v_n % __pyx_v_factor);

    /* "utils.pxd":3171
 *             q = n // factor
 *             r = n % factor
 *             abs_r = -r if r < 0 else r             # <<<<<<<<<<<<<<
 *             if abs_r * 2 >= abs_f:
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):
 */
    __pyx_t_1 = (__pyx_v_r < 0);
    if (__pyx_t_1) {
      __pyx_t_8 = (-__pyx_v_r);
    } else {
      __pyx_t_8 = __pyx_v_r;
    }
    __pyx_v_abs_r = __pyx_t_8;

    /* "utils.pxd":3172
 *             r = n % factor
 *             abs_r = -r if r < 0 else r
 *             if abs_r * 2 >= abs_f:             # <<<<<<<<<<<<<<
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):
 *                     q += 1
 */
    __pyx_t_1 = ((__pyx_v_abs_r * 2) >= __pyx_v_abs_f);
    if (__pyx_t_1) {

      /* "utils.pxd":3173
 *             abs_r = -r if r < 0 else r
 *             if abs_r * 2 >= abs_f:
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):             # <<<<<<<<<<<<<<
 *                     q += 1
 *                 else:
 */
      __pyx_t_2 = (!__pyx_v_neg_f);
      if (!__pyx_t_2) {
        goto __pyx_L12_next_or;
      } else {
      }
      __pyx_t_2 = (__pyx_v_n >= 0);
      if (!__pyx_t_2) {
      } else {
        __pyx_t_1 = __pyx_t_2;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_L12_next_or:;
      if (__pyx_v_neg_f) {
      } else {
        __pyx_t_1 = __pyx_v_neg_f;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_2 = (__pyx_v_n < 0);
      __pyx_t_1 = __pyx_t_2;
      __pyx_L11_bool_binop_done:;
      if (__pyx_t_1) {

        /* "utils.pxd":3174
 *             if abs_r * 2 >= abs_f:
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):
 *                     q += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     q -= 1
 */
        __pyx_v_q = (__pyx_v_q + 1);

        /* "utils.pxd":3173
 *             abs_r = -r if r < 0 else r
 *             if abs_r * 2 >= abs_f:
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):             # <<<<<<<<<<<<<<
 *                     q += 1
 *                 else:
 */
        goto __pyx_L10;
      }

      /* "utils.pxd":3176
 *                     q += 1
 *                 else:
 *                     q -= 1             # <<<<<<<<<<<<<<
 *             res_ptr[i] = q + offset
 *     return res
 */
      /*else*/ {
        __pyx_v_q = (__pyx_v_q - 1);
      }
      __pyx_L10:;

      /* "utils.pxd":3172
 *             r = n % factor
 *             abs_r = -r if r < 0 else r
 *             if abs_r * 2 >= abs_f:             # <<<<<<<<<<<<<<
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):
 *                     q += 1
 */
    }

    /* "utils.pxd":3177
 *                 else:
 *                     q -= 1
 *             res_ptr[i] = q + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__pyx_v_q + __pyx_v_offset);
  }

  /* "utils.pxd":3178
 *                     q -= 1
 *             res_ptr[i] = q + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_ceil_div(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3136
 *     return res
 * 
 * cdef inline np.ndarray arr_round_div(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Divides the values of the ndarray by the factor and rounds to the
 *     nearest integers (half away from zero), handling negative numbers
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.arr_round_div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3180
 *     return res
 * 
 * cdef inline np.ndarray arr_ceil_div(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Divides the values of the ndarray by the factor and rounds
 *     up to the nearest integers, handling negative numbers accoring
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_ceil_div(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_arr_ceil_div *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  int __pyx_v_neg_f;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_n;
  npy_int64 __pyx_v_q;
  npy_int64 __pyx_v_r;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  npy_intp __pyx_t_4[1];
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_ceil_div", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3192
 *     """
 *     # Fast-path
 *     if factor == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  __pyx_t_2 = (__pyx_v_factor == 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_offset == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "utils.pxd":3193
 *     # Fast-path
 *     if factor == 1 and offset == 0:
 *         return arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Validate
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":3192
 *     """
 *     # Fast-path
 *     if factor == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  }

  /* "utils.pxd":3196
 * 
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.arr_ceil_div()'.")
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "utils.pxd":3197
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.arr_ceil_div()'.")
 * 
 */
  __pyx_t_1 = (__pyx_v_factor == 0);
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":3198
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.arr_ceil_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3198, __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(5, 3198, __pyx_L1_error)

    /* "utils.pxd":3197
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.arr_ceil_div()'.")
 * 
 */
  }

  /* "utils.pxd":3202
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3203
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_4[0] = __pyx_v_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_4, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3203, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "utils.pxd":3204
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3205
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         bint neg_f = factor < 0
 *         np.npy_int64 i, n, q, r
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3206
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, n, q, r
 * 
 */
  __pyx_v_neg_f = (__pyx_v_factor < 0);

  /* "utils.pxd":3210
 * 
 *     with cython.cdivision(True):
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             n = arr_ptr[i]
 *             q = n // factor
 */
  __pyx_t_5 = __pyx_v_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "utils.pxd":3211
 *     with cython.cdivision(True):
 *         for i in range(size):
 *             n = arr_ptr[i]             # <<<<<<<<<<<<<<
 *             q = n // factor
 *             r = n % factor
 */
    __pyx_v_n = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "utils.pxd":3212
 *         for i in range(size):
 *             n = arr_ptr[i]
 *             q = n // factor             # <<<<<<<<<<<<<<
 *             r = n % factor
 *             if r != 0:
 */
    __pyx_v_q = (__pyx_v_n / __pyx_v_factor);

    /* "utils.pxd":3213
 *             n = arr_ptr[i]
 *             q = n // factor
 *             r = n % factor             # <<<<<<<<<<<<<<
 *             if r != 0:
 *                 if not neg_f:
 */
    __pyx_v_r = (__pyx_v_n % __pyx_v_factor);

    /* "utils.pxd":3214
 *             q = n // factor
 *             r = n % factor
 *             if r != 0:             # <<<<<<<<<<<<<<
 *                 if not neg_f:
 *                     if n > 0:
 */
    __pyx_t_1 = (__pyx_v_r != 0);
    if (__pyx_t_1) {

      /* "utils.pxd":3215
 *             r = n % factor
 *             if r != 0:
 *                 if not neg_f:             # <<<<<<<<<<<<<<
 *                     if n > 0:
 *                         q += 1
 */
      __pyx_t_1 = (!__pyx_v_neg_f);
      if (__pyx_t_1) {

        /* "utils.pxd":3216
 *             if r != 0:
 *                 if not neg_f:
 *                     if n > 0:             # <<<<<<<<<<<<<<
 *                         q += 1
 *                 else:
 */
        __pyx_t_1 = (__pyx_v_n > 0);
        if (__pyx_t_1) {

          /* "utils.pxd":3217
 *                 if not neg_f:
 *                     if n > 0:
 *                         q += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     if n < 0:
 */
          __pyx_v_q = (__pyx_v_q + 1);

          /* "utils.pxd":3216
 *             if r != 0:
 *                 if not neg_f:
 *                     if n > 0:             # <<<<<<<<<<<<<<
 *                         q += 1
 *                 else:
 */
        }

        /* "utils.pxd":3215
 *             r = n % factor
 *             if r != 0:
 *                 if not neg_f:             # <<<<<<<<<<<<<<
 *                     if n > 0:
 *                         q += 1
 */
        goto __pyx_L10;
      }

      /* "utils.pxd":3219
 *                         q += 1
 *                 else:
 *                     if n < 0:             # <<<<<<<<<<<<<<
 *                         q += 1
 *             res_ptr[i] = q + offset
 */
      /*else*/ {
        __pyx_t_1 = (__pyx_v_n < 0);
        if (__pyx_t_1) {

          /* "utils.pxd":3220
 *                 else:
 *                     if n < 0:
 *                         q += 1             # <<<<<<<<<<<<<<
 *             res_ptr[i] = q + offset
 *     return res
 */
          __pyx_v_q = (__pyx_v_q + 1);

          /* "utils.pxd":3219
 *                         q += 1
 *                 else:
 *                     if n < 0:             # <<<<<<<<<<<<<<
 *                         q += 1
 *             res_ptr[i] = q + offset
 */
        }
      }
      __pyx_L10:;

      /* "utils.pxd":3214
 *             q = n // factor
 *             r = n % factor
 *             if r != 0:             # <<<<<<<<<<<<<<
 *                 if not neg_f:
 *                     if n > 0:
 */
    }

    /* "utils.pxd":3221
 *                     if n < 0:
 *                         q += 1
 *             res_ptr[i] = q + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__pyx_v_q + __pyx_v_offset);
  }

  /* "utils.pxd":3222
 *                         q += 1
 *             res_ptr[i] = q + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_floor_div(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3180
 *     return res
 * 
 * cdef inline np.ndarray arr_ceil_div(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Divides the values of the ndarray by the factor and rounds
 *     up to the nearest integers, handling negative numbers accoring
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.arr_ceil_div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3224
 *     return res
 * 
 * cdef inline np.ndarray arr_floor_div(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Divides the values of the ndarray by the factor and rounds down
 *     to the nearest integers, handling negative numbers accoring to
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_floor_div(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_arr_floor_div *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  int __pyx_v_neg_f;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_n;
  npy_int64 __pyx_v_q;
  npy_int64 __pyx_v_r;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  npy_intp __pyx_t_4[1];
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_floor_div", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3236
 *     """
 *     # Fast-path
 *     if factor == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  __pyx_t_2 = (__pyx_v_factor == 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_offset == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "utils.pxd":3237
 *     # Fast-path
 *     if factor == 1 and offset == 0:
 *         return arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Validate
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":3236
 *     """
 *     # Fast-path
 *     if factor == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  }

  /* "utils.pxd":3240
 * 
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.arr_floor_div()'.")
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "utils.pxd":3241
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.arr_floor_div()'.")
 * 
 */
  __pyx_t_1 = (__pyx_v_factor == 0);
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":3242
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.arr_floor_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3242, __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(5, 3242, __pyx_L1_error)

    /* "utils.pxd":3241
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("division by zero for 'utils.arr_floor_div()'.")
 * 
 */
  }

  /* "utils.pxd":3246
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3247
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_4[0] = __pyx_v_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_4, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3247, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "utils.pxd":3248
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3249
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         bint neg_f = factor < 0
 *         np.npy_int64 i, n, q, r
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3250
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, n, q, r
 * 
 */
  __pyx_v_neg_f = (__pyx_v_factor < 0);

  /* "utils.pxd":3254
 * 
 *     with cython.cdivision(True):
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             n = arr_ptr[i]
 *             q = n // factor
 */
  __pyx_t_5 = __pyx_v_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "utils.pxd":3255
 *     with cython.cdivision(True):
 *         for i in range(size):
 *             n = arr_ptr[i]             # <<<<<<<<<<<<<<
 *             q = n // factor
 *             r = n % factor
 */
    __pyx_v_n = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "utils.pxd":3256
 *         for i in range(size):
 *             n = arr_ptr[i]
 *             q = n // factor             # <<<<<<<<<<<<<<
 *             r = n % factor
 *             if r != 0:
 */
    __pyx_v_q = (__pyx_v_n / __pyx_v_factor);

    /* "utils.pxd":3257
 *             n = arr_ptr[i]
 *             q = n // factor
 *             r = n % factor             # <<<<<<<<<<<<<<
 *             if r != 0:
 *                 if not neg_f:
 */
    __pyx_v_r = (__pyx_v_n % __pyx_v_factor);

    /* "utils.pxd":3258
 *             q = n // factor
 *             r = n % factor
 *             if r != 0:             # <<<<<<<<<<<<<<
 *                 if not neg_f:
 *                     if n < 0:
 */
    __pyx_t_1 = (__pyx_v_r != 0);
    if (__pyx_t_1) {

      /* "utils.pxd":3259
 *             r = n % factor
 *             if r != 0:
 *                 if not neg_f:             # <<<<<<<<<<<<<<
 *                     if n < 0:
 *                         q -= 1
 */
      __pyx_t_1 = (!__pyx_v_neg_f);
      if (__pyx_t_1) {

        /* "utils.pxd":3260
 *             if r != 0:
 *                 if not neg_f:
 *                     if n < 0:             # <<<<<<<<<<<<<<
 *                         q -= 1
 *                 else:
 */
        __pyx_t_1 = (__pyx_v_n < 0);
        if (__pyx_t_1) {

          /* "utils.pxd":3261
 *                 if not neg_f:
 *                     if n < 0:
 *                         q -= 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     if n > 0:
 */
          __pyx_v_q = (__pyx_v_q - 1);

          /* "utils.pxd":3260
 *             if r != 0:
 *                 if not neg_f:
 *                     if n < 0:             # <<<<<<<<<<<<<<
 *                         q -= 1
 *                 else:
 */
        }

        /* "utils.pxd":3259
 *             r = n % factor
 *             if r != 0:
 *                 if not neg_f:             # <<<<<<<<<<<<<<
 *                     if n < 0:
 *                         q -= 1
 */
        goto __pyx_L10;
      }

      /* "utils.pxd":3263
 *                         q -= 1
 *                 else:
 *                     if n > 0:             # <<<<<<<<<<<<<<
 *                         q -= 1
 *             res_ptr[i] = q + offset
 */
      /*else*/ {
        __pyx_t_1 = (__pyx_v_n > 0);
        if (__pyx_t_1) {

          /* "utils.pxd":3264
 *                 else:
 *                     if n > 0:
 *                         q -= 1             # <<<<<<<<<<<<<<
 *             res_ptr[i] = q + offset
 *     return res
 */
          __pyx_v_q = (__pyx_v_q - 1);

          /* "utils.pxd":3263
 *                         q -= 1
 *                 else:
 *                     if n > 0:             # <<<<<<<<<<<<<<
 *                         q -= 1
 *             res_ptr[i] = q + offset
 */
        }
      }
      __pyx_L10:;

      /* "utils.pxd":3258
 *             q = n // factor
 *             r = n % factor
 *             if r != 0:             # <<<<<<<<<<<<<<
 *                 if not neg_f:
 *                     if n < 0:
 */
    }

    /* "utils.pxd":3265
 *                     if n > 0:
 *                         q -= 1
 *             res_ptr[i] = q + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__pyx_v_q + __pyx_v_offset);
  }

  /* "utils.pxd":3266
 *                         q -= 1
 *             res_ptr[i] = q + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_round_to_mul(np.ndarray arr, np.npy_int64 factor, np.npy_int64 multiple = 0, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3224
 *     return res
 * 
 * cdef inline np.ndarray arr_floor_div(np.ndarray arr, np.npy_int64 factor, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Divides the values of the ndarray by the factor and rounds down
 *     to the nearest integers, handling negative numbers accoring to
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.arr_floor_div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3268
 *     return res
 * 
 * cdef inline np.ndarray arr_round_to_mul(np.ndarray arr, np.npy_int64 factor, np.npy_int64 multiple = 0, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Round to multiple. Divides the values of the ndarray by the factor and rounds
 *     to the nearest integers (half away from zero), handling negative numbers accoring
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_round_to_mul(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_arr_round_to_mul *__pyx_optional_args) {
  npy_int64 __pyx_v_multiple = ((npy_int64)0);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  int __pyx_v_neg_f;
  npy_int64 __pyx_v_abs_f;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_n;
  npy_int64 __pyx_v_q;
  npy_int64 __pyx_v_r;
  npy_int64 __pyx_v_abs_r;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  npy_intp __pyx_t_4[1];
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  npy_int64 __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_round_to_mul", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_multiple = __pyx_optional_args->multiple;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3282
 *     """
 *     # Fast-path
 *     if factor == 1 and multiple == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  __pyx_t_2 = (__pyx_v_factor == 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_multiple == 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_offset == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "utils.pxd":3283
 *     # Fast-path
 *     if factor == 1 and multiple == 1 and offset == 0:
 *         return arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Validate
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":3282
 *     """
 *     # Fast-path
 *     if factor == 1 and multiple == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  }

  /* "utils.pxd":3286
 * 
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot round to multiple 0.")
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "utils.pxd":3287
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("cannot round to multiple 0.")
 *     if multiple == 0:
 */
  __pyx_t_1 = (__pyx_v_factor == 0);
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":3288
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot round to multiple 0.")             # <<<<<<<<<<<<<<
 *     if multiple == 0:
 *         multiple = factor
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3288, __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(5, 3288, __pyx_L1_error)

    /* "utils.pxd":3287
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("cannot round to multiple 0.")
 *     if multiple == 0:
 */
  }

  /* "utils.pxd":3289
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot round to multiple 0.")
 *     if multiple == 0:             # <<<<<<<<<<<<<<
 *         multiple = factor
 * 
 */
  __pyx_t_1 = (__pyx_v_multiple == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":3290
 *         raise ZeroDivisionError("cannot round to multiple 0.")
 *     if multiple == 0:
 *         multiple = factor             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
    __pyx_v_multiple = __pyx_v_factor;

    /* "utils.pxd":3289
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot round to multiple 0.")
 *     if multiple == 0:             # <<<<<<<<<<<<<<
 *         multiple = factor
 * 
 */
  }

  /* "utils.pxd":3294
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3295
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_4[0] = __pyx_v_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_4, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3295, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "utils.pxd":3296
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3297
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         bint neg_f = factor < 0
 *         np.npy_int64 abs_f = -factor if neg_f else factor
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3298
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0             # <<<<<<<<<<<<<<
 *         np.npy_int64 abs_f = -factor if neg_f else factor
 *         np.npy_int64 i, n, q, r, abs_r
 */
  __pyx_v_neg_f = (__pyx_v_factor < 0);

  /* "utils.pxd":3299
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0
 *         np.npy_int64 abs_f = -factor if neg_f else factor             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, n, q, r, abs_r
 * 
 */
  if (__pyx_v_neg_f) {
    __pyx_t_5 = (-__pyx_v_factor);
  } else {
    __pyx_t_5 = __pyx_v_factor;
  }
  __pyx_v_abs_f = __pyx_t_5;

  /* "utils.pxd":3303
 * 
 *     with cython.cdivision(True):
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             n = arr_ptr[i]
 *             q = n // factor
 */
  __pyx_t_5 = __pyx_v_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "utils.pxd":3304
 *     with cython.cdivision(True):
 *         for i in range(size):
 *             n = arr_ptr[i]             # <<<<<<<<<<<<<<
 *             q = n // factor
 *             r = n % factor
 */
    __pyx_v_n = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "utils.pxd":3305
 *         for i in range(size):
 *             n = arr_ptr[i]
 *             q = n // factor             # <<<<<<<<<<<<<<
 *             r = n % factor
 *             abs_r = -r if r < 0 else r
 */
    __pyx_v_q = (__pyx_v_n / __pyx_v_factor);

    /* "utils.pxd":3306
 *             n = arr_ptr[i]
 *             q = n // factor
 *             r = n % factor             # <<<<<<<<<<<<<<
 *             abs_r = -r if r < 0 else r
 *             if abs_r * 2 >= abs_f:
 */
    __pyx_v_r = (__pyx_v_n % __pyx_v_factor);

    /* "utils.pxd":3307
 *             q = n // factor
 *             r = n % factor
 *             abs_r = -r if r < 0 else r             # <<<<<<<<<<<<<<
 *             if abs_r * 2 >= abs_f:
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):
 */
    __pyx_t_1 = (__pyx_v_r < 0);
    if (__pyx_t_1) {
      __pyx_t_8 = (-__pyx_v_r);
    } else {
      __pyx_t_8 = __pyx_v_r;
    }
    __pyx_v_abs_r = __pyx_t_8;

    /* "utils.pxd":3308
 *             r = n % factor
 *             abs_r = -r if r < 0 else r
 *             if abs_r * 2 >= abs_f:             # <<<<<<<<<<<<<<
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):
 *                     q += 1
 */
    __pyx_t_1 = ((__pyx_v_abs_r * 2) >= __pyx_v_abs_f);
    if (__pyx_t_1) {

      /* "utils.pxd":3309
 *             abs_r = -r if r < 0 else r
 *             if abs_r * 2 >= abs_f:
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):             # <<<<<<<<<<<<<<
 *                     q += 1
 *                 else:
 */
      __pyx_t_2 = (!__pyx_v_neg_f);
      if (!__pyx_t_2) {
        goto __pyx_L14_next_or;
      } else {
      }
      __pyx_t_2 = (__pyx_v_n >= 0);
      if (!__pyx_t_2) {
      } else {
        __pyx_t_1 = __pyx_t_2;
        goto __pyx_L13_bool_binop_done;
      }
      __pyx_L14_next_or:;
      if (__pyx_v_neg_f) {
      } else {
        __pyx_t_1 = __pyx_v_neg_f;
        goto __pyx_L13_bool_binop_done;
      }
      __pyx_t_2 = (__pyx_v_n < 0);
      __pyx_t_1 = __pyx_t_2;
      __pyx_L13_bool_binop_done:;
      if (__pyx_t_1) {

        /* "utils.pxd":3310
 *             if abs_r * 2 >= abs_f:
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):
 *                     q += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     q -= 1
 */
        __pyx_v_q = (__pyx_v_q + 1);

        /* "utils.pxd":3309
 *             abs_r = -r if r < 0 else r
 *             if abs_r * 2 >= abs_f:
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):             # <<<<<<<<<<<<<<
 *                     q += 1
 *                 else:
 */
        goto __pyx_L12;
      }

      /* "utils.pxd":3312
 *                     q += 1
 *                 else:
 *                     q -= 1             # <<<<<<<<<<<<<<
 *             res_ptr[i] = q * multiple + offset
 *     return res
 */
      /*else*/ {
        __pyx_v_q = (__pyx_v_q - 1);
      }
      __pyx_L12:;

      /* "utils.pxd":3308
 *             r = n % factor
 *             abs_r = -r if r < 0 else r
 *             if abs_r * 2 >= abs_f:             # <<<<<<<<<<<<<<
 *                 if (not neg_f and n >= 0) or (neg_f and n < 0):
 *                     q += 1
 */
    }

    /* "utils.pxd":3313
 *                 else:
 *                     q -= 1
 *             res_ptr[i] = q * multiple + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((__pyx_v_q * __pyx_v_multiple) + __pyx_v_offset);
  }

  /* "utils.pxd":3314
 *                     q -= 1
 *             res_ptr[i] = q * multiple + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_ceil_to_mul(np.ndarray arr, np.npy_int64 factor, np.npy_int64 multiple = 0, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3268
 *     return res
 * 
 * cdef inline np.ndarray arr_round_to_mul(np.ndarray arr, np.npy_int64 factor, np.npy_int64 multiple = 0, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Round to multiple. Divides the values of the ndarray by the factor and rounds
 *     to the nearest integers (half away from zero), handling negative numbers accoring
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.arr_round_to_mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3316
 *     return res
 * 
 * cdef inline np.ndarray arr_ceil_to_mul(np.ndarray arr, np.npy_int64 factor, np.npy_int64 multiple = 0, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Ceil to multiple. Divides the values of the ndarray by the factor and
 *     rounds up to the nearest integers, handling negative numbers accoring to
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_ceil_to_mul(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_arr_ceil_to_mul *__pyx_optional_args) {
  npy_int64 __pyx_v_multiple = ((npy_int64)0);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  int __pyx_v_neg_f;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_n;
  npy_int64 __pyx_v_q;
  npy_int64 __pyx_v_r;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  npy_intp __pyx_t_4[1];
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_ceil_to_mul", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_multiple = __pyx_optional_args->multiple;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3330
 *     """
 *     # Fast-path
 *     if factor == 1 and multiple == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  __pyx_t_2 = (__pyx_v_factor == 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_multiple == 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_offset == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "utils.pxd":3331
 *     # Fast-path
 *     if factor == 1 and multiple == 1 and offset == 0:
 *         return arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Validate
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":3330
 *     """
 *     # Fast-path
 *     if factor == 1 and multiple == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  }

  /* "utils.pxd":3334
 * 
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot ceil to multiple 0.")
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "utils.pxd":3335
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("cannot ceil to multiple 0.")
 *     if multiple == 0:
 */
  __pyx_t_1 = (__pyx_v_factor == 0);
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":3336
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot ceil to multiple 0.")             # <<<<<<<<<<<<<<
 *     if multiple == 0:
 *         multiple = factor
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3336, __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(5, 3336, __pyx_L1_error)

    /* "utils.pxd":3335
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("cannot ceil to multiple 0.")
 *     if multiple == 0:
 */
  }

  /* "utils.pxd":3337
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot ceil to multiple 0.")
 *     if multiple == 0:             # <<<<<<<<<<<<<<
 *         multiple = factor
 * 
 */
  __pyx_t_1 = (__pyx_v_multiple == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":3338
 *         raise ZeroDivisionError("cannot ceil to multiple 0.")
 *     if multiple == 0:
 *         multiple = factor             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
    __pyx_v_multiple = __pyx_v_factor;

    /* "utils.pxd":3337
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot ceil to multiple 0.")
 *     if multiple == 0:             # <<<<<<<<<<<<<<
 *         multiple = factor
 * 
 */
  }

  /* "utils.pxd":3342
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3343
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_4[0] = __pyx_v_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_4, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3343, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "utils.pxd":3344
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3345
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         bint neg_f = factor < 0
 *         np.npy_int64 i, n, q, r
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3346
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, n, q, r
 * 
 */
  __pyx_v_neg_f = (__pyx_v_factor < 0);

  /* "utils.pxd":3350
 * 
 *     with cython.cdivision(True):
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             n = arr_ptr[i]
 *             q = n // factor
 */
  __pyx_t_5 = __pyx_v_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "utils.pxd":3351
 *     with cython.cdivision(True):
 *         for i in range(size):
 *             n = arr_ptr[i]             # <<<<<<<<<<<<<<
 *             q = n // factor
 *             r = n % factor
 */
    __pyx_v_n = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "utils.pxd":3352
 *         for i in range(size):
 *             n = arr_ptr[i]
 *             q = n // factor             # <<<<<<<<<<<<<<
 *             r = n % factor
 *             if r != 0:
 */
    __pyx_v_q = (__pyx_v_n / __pyx_v_factor);

    /* "utils.pxd":3353
 *             n = arr_ptr[i]
 *             q = n // factor
 *             r = n % factor             # <<<<<<<<<<<<<<
 *             if r != 0:
 *                 if not neg_f:
 */
    __pyx_v_r = (__pyx_v_n % __pyx_v_factor);

    /* "utils.pxd":3354
 *             q = n // factor
 *             r = n % factor
 *             if r != 0:             # <<<<<<<<<<<<<<
 *                 if not neg_f:
 *                     if n > 0:
 */
    __pyx_t_1 = (__pyx_v_r != 0);
    if (__pyx_t_1) {

      /* "utils.pxd":3355
 *             r = n % factor
 *             if r != 0:
 *                 if not neg_f:             # <<<<<<<<<<<<<<
 *                     if n > 0:
 *                         q += 1
 */
      __pyx_t_1 = (!__pyx_v_neg_f);
      if (__pyx_t_1) {

        /* "utils.pxd":3356
 *             if r != 0:
 *                 if not neg_f:
 *                     if n > 0:             # <<<<<<<<<<<<<<
 *                         q += 1
 *                 else:
 */
        __pyx_t_1 = (__pyx_v_n > 0);
        if (__pyx_t_1) {

          /* "utils.pxd":3357
 *                 if not neg_f:
 *                     if n > 0:
 *                         q += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     if n < 0:
 */
          __pyx_v_q = (__pyx_v_q + 1);

          /* "utils.pxd":3356
 *             if r != 0:
 *                 if not neg_f:
 *                     if n > 0:             # <<<<<<<<<<<<<<
 *                         q += 1
 *                 else:
 */
        }

        /* "utils.pxd":3355
 *             r = n % factor
 *             if r != 0:
 *                 if not neg_f:             # <<<<<<<<<<<<<<
 *                     if n > 0:
 *                         q += 1
 */
        goto __pyx_L12;
      }

      /* "utils.pxd":3359
 *                         q += 1
 *                 else:
 *                     if n < 0:             # <<<<<<<<<<<<<<
 *                         q += 1
 *             res_ptr[i] = q * multiple + offset
 */
      /*else*/ {
        __pyx_t_1 = (__pyx_v_n < 0);
        if (__pyx_t_1) {

          /* "utils.pxd":3360
 *                 else:
 *                     if n < 0:
 *                         q += 1             # <<<<<<<<<<<<<<
 *             res_ptr[i] = q * multiple + offset
 *     return res
 */
          __pyx_v_q = (__pyx_v_q + 1);

          /* "utils.pxd":3359
 *                         q += 1
 *                 else:
 *                     if n < 0:             # <<<<<<<<<<<<<<
 *                         q += 1
 *             res_ptr[i] = q * multiple + offset
 */
        }
      }
      __pyx_L12:;

      /* "utils.pxd":3354
 *             q = n // factor
 *             r = n % factor
 *             if r != 0:             # <<<<<<<<<<<<<<
 *                 if not neg_f:
 *                     if n > 0:
 */
    }

    /* "utils.pxd":3361
 *                     if n < 0:
 *                         q += 1
 *             res_ptr[i] = q * multiple + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((__pyx_v_q * __pyx_v_multiple) + __pyx_v_offset);
  }

  /* "utils.pxd":3362
 *                         q += 1
 *             res_ptr[i] = q * multiple + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_floor_to_mul(np.ndarray arr, np.npy_int64 factor, np.npy_int64 multiple = 0, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3316
 *     return res
 * 
 * cdef inline np.ndarray arr_ceil_to_mul(np.ndarray arr, np.npy_int64 factor, np.npy_int64 multiple = 0, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Ceil to multiple. Divides the values of the ndarray by the factor and
 *     rounds up to the nearest integers, handling negative numbers accoring to
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.arr_ceil_to_mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3364
 *     return res
 * 
 * cdef inline np.ndarray arr_floor_to_mul(np.ndarray arr, np.npy_int64 factor, np.npy_int64 multiple = 0, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Floor to multiple. Divides the values of the ndarray by the factor and
 *     rounds down to the nearest integers, handling negative numbers accoring to
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_floor_to_mul(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_factor, struct __pyx_opt_args_7cytimes_5utils_arr_floor_to_mul *__pyx_optional_args) {
  npy_int64 __pyx_v_multiple = ((npy_int64)0);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  int __pyx_v_neg_f;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_n;
  npy_int64 __pyx_v_q;
  npy_int64 __pyx_v_r;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  npy_intp __pyx_t_4[1];
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_floor_to_mul", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_multiple = __pyx_optional_args->multiple;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3378
 *     """
 *     # Fast-path
 *     if factor == 1 and multiple == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  __pyx_t_2 = (__pyx_v_factor == 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_multiple == 1);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_offset == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "utils.pxd":3379
 *     # Fast-path
 *     if factor == 1 and multiple == 1 and offset == 0:
 *         return arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Validate
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":3378
 *     """
 *     # Fast-path
 *     if factor == 1 and multiple == 1 and offset == 0:             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr)
 * 
 */
  }

  /* "utils.pxd":3382
 * 
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot floor to multiple 0.")
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "utils.pxd":3383
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("cannot floor to multiple 0.")
 *     if multiple == 0:
 */
  __pyx_t_1 = (__pyx_v_factor == 0);
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":3384
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot floor to multiple 0.")             # <<<<<<<<<<<<<<
 *     if multiple == 0:
 *         multiple = factor
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ZeroDivisionError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3384, __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(5, 3384, __pyx_L1_error)

    /* "utils.pxd":3383
 *     # Validate
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:             # <<<<<<<<<<<<<<
 *         raise ZeroDivisionError("cannot floor to multiple 0.")
 *     if multiple == 0:
 */
  }

  /* "utils.pxd":3385
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot floor to multiple 0.")
 *     if multiple == 0:             # <<<<<<<<<<<<<<
 *         multiple = factor
 * 
 */
  __pyx_t_1 = (__pyx_v_multiple == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":3386
 *         raise ZeroDivisionError("cannot floor to multiple 0.")
 *     if multiple == 0:
 *         multiple = factor             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
    __pyx_v_multiple = __pyx_v_factor;

    /* "utils.pxd":3385
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot floor to multiple 0.")
 *     if multiple == 0:             # <<<<<<<<<<<<<<
 *         multiple = factor
 * 
 */
  }

  /* "utils.pxd":3390
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3391
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_4[0] = __pyx_v_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_4, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3391, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "utils.pxd":3392
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3393
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         bint neg_f = factor < 0
 *         np.npy_int64 i, n, q, r
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3394
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         bint neg_f = factor < 0             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, n, q, r
 * 
 */
  __pyx_v_neg_f = (__pyx_v_factor < 0);

  /* "utils.pxd":3398
 * 
 *     with cython.cdivision(True):
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             n = arr_ptr[i]
 *             q = n // factor
 */
  __pyx_t_5 = __pyx_v_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "utils.pxd":3399
 *     with cython.cdivision(True):
 *         for i in range(size):
 *             n = arr_ptr[i]             # <<<<<<<<<<<<<<
 *             q = n // factor
 *             r = n % factor
 */
    __pyx_v_n = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "utils.pxd":3400
 *         for i in range(size):
 *             n = arr_ptr[i]
 *             q = n // factor             # <<<<<<<<<<<<<<
 *             r = n % factor
 *             if r != 0:
 */
    __pyx_v_q = (__pyx_v_n / __pyx_v_factor);

    /* "utils.pxd":3401
 *             n = arr_ptr[i]
 *             q = n // factor
 *             r = n % factor             # <<<<<<<<<<<<<<
 *             if r != 0:
 *                 if not neg_f:
 */
    __pyx_v_r = (__pyx_v_n % __pyx_v_factor);

    /* "utils.pxd":3402
 *             q = n // factor
 *             r = n % factor
 *             if r != 0:             # <<<<<<<<<<<<<<
 *                 if not neg_f:
 *                     if n < 0:
 */
    __pyx_t_1 = (__pyx_v_r != 0);
    if (__pyx_t_1) {

      /* "utils.pxd":3403
 *             r = n % factor
 *             if r != 0:
 *                 if not neg_f:             # <<<<<<<<<<<<<<
 *                     if n < 0:
 *                         q -= 1
 */
      __pyx_t_1 = (!__pyx_v_neg_f);
      if (__pyx_t_1) {

        /* "utils.pxd":3404
 *             if r != 0:
 *                 if not neg_f:
 *                     if n < 0:             # <<<<<<<<<<<<<<
 *                         q -= 1
 *                 else:
 */
        __pyx_t_1 = (__pyx_v_n < 0);
        if (__pyx_t_1) {

          /* "utils.pxd":3405
 *                 if not neg_f:
 *                     if n < 0:
 *                         q -= 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     if n > 0:
 */
          __pyx_v_q = (__pyx_v_q - 1);

          /* "utils.pxd":3404
 *             if r != 0:
 *                 if not neg_f:
 *                     if n < 0:             # <<<<<<<<<<<<<<
 *                         q -= 1
 *                 else:
 */
        }

        /* "utils.pxd":3403
 *             r = n % factor
 *             if r != 0:
 *                 if not neg_f:             # <<<<<<<<<<<<<<
 *                     if n < 0:
 *                         q -= 1
 */
        goto __pyx_L12;
      }

      /* "utils.pxd":3407
 *                         q -= 1
 *                 else:
 *                     if n > 0:             # <<<<<<<<<<<<<<
 *                         q -= 1
 *             res_ptr[i] = q * multiple + offset
 */
      /*else*/ {
        __pyx_t_1 = (__pyx_v_n > 0);
        if (__pyx_t_1) {

          /* "utils.pxd":3408
 *                 else:
 *                     if n > 0:
 *                         q -= 1             # <<<<<<<<<<<<<<
 *             res_ptr[i] = q * multiple + offset
 *     return res
 */
          __pyx_v_q = (__pyx_v_q - 1);

          /* "utils.pxd":3407
 *                         q -= 1
 *                 else:
 *                     if n > 0:             # <<<<<<<<<<<<<<
 *                         q -= 1
 *             res_ptr[i] = q * multiple + offset
 */
        }
      }
      __pyx_L12:;

      /* "utils.pxd":3402
 *             q = n // factor
 *             r = n % factor
 *             if r != 0:             # <<<<<<<<<<<<<<
 *                 if not neg_f:
 *                     if n < 0:
 */
    }

    /* "utils.pxd":3409
 *                     if n > 0:
 *                         q -= 1
 *             res_ptr[i] = q * multiple + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((__pyx_v_q * __pyx_v_multiple) + __pyx_v_offset);
  }

  /* "utils.pxd":3410
 *                         q -= 1
 *             res_ptr[i] = q * multiple + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_add_arr(np.ndarray arr1, np.ndarray arr2, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3364
 *     return res
 * 
 * cdef inline np.ndarray arr_floor_to_mul(np.ndarray arr, np.npy_int64 factor, np.npy_int64 multiple = 0, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Floor to multiple. Divides the values of the ndarray by the factor and
 *     rounds down to the nearest integers, handling negative numbers accoring to
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.arr_floor_to_mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3412
 *     return res
 * 
 * cdef inline np.ndarray arr_add_arr(np.ndarray arr1, np.ndarray arr2, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Addition between two ndarrays `<'ndarray[int64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_add_arr(PyArrayObject *__pyx_v_arr1, PyArrayObject *__pyx_v_arr2, struct __pyx_opt_args_7cytimes_5utils_arr_add_arr *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr1_ptr;
  npy_int64 *__pyx_v_arr2_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_add_arr", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr1);
  __Pyx_INCREF((PyObject *)__pyx_v_arr2);

  /* "utils.pxd":3422
 *     """
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]             # <<<<<<<<<<<<<<
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform addition on ndarrays with different shapes.")
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr1)[0]);

  /* "utils.pxd":3423
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:             # <<<<<<<<<<<<<<
 *         raise ValueError("cannot perform addition on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  __pyx_t_1 = (__pyx_v_size != (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr2)[0]));
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":3424
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform addition on ndarrays with different shapes.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3424, __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(5, 3424, __pyx_L1_error)

    /* "utils.pxd":3423
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:             # <<<<<<<<<<<<<<
 *         raise ValueError("cannot perform addition on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  }

  /* "utils.pxd":3425
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform addition on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)             # <<<<<<<<<<<<<<
 *     arr2 = arr_assure_int64_like(arr2)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr1, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "utils.pxd":3426
 *         raise ValueError("cannot perform addition on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr2, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "utils.pxd":3430
 *     # Compute
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_2 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3430, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "utils.pxd":3431
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3432
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 *         np.npy_int64 i
 */
  __pyx_v_arr1_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr1));

  /* "utils.pxd":3433
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr2_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr2));

  /* "utils.pxd":3436
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr1_ptr[i] + arr2_ptr[i] + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":3437
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr1_ptr[i] + arr2_ptr[i] + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (((__pyx_v_arr1_ptr[__pyx_v_i]) + (__pyx_v_arr2_ptr[__pyx_v_i])) + __pyx_v_offset);
  }

  /* "utils.pxd":3438
 *     for i in range(size):
 *         res_ptr[i] = arr1_ptr[i] + arr2_ptr[i] + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_sub_arr(np.ndarray arr1, np.ndarray arr2, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3412
 *     return res
 * 
 * cdef inline np.ndarray arr_add_arr(np.ndarray arr1, np.ndarray arr2, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Addition between two ndarrays `<'ndarray[int64]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.arr_add_arr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr1);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr2);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3440
 *     return res
 * 
 * cdef inline np.ndarray arr_sub_arr(np.ndarray arr1, np.ndarray arr2, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Subtraction between two ndarrays `<'ndarray[int64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_sub_arr(PyArrayObject *__pyx_v_arr1, PyArrayObject *__pyx_v_arr2, struct __pyx_opt_args_7cytimes_5utils_arr_sub_arr *__pyx_optional_args) {
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr1_ptr;
  npy_int64 *__pyx_v_arr2_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_sub_arr", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_offset = __pyx_optional_args->offset;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr1);
  __Pyx_INCREF((PyObject *)__pyx_v_arr2);

  /* "utils.pxd":3450
 *     """
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]             # <<<<<<<<<<<<<<
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform subtraction on ndarrays with different shapes.")
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr1)[0]);

  /* "utils.pxd":3451
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:             # <<<<<<<<<<<<<<
 *         raise ValueError("cannot perform subtraction on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  __pyx_t_1 = (__pyx_v_size != (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr2)[0]));
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":3452
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform subtraction on ndarrays with different shapes.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3452, __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(5, 3452, __pyx_L1_error)

    /* "utils.pxd":3451
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:             # <<<<<<<<<<<<<<
 *         raise ValueError("cannot perform subtraction on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  }

  /* "utils.pxd":3453
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform subtraction on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)             # <<<<<<<<<<<<<<
 *     arr2 = arr_assure_int64_like(arr2)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr1, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "utils.pxd":3454
 *         raise ValueError("cannot perform subtraction on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr2, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "utils.pxd":3458
 *     # Compute
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_2 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3458, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "utils.pxd":3459
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3460
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 *         np.npy_int64 i
 */
  __pyx_v_arr1_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr1));

  /* "utils.pxd":3461
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr2_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr2));

  /* "utils.pxd":3464
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr1_ptr[i] - arr2_ptr[i] + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":3465
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr1_ptr[i] - arr2_ptr[i] + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (((__pyx_v_arr1_ptr[__pyx_v_i]) - (__pyx_v_arr2_ptr[__pyx_v_i])) + __pyx_v_offset);
  }

  /* "utils.pxd":3466
 *     for i in range(size):
 *         res_ptr[i] = arr1_ptr[i] - arr2_ptr[i] + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * # . comparison
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3440
 *     return res
 * 
 * cdef inline np.ndarray arr_sub_arr(np.ndarray arr1, np.ndarray arr2, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Subtraction between two ndarrays `<'ndarray[int64]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.arr_sub_arr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr1);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr2);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3469
 * 
 * # . comparison
 * cdef inline np.ndarray arr_equal_to(np.ndarray arr, np.npy_int64 value):             # <<<<<<<<<<<<<<
 *     """Check if the values of the ndarray are equal to the 'value' `<'ndarray[bool]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_equal_to(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_value) {
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_bool *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp __pyx_t_2[1];
  npy_int64 __pyx_t_3;
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_equal_to", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3479
 *     """
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":3483
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3484
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)             # <<<<<<<<<<<<<<
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_2[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_2, NPY_BOOL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3484, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":3485
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_bool *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3486
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3489
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr_ptr[i] == value
 *     return res
 */
  __pyx_t_3 = __pyx_v_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "utils.pxd":3490
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] == value             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((__pyx_v_arr_ptr[__pyx_v_i]) == __pyx_v_value);
  }

  /* "utils.pxd":3491
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] == value
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_greater_than(np.ndarray arr, np.npy_int64 value):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3469
 * 
 * # . comparison
 * cdef inline np.ndarray arr_equal_to(np.ndarray arr, np.npy_int64 value):             # <<<<<<<<<<<<<<
 *     """Check if the values of the ndarray are equal to the 'value' `<'ndarray[bool]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.arr_equal_to", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3493
 *     return res
 * 
 * cdef inline np.ndarray arr_greater_than(np.ndarray arr, np.npy_int64 value):             # <<<<<<<<<<<<<<
 *     """Check if the values of the ndarray are greater than the 'value' `<'ndarray[bool]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_greater_than(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_value) {
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_bool *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp __pyx_t_2[1];
  npy_int64 __pyx_t_3;
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_greater_than", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3503
 *     """
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":3507
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3508
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)             # <<<<<<<<<<<<<<
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_2[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_2, NPY_BOOL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3508, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":3509
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_bool *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3510
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3513
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr_ptr[i] > value
 *     return res
 */
  __pyx_t_3 = __pyx_v_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "utils.pxd":3514
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] > value             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((__pyx_v_arr_ptr[__pyx_v_i]) > __pyx_v_value);
  }

  /* "utils.pxd":3515
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] > value
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_less_than(np.ndarray arr, np.npy_int64 value):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3493
 *     return res
 * 
 * cdef inline np.ndarray arr_greater_than(np.ndarray arr, np.npy_int64 value):             # <<<<<<<<<<<<<<
 *     """Check if the values of the ndarray are greater than the 'value' `<'ndarray[bool]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.arr_greater_than", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3517
 *     return res
 * 
 * cdef inline np.ndarray arr_less_than(np.ndarray arr, np.npy_int64 value):             # <<<<<<<<<<<<<<
 *     """Check if the values of the ndarray are less than the 'value' `<'ndarray[bool]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_less_than(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_value) {
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_bool *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp __pyx_t_2[1];
  npy_int64 __pyx_t_3;
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_less_than", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3527
 *     """
 *     # Validate
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":3531
 *     # Compute
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3532
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)             # <<<<<<<<<<<<<<
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_2[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_2, NPY_BOOL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3532, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":3533
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_bool *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3534
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3537
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr_ptr[i] < value
 *     return res
 */
  __pyx_t_3 = __pyx_v_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "utils.pxd":3538
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] < value             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((__pyx_v_arr_ptr[__pyx_v_i]) < __pyx_v_value);
  }

  /* "utils.pxd":3539
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] < value
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray arr_equal_to_arr(np.ndarray arr1, np.ndarray arr2):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3517
 *     return res
 * 
 * cdef inline np.ndarray arr_less_than(np.ndarray arr, np.npy_int64 value):             # <<<<<<<<<<<<<<
 *     """Check if the values of the ndarray are less than the 'value' `<'ndarray[bool]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.arr_less_than", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3541
 *     return res
 * 
 * cdef inline np.ndarray arr_equal_to_arr(np.ndarray arr1, np.ndarray arr2):             # <<<<<<<<<<<<<<
 *     """Check if the values of two ndarrays are equal `<'ndarray[bool]'>`
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_arr_equal_to_arr(PyArrayObject *__pyx_v_arr1, PyArrayObject *__pyx_v_arr2) {
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_bool *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr1_ptr;
  npy_int64 *__pyx_v_arr2_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arr_equal_to_arr", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr1);
  __Pyx_INCREF((PyObject *)__pyx_v_arr2);

  /* "utils.pxd":3548
 *     """
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]             # <<<<<<<<<<<<<<
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform comparison on ndarrays with different shapes.")
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr1)[0]);

  /* "utils.pxd":3549
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:             # <<<<<<<<<<<<<<
 *         raise ValueError("cannot perform comparison on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  __pyx_t_1 = (__pyx_v_size != (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr2)[0]));
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":3550
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform comparison on ndarrays with different shapes.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3550, __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(5, 3550, __pyx_L1_error)

    /* "utils.pxd":3549
 *     # Validate
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:             # <<<<<<<<<<<<<<
 *         raise ValueError("cannot perform comparison on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  }

  /* "utils.pxd":3551
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform comparison on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)             # <<<<<<<<<<<<<<
 *     arr2 = arr_assure_int64_like(arr2)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr1, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "utils.pxd":3552
 *         raise ValueError("cannot perform comparison on ndarrays with different shapes.")
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr2, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "utils.pxd":3556
 *     # Compute
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)             # <<<<<<<<<<<<<<
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_2 = PyArray_EMPTY(1, __pyx_t_3, NPY_BOOL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3556, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "utils.pxd":3557
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 */
  __pyx_v_res_ptr = ((npy_bool *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3558
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 *         np.npy_int64 i
 */
  __pyx_v_arr1_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr1));

  /* "utils.pxd":3559
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr2_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr2));

  /* "utils.pxd":3562
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr1_ptr[i] == arr2_ptr[i]
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":3563
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr1_ptr[i] == arr2_ptr[i]             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((__pyx_v_arr1_ptr[__pyx_v_i]) == (__pyx_v_arr2_ptr[__pyx_v_i]));
  }

  /* "utils.pxd":3564
 *     for i in range(size):
 *         res_ptr[i] = arr1_ptr[i] == arr2_ptr[i]
 *     return res             # <<<<<<<<<<<<<<
 * 
 * # NumPy: ndarray[datetime64] ---------------------------------------------------------------------------
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3541
 *     return res
 * 
 * cdef inline np.ndarray arr_equal_to_arr(np.ndarray arr1, np.ndarray arr2):             # <<<<<<<<<<<<<<
 *     """Check if the values of two ndarrays are equal `<'ndarray[bool]'>`
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.arr_equal_to_arr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr1);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr2);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3568
 * # NumPy: ndarray[datetime64] ---------------------------------------------------------------------------
 * # . type check
 * cdef inline bint is_dt64arr(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the given array is dtype of 'datetime64' `<'bool'>`.
 * 
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_dt64arr(PyArrayObject *__pyx_v_arr) {
  int __pyx_r;

  /* "utils.pxd":3574
 *     >>> isinstance(arr.dtype, np.dtypes.DateTime64DType)
 *     """
 *     return np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_DATETIME             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint validate_dt64arr(np.ndarray arr) except -1:
 */
  __pyx_r = (PyArray_TYPE(__pyx_v_arr) == NPY_DATETIME);
  goto __pyx_L0;

  /* "utils.pxd":3568
 * # NumPy: ndarray[datetime64] ---------------------------------------------------------------------------
 * # . type check
 * cdef inline bint is_dt64arr(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the given array is dtype of 'datetime64' `<'bool'>`.
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":3576
 *     return np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_DATETIME
 * 
 * cdef inline bint validate_dt64arr(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Validate if the given array is dtype of 'datetime64',
 *     raises `TypeError` if dtype is incorrect.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_validate_dt64arr(PyArrayObject *__pyx_v_arr) {
  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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("validate_dt64arr", 1);

  /* "utils.pxd":3580
 *     raises `TypeError` if dtype is incorrect.
 *     """
 *     if not is_dt64arr(arr):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects np.ndarray[datetime64], got '%s'." % arr.dtype)
 *     return True
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr(__pyx_v_arr); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 3580, __pyx_L1_error)
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {

    /* "utils.pxd":3581
 *     """
 *     if not is_dt64arr(arr):
 *         raise TypeError("expects np.ndarray[datetime64], got '%s'." % arr.dtype)             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3581, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_expects_np_ndarray_datetime64_go, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 3581, __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_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3581, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(5, 3581, __pyx_L1_error)

    /* "utils.pxd":3580
 *     raises `TypeError` if dtype is incorrect.
 *     """
 *     if not is_dt64arr(arr):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects np.ndarray[datetime64], got '%s'." % arr.dtype)
 *     return True
 */
  }

  /* "utils.pxd":3582
 *     if not is_dt64arr(arr):
 *         raise TypeError("expects np.ndarray[datetime64], got '%s'." % arr.dtype)
 *     return True             # <<<<<<<<<<<<<<
 * 
 * # . range check
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "utils.pxd":3576
 *     return np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_DATETIME
 * 
 * cdef inline bint validate_dt64arr(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Validate if the given array is dtype of 'datetime64',
 *     raises `TypeError` if dtype is incorrect.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils.validate_dt64arr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3585
 * 
 * # . range check
 * cdef inline bint is_dt64arr_ns_safe(np.ndarray arr, str arr_unit=None) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the ndarray[datetime64] is within
 *     nanoseconds conversion range `<'bool'>`.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  npy_int64 __pyx_v_minimum;
  npy_int64 __pyx_v_maximum;
  npy_int64 __pyx_v_size;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PY_LONG_LONG __pyx_t_5;
  PY_LONG_LONG __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_UCS4 __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  npy_int64 __pyx_t_10;
  npy_int64 __pyx_t_11;
  npy_int64 __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_dt64arr_ns_safe", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3592
 *     """
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":3593
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_arr)); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 3593, __pyx_L1_error)
    __pyx_r = __pyx_t_1;
    goto __pyx_L0;

    /* "utils.pxd":3592
 *     """
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "utils.pxd":3597
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "utils.pxd":3598
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             raise ValueError(
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "utils.pxd":3599
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "cannot check if <'ndarray[%s]'> is within nanosecond conversion "
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (unlikely(__pyx_t_1)) {

      /* "utils.pxd":3602
 *             raise ValueError(
 *                 "cannot check if <'ndarray[%s]'> is within nanosecond conversion "
 *                 "range without specifying the array datetime unit." % arr.dtype             # <<<<<<<<<<<<<<
 *             )
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3602, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_cannot_check_if_ndarray_s_is_wit, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3602, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "utils.pxd":3600
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "cannot check if <'ndarray[%s]'> is within nanosecond conversion "
 *                 "range without specifying the array datetime unit." % arr.dtype
 */
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3600, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(5, 3600, __pyx_L1_error)

      /* "utils.pxd":3599
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "cannot check if <'ndarray[%s]'> is within nanosecond conversion "
 */
    }

    /* "utils.pxd":3604
 *                 "range without specifying the array datetime unit." % arr.dtype
 *             )
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_4 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 3604, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_4;

    /* "utils.pxd":3605
 *             )
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "utils.pxd":3598
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             raise ValueError(
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":3606
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "utils.pxd":3607
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_4 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 3607, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_4;

    /* "utils.pxd":3606
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":3609
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only datetime64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_4 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 3609, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_4;
  }
  __pyx_L4:;

  /* "utils.pxd":3614
 *     # Get min & max range
 *     cdef np.npy_int64 minimum, maximum
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         minimum, maximum = DT64_NS_NS_MIN, DT64_NS_NS_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  switch (__pyx_v_unit) {
    case NPY_FR_ns:

    /* "utils.pxd":3615
 *     cdef np.npy_int64 minimum, maximum
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         minimum, maximum = DT64_NS_NS_MIN, DT64_NS_NS_MAX             # <<<<<<<<<<<<<<
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         minimum, maximum = DT64_NS_US_MIN, DT64_NS_US_MAX
 */
    __pyx_t_5 = __pyx_v_7cytimes_5utils_DT64_NS_NS_MIN;
    __pyx_t_6 = __pyx_v_7cytimes_5utils_DT64_NS_NS_MAX;
    __pyx_v_minimum = __pyx_t_5;
    __pyx_v_maximum = __pyx_t_6;

    /* "utils.pxd":3614
 *     # Get min & max range
 *     cdef np.npy_int64 minimum, maximum
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         minimum, maximum = DT64_NS_NS_MIN, DT64_NS_NS_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
    break;
    case NPY_FR_us:

    /* "utils.pxd":3617
 *         minimum, maximum = DT64_NS_NS_MIN, DT64_NS_NS_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         minimum, maximum = DT64_NS_US_MIN, DT64_NS_US_MAX             # <<<<<<<<<<<<<<
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         minimum, maximum = DT64_NS_MS_MIN, DT64_NS_MS_MAX
 */
    __pyx_t_6 = __pyx_v_7cytimes_5utils_DT64_NS_US_MIN;
    __pyx_t_5 = __pyx_v_7cytimes_5utils_DT64_NS_US_MAX;
    __pyx_v_minimum = __pyx_t_6;
    __pyx_v_maximum = __pyx_t_5;

    /* "utils.pxd":3616
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         minimum, maximum = DT64_NS_NS_MIN, DT64_NS_NS_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         minimum, maximum = DT64_NS_US_MIN, DT64_NS_US_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
    break;
    case NPY_FR_ms:

    /* "utils.pxd":3619
 *         minimum, maximum = DT64_NS_US_MIN, DT64_NS_US_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         minimum, maximum = DT64_NS_MS_MIN, DT64_NS_MS_MAX             # <<<<<<<<<<<<<<
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         minimum, maximum = DT64_NS_SS_MIN, DT64_NS_SS_MAX
 */
    __pyx_t_5 = __pyx_v_7cytimes_5utils_DT64_NS_MS_MIN;
    __pyx_t_6 = __pyx_v_7cytimes_5utils_DT64_NS_MS_MAX;
    __pyx_v_minimum = __pyx_t_5;
    __pyx_v_maximum = __pyx_t_6;

    /* "utils.pxd":3618
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         minimum, maximum = DT64_NS_US_MIN, DT64_NS_US_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         minimum, maximum = DT64_NS_MS_MIN, DT64_NS_MS_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
    break;
    case NPY_FR_s:

    /* "utils.pxd":3621
 *         minimum, maximum = DT64_NS_MS_MIN, DT64_NS_MS_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         minimum, maximum = DT64_NS_SS_MIN, DT64_NS_SS_MAX             # <<<<<<<<<<<<<<
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         minimum, maximum = DT64_NS_MI_MIN, DT64_NS_MI_MAX
 */
    __pyx_t_6 = __pyx_v_7cytimes_5utils_DT64_NS_SS_MIN;
    __pyx_t_5 = __pyx_v_7cytimes_5utils_DT64_NS_SS_MAX;
    __pyx_v_minimum = __pyx_t_6;
    __pyx_v_maximum = __pyx_t_5;

    /* "utils.pxd":3620
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         minimum, maximum = DT64_NS_MS_MIN, DT64_NS_MS_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         minimum, maximum = DT64_NS_SS_MIN, DT64_NS_SS_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
    break;
    case NPY_FR_m:

    /* "utils.pxd":3623
 *         minimum, maximum = DT64_NS_SS_MIN, DT64_NS_SS_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         minimum, maximum = DT64_NS_MI_MIN, DT64_NS_MI_MAX             # <<<<<<<<<<<<<<
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         minimum, maximum = DT64_NS_HH_MIN, DT64_NS_HH_MAX
 */
    __pyx_t_5 = __pyx_v_7cytimes_5utils_DT64_NS_MI_MIN;
    __pyx_t_6 = __pyx_v_7cytimes_5utils_DT64_NS_MI_MAX;
    __pyx_v_minimum = __pyx_t_5;
    __pyx_v_maximum = __pyx_t_6;

    /* "utils.pxd":3622
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         minimum, maximum = DT64_NS_SS_MIN, DT64_NS_SS_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         minimum, maximum = DT64_NS_MI_MIN, DT64_NS_MI_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
    break;
    case NPY_FR_h:

    /* "utils.pxd":3625
 *         minimum, maximum = DT64_NS_MI_MIN, DT64_NS_MI_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         minimum, maximum = DT64_NS_HH_MIN, DT64_NS_HH_MAX             # <<<<<<<<<<<<<<
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         minimum, maximum = DT64_NS_DD_MIN, DT64_NS_DD_MAX
 */
    __pyx_t_6 = __pyx_v_7cytimes_5utils_DT64_NS_HH_MIN;
    __pyx_t_5 = __pyx_v_7cytimes_5utils_DT64_NS_HH_MAX;
    __pyx_v_minimum = __pyx_t_6;
    __pyx_v_maximum = __pyx_t_5;

    /* "utils.pxd":3624
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         minimum, maximum = DT64_NS_MI_MIN, DT64_NS_MI_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         minimum, maximum = DT64_NS_HH_MIN, DT64_NS_HH_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
    break;
    case NPY_FR_D:

    /* "utils.pxd":3627
 *         minimum, maximum = DT64_NS_HH_MIN, DT64_NS_HH_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         minimum, maximum = DT64_NS_DD_MIN, DT64_NS_DD_MAX             # <<<<<<<<<<<<<<
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         minimum, maximum = DT64_NS_WW_MIN, DT64_NS_WW_MAX
 */
    __pyx_t_5 = __pyx_v_7cytimes_5utils_DT64_NS_DD_MIN;
    __pyx_t_6 = __pyx_v_7cytimes_5utils_DT64_NS_DD_MAX;
    __pyx_v_minimum = __pyx_t_5;
    __pyx_v_maximum = __pyx_t_6;

    /* "utils.pxd":3626
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         minimum, maximum = DT64_NS_HH_MIN, DT64_NS_HH_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         minimum, maximum = DT64_NS_DD_MIN, DT64_NS_DD_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
    break;
    case NPY_FR_W:

    /* "utils.pxd":3629
 *         minimum, maximum = DT64_NS_DD_MIN, DT64_NS_DD_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         minimum, maximum = DT64_NS_WW_MIN, DT64_NS_WW_MAX             # <<<<<<<<<<<<<<
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         minimum, maximum = DT64_NS_MM_MIN, DT64_NS_MM_MAX
 */
    __pyx_t_6 = __pyx_v_7cytimes_5utils_DT64_NS_WW_MIN;
    __pyx_t_5 = __pyx_v_7cytimes_5utils_DT64_NS_WW_MAX;
    __pyx_v_minimum = __pyx_t_6;
    __pyx_v_maximum = __pyx_t_5;

    /* "utils.pxd":3628
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         minimum, maximum = DT64_NS_DD_MIN, DT64_NS_DD_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         minimum, maximum = DT64_NS_WW_MIN, DT64_NS_WW_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
    break;
    case NPY_FR_M:

    /* "utils.pxd":3631
 *         minimum, maximum = DT64_NS_WW_MIN, DT64_NS_WW_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         minimum, maximum = DT64_NS_MM_MIN, DT64_NS_MM_MAX             # <<<<<<<<<<<<<<
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         minimum, maximum = DT64_NS_YY_MIN, DT64_NS_YY_MAX
 */
    __pyx_t_5 = __pyx_v_7cytimes_5utils_DT64_NS_MM_MIN;
    __pyx_t_6 = __pyx_v_7cytimes_5utils_DT64_NS_MM_MAX;
    __pyx_v_minimum = __pyx_t_5;
    __pyx_v_maximum = __pyx_t_6;

    /* "utils.pxd":3630
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         minimum, maximum = DT64_NS_WW_MIN, DT64_NS_WW_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         minimum, maximum = DT64_NS_MM_MIN, DT64_NS_MM_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
    break;
    case NPY_FR_Y:

    /* "utils.pxd":3633
 *         minimum, maximum = DT64_NS_MM_MIN, DT64_NS_MM_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         minimum, maximum = DT64_NS_YY_MIN, DT64_NS_YY_MAX             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __pyx_t_6 = __pyx_v_7cytimes_5utils_DT64_NS_YY_MIN;
    __pyx_t_5 = __pyx_v_7cytimes_5utils_DT64_NS_YY_MAX;
    __pyx_v_minimum = __pyx_t_6;
    __pyx_v_maximum = __pyx_t_5;

    /* "utils.pxd":3632
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         minimum, maximum = DT64_NS_MM_MIN, DT64_NS_MM_MAX
 *     elif unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         minimum, maximum = DT64_NS_YY_MIN, DT64_NS_YY_MAX
 *     else:
 */
    break;
    default:

    /* "utils.pxd":3636
 *     else:
 *         raise ValueError(
 *             "cannot check <'ndarray[%s]'> nanosecond conversion "             # <<<<<<<<<<<<<<
 *             "range, datetime unit '%s' is not supported."
 *             % (arr.dtype, map_nptime_unit_int2str(unit))
 */
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = 0;
    __pyx_t_8 = 127;
    __Pyx_INCREF(__pyx_kp_u_cannot_check_ndarray);
    __pyx_t_7 += 23;
    __Pyx_GIVEREF(__pyx_kp_u_cannot_check_ndarray);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_cannot_check_ndarray);

    /* "utils.pxd":3638
 *             "cannot check <'ndarray[%s]'> nanosecond conversion "
 *             "range, datetime unit '%s' is not supported."
 *             % (arr.dtype, map_nptime_unit_int2str(unit))             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_3), __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 3638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_8;
    __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_9);
    __pyx_t_9 = 0;
    __Pyx_INCREF(__pyx_kp_u_nanosecond_conversion_range_dat);
    __pyx_t_7 += 48;
    __Pyx_GIVEREF(__pyx_kp_u_nanosecond_conversion_range_dat);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_nanosecond_conversion_range_dat);
    __pyx_t_9 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_unit); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 3638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_3 = __Pyx_PyUnicode_Unicode(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_8;
    __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u_is_not_supported);
    __pyx_t_7 += 19;
    __Pyx_GIVEREF(__pyx_kp_u_is_not_supported);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u_is_not_supported);

    /* "utils.pxd":3636
 *     else:
 *         raise ValueError(
 *             "cannot check <'ndarray[%s]'> nanosecond conversion "             # <<<<<<<<<<<<<<
 *             "range, datetime unit '%s' is not supported."
 *             % (arr.dtype, map_nptime_unit_int2str(unit))
 */
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "utils.pxd":3635
 *         minimum, maximum = DT64_NS_YY_MIN, DT64_NS_YY_MAX
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "cannot check <'ndarray[%s]'> nanosecond conversion "
 *             "range, datetime unit '%s' is not supported."
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3635, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(5, 3635, __pyx_L1_error)
    break;
  }

  /* "utils.pxd":3643
 *     # Check range
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3644
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3647
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         if not minimum < arr_ptr[i] < maximum:
 *             return False
 */
  __pyx_t_10 = __pyx_v_size;
  __pyx_t_11 = __pyx_t_10;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "utils.pxd":3648
 * 
 *     for i in range(size):
 *         if not minimum < arr_ptr[i] < maximum:             # <<<<<<<<<<<<<<
 *             return False
 *     return True
 */
    __pyx_t_1 = (__pyx_v_minimum < (__pyx_v_arr_ptr[__pyx_v_i]));
    if (__pyx_t_1) {
      __pyx_t_1 = ((__pyx_v_arr_ptr[__pyx_v_i]) < __pyx_v_maximum);
    }
    __pyx_t_13 = (!__pyx_t_1);
    if (__pyx_t_13) {

      /* "utils.pxd":3649
 *     for i in range(size):
 *         if not minimum < arr_ptr[i] < maximum:
 *             return False             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
      __pyx_r = 0;
      goto __pyx_L0;

      /* "utils.pxd":3648
 * 
 *     for i in range(size):
 *         if not minimum < arr_ptr[i] < maximum:             # <<<<<<<<<<<<<<
 *             return False
 *     return True
 */
    }
  }

  /* "utils.pxd":3650
 *         if not minimum < arr_ptr[i] < maximum:
 *             return False
 *     return True             # <<<<<<<<<<<<<<
 * 
 * # . access
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "utils.pxd":3585
 * 
 * # . range check
 * cdef inline bint is_dt64arr_ns_safe(np.ndarray arr, str arr_unit=None) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the ndarray[datetime64] is within
 *     nanoseconds conversion range `<'bool'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("cytimes.utils.is_dt64arr_ns_safe", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3653
 * 
 * # . access
 * cdef inline np.ndarray dt64arr_year(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the year values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[Y]
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_year(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_year *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_year", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3656
 *     """Get the year values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[Y]
 *     arr = dt64arr_as_int64_Y(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Add back epoch
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":3660
 *     # Add back epoch
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3661
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3661, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":3662
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3663
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3666
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr_ptr[i] + EPOCH_YEAR + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":3667
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] + EPOCH_YEAR + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_YEAR) + __pyx_v_offset);
  }

  /* "utils.pxd":3668
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] + EPOCH_YEAR + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_quarter(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3653
 * 
 * # . access
 * cdef inline np.ndarray dt64arr_year(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the year values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[Y]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3670
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_quarter(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the quarter values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_quarter(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_quarter *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_quarter", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3673
 *     """Get the quarter values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_M(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":3677
 *     # Compute quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3678
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3678, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":3679
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3680
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3683
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = quarter_of_month(arr_ptr[i] % 12 + 1) + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":3684
 * 
 *     for i in range(size):
 *         res_ptr[i] = quarter_of_month(arr_ptr[i] % 12 + 1) + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_7 = __pyx_f_7cytimes_5utils_quarter_of_month((__Pyx_mod_npy_int64((__pyx_v_arr_ptr[__pyx_v_i]), 12) + 1)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 3684, __pyx_L1_error)
    (__pyx_v_res_ptr[__pyx_v_i]) = (__pyx_t_7 + __pyx_v_offset);
  }

  /* "utils.pxd":3685
 *     for i in range(size):
 *         res_ptr[i] = quarter_of_month(arr_ptr[i] % 12 + 1) + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_month(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3670
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_quarter(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the quarter values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3687
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_month(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the month values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_month(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_month *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_month", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3690
 *     """Get the month values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_M(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":3694
 *     # Compute quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3695
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3695, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":3696
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3697
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3700
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr_ptr[i] % 12 + 1 + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":3701
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] % 12 + 1 + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((__Pyx_mod_npy_int64((__pyx_v_arr_ptr[__pyx_v_i]), 12) + 1) + __pyx_v_offset);
  }

  /* "utils.pxd":3702
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] % 12 + 1 + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_weekday(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3687
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_month(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the month values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3704
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_weekday(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the weekday values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_weekday(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_weekday *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_weekday", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3707
 *     """Get the weekday values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":3711
 *     # Compute quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3712
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3712, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":3713
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3714
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3717
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = (arr_ptr[i] + EPOCH_DAY + 6) % 7 + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":3718
 * 
 *     for i in range(size):
 *         res_ptr[i] = (arr_ptr[i] + EPOCH_DAY + 6) % 7 + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__Pyx_mod_npy_int64((((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_DAY) + 6), 7) + __pyx_v_offset);
  }

  /* "utils.pxd":3719
 *     for i in range(size):
 *         res_ptr[i] = (arr_ptr[i] + EPOCH_DAY + 6) % 7 + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_day(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3704
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_weekday(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the weekday values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3721
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_day(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the day values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_day(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_day *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_n;
  npy_int64 __pyx_v_n400;
  npy_int64 __pyx_v_n100;
  npy_int64 __pyx_v_n4;
  npy_int64 __pyx_v_n1;
  npy_int64 __pyx_v_year;
  npy_int64 __pyx_v_month;
  npy_int64 __pyx_v_day;
  npy_int64 __pyx_v_days_bf;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_day", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3724
 *     """Get the day values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":3728
 *     # Compute quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3729
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3729, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":3730
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i, n, n400, n100, n4, n1, year, month, day, days_bf
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3731
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, n, n400, n100, n4, n1, year, month, day, days_bf
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3734
 *         np.npy_int64 i, n, n400, n100, n4, n1, year, month, day, days_bf
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         # Convert to ordinal
 *         n = arr_ptr[i] + EPOCH_DAY - 1
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":3736
 *     for i in range(size):
 *         # Convert to ordinal
 *         n = arr_ptr[i] + EPOCH_DAY - 1             # <<<<<<<<<<<<<<
 *         # Number of complete 400-year cycles
 *         n400 = n // 146_097
 */
    __pyx_v_n = (((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_DAY) - 1);

    /* "utils.pxd":3738
 *         n = arr_ptr[i] + EPOCH_DAY - 1
 *         # Number of complete 400-year cycles
 *         n400 = n // 146_097             # <<<<<<<<<<<<<<
 *         n -= n400 * 146_097
 *         # Number of complete 100-year cycles within the 400-year cycle
 */
    __pyx_v_n400 = __Pyx_div_npy_int64(__pyx_v_n, 0x23AB1);

    /* "utils.pxd":3739
 *         # Number of complete 400-year cycles
 *         n400 = n // 146_097
 *         n -= n400 * 146_097             # <<<<<<<<<<<<<<
 *         # Number of complete 100-year cycles within the 400-year cycle
 *         n100 = n // 36_524
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n400 * 0x23AB1));

    /* "utils.pxd":3741
 *         n -= n400 * 146_097
 *         # Number of complete 100-year cycles within the 400-year cycle
 *         n100 = n // 36_524             # <<<<<<<<<<<<<<
 *         n -= n100 * 36_524
 *         # Number of complete 4-year cycles within the 100-year cycle
 */
    __pyx_v_n100 = __Pyx_div_npy_int64(__pyx_v_n, 0x8EAC);

    /* "utils.pxd":3742
 *         # Number of complete 100-year cycles within the 400-year cycle
 *         n100 = n // 36_524
 *         n -= n100 * 36_524             # <<<<<<<<<<<<<<
 *         # Number of complete 4-year cycles within the 100-year cycle
 *         n4 = n // 1_461
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n100 * 0x8EAC));

    /* "utils.pxd":3744
 *         n -= n100 * 36_524
 *         # Number of complete 4-year cycles within the 100-year cycle
 *         n4 = n // 1_461             # <<<<<<<<<<<<<<
 *         n -= n4 * 1_461
 *         # Number of complete years within the 4-year cycle
 */
    __pyx_v_n4 = __Pyx_div_npy_int64(__pyx_v_n, 0x5B5);

    /* "utils.pxd":3745
 *         # Number of complete 4-year cycles within the 100-year cycle
 *         n4 = n // 1_461
 *         n -= n4 * 1_461             # <<<<<<<<<<<<<<
 *         # Number of complete years within the 4-year cycle
 *         n1 = n // 365
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n4 * 0x5B5));

    /* "utils.pxd":3747
 *         n -= n4 * 1_461
 *         # Number of complete years within the 4-year cycle
 *         n1 = n // 365             # <<<<<<<<<<<<<<
 *         n -= n1 * 365
 *         # Compute the year
 */
    __pyx_v_n1 = __Pyx_div_npy_int64(__pyx_v_n, 0x16D);

    /* "utils.pxd":3748
 *         # Number of complete years within the 4-year cycle
 *         n1 = n // 365
 *         n -= n1 * 365             # <<<<<<<<<<<<<<
 *         # Compute the year
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1 + 1
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n1 * 0x16D));

    /* "utils.pxd":3750
 *         n -= n1 * 365
 *         # Compute the year
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1 + 1             # <<<<<<<<<<<<<<
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:
 */
    __pyx_v_year = (((((__pyx_v_n400 * 0x190) + (__pyx_v_n100 * 0x64)) + (__pyx_v_n4 * 4)) + __pyx_v_n1) + 1);

    /* "utils.pxd":3752
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1 + 1
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:             # <<<<<<<<<<<<<<
 *             day = 31
 *         else:
 */
    __pyx_t_8 = (__pyx_v_n100 == 4);
    if (!__pyx_t_8) {
    } else {
      __pyx_t_7 = __pyx_t_8;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_8 = (__pyx_v_n1 == 4);
    __pyx_t_7 = __pyx_t_8;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_7) {

      /* "utils.pxd":3753
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:
 *             day = 31             # <<<<<<<<<<<<<<
 *         else:
 *             month = (n + 50) >> 5
 */
      __pyx_v_day = 31;

      /* "utils.pxd":3752
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1 + 1
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:             # <<<<<<<<<<<<<<
 *             day = 31
 *         else:
 */
      goto __pyx_L5;
    }

    /* "utils.pxd":3755
 *             day = 31
 *         else:
 *             month = (n + 50) >> 5             # <<<<<<<<<<<<<<
 *             days_bf = days_bf_month(year, month)
 *             if days_bf > n:
 */
    /*else*/ {
      __pyx_v_month = ((__pyx_v_n + 50) >> 5);

      /* "utils.pxd":3756
 *         else:
 *             month = (n + 50) >> 5
 *             days_bf = days_bf_month(year, month)             # <<<<<<<<<<<<<<
 *             if days_bf > n:
 *                 days_bf = days_bf_month(year, month - 1)
 */
      __pyx_t_9 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 3756, __pyx_L1_error)
      __pyx_v_days_bf = __pyx_t_9;

      /* "utils.pxd":3757
 *             month = (n + 50) >> 5
 *             days_bf = days_bf_month(year, month)
 *             if days_bf > n:             # <<<<<<<<<<<<<<
 *                 days_bf = days_bf_month(year, month - 1)
 *             day = n - days_bf + 1
 */
      __pyx_t_7 = (__pyx_v_days_bf > __pyx_v_n);
      if (__pyx_t_7) {

        /* "utils.pxd":3758
 *             days_bf = days_bf_month(year, month)
 *             if days_bf > n:
 *                 days_bf = days_bf_month(year, month - 1)             # <<<<<<<<<<<<<<
 *             day = n - days_bf + 1
 *         # Compute total months
 */
        __pyx_t_9 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_year, (__pyx_v_month - 1)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 3758, __pyx_L1_error)
        __pyx_v_days_bf = __pyx_t_9;

        /* "utils.pxd":3757
 *             month = (n + 50) >> 5
 *             days_bf = days_bf_month(year, month)
 *             if days_bf > n:             # <<<<<<<<<<<<<<
 *                 days_bf = days_bf_month(year, month - 1)
 *             day = n - days_bf + 1
 */
      }

      /* "utils.pxd":3759
 *             if days_bf > n:
 *                 days_bf = days_bf_month(year, month - 1)
 *             day = n - days_bf + 1             # <<<<<<<<<<<<<<
 *         # Compute total months
 *         res_ptr[i] = day + offset
 */
      __pyx_v_day = ((__pyx_v_n - __pyx_v_days_bf) + 1);
    }
    __pyx_L5:;

    /* "utils.pxd":3761
 *             day = n - days_bf + 1
 *         # Compute total months
 *         res_ptr[i] = day + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__pyx_v_day + __pyx_v_offset);
  }

  /* "utils.pxd":3762
 *         # Compute total months
 *         res_ptr[i] = day + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_hour(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3721
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_day(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the day values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_day", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3764
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_hour(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the hour values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_hour(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_hour *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_h __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_hour", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3767
 *     """Get the hour values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_h(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_h(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":3771
 *     # Compute quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3772
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3772, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":3773
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3774
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3777
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = (arr_ptr[i] + EPOCH_HOUR) % 24 + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":3778
 * 
 *     for i in range(size):
 *         res_ptr[i] = (arr_ptr[i] + EPOCH_HOUR) % 24 + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__Pyx_mod_npy_int64(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_HOUR), 24) + __pyx_v_offset);
  }

  /* "utils.pxd":3779
 *     for i in range(size):
 *         res_ptr[i] = (arr_ptr[i] + EPOCH_HOUR) % 24 + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_minute(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3764
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_hour(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the hour values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_hour", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3781
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_minute(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the minute values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_minute(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_minute *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_m __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_minute", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3784
 *     """Get the minute values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_m(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_m(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":3788
 *     # Compute quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3789
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3789, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":3790
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3791
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3794
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = (arr_ptr[i] + EPOCH_MINUTE) % 60 + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":3795
 * 
 *     for i in range(size):
 *         res_ptr[i] = (arr_ptr[i] + EPOCH_MINUTE) % 60 + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__Pyx_mod_npy_int64(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_MINUTE), 60) + __pyx_v_offset);
  }

  /* "utils.pxd":3796
 *     for i in range(size):
 *         res_ptr[i] = (arr_ptr[i] + EPOCH_MINUTE) % 60 + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_second(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3781
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_minute(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the minute values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_minute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3798
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_second(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the second values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_second(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_second *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_s __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_second", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3801
 *     """Get the second values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_s(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_s(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3801, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":3805
 *     # Compute quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3806
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3806, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":3807
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3808
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3811
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr_ptr[i] % 60 + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":3812
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] % 60 + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__Pyx_mod_npy_int64((__pyx_v_arr_ptr[__pyx_v_i]), 60) + __pyx_v_offset);
  }

  /* "utils.pxd":3813
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] % 60 + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_millisecond(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3798
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_second(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the second values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_second", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3815
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_millisecond(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the millisecond values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_millisecond(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_millisecond *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ms __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_millisecond", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3818
 *     """Get the millisecond values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_ms(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_ms(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":3822
 *     # Compute quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3823
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3823, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":3824
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3825
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3828
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr_ptr[i] % 1_000 + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":3829
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] % 1_000 + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__Pyx_mod_npy_int64((__pyx_v_arr_ptr[__pyx_v_i]), 0x3E8) + __pyx_v_offset);
  }

  /* "utils.pxd":3830
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] % 1_000 + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_microsecond(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3815
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_millisecond(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the millisecond values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_millisecond", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3832
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_microsecond(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the microsecond values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_microsecond(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_microsecond *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_us __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_microsecond", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3835
 *     """Get the microsecond values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_us(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_us(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":3839
 *     # Compute quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3840
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3840, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":3841
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3842
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3845
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr_ptr[i] % 1_000_000 + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":3846
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] % 1_000_000 + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__Pyx_mod_npy_int64((__pyx_v_arr_ptr[__pyx_v_i]), 0xF4240) + __pyx_v_offset);
  }

  /* "utils.pxd":3847
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] % 1_000_000 + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_nanosecond(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3832
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_microsecond(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the microsecond values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_microsecond", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3849
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_nanosecond(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the nanosecond values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_nanosecond(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_nanosecond *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ns __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_nanosecond", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3852
 *     """Get the nanosecond values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_ns(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_ns(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":3856
 *     # Compute quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3857
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3857, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":3858
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3859
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3862
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = arr_ptr[i] % 1_000 + offset
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":3863
 * 
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] % 1_000 + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__Pyx_mod_npy_int64((__pyx_v_arr_ptr[__pyx_v_i]), 0x3E8) + __pyx_v_offset);
  }

  /* "utils.pxd":3864
 *     for i in range(size):
 *         res_ptr[i] = arr_ptr[i] % 1_000 + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_times(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3849
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_nanosecond(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the nanosecond values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[M]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_nanosecond", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3866
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_times(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the times values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Empty array
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_times(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_times *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  PyObject *__pyx_v_unit_str = NULL;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_mod __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_times", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3869
 *     """Get the times values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":3870
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "utils.pxd":3869
 *     """Get the times values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "utils.pxd":3874
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "utils.pxd":3875
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "utils.pxd":3876
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "utils.pxd":3877
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_kp_u_int64_under_Y_resolution); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 3877, __pyx_L1_error)

      /* "utils.pxd":3876
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "utils.pxd":3878
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 3878, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "utils.pxd":3879
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3879, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "utils.pxd":3875
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":3880
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "utils.pxd":3881
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 3881, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "utils.pxd":3880
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":3883
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only datetime64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 3883, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "utils.pxd":3888
 *     # Get factor
 *     cdef np.npy_int64 factor
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "utils.pxd":3889
 *     cdef np.npy_int64 factor
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_mod(arr, NS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_mod(arr, US_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mod(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_DAY, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3889, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":3888
 *     # Get factor
 *     cdef np.npy_int64 factor
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "utils.pxd":3890
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_mod(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "utils.pxd":3891
 *         return arr_mod(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_mod(arr, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mod(arr, MS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mod(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_DAY, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3891, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":3890
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_mod(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "utils.pxd":3892
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_mod(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "utils.pxd":3893
 *         return arr_mod(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mod(arr, MS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mod(arr, SS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mod(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_DAY, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":3892
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_mod(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "utils.pxd":3894
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mod(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "utils.pxd":3895
 *         return arr_mod(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mod(arr, SS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mod(arr, 1440, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mod(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_DAY, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3895, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":3894
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mod(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "utils.pxd":3896
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mod(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, 1440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "utils.pxd":3897
 *         return arr_mod(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mod(arr, 1440, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mod(arr, 24, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mod(__pyx_v_arr, 0x5A0, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3897, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":3896
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mod(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, 1440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "utils.pxd":3898
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mod(arr, 1440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, 24, offset)
 *     if unit in (
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "utils.pxd":3899
 *         return arr_mod(arr, 1440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mod(arr, 24, offset)             # <<<<<<<<<<<<<<
 *     if unit in (
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,  # day
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mod(__pyx_v_arr, 24, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":3898
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mod(arr, 1440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mod(arr, 24, offset)
 *     if unit in (
 */
  }

  /* "utils.pxd":3900
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mod(arr, 24, offset)
 *     if unit in (             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,  # day
 *         np.NPY_DATETIMEUNIT.NPY_FR_W,  # week
 */
  switch (__pyx_v_unit) {
    case NPY_FR_D:

    /* "utils.pxd":3901
 *         return arr_mod(arr, 24, offset)
 *     if unit in (
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,  # day             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_W,  # week
 *         np.NPY_DATETIMEUNIT.NPY_FR_M,  # month
 */
    case NPY_FR_W:

    /* "utils.pxd":3902
 *     if unit in (
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,  # day
 *         np.NPY_DATETIMEUNIT.NPY_FR_W,  # week             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_M,  # month
 *         np.NPY_DATETIMEUNIT.NPY_FR_Y,  # year
 */
    case NPY_FR_M:

    /* "utils.pxd":3903
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,  # day
 *         np.NPY_DATETIMEUNIT.NPY_FR_W,  # week
 *         np.NPY_DATETIMEUNIT.NPY_FR_M,  # month             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_Y,  # year
 *     ):
 */
    case NPY_FR_Y:

    /* "utils.pxd":3906
 *         np.NPY_DATETIMEUNIT.NPY_FR_Y,  # year
 *     ):
 *         if offset == 0:             # <<<<<<<<<<<<<<
 *             return arr_zero_int64(arr.shape[0])
 *         else:
 */
    __pyx_t_1 = (__pyx_v_offset == 0);
    if (__pyx_t_1) {

      /* "utils.pxd":3907
 *     ):
 *         if offset == 0:
 *             return arr_zero_int64(arr.shape[0])             # <<<<<<<<<<<<<<
 *         else:
 *             return arr_full_int64(offset, arr.shape[0])
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_zero_int64((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3907, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "utils.pxd":3906
 *         np.NPY_DATETIMEUNIT.NPY_FR_Y,  # year
 *     ):
 *         if offset == 0:             # <<<<<<<<<<<<<<
 *             return arr_zero_int64(arr.shape[0])
 *         else:
 */
    }

    /* "utils.pxd":3909
 *             return arr_zero_int64(arr.shape[0])
 *         else:
 *             return arr_full_int64(offset, arr.shape[0])             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     unit_str = map_nptime_unit_int2str(unit)
 */
    /*else*/ {
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_full_int64(__pyx_v_offset, (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3909, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }

    /* "utils.pxd":3900
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mod(arr, 24, offset)
 *     if unit in (             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,  # day
 *         np.NPY_DATETIMEUNIT.NPY_FR_W,  # week
 */
    break;
    default: break;
  }

  /* "utils.pxd":3911
 *             return arr_full_int64(offset, arr.shape[0])
 *     # . unsupported
 *     unit_str = map_nptime_unit_int2str(unit)             # <<<<<<<<<<<<<<
 *     raise ValueError(
 *         "cannot access the time value from ndarray[datetime64[%s]].\n"
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_unit_str = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "utils.pxd":3913
 *     unit_str = map_nptime_unit_int2str(unit)
 *     raise ValueError(
 *         "cannot access the time value from ndarray[datetime64[%s]].\n"             # <<<<<<<<<<<<<<
 *         "Array with dtype of 'datetime64[%s]' is not supported" % (unit_str, unit_str)
 *     )
 */
  __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 0;
  __pyx_t_6 = 127;
  __Pyx_INCREF(__pyx_kp_u_cannot_access_the_time_value_fro);
  __pyx_t_5 += 53;
  __Pyx_GIVEREF(__pyx_kp_u_cannot_access_the_time_value_fro);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_cannot_access_the_time_value_fro);

  /* "utils.pxd":3914
 *     raise ValueError(
 *         "cannot access the time value from ndarray[datetime64[%s]].\n"
 *         "Array with dtype of 'datetime64[%s]' is not supported" % (unit_str, unit_str)             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_unit_str); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 3914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u_Array_with_dtype_of_datetime64);
  __pyx_t_5 += 36;
  __Pyx_GIVEREF(__pyx_kp_u_Array_with_dtype_of_datetime64);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_Array_with_dtype_of_datetime64);
  __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_unit_str); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 3914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u_is_not_supported_2);
  __pyx_t_5 += 19;
  __Pyx_GIVEREF(__pyx_kp_u_is_not_supported_2);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u_is_not_supported_2);

  /* "utils.pxd":3913
 *     unit_str = map_nptime_unit_int2str(unit)
 *     raise ValueError(
 *         "cannot access the time value from ndarray[datetime64[%s]].\n"             # <<<<<<<<<<<<<<
 *         "Array with dtype of 'datetime64[%s]' is not supported" % (unit_str, unit_str)
 *     )
 */
  __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 3913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "utils.pxd":3912
 *     # . unsupported
 *     unit_str = map_nptime_unit_int2str(unit)
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "cannot access the time value from ndarray[datetime64[%s]].\n"
 *         "Array with dtype of 'datetime64[%s]' is not supported" % (unit_str, unit_str)
 */
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_ERR(5, 3912, __pyx_L1_error)

  /* "utils.pxd":3866
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_times(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Get the times values of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Empty array
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_times", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unit_str);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3918
 * 
 * # . calendar
 * cdef inline np.ndarray dt64arr_isocalendar(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the ISO calendar values of the ndarray[datetime64] `<'ndarray[int64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_isocalendar(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_isocalendar *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  __pyx_t_7cytimes_5utils_ymd __pyx_v__ymd;
  __pyx_t_7cytimes_5utils_iso __pyx_v__iso;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_2;
  npy_intp __pyx_t_3[2];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_7;
  __pyx_t_7cytimes_5utils_iso __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_isocalendar", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3934
 *     """
 *     # Cast to int64[D]
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute days in month
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":3938
 *     # Compute days in month
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(2, [size, 3], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3939
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(2, [size, 3], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_3[1] = 3;
  __pyx_t_1 = PyArray_EMPTY(2, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3939, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3939, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":3940
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(2, [size, 3], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3941
 *         np.ndarray res = np.PyArray_EMPTY(2, [size, 3], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3944
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         _iso = ymd_isocalendar(_ymd.year, _ymd.month, _ymd.day)
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":3945
 * 
 *     for i in range(size):
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)             # <<<<<<<<<<<<<<
 *         _iso = ymd_isocalendar(_ymd.year, _ymd.month, _ymd.day)
 *         res_ptr[i * 3] = _iso.year
 */
    __pyx_t_7 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_DAY)); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 3945, __pyx_L1_error)
    __pyx_v__ymd = __pyx_t_7;

    /* "utils.pxd":3946
 *     for i in range(size):
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         _iso = ymd_isocalendar(_ymd.year, _ymd.month, _ymd.day)             # <<<<<<<<<<<<<<
 *         res_ptr[i * 3] = _iso.year
 *         res_ptr[i * 3 + 1] = _iso.week
 */
    __pyx_t_8 = __pyx_f_7cytimes_5utils_ymd_isocalendar(__pyx_v__ymd.year, __pyx_v__ymd.month, __pyx_v__ymd.day); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 3946, __pyx_L1_error)
    __pyx_v__iso = __pyx_t_8;

    /* "utils.pxd":3947
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         _iso = ymd_isocalendar(_ymd.year, _ymd.month, _ymd.day)
 *         res_ptr[i * 3] = _iso.year             # <<<<<<<<<<<<<<
 *         res_ptr[i * 3 + 1] = _iso.week
 *         res_ptr[i * 3 + 2] = _iso.weekday
 */
    __pyx_t_9 = __pyx_v__iso.year;
    (__pyx_v_res_ptr[(__pyx_v_i * 3)]) = __pyx_t_9;

    /* "utils.pxd":3948
 *         _iso = ymd_isocalendar(_ymd.year, _ymd.month, _ymd.day)
 *         res_ptr[i * 3] = _iso.year
 *         res_ptr[i * 3 + 1] = _iso.week             # <<<<<<<<<<<<<<
 *         res_ptr[i * 3 + 2] = _iso.weekday
 *     return res
 */
    __pyx_t_9 = __pyx_v__iso.week;
    (__pyx_v_res_ptr[((__pyx_v_i * 3) + 1)]) = __pyx_t_9;

    /* "utils.pxd":3949
 *         res_ptr[i * 3] = _iso.year
 *         res_ptr[i * 3 + 1] = _iso.week
 *         res_ptr[i * 3 + 2] = _iso.weekday             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_9 = __pyx_v__iso.weekday;
    (__pyx_v_res_ptr[((__pyx_v_i * 3) + 2)]) = __pyx_t_9;
  }

  /* "utils.pxd":3950
 *         res_ptr[i * 3 + 1] = _iso.week
 *         res_ptr[i * 3 + 2] = _iso.weekday
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_is_leap_year(np.ndarray arr, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3918
 * 
 * # . calendar
 * cdef inline np.ndarray dt64arr_isocalendar(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the ISO calendar values of the ndarray[datetime64] `<'ndarray[int64]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_isocalendar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3952
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_is_leap_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Check if the ndarray[datetime64] are leap years `<'ndarray[bool]'>`."""
 *     # Cast to int64[Y]
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_is_leap_year(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_is_leap_year *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_bool *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_is_leap_year", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3955
 *     """Check if the ndarray[datetime64] are leap years `<'ndarray[bool]'>`."""
 *     # Cast to int64[Y]
 *     arr = dt64arr_as_int64_Y(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Check leap year
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":3959
 *     # Check leap year
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3960
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)             # <<<<<<<<<<<<<<
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_BOOL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3960, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":3961
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_bool *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3962
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3965
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = is_leap_year(arr_ptr[i] + EPOCH_YEAR)
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":3966
 * 
 *     for i in range(size):
 *         res_ptr[i] = is_leap_year(arr_ptr[i] + EPOCH_YEAR)             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_7 = __pyx_f_7cytimes_5utils_is_leap_year(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_YEAR)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 3966, __pyx_L1_error)
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_t_7;
  }

  /* "utils.pxd":3967
 *     for i in range(size):
 *         res_ptr[i] = is_leap_year(arr_ptr[i] + EPOCH_YEAR)
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_is_long_year(np.ndarray arr, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3952
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_is_leap_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Check if the ndarray[datetime64] are leap years `<'ndarray[bool]'>`."""
 *     # Cast to int64[Y]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_is_leap_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3969
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_is_long_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Check if the ndarray[datetime64] are long years
 *     (maximum ISO week number equal 53) `<'ndarray[bool]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_is_long_year(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_is_long_year *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_bool *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_is_long_year", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3974
 *     """
 *     # Cast to int64[Y]
 *     arr = dt64arr_as_int64_Y(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Check long year
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":3978
 *     # Check long year
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3979
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)             # <<<<<<<<<<<<<<
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_BOOL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3979, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":3980
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_bool *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3981
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_BOOL, 0)
 *         np.npy_bool* res_ptr = <np.npy_bool*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":3984
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = is_long_year(arr_ptr[i] + EPOCH_YEAR)
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":3985
 * 
 *     for i in range(size):
 *         res_ptr[i] = is_long_year(arr_ptr[i] + EPOCH_YEAR)             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_7 = __pyx_f_7cytimes_5utils_is_long_year(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_YEAR)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 3985, __pyx_L1_error)
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_t_7;
  }

  /* "utils.pxd":3986
 *     for i in range(size):
 *         res_ptr[i] = is_long_year(arr_ptr[i] + EPOCH_YEAR)
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_leap_bt_year(np.ndarray arr, np.npy_int64 year, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3969
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_is_long_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Check if the ndarray[datetime64] are long years
 *     (maximum ISO week number equal 53) `<'ndarray[bool]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_is_long_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":3988
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_leap_bt_year(np.ndarray arr, np.npy_int64 year, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Calcuate the number of leap years between the ndarray[datetime64]
 *     and the passed in 'year' value `<'ndarray[int64]'>`."""
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_leap_bt_year(PyArrayObject *__pyx_v_arr, npy_int64 __pyx_v_year, struct __pyx_opt_args_7cytimes_5utils_dt64arr_leap_bt_year *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_leap_bt_year", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":3992
 *     and the passed in 'year' value `<'ndarray[int64]'>`."""
 *     # Cast to int64[Y]
 *     arr = dt64arr_as_int64_Y(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute leap years
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":3996
 *     # Compute leap years
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":3997
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 3997, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":3998
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":3999
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":4002
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = leap_bt_year(arr_ptr[i] + EPOCH_YEAR, year)
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":4003
 * 
 *     for i in range(size):
 *         res_ptr[i] = leap_bt_year(arr_ptr[i] + EPOCH_YEAR, year)             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_7 = __pyx_f_7cytimes_5utils_leap_bt_year(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_YEAR), __pyx_v_year); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 4003, __pyx_L1_error)
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_t_7;
  }

  /* "utils.pxd":4004
 *     for i in range(size):
 *         res_ptr[i] = leap_bt_year(arr_ptr[i] + EPOCH_YEAR, year)
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_days_in_year(np.ndarray arr, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":3988
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_leap_bt_year(np.ndarray arr, np.npy_int64 year, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Calcuate the number of leap years between the ndarray[datetime64]
 *     and the passed in 'year' value `<'ndarray[int64]'>`."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_leap_bt_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4006
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_in_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the maximum days (365, 366) in the year
 *     of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_in_year(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_year *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_days_in_year", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4010
 *     of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 *     # Cast to int64[Y]
 *     arr = dt64arr_as_int64_Y(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute days in year
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":4014
 *     # Compute days in year
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":4015
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4015, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":4016
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":4017
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":4020
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = days_in_year(arr_ptr[i] + EPOCH_YEAR)
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":4021
 * 
 *     for i in range(size):
 *         res_ptr[i] = days_in_year(arr_ptr[i] + EPOCH_YEAR)             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_7 = __pyx_f_7cytimes_5utils_days_in_year(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_YEAR)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 4021, __pyx_L1_error)
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_t_7;
  }

  /* "utils.pxd":4022
 *     for i in range(size):
 *         res_ptr[i] = days_in_year(arr_ptr[i] + EPOCH_YEAR)
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_days_bf_year(np.ndarray arr, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":4006
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_in_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the maximum days (365, 366) in the year
 *     of the ndarray[datetime64] `<'ndarray[int64]'>`."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_days_in_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4024
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_bf_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the np.ndarray[datetime64]
 *     and the 1st day of the 1AD `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_bf_year(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_bf_year *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_days_bf_year", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4029
 *     """
 *     # Cast to int64[Y]
 *     arr = dt64arr_as_int64_Y(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute days before year
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":4033
 *     # Compute days before year
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":4034
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4034, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":4035
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":4036
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":4039
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = days_bf_year(arr_ptr[i] + EPOCH_YEAR)
 *     return res
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":4040
 * 
 *     for i in range(size):
 *         res_ptr[i] = days_bf_year(arr_ptr[i] + EPOCH_YEAR)             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_7 = __pyx_f_7cytimes_5utils_days_bf_year(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_YEAR)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 4040, __pyx_L1_error)
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_t_7;
  }

  /* "utils.pxd":4041
 *     for i in range(size):
 *         res_ptr[i] = days_bf_year(arr_ptr[i] + EPOCH_YEAR)
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_days_of_year(np.ndarray arr, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":4024
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_bf_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the np.ndarray[datetime64]
 *     and the 1st day of the 1AD `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_days_bf_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4043
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_of_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the np.ndarray[datetime64]
 *     and the 1st day of the array years `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_of_year(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_of_year *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  __pyx_t_7cytimes_5utils_ymd __pyx_v__ymd;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_days_of_year", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4048
 *     """
 *     # Cast to int64[D]
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute days of year
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":4052
 *     # Compute days of year
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":4053
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4053, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":4054
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":4055
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":4058
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_of_year(_ymd.year, _ymd.month, _ymd.day)
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":4059
 * 
 *     for i in range(size):
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)             # <<<<<<<<<<<<<<
 *         res_ptr[i] = days_of_year(_ymd.year, _ymd.month, _ymd.day)
 *     return res
 */
    __pyx_t_7 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_DAY)); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 4059, __pyx_L1_error)
    __pyx_v__ymd = __pyx_t_7;

    /* "utils.pxd":4060
 *     for i in range(size):
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_of_year(_ymd.year, _ymd.month, _ymd.day)             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_8 = __pyx_f_7cytimes_5utils_days_of_year(__pyx_v__ymd.year, __pyx_v__ymd.month, __pyx_v__ymd.day); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 4060, __pyx_L1_error)
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_t_8;
  }

  /* "utils.pxd":4061
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_of_year(_ymd.year, _ymd.month, _ymd.day)
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_days_in_quarter(np.ndarray arr, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":4043
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_of_year(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the np.ndarray[datetime64]
 *     and the 1st day of the array years `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_days_of_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4063
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_in_quarter(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the maximum days in the quarter of the np.npdarray[datetime64] `<'int'>`."""
 *     # Cast to int64[D]
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_in_quarter(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_quarter *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  __pyx_t_7cytimes_5utils_ymd __pyx_v__ymd;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_days_in_quarter", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4066
 *     """Get the maximum days in the quarter of the np.npdarray[datetime64] `<'int'>`."""
 *     # Cast to int64[D]
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute days in quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":4070
 *     # Compute days in quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":4071
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4071, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4071, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":4072
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":4073
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":4076
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_in_quarter(_ymd.year, _ymd.month)
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":4077
 * 
 *     for i in range(size):
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)             # <<<<<<<<<<<<<<
 *         res_ptr[i] = days_in_quarter(_ymd.year, _ymd.month)
 *     return res
 */
    __pyx_t_7 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_DAY)); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 4077, __pyx_L1_error)
    __pyx_v__ymd = __pyx_t_7;

    /* "utils.pxd":4078
 *     for i in range(size):
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_in_quarter(_ymd.year, _ymd.month)             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_8 = __pyx_f_7cytimes_5utils_days_in_quarter(__pyx_v__ymd.year, __pyx_v__ymd.month); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 4078, __pyx_L1_error)
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_t_8;
  }

  /* "utils.pxd":4079
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_in_quarter(_ymd.year, _ymd.month)
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_days_bf_quarter(np.ndarray arr, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":4063
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_in_quarter(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the maximum days in the quarter of the np.npdarray[datetime64] `<'int'>`."""
 *     # Cast to int64[D]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_days_in_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4081
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_bf_quarter(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the 1st day of the year
 *     of the np.ndarray[datetime64] and the 1st day of its quarter `<'int'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_bf_quarter(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_bf_quarter *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  __pyx_t_7cytimes_5utils_ymd __pyx_v__ymd;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_days_bf_quarter", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4086
 *     """
 *     # Cast to int64[D]
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute days in quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":4090
 *     # Compute days in quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":4091
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4091, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":4092
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":4093
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":4096
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_bf_quarter(_ymd.year, _ymd.month)
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":4097
 * 
 *     for i in range(size):
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)             # <<<<<<<<<<<<<<
 *         res_ptr[i] = days_bf_quarter(_ymd.year, _ymd.month)
 *     return res
 */
    __pyx_t_7 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_DAY)); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 4097, __pyx_L1_error)
    __pyx_v__ymd = __pyx_t_7;

    /* "utils.pxd":4098
 *     for i in range(size):
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_bf_quarter(_ymd.year, _ymd.month)             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_8 = __pyx_f_7cytimes_5utils_days_bf_quarter(__pyx_v__ymd.year, __pyx_v__ymd.month); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 4098, __pyx_L1_error)
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_t_8;
  }

  /* "utils.pxd":4099
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_bf_quarter(_ymd.year, _ymd.month)
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_days_of_quarter(np.ndarray arr, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":4081
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_bf_quarter(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the 1st day of the year
 *     of the np.ndarray[datetime64] and the 1st day of its quarter `<'int'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_days_bf_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4101
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_of_quarter(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the 1st day of the quarter
 *     of the np.ndarray[datetime64] and the its date `<'int'>`."""
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_of_quarter(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_of_quarter *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  __pyx_t_7cytimes_5utils_ymd __pyx_v__ymd;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_days_of_quarter", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4105
 *     of the np.ndarray[datetime64] and the its date `<'int'>`."""
 *     # Cast to int64[D]
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute days in quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":4109
 *     # Compute days in quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":4110
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4110, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":4111
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":4112
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":4115
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_of_quarter(_ymd.year, _ymd.month, _ymd.day)
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":4116
 * 
 *     for i in range(size):
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)             # <<<<<<<<<<<<<<
 *         res_ptr[i] = days_of_quarter(_ymd.year, _ymd.month, _ymd.day)
 *     return res
 */
    __pyx_t_7 = __pyx_f_7cytimes_5utils_ymd_fr_ordinal(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_DAY)); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 4116, __pyx_L1_error)
    __pyx_v__ymd = __pyx_t_7;

    /* "utils.pxd":4117
 *     for i in range(size):
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_of_quarter(_ymd.year, _ymd.month, _ymd.day)             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_8 = __pyx_f_7cytimes_5utils_days_of_quarter(__pyx_v__ymd.year, __pyx_v__ymd.month, __pyx_v__ymd.day); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 4117, __pyx_L1_error)
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_t_8;
  }

  /* "utils.pxd":4118
 *         _ymd = ymd_fr_ordinal(arr_ptr[i] + EPOCH_DAY)
 *         res_ptr[i] = days_of_quarter(_ymd.year, _ymd.month, _ymd.day)
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_days_in_month(np.ndarray arr, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":4101
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_of_quarter(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the 1st day of the quarter
 *     of the np.ndarray[datetime64] and the its date `<'int'>`."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_days_of_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4120
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_in_month(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the maximum days in the month of the ndarray[datetime64] <'ndarray[int64]'>."""
 *     # Cast to int64[M]
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_in_month(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_month *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_v;
  npy_int64 __pyx_v_mm;
  npy_int64 __pyx_v_dd;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_days_in_month", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4123
 *     """Get the maximum days in the month of the ndarray[datetime64] <'ndarray[int64]'>."""
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_M(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute days in month
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":4127
 *     # Compute days in month
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":4128
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4128, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":4129
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i, v, yy, mm, dd
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":4130
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, v, yy, mm, dd
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":4133
 *         np.npy_int64 i, v, yy, mm, dd
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         v = arr_ptr[i]
 *         mm = v % 12 + 1  # 1-based index
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":4134
 * 
 *     for i in range(size):
 *         v = arr_ptr[i]             # <<<<<<<<<<<<<<
 *         mm = v % 12 + 1  # 1-based index
 *         if not 1 < mm < 12:
 */
    __pyx_v_v = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "utils.pxd":4135
 *     for i in range(size):
 *         v = arr_ptr[i]
 *         mm = v % 12 + 1  # 1-based index             # <<<<<<<<<<<<<<
 *         if not 1 < mm < 12:
 *             dd = 31
 */
    __pyx_v_mm = (__Pyx_mod_npy_int64(__pyx_v_v, 12) + 1);

    /* "utils.pxd":4136
 *         v = arr_ptr[i]
 *         mm = v % 12 + 1  # 1-based index
 *         if not 1 < mm < 12:             # <<<<<<<<<<<<<<
 *             dd = 31
 *         else:
 */
    __pyx_t_7 = (1 < __pyx_v_mm);
    if (__pyx_t_7) {
      __pyx_t_7 = (__pyx_v_mm < 12);
    }
    __pyx_t_8 = (!__pyx_t_7);
    if (__pyx_t_8) {

      /* "utils.pxd":4137
 *         mm = v % 12 + 1  # 1-based index
 *         if not 1 < mm < 12:
 *             dd = 31             # <<<<<<<<<<<<<<
 *         else:
 *             dd = DAYS_IN_MONTH[mm]
 */
      __pyx_v_dd = 31;

      /* "utils.pxd":4136
 *         v = arr_ptr[i]
 *         mm = v % 12 + 1  # 1-based index
 *         if not 1 < mm < 12:             # <<<<<<<<<<<<<<
 *             dd = 31
 *         else:
 */
      goto __pyx_L5;
    }

    /* "utils.pxd":4139
 *             dd = 31
 *         else:
 *             dd = DAYS_IN_MONTH[mm]             # <<<<<<<<<<<<<<
 *             if mm == 2 and is_leap_year(v // 12 + EPOCH_YEAR):  # add back epoch
 *                 dd += 1
 */
    /*else*/ {
      __pyx_v_dd = (__pyx_v_7cytimes_5utils_DAYS_IN_MONTH[__pyx_v_mm]);

      /* "utils.pxd":4140
 *         else:
 *             dd = DAYS_IN_MONTH[mm]
 *             if mm == 2 and is_leap_year(v // 12 + EPOCH_YEAR):  # add back epoch             # <<<<<<<<<<<<<<
 *                 dd += 1
 *         res_ptr[i] = dd
 */
      __pyx_t_7 = (__pyx_v_mm == 2);
      if (__pyx_t_7) {
      } else {
        __pyx_t_8 = __pyx_t_7;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_7 = __pyx_f_7cytimes_5utils_is_leap_year((__Pyx_div_npy_int64(__pyx_v_v, 12) + __pyx_v_7cytimes_5utils_EPOCH_YEAR)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 4140, __pyx_L1_error)
      __pyx_t_8 = __pyx_t_7;
      __pyx_L7_bool_binop_done:;
      if (__pyx_t_8) {

        /* "utils.pxd":4141
 *             dd = DAYS_IN_MONTH[mm]
 *             if mm == 2 and is_leap_year(v // 12 + EPOCH_YEAR):  # add back epoch
 *                 dd += 1             # <<<<<<<<<<<<<<
 *         res_ptr[i] = dd
 *     return res
 */
        __pyx_v_dd = (__pyx_v_dd + 1);

        /* "utils.pxd":4140
 *         else:
 *             dd = DAYS_IN_MONTH[mm]
 *             if mm == 2 and is_leap_year(v // 12 + EPOCH_YEAR):  # add back epoch             # <<<<<<<<<<<<<<
 *                 dd += 1
 *         res_ptr[i] = dd
 */
      }
    }
    __pyx_L5:;

    /* "utils.pxd":4142
 *             if mm == 2 and is_leap_year(v // 12 + EPOCH_YEAR):  # add back epoch
 *                 dd += 1
 *         res_ptr[i] = dd             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_v_dd;
  }

  /* "utils.pxd":4143
 *                 dd += 1
 *         res_ptr[i] = dd
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_days_bf_month(np.ndarray arr, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":4120
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_in_month(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the maximum days in the month of the ndarray[datetime64] <'ndarray[int64]'>."""
 *     # Cast to int64[M]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_days_in_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4145
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_bf_month(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the 1st day of the
 *     np.ndarray[datetime64] and the 1st day of its month `<'int'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_days_bf_month(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_bf_month *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_v;
  npy_int64 __pyx_v_mm;
  npy_int64 __pyx_v_dd;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_days_bf_month", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4150
 *     """
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_M(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute days before month
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":4154
 *     # Compute days before month
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":4155
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4155, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":4156
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i, v, yy, mm, dd
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":4157
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, v, yy, mm, dd
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":4160
 *         np.npy_int64 i, v, yy, mm, dd
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         v = arr_ptr[i]
 *         mm = v % 12 + 1  # 1-based index
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":4161
 * 
 *     for i in range(size):
 *         v = arr_ptr[i]             # <<<<<<<<<<<<<<
 *         mm = v % 12 + 1  # 1-based index
 *         if mm <= 0:
 */
    __pyx_v_v = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "utils.pxd":4162
 *     for i in range(size):
 *         v = arr_ptr[i]
 *         mm = v % 12 + 1  # 1-based index             # <<<<<<<<<<<<<<
 *         if mm <= 0:
 *             dd = 0
 */
    __pyx_v_mm = (__Pyx_mod_npy_int64(__pyx_v_v, 12) + 1);

    /* "utils.pxd":4163
 *         v = arr_ptr[i]
 *         mm = v % 12 + 1  # 1-based index
 *         if mm <= 0:             # <<<<<<<<<<<<<<
 *             dd = 0
 *         elif mm == 2:
 */
    __pyx_t_7 = (__pyx_v_mm <= 0);
    if (__pyx_t_7) {

      /* "utils.pxd":4164
 *         mm = v % 12 + 1  # 1-based index
 *         if mm <= 0:
 *             dd = 0             # <<<<<<<<<<<<<<
 *         elif mm == 2:
 *             dd = 31
 */
      __pyx_v_dd = 0;

      /* "utils.pxd":4163
 *         v = arr_ptr[i]
 *         mm = v % 12 + 1  # 1-based index
 *         if mm <= 0:             # <<<<<<<<<<<<<<
 *             dd = 0
 *         elif mm == 2:
 */
      goto __pyx_L5;
    }

    /* "utils.pxd":4165
 *         if mm <= 0:
 *             dd = 0
 *         elif mm == 2:             # <<<<<<<<<<<<<<
 *             dd = 31
 *         else:
 */
    __pyx_t_7 = (__pyx_v_mm == 2);
    if (__pyx_t_7) {

      /* "utils.pxd":4166
 *             dd = 0
 *         elif mm == 2:
 *             dd = 31             # <<<<<<<<<<<<<<
 *         else:
 *             dd = DAYS_BR_MONTH[mm - 1]
 */
      __pyx_v_dd = 31;

      /* "utils.pxd":4165
 *         if mm <= 0:
 *             dd = 0
 *         elif mm == 2:             # <<<<<<<<<<<<<<
 *             dd = 31
 *         else:
 */
      goto __pyx_L5;
    }

    /* "utils.pxd":4168
 *             dd = 31
 *         else:
 *             dd = DAYS_BR_MONTH[mm - 1]             # <<<<<<<<<<<<<<
 *             if is_leap_year(v // 12 + EPOCH_YEAR):  # add back epoch
 *                 dd += 1
 */
    /*else*/ {
      __pyx_v_dd = (__pyx_v_7cytimes_5utils_DAYS_BR_MONTH[(__pyx_v_mm - 1)]);

      /* "utils.pxd":4169
 *         else:
 *             dd = DAYS_BR_MONTH[mm - 1]
 *             if is_leap_year(v // 12 + EPOCH_YEAR):  # add back epoch             # <<<<<<<<<<<<<<
 *                 dd += 1
 *         res_ptr[i] = dd
 */
      __pyx_t_7 = __pyx_f_7cytimes_5utils_is_leap_year((__Pyx_div_npy_int64(__pyx_v_v, 12) + __pyx_v_7cytimes_5utils_EPOCH_YEAR)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 4169, __pyx_L1_error)
      if (__pyx_t_7) {

        /* "utils.pxd":4170
 *             dd = DAYS_BR_MONTH[mm - 1]
 *             if is_leap_year(v // 12 + EPOCH_YEAR):  # add back epoch
 *                 dd += 1             # <<<<<<<<<<<<<<
 *         res_ptr[i] = dd
 *     return res
 */
        __pyx_v_dd = (__pyx_v_dd + 1);

        /* "utils.pxd":4169
 *         else:
 *             dd = DAYS_BR_MONTH[mm - 1]
 *             if is_leap_year(v // 12 + EPOCH_YEAR):  # add back epoch             # <<<<<<<<<<<<<<
 *                 dd += 1
 *         res_ptr[i] = dd
 */
      }
    }
    __pyx_L5:;

    /* "utils.pxd":4171
 *             if is_leap_year(v // 12 + EPOCH_YEAR):  # add back epoch
 *                 dd += 1
 *         res_ptr[i] = dd             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_v_dd;
  }

  /* "utils.pxd":4172
 *                 dd += 1
 *         res_ptr[i] = dd
 *     return res             # <<<<<<<<<<<<<<
 * 
 * # . conversion: int64
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":4145
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_days_bf_month(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Get the number of days between the 1st day of the
 *     np.ndarray[datetime64] and the 1st day of its month `<'int'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_days_bf_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4175
 * 
 * # . conversion: int64
 * cdef inline np.ndarray dt64arr_fr_int64(np.npy_int64 val, str unit, np.npy_int64 size):             # <<<<<<<<<<<<<<
 *     """Create an ndarray[datetime64] from the passed in
 *     integer and array size `<'ndarray[datetime64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_fr_int64(npy_int64 __pyx_v_val, PyObject *__pyx_v_unit, npy_int64 __pyx_v_size) {
  PyArrayObject *__pyx_v_arr = 0;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  npy_intp __pyx_t_4[1];
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  unsigned int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_fr_int64", 0);
  __Pyx_INCREF(__pyx_v_unit);

  /* "utils.pxd":4183
 *     """
 *     # Validate
 *     if size < 1:             # <<<<<<<<<<<<<<
 *         raise ValueError("array size must be greater than 0.")
 *     unit = map_nptime_unit_int2str(map_nptime_unit_str2int(unit))
 */
  __pyx_t_1 = (__pyx_v_size < 1);
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":4184
 *     # Validate
 *     if size < 1:
 *         raise ValueError("array size must be greater than 0.")             # <<<<<<<<<<<<<<
 *     unit = map_nptime_unit_int2str(map_nptime_unit_str2int(unit))
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 4184, __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(5, 4184, __pyx_L1_error)

    /* "utils.pxd":4183
 *     """
 *     # Validate
 *     if size < 1:             # <<<<<<<<<<<<<<
 *         raise ValueError("array size must be greater than 0.")
 *     unit = map_nptime_unit_int2str(map_nptime_unit_str2int(unit))
 */
  }

  /* "utils.pxd":4185
 *     if size < 1:
 *         raise ValueError("array size must be greater than 0.")
 *     unit = map_nptime_unit_int2str(map_nptime_unit_str2int(unit))             # <<<<<<<<<<<<<<
 * 
 *     # New array
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_unit); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 4185, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 4185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_unit, ((PyObject*)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "utils.pxd":4189
 *     # New array
 *     cdef:
 *         np.ndarray arr = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i
 */
  __pyx_t_4[0] = __pyx_v_size;
  __pyx_t_2 = PyArray_EMPTY(1, __pyx_t_4, NPY_INT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 4189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4189, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "utils.pxd":4190
 *     cdef:
 *         np.ndarray arr = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":4193
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         arr_ptr[i] = val
 *     return arr.astype("datetime64[%s]" % unit)
 */
  __pyx_t_5 = __pyx_v_size;
  __pyx_t_6 = __pyx_t_5;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "utils.pxd":4194
 * 
 *     for i in range(size):
 *         arr_ptr[i] = val             # <<<<<<<<<<<<<<
 *     return arr.astype("datetime64[%s]" % unit)
 * 
 */
    (__pyx_v_arr_ptr[__pyx_v_i]) = __pyx_v_val;
  }

  /* "utils.pxd":4195
 *     for i in range(size):
 *         arr_ptr[i] = val
 *     return arr.astype("datetime64[%s]" % unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_int64(np.ndarray arr, str unit, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 4195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_unit); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 4195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_9};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 4195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4195, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":4175
 * 
 * # . conversion: int64
 * cdef inline np.ndarray dt64arr_fr_int64(np.npy_int64 val, str unit, np.npy_int64 size):             # <<<<<<<<<<<<<<
 *     """Create an ndarray[datetime64] from the passed in
 *     integer and array size `<'ndarray[datetime64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_fr_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_unit);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4197
 *     return arr.astype("datetime64[%s]" % unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64(np.ndarray arr, str unit, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 according to the given
 *     'unit' resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_unit, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  Py_ssize_t __pyx_v_size;
  Py_UCS4 __pyx_v_ch;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_UCS4 __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_s __pyx_t_4;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_m __pyx_t_5;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_h __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_W __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Q __pyx_t_10;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_11;
  int __pyx_t_12;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ns __pyx_t_13;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_us __pyx_t_14;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ms __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }

  /* "utils.pxd":4207
 *     """
 *     cdef:
 *         Py_ssize_t size = str_len(unit)             # <<<<<<<<<<<<<<
 *         Py_UCS4 ch
 * 
 */
  __pyx_v_size = PyUnicode_GET_LENGTH(__pyx_v_unit);

  /* "utils.pxd":4211
 * 
 *     # Unit: 's', 'm', 'h', 'D'/'d', 'M', 'Y'
 *     if size == 1:             # <<<<<<<<<<<<<<
 *         ch = str_read(unit, 0)
 *         if ch == "s":
 */
  __pyx_t_1 = (__pyx_v_size == 1);
  if (__pyx_t_1) {

    /* "utils.pxd":4212
 *     # Unit: 's', 'm', 'h', 'D'/'d', 'M', 'Y'
 *     if size == 1:
 *         ch = str_read(unit, 0)             # <<<<<<<<<<<<<<
 *         if ch == "s":
 *             return dt64arr_as_int64_s(arr, arr_unit, offset)
 */
    __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_unit, 0); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(5, 4212, __pyx_L1_error)
    __pyx_v_ch = __pyx_t_2;

    /* "utils.pxd":4213
 *     if size == 1:
 *         ch = str_read(unit, 0)
 *         if ch == "s":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_s(arr, arr_unit, offset)
 *         if ch == "m":
 */
    __pyx_t_1 = (__pyx_v_ch == 0x73);
    if (__pyx_t_1) {

      /* "utils.pxd":4214
 *         ch = str_read(unit, 0)
 *         if ch == "s":
 *             return dt64arr_as_int64_s(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 *         if ch == "m":
 *             return dt64arr_as_int64_m(arr, arr_unit, offset)
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_4.__pyx_n = 2;
      __pyx_t_4.arr_unit = __pyx_v_arr_unit;
      __pyx_t_4.offset = __pyx_v_offset;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_s(__pyx_v_arr, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4214, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "utils.pxd":4213
 *     if size == 1:
 *         ch = str_read(unit, 0)
 *         if ch == "s":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_s(arr, arr_unit, offset)
 *         if ch == "m":
 */
    }

    /* "utils.pxd":4215
 *         if ch == "s":
 *             return dt64arr_as_int64_s(arr, arr_unit, offset)
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_m(arr, arr_unit, offset)
 *         if ch == "h":
 */
    __pyx_t_1 = (__pyx_v_ch == 0x6D);
    if (__pyx_t_1) {

      /* "utils.pxd":4216
 *             return dt64arr_as_int64_s(arr, arr_unit, offset)
 *         if ch == "m":
 *             return dt64arr_as_int64_m(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 *         if ch == "h":
 *             return dt64arr_as_int64_h(arr, arr_unit, offset)
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_5.__pyx_n = 2;
      __pyx_t_5.arr_unit = __pyx_v_arr_unit;
      __pyx_t_5.offset = __pyx_v_offset;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_m(__pyx_v_arr, &__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "utils.pxd":4215
 *         if ch == "s":
 *             return dt64arr_as_int64_s(arr, arr_unit, offset)
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_m(arr, arr_unit, offset)
 *         if ch == "h":
 */
    }

    /* "utils.pxd":4217
 *         if ch == "m":
 *             return dt64arr_as_int64_m(arr, arr_unit, offset)
 *         if ch == "h":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_h(arr, arr_unit, offset)
 *         if ch in ("D", "d"):
 */
    __pyx_t_1 = (__pyx_v_ch == 0x68);
    if (__pyx_t_1) {

      /* "utils.pxd":4218
 *             return dt64arr_as_int64_m(arr, arr_unit, offset)
 *         if ch == "h":
 *             return dt64arr_as_int64_h(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 *         if ch in ("D", "d"):
 *             return dt64arr_as_int64_D(arr, arr_unit, offset)
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_6.__pyx_n = 2;
      __pyx_t_6.arr_unit = __pyx_v_arr_unit;
      __pyx_t_6.offset = __pyx_v_offset;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_h(__pyx_v_arr, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "utils.pxd":4217
 *         if ch == "m":
 *             return dt64arr_as_int64_m(arr, arr_unit, offset)
 *         if ch == "h":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_h(arr, arr_unit, offset)
 *         if ch in ("D", "d"):
 */
    }

    /* "utils.pxd":4219
 *         if ch == "h":
 *             return dt64arr_as_int64_h(arr, arr_unit, offset)
 *         if ch in ("D", "d"):             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_D(arr, arr_unit, offset)
 *         if ch == "W":
 */
    switch (__pyx_v_ch) {
      case 68:
      case 0x64:

      /* "utils.pxd":4220
 *             return dt64arr_as_int64_h(arr, arr_unit, offset)
 *         if ch in ("D", "d"):
 *             return dt64arr_as_int64_D(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 *         if ch == "W":
 *             return dt64arr_as_int64_W(arr, arr_unit, offset)
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_7.__pyx_n = 2;
      __pyx_t_7.arr_unit = __pyx_v_arr_unit;
      __pyx_t_7.offset = __pyx_v_offset;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4220, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "utils.pxd":4219
 *         if ch == "h":
 *             return dt64arr_as_int64_h(arr, arr_unit, offset)
 *         if ch in ("D", "d"):             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_D(arr, arr_unit, offset)
 *         if ch == "W":
 */
      break;
      default: break;
    }

    /* "utils.pxd":4221
 *         if ch in ("D", "d"):
 *             return dt64arr_as_int64_D(arr, arr_unit, offset)
 *         if ch == "W":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_W(arr, arr_unit, offset)
 *         if ch == "M":
 */
    __pyx_t_1 = (__pyx_v_ch == 87);
    if (__pyx_t_1) {

      /* "utils.pxd":4222
 *             return dt64arr_as_int64_D(arr, arr_unit, offset)
 *         if ch == "W":
 *             return dt64arr_as_int64_W(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 *         if ch == "M":
 *             return dt64arr_as_int64_M(arr, arr_unit, offset)
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_8.__pyx_n = 2;
      __pyx_t_8.arr_unit = __pyx_v_arr_unit;
      __pyx_t_8.offset = __pyx_v_offset;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_W(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4222, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "utils.pxd":4221
 *         if ch in ("D", "d"):
 *             return dt64arr_as_int64_D(arr, arr_unit, offset)
 *         if ch == "W":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_W(arr, arr_unit, offset)
 *         if ch == "M":
 */
    }

    /* "utils.pxd":4223
 *         if ch == "W":
 *             return dt64arr_as_int64_W(arr, arr_unit, offset)
 *         if ch == "M":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_M(arr, arr_unit, offset)
 *         if ch == "Q":
 */
    __pyx_t_1 = (__pyx_v_ch == 77);
    if (__pyx_t_1) {

      /* "utils.pxd":4224
 *             return dt64arr_as_int64_W(arr, arr_unit, offset)
 *         if ch == "M":
 *             return dt64arr_as_int64_M(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 *         if ch == "Q":
 *             return dt64arr_as_int64_Q(arr, arr_unit, offset)
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_9.__pyx_n = 2;
      __pyx_t_9.arr_unit = __pyx_v_arr_unit;
      __pyx_t_9.offset = __pyx_v_offset;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_arr, &__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4224, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "utils.pxd":4223
 *         if ch == "W":
 *             return dt64arr_as_int64_W(arr, arr_unit, offset)
 *         if ch == "M":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_M(arr, arr_unit, offset)
 *         if ch == "Q":
 */
    }

    /* "utils.pxd":4225
 *         if ch == "M":
 *             return dt64arr_as_int64_M(arr, arr_unit, offset)
 *         if ch == "Q":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_Q(arr, arr_unit, offset)
 *         if ch == "Y":
 */
    __pyx_t_1 = (__pyx_v_ch == 81);
    if (__pyx_t_1) {

      /* "utils.pxd":4226
 *             return dt64arr_as_int64_M(arr, arr_unit, offset)
 *         if ch == "Q":
 *             return dt64arr_as_int64_Q(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 *         if ch == "Y":
 *             return dt64arr_as_int64_Y(arr, arr_unit, offset)
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_10.__pyx_n = 2;
      __pyx_t_10.arr_unit = __pyx_v_arr_unit;
      __pyx_t_10.offset = __pyx_v_offset;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Q(__pyx_v_arr, &__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4226, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "utils.pxd":4225
 *         if ch == "M":
 *             return dt64arr_as_int64_M(arr, arr_unit, offset)
 *         if ch == "Q":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_Q(arr, arr_unit, offset)
 *         if ch == "Y":
 */
    }

    /* "utils.pxd":4227
 *         if ch == "Q":
 *             return dt64arr_as_int64_Q(arr, arr_unit, offset)
 *         if ch == "Y":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_Y(arr, arr_unit, offset)
 * 
 */
    __pyx_t_1 = (__pyx_v_ch == 89);
    if (__pyx_t_1) {

      /* "utils.pxd":4228
 *             return dt64arr_as_int64_Q(arr, arr_unit, offset)
 *         if ch == "Y":
 *             return dt64arr_as_int64_Y(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 * 
 *     # Unit: 'ns', 'us', 'ms'
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_11.__pyx_n = 2;
      __pyx_t_11.arr_unit = __pyx_v_arr_unit;
      __pyx_t_11.offset = __pyx_v_offset;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "utils.pxd":4227
 *         if ch == "Q":
 *             return dt64arr_as_int64_Q(arr, arr_unit, offset)
 *         if ch == "Y":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_Y(arr, arr_unit, offset)
 * 
 */
    }

    /* "utils.pxd":4211
 * 
 *     # Unit: 's', 'm', 'h', 'D'/'d', 'M', 'Y'
 *     if size == 1:             # <<<<<<<<<<<<<<
 *         ch = str_read(unit, 0)
 *         if ch == "s":
 */
    goto __pyx_L3;
  }

  /* "utils.pxd":4231
 * 
 *     # Unit: 'ns', 'us', 'ms'
 *     elif size == 2 and str_read(unit, 1) == "s":             # <<<<<<<<<<<<<<
 *         ch = str_read(unit, 0)
 *         if ch == "n":
 */
  __pyx_t_12 = (__pyx_v_size == 2);
  if (__pyx_t_12) {
  } else {
    __pyx_t_1 = __pyx_t_12;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_unit, 1); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(5, 4231, __pyx_L1_error)
  __pyx_t_12 = (__pyx_t_2 == 0x73);
  __pyx_t_1 = __pyx_t_12;
  __pyx_L11_bool_binop_done:;
  if (__pyx_t_1) {

    /* "utils.pxd":4232
 *     # Unit: 'ns', 'us', 'ms'
 *     elif size == 2 and str_read(unit, 1) == "s":
 *         ch = str_read(unit, 0)             # <<<<<<<<<<<<<<
 *         if ch == "n":
 *             return dt64arr_as_int64_ns(arr, arr_unit, offset)
 */
    __pyx_t_2 = PyUnicode_ReadChar(__pyx_v_unit, 0); if (unlikely(__pyx_t_2 == ((Py_UCS4)-1))) __PYX_ERR(5, 4232, __pyx_L1_error)
    __pyx_v_ch = __pyx_t_2;

    /* "utils.pxd":4233
 *     elif size == 2 and str_read(unit, 1) == "s":
 *         ch = str_read(unit, 0)
 *         if ch == "n":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_ns(arr, arr_unit, offset)
 *         if ch == "u":
 */
    __pyx_t_1 = (__pyx_v_ch == 0x6E);
    if (__pyx_t_1) {

      /* "utils.pxd":4234
 *         ch = str_read(unit, 0)
 *         if ch == "n":
 *             return dt64arr_as_int64_ns(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 *         if ch == "u":
 *             return dt64arr_as_int64_us(arr, arr_unit, offset)
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_13.__pyx_n = 2;
      __pyx_t_13.arr_unit = __pyx_v_arr_unit;
      __pyx_t_13.offset = __pyx_v_offset;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_ns(__pyx_v_arr, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4234, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "utils.pxd":4233
 *     elif size == 2 and str_read(unit, 1) == "s":
 *         ch = str_read(unit, 0)
 *         if ch == "n":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_ns(arr, arr_unit, offset)
 *         if ch == "u":
 */
    }

    /* "utils.pxd":4235
 *         if ch == "n":
 *             return dt64arr_as_int64_ns(arr, arr_unit, offset)
 *         if ch == "u":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_us(arr, arr_unit, offset)
 *         if ch == "m":
 */
    __pyx_t_1 = (__pyx_v_ch == 0x75);
    if (__pyx_t_1) {

      /* "utils.pxd":4236
 *             return dt64arr_as_int64_ns(arr, arr_unit, offset)
 *         if ch == "u":
 *             return dt64arr_as_int64_us(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 *         if ch == "m":
 *             return dt64arr_as_int64_ms(arr, arr_unit, offset)
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_14.__pyx_n = 2;
      __pyx_t_14.arr_unit = __pyx_v_arr_unit;
      __pyx_t_14.offset = __pyx_v_offset;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_us(__pyx_v_arr, &__pyx_t_14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4236, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "utils.pxd":4235
 *         if ch == "n":
 *             return dt64arr_as_int64_ns(arr, arr_unit, offset)
 *         if ch == "u":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_us(arr, arr_unit, offset)
 *         if ch == "m":
 */
    }

    /* "utils.pxd":4237
 *         if ch == "u":
 *             return dt64arr_as_int64_us(arr, arr_unit, offset)
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_ms(arr, arr_unit, offset)
 * 
 */
    __pyx_t_1 = (__pyx_v_ch == 0x6D);
    if (__pyx_t_1) {

      /* "utils.pxd":4238
 *             return dt64arr_as_int64_us(arr, arr_unit, offset)
 *         if ch == "m":
 *             return dt64arr_as_int64_ms(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 * 
 *     # Unit: 'min' for pandas compatibility
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_15.__pyx_n = 2;
      __pyx_t_15.arr_unit = __pyx_v_arr_unit;
      __pyx_t_15.offset = __pyx_v_offset;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_ms(__pyx_v_arr, &__pyx_t_15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4238, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "utils.pxd":4237
 *         if ch == "u":
 *             return dt64arr_as_int64_us(arr, arr_unit, offset)
 *         if ch == "m":             # <<<<<<<<<<<<<<
 *             return dt64arr_as_int64_ms(arr, arr_unit, offset)
 * 
 */
    }

    /* "utils.pxd":4231
 * 
 *     # Unit: 'ns', 'us', 'ms'
 *     elif size == 2 and str_read(unit, 1) == "s":             # <<<<<<<<<<<<<<
 *         ch = str_read(unit, 0)
 *         if ch == "n":
 */
    goto __pyx_L3;
  }

  /* "utils.pxd":4241
 * 
 *     # Unit: 'min' for pandas compatibility
 *     elif size == 3 and unit == "min":             # <<<<<<<<<<<<<<
 *         return dt64arr_as_int64_m(arr, arr_unit, offset)
 * 
 */
  __pyx_t_12 = (__pyx_v_size == 3);
  if (__pyx_t_12) {
  } else {
    __pyx_t_1 = __pyx_t_12;
    goto __pyx_L16_bool_binop_done;
  }
  __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_min, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(5, 4241, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_12;
  __pyx_L16_bool_binop_done:;
  if (__pyx_t_1) {

    /* "utils.pxd":4242
 *     # Unit: 'min' for pandas compatibility
 *     elif size == 3 and unit == "min":
 *         return dt64arr_as_int64_m(arr, arr_unit, offset)             # <<<<<<<<<<<<<<
 * 
 *     # Unsupported unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5.__pyx_n = 2;
    __pyx_t_5.arr_unit = __pyx_v_arr_unit;
    __pyx_t_5.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_m(__pyx_v_arr, &__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4241
 * 
 *     # Unit: 'min' for pandas compatibility
 *     elif size == 3 and unit == "min":             # <<<<<<<<<<<<<<
 *         return dt64arr_as_int64_m(arr, arr_unit, offset)
 * 
 */
  }
  __pyx_L3:;

  /* "utils.pxd":4246
 *     # Unsupported unit
 *     raise ValueError(
 *         "cannot cast <'ndarray[%s]'> to int64 under '%s' resolution.\n"             # <<<<<<<<<<<<<<
 *         "Supported resolutions: ['Y', 'M', 'D', 'h', 'm', 's', 'ms', 'us', 'ns']." % (arr.dtype, unit)
 *     )
 */
  __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_16 = 0;
  __pyx_t_2 = 127;
  __Pyx_INCREF(__pyx_kp_u_cannot_cast_ndarray);
  __pyx_t_16 += 22;
  __Pyx_GIVEREF(__pyx_kp_u_cannot_cast_ndarray);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_cannot_cast_ndarray);

  /* "utils.pxd":4247
 *     raise ValueError(
 *         "cannot cast <'ndarray[%s]'> to int64 under '%s' resolution.\n"
 *         "Supported resolutions: ['Y', 'M', 'D', 'h', 'm', 's', 'ms', 'us', 'ns']." % (arr.dtype, unit)             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_17)) __PYX_ERR(5, 4247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_18 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_17), __pyx_empty_unicode); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 4247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_t_2 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_18) > __pyx_t_2) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_18) : __pyx_t_2;
  __pyx_t_16 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_18);
  __Pyx_GIVEREF(__pyx_t_18);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_18);
  __pyx_t_18 = 0;
  __Pyx_INCREF(__pyx_kp_u_to_int64_under);
  __pyx_t_16 += 20;
  __Pyx_GIVEREF(__pyx_kp_u_to_int64_under);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_to_int64_under);
  __pyx_t_18 = __Pyx_PyUnicode_Unicode(__pyx_v_unit); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 4247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_2 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_18) > __pyx_t_2) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_18) : __pyx_t_2;
  __pyx_t_16 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_18);
  __Pyx_GIVEREF(__pyx_t_18);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_18);
  __pyx_t_18 = 0;
  __Pyx_INCREF(__pyx_kp_u_resolution_Supported_resolution);
  __pyx_t_16 += 86;
  __Pyx_GIVEREF(__pyx_kp_u_resolution_Supported_resolution);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u_resolution_Supported_resolution);

  /* "utils.pxd":4246
 *     # Unsupported unit
 *     raise ValueError(
 *         "cannot cast <'ndarray[%s]'> to int64 under '%s' resolution.\n"             # <<<<<<<<<<<<<<
 *         "Supported resolutions: ['Y', 'M', 'D', 'h', 'm', 's', 'ms', 'us', 'ns']." % (arr.dtype, unit)
 *     )
 */
  __pyx_t_18 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_16, __pyx_t_2); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 4246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "utils.pxd":4245
 * 
 *     # Unsupported unit
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "cannot cast <'ndarray[%s]'> to int64 under '%s' resolution.\n"
 *         "Supported resolutions: ['Y', 'M', 'D', 'h', 'm', 's', 'ms', 'us', 'ns']." % (arr.dtype, unit)
 */
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_18); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_ERR(5, 4245, __pyx_L1_error)

  /* "utils.pxd":4197
 *     return arr.astype("datetime64[%s]" % unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64(np.ndarray arr, str unit, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 according to the given
 *     'unit' resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4250
 *     )
 * 
 * cdef inline np.ndarray dt64arr_as_int64_Y(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'Y' (year)
 *     resolution `<'ndarray[int64]>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_n;
  npy_int64 __pyx_v_n400;
  npy_int64 __pyx_v_n100;
  npy_int64 __pyx_v_n4;
  npy_int64 __pyx_v_n1;
  npy_int64 __pyx_v_year;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  npy_intp __pyx_t_5[1];
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  npy_int64 __pyx_t_8;
  int __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64_Y", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4258
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":4259
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "utils.pxd":4258
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "utils.pxd":4263
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "utils.pxd":4264
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "utils.pxd":4265
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "utils.pxd":4266
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_kp_u_int64_under_Y_resolution); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 4266, __pyx_L1_error)

      /* "utils.pxd":4265
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "utils.pxd":4267
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4267, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "utils.pxd":4268
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "utils.pxd":4264
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'Y' resolution")
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":4269
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "utils.pxd":4270
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4270, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "utils.pxd":4269
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":4272
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only datetime64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4272, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "utils.pxd":4276
 * 
 *     # Fast-path: datetime64[Y]
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:             # <<<<<<<<<<<<<<
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "utils.pxd":4277
 *     # Fast-path: datetime64[Y]
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *         return arr if offset == 0 else arr_add(arr, offset)
 */
    __pyx_t_1 = (__pyx_v_dtype == NPY_DATETIME);
    if (__pyx_t_1) {

      /* "utils.pxd":4278
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)             # <<<<<<<<<<<<<<
 *         return arr if offset == 0 else arr_add(arr, offset)
 * 
 */
      __pyx_t_3 = PyArray_Cast(__pyx_v_arr, NPY_INT64); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4278, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "utils.pxd":4277
 *     # Fast-path: datetime64[Y]
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *         return arr if offset == 0 else arr_add(arr, offset)
 */
    }

    /* "utils.pxd":4279
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *         return arr if offset == 0 else arr_add(arr, offset)             # <<<<<<<<<<<<<<
 * 
 *     # Fast-path: datetime64[M]
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = (__pyx_v_offset == 0);
    if (__pyx_t_1) {
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_t_3 = ((PyObject *)__pyx_v_arr);
    } else {
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_arr, __pyx_v_offset)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 4279, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __pyx_t_4;
      __pyx_t_4 = 0;
    }
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4276
 * 
 *     # Fast-path: datetime64[Y]
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:             # <<<<<<<<<<<<<<
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 */
  }

  /* "utils.pxd":4282
 * 
 *     # Fast-path: datetime64[M]
 *     cdef np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *     cdef np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *     cdef np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":4283
 *     # Fast-path: datetime64[M]
 *     cdef np.npy_int64 size = arr.shape[0]
 *     cdef np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *     cdef np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *     cdef np.npy_int64* arr_ptr
 */
  __pyx_t_5[0] = __pyx_v_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_5, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4283, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "utils.pxd":4284
 *     cdef np.npy_int64 size = arr.shape[0]
 *     cdef np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *     cdef np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *     cdef np.npy_int64* arr_ptr
 *     cdef np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":4287
 *     cdef np.npy_int64* arr_ptr
 *     cdef np.npy_int64 i
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:             # <<<<<<<<<<<<<<
 *         arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         for i in range(size):
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "utils.pxd":4288
 *     cdef np.npy_int64 i
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 *         arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         for i in range(size):
 *             res_ptr[i] = arr_ptr[i] // 12 + offset
 */
    __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

    /* "utils.pxd":4289
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 *         arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             res_ptr[i] = arr_ptr[i] // 12 + offset
 *         return res
 */
    __pyx_t_6 = __pyx_v_size;
    __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;

      /* "utils.pxd":4290
 *         arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         for i in range(size):
 *             res_ptr[i] = arr_ptr[i] // 12 + offset             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
      (__pyx_v_res_ptr[__pyx_v_i]) = (__Pyx_div_npy_int64((__pyx_v_arr_ptr[__pyx_v_i]), 12) + __pyx_v_offset);
    }

    /* "utils.pxd":4291
 *         for i in range(size):
 *             res_ptr[i] = arr_ptr[i] // 12 + offset
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     # All the rest resolutions
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_res);
    __pyx_r = __pyx_v_res;
    goto __pyx_L0;

    /* "utils.pxd":4287
 *     cdef np.npy_int64* arr_ptr
 *     cdef np.npy_int64 i
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:             # <<<<<<<<<<<<<<
 *         arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         for i in range(size):
 */
  }

  /* "utils.pxd":4295
 *     # All the rest resolutions
 *     cdef np.npy_int64 n, n400, n100, n4, n1, year
 *     if unit not in (             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
  switch (__pyx_v_unit) {
    case NPY_FR_ns:

    /* "utils.pxd":4296
 *     cdef np.npy_int64 n, n400, n100, n4, n1, year
 *     if unit not in (
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 *         np.NPY_DATETIMEUNIT.NPY_FR_ms,
 */
    case NPY_FR_us:

    /* "utils.pxd":4297
 *     if unit not in (
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_ms,
 *         np.NPY_DATETIMEUNIT.NPY_FR_s,
 */
    case NPY_FR_ms:

    /* "utils.pxd":4298
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 *         np.NPY_DATETIMEUNIT.NPY_FR_ms,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         np.NPY_DATETIMEUNIT.NPY_FR_m,
 */
    case NPY_FR_s:

    /* "utils.pxd":4299
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 *         np.NPY_DATETIMEUNIT.NPY_FR_ms,
 *         np.NPY_DATETIMEUNIT.NPY_FR_s,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_m,
 *         np.NPY_DATETIMEUNIT.NPY_FR_h,
 */
    case NPY_FR_m:

    /* "utils.pxd":4300
 *         np.NPY_DATETIMEUNIT.NPY_FR_ms,
 *         np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         np.NPY_DATETIMEUNIT.NPY_FR_m,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_h,
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,
 */
    case NPY_FR_h:

    /* "utils.pxd":4301
 *         np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         np.NPY_DATETIMEUNIT.NPY_FR_m,
 *         np.NPY_DATETIMEUNIT.NPY_FR_h,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,
 *         np.NPY_DATETIMEUNIT.NPY_FR_W,
 */
    case NPY_FR_D:

    /* "utils.pxd":4302
 *         np.NPY_DATETIMEUNIT.NPY_FR_m,
 *         np.NPY_DATETIMEUNIT.NPY_FR_h,
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_W,
 *     ):
 */
    case NPY_FR_W:

    /* "utils.pxd":4295
 *     # All the rest resolutions
 *     cdef np.npy_int64 n, n400, n100, n4, n1, year
 *     if unit not in (             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
    __pyx_t_1 = 0;
    break;
    default:
    __pyx_t_1 = 1;
    break;
  }
  __pyx_t_9 = __pyx_t_1;
  if (__pyx_t_9) {

    /* "utils.pxd":4305
 *         np.NPY_DATETIMEUNIT.NPY_FR_W,
 *     ):
 *         _raise_dt64arr_as_int64_unit_error("Y", unit)             # <<<<<<<<<<<<<<
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)
 *     arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
    __pyx_t_9 = __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(__pyx_n_u_Y, __pyx_v_unit, NULL); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 4305, __pyx_L1_error)

    /* "utils.pxd":4295
 *     # All the rest resolutions
 *     cdef np.npy_int64 n, n400, n100, n4, n1, year
 *     if unit not in (             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
  }

  /* "utils.pxd":4306
 *     ):
 *         _raise_dt64arr_as_int64_unit_error("Y", unit)
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *     arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *     for i in range(size):
 */
  __pyx_t_10.__pyx_n = 2;
  __pyx_t_10.arr_unit = __pyx_v_arr_unit;
  __pyx_t_10.offset = 0;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "utils.pxd":4307
 *         _raise_dt64arr_as_int64_unit_error("Y", unit)
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)
 *     arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *     for i in range(size):
 *         # Convert to ordinal
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":4308
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)
 *     arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         # Convert to ordinal
 *         n = arr_ptr[i] + EPOCH_DAY - 1
 */
  __pyx_t_6 = __pyx_v_size;
  __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;

    /* "utils.pxd":4310
 *     for i in range(size):
 *         # Convert to ordinal
 *         n = arr_ptr[i] + EPOCH_DAY - 1             # <<<<<<<<<<<<<<
 *         # Number of complete 400-year cycles
 *         n400 = n // 146_097
 */
    __pyx_v_n = (((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_DAY) - 1);

    /* "utils.pxd":4312
 *         n = arr_ptr[i] + EPOCH_DAY - 1
 *         # Number of complete 400-year cycles
 *         n400 = n // 146_097             # <<<<<<<<<<<<<<
 *         n -= n400 * 146_097
 *         # Number of complete 100-year cycles within the 400-year cycle
 */
    __pyx_v_n400 = __Pyx_div_npy_int64(__pyx_v_n, 0x23AB1);

    /* "utils.pxd":4313
 *         # Number of complete 400-year cycles
 *         n400 = n // 146_097
 *         n -= n400 * 146_097             # <<<<<<<<<<<<<<
 *         # Number of complete 100-year cycles within the 400-year cycle
 *         n100 = n // 36_524
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n400 * 0x23AB1));

    /* "utils.pxd":4315
 *         n -= n400 * 146_097
 *         # Number of complete 100-year cycles within the 400-year cycle
 *         n100 = n // 36_524             # <<<<<<<<<<<<<<
 *         n -= n100 * 36_524
 *         # Number of complete 4-year cycles within the 100-year cycle
 */
    __pyx_v_n100 = __Pyx_div_npy_int64(__pyx_v_n, 0x8EAC);

    /* "utils.pxd":4316
 *         # Number of complete 100-year cycles within the 400-year cycle
 *         n100 = n // 36_524
 *         n -= n100 * 36_524             # <<<<<<<<<<<<<<
 *         # Number of complete 4-year cycles within the 100-year cycle
 *         n4 = n // 1_461
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n100 * 0x8EAC));

    /* "utils.pxd":4318
 *         n -= n100 * 36_524
 *         # Number of complete 4-year cycles within the 100-year cycle
 *         n4 = n // 1_461             # <<<<<<<<<<<<<<
 *         n -= n4 * 1_461
 *         # Number of complete years within the 4-year cycle
 */
    __pyx_v_n4 = __Pyx_div_npy_int64(__pyx_v_n, 0x5B5);

    /* "utils.pxd":4319
 *         # Number of complete 4-year cycles within the 100-year cycle
 *         n4 = n // 1_461
 *         n -= n4 * 1_461             # <<<<<<<<<<<<<<
 *         # Number of complete years within the 4-year cycle
 *         n1 = n // 365
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n4 * 0x5B5));

    /* "utils.pxd":4321
 *         n -= n4 * 1_461
 *         # Number of complete years within the 4-year cycle
 *         n1 = n // 365             # <<<<<<<<<<<<<<
 *         n -= n1 * 365
 *         # Compute the year
 */
    __pyx_v_n1 = __Pyx_div_npy_int64(__pyx_v_n, 0x16D);

    /* "utils.pxd":4322
 *         # Number of complete years within the 4-year cycle
 *         n1 = n // 365
 *         n -= n1 * 365             # <<<<<<<<<<<<<<
 *         # Compute the year
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1 + 1
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n1 * 0x16D));

    /* "utils.pxd":4324
 *         n -= n1 * 365
 *         # Compute the year
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1 + 1             # <<<<<<<<<<<<<<
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:
 */
    __pyx_v_year = (((((__pyx_v_n400 * 0x190) + (__pyx_v_n100 * 0x64)) + (__pyx_v_n4 * 4)) + __pyx_v_n1) + 1);

    /* "utils.pxd":4326
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1 + 1
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:             # <<<<<<<<<<<<<<
 *             year -= 1
 *         res_ptr[i] = year - EPOCH_YEAR + offset
 */
    __pyx_t_1 = (__pyx_v_n100 == 4);
    if (!__pyx_t_1) {
    } else {
      __pyx_t_9 = __pyx_t_1;
      goto __pyx_L15_bool_binop_done;
    }
    __pyx_t_1 = (__pyx_v_n1 == 4);
    __pyx_t_9 = __pyx_t_1;
    __pyx_L15_bool_binop_done:;
    if (__pyx_t_9) {

      /* "utils.pxd":4327
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:
 *             year -= 1             # <<<<<<<<<<<<<<
 *         res_ptr[i] = year - EPOCH_YEAR + offset
 *     return res
 */
      __pyx_v_year = (__pyx_v_year - 1);

      /* "utils.pxd":4326
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1 + 1
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:             # <<<<<<<<<<<<<<
 *             year -= 1
 *         res_ptr[i] = year - EPOCH_YEAR + offset
 */
    }

    /* "utils.pxd":4328
 *         if n100 == 4 or n1 == 4:
 *             year -= 1
 *         res_ptr[i] = year - EPOCH_YEAR + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((__pyx_v_year - __pyx_v_7cytimes_5utils_EPOCH_YEAR) + __pyx_v_offset);
  }

  /* "utils.pxd":4329
 *             year -= 1
 *         res_ptr[i] = year - EPOCH_YEAR + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_int64_Q(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":4250
 *     )
 * 
 * cdef inline np.ndarray dt64arr_as_int64_Y(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'Y' (year)
 *     resolution `<'ndarray[int64]>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64_Y", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4331
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_as_int64_Q(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'Q' (quarter)
 *     resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_Q(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Q *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_v;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64_Q", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4336
 *     """
 *     # Cast to int64[M]
 *     arr = dt64arr_as_int64_M(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute quarter
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":4340
 *     # Compute quarter
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":4341
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4341, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":4342
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i, v
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":4343
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, v
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":4346
 *         np.npy_int64 i, v
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         v = arr_ptr[i]
 *         res_ptr[i] = (v // 12 * 4) + (v % 12) // 3 + offset
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":4347
 * 
 *     for i in range(size):
 *         v = arr_ptr[i]             # <<<<<<<<<<<<<<
 *         res_ptr[i] = (v // 12 * 4) + (v % 12) // 3 + offset
 *     return res
 */
    __pyx_v_v = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "utils.pxd":4348
 *     for i in range(size):
 *         v = arr_ptr[i]
 *         res_ptr[i] = (v // 12 * 4) + (v % 12) // 3 + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (((__Pyx_div_npy_int64(__pyx_v_v, 12) * 4) + __Pyx_div_npy_int64(__Pyx_mod_npy_int64(__pyx_v_v, 12), 3)) + __pyx_v_offset);
  }

  /* "utils.pxd":4349
 *         v = arr_ptr[i]
 *         res_ptr[i] = (v // 12 * 4) + (v % 12) // 3 + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_int64_M(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":4331
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_as_int64_Q(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'Q' (quarter)
 *     resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64_Q", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4351
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_as_int64_M(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'M' (month)
 *     resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_n;
  npy_int64 __pyx_v_n400;
  npy_int64 __pyx_v_n100;
  npy_int64 __pyx_v_n4;
  npy_int64 __pyx_v_n1;
  npy_int64 __pyx_v_year;
  npy_int64 __pyx_v_month;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  npy_intp __pyx_t_5[1];
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  npy_int64 __pyx_t_8;
  int __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_10;
  npy_int64 __pyx_t_11;
  npy_int64 __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64_M", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4359
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":4360
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "utils.pxd":4359
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "utils.pxd":4364
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "utils.pxd":4365
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'M' resolution")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "utils.pxd":4366
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'M' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "utils.pxd":4367
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'M' resolution")             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_kp_u_int64_under_M_resolution); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 4367, __pyx_L1_error)

      /* "utils.pxd":4366
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'M' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "utils.pxd":4368
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'M' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4368, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "utils.pxd":4369
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'M' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "utils.pxd":4365
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'M' resolution")
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":4370
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "utils.pxd":4371
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4371, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "utils.pxd":4370
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":4373
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only datetime64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4373, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "utils.pxd":4377
 * 
 *     # Fast-path: datetime64[M]
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:             # <<<<<<<<<<<<<<
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "utils.pxd":4378
 *     # Fast-path: datetime64[M]
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *         return arr if offset == 0 else arr_add(arr, offset)
 */
    __pyx_t_1 = (__pyx_v_dtype == NPY_DATETIME);
    if (__pyx_t_1) {

      /* "utils.pxd":4379
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)             # <<<<<<<<<<<<<<
 *         return arr if offset == 0 else arr_add(arr, offset)
 * 
 */
      __pyx_t_3 = PyArray_Cast(__pyx_v_arr, NPY_INT64); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4379, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4379, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "utils.pxd":4378
 *     # Fast-path: datetime64[M]
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *         return arr if offset == 0 else arr_add(arr, offset)
 */
    }

    /* "utils.pxd":4380
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *         return arr if offset == 0 else arr_add(arr, offset)             # <<<<<<<<<<<<<<
 * 
 *     # Fast-path: datetime64[Y]
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = (__pyx_v_offset == 0);
    if (__pyx_t_1) {
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_t_3 = ((PyObject *)__pyx_v_arr);
    } else {
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_arr, __pyx_v_offset)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 4380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __pyx_t_4;
      __pyx_t_4 = 0;
    }
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4377
 * 
 *     # Fast-path: datetime64[M]
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:             # <<<<<<<<<<<<<<
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 */
  }

  /* "utils.pxd":4383
 * 
 *     # Fast-path: datetime64[Y]
 *     cdef np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *     cdef np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *     cdef np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":4384
 *     # Fast-path: datetime64[Y]
 *     cdef np.npy_int64 size = arr.shape[0]
 *     cdef np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *     cdef np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *     cdef np.npy_int64* arr_ptr
 */
  __pyx_t_5[0] = __pyx_v_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_5, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4384, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "utils.pxd":4385
 *     cdef np.npy_int64 size = arr.shape[0]
 *     cdef np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *     cdef np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *     cdef np.npy_int64* arr_ptr
 *     cdef np.npy_int64 i
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":4388
 *     cdef np.npy_int64* arr_ptr
 *     cdef np.npy_int64 i
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:             # <<<<<<<<<<<<<<
 *         arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         for i in range(size):
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "utils.pxd":4389
 *     cdef np.npy_int64 i
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:
 *         arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         for i in range(size):
 *             res_ptr[i] = arr_ptr[i] * 12 + offset
 */
    __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

    /* "utils.pxd":4390
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:
 *         arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             res_ptr[i] = arr_ptr[i] * 12 + offset
 *         return res
 */
    __pyx_t_6 = __pyx_v_size;
    __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;

      /* "utils.pxd":4391
 *         arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         for i in range(size):
 *             res_ptr[i] = arr_ptr[i] * 12 + offset             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
      (__pyx_v_res_ptr[__pyx_v_i]) = (((__pyx_v_arr_ptr[__pyx_v_i]) * 12) + __pyx_v_offset);
    }

    /* "utils.pxd":4392
 *         for i in range(size):
 *             res_ptr[i] = arr_ptr[i] * 12 + offset
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     # All the rest resolutions
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_res);
    __pyx_r = __pyx_v_res;
    goto __pyx_L0;

    /* "utils.pxd":4388
 *     cdef np.npy_int64* arr_ptr
 *     cdef np.npy_int64 i
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:             # <<<<<<<<<<<<<<
 *         arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         for i in range(size):
 */
  }

  /* "utils.pxd":4396
 *     # All the rest resolutions
 *     cdef np.npy_int64 n, n400, n100, n4, n1, year, month
 *     if unit not in (             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
  switch (__pyx_v_unit) {
    case NPY_FR_ns:

    /* "utils.pxd":4397
 *     cdef np.npy_int64 n, n400, n100, n4, n1, year, month
 *     if unit not in (
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 *         np.NPY_DATETIMEUNIT.NPY_FR_ms,
 */
    case NPY_FR_us:

    /* "utils.pxd":4398
 *     if unit not in (
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_ms,
 *         np.NPY_DATETIMEUNIT.NPY_FR_s,
 */
    case NPY_FR_ms:

    /* "utils.pxd":4399
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 *         np.NPY_DATETIMEUNIT.NPY_FR_ms,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         np.NPY_DATETIMEUNIT.NPY_FR_m,
 */
    case NPY_FR_s:

    /* "utils.pxd":4400
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 *         np.NPY_DATETIMEUNIT.NPY_FR_ms,
 *         np.NPY_DATETIMEUNIT.NPY_FR_s,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_m,
 *         np.NPY_DATETIMEUNIT.NPY_FR_h,
 */
    case NPY_FR_m:

    /* "utils.pxd":4401
 *         np.NPY_DATETIMEUNIT.NPY_FR_ms,
 *         np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         np.NPY_DATETIMEUNIT.NPY_FR_m,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_h,
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,
 */
    case NPY_FR_h:

    /* "utils.pxd":4402
 *         np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         np.NPY_DATETIMEUNIT.NPY_FR_m,
 *         np.NPY_DATETIMEUNIT.NPY_FR_h,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,
 *         np.NPY_DATETIMEUNIT.NPY_FR_W,
 */
    case NPY_FR_D:

    /* "utils.pxd":4403
 *         np.NPY_DATETIMEUNIT.NPY_FR_m,
 *         np.NPY_DATETIMEUNIT.NPY_FR_h,
 *         np.NPY_DATETIMEUNIT.NPY_FR_D,             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_W,
 *     ):
 */
    case NPY_FR_W:

    /* "utils.pxd":4396
 *     # All the rest resolutions
 *     cdef np.npy_int64 n, n400, n100, n4, n1, year, month
 *     if unit not in (             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
    __pyx_t_1 = 0;
    break;
    default:
    __pyx_t_1 = 1;
    break;
  }
  __pyx_t_9 = __pyx_t_1;
  if (__pyx_t_9) {

    /* "utils.pxd":4406
 *         np.NPY_DATETIMEUNIT.NPY_FR_W,
 *     ):
 *         _raise_dt64arr_as_int64_unit_error("M", unit)             # <<<<<<<<<<<<<<
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)
 *     arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
    __pyx_t_9 = __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(__pyx_n_u_M, __pyx_v_unit, NULL); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 4406, __pyx_L1_error)

    /* "utils.pxd":4396
 *     # All the rest resolutions
 *     cdef np.npy_int64 n, n400, n100, n4, n1, year, month
 *     if unit not in (             # <<<<<<<<<<<<<<
 *         np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *         np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
  }

  /* "utils.pxd":4407
 *     ):
 *         _raise_dt64arr_as_int64_unit_error("M", unit)
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *     arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *     for i in range(size):
 */
  __pyx_t_10.__pyx_n = 2;
  __pyx_t_10.arr_unit = __pyx_v_arr_unit;
  __pyx_t_10.offset = 0;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "utils.pxd":4408
 *         _raise_dt64arr_as_int64_unit_error("M", unit)
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)
 *     arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *     for i in range(size):
 *         # Convert to ordinal
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":4409
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)
 *     arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         # Convert to ordinal
 *         n = arr_ptr[i] + EPOCH_DAY - 1
 */
  __pyx_t_6 = __pyx_v_size;
  __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;

    /* "utils.pxd":4411
 *     for i in range(size):
 *         # Convert to ordinal
 *         n = arr_ptr[i] + EPOCH_DAY - 1             # <<<<<<<<<<<<<<
 *         # Number of complete 400-year cycles
 *         n400 = n // 146_097
 */
    __pyx_v_n = (((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_7cytimes_5utils_EPOCH_DAY) - 1);

    /* "utils.pxd":4413
 *         n = arr_ptr[i] + EPOCH_DAY - 1
 *         # Number of complete 400-year cycles
 *         n400 = n // 146_097             # <<<<<<<<<<<<<<
 *         n -= n400 * 146_097
 *         # Number of complete 100-year cycles within the 400-year cycle
 */
    __pyx_v_n400 = __Pyx_div_npy_int64(__pyx_v_n, 0x23AB1);

    /* "utils.pxd":4414
 *         # Number of complete 400-year cycles
 *         n400 = n // 146_097
 *         n -= n400 * 146_097             # <<<<<<<<<<<<<<
 *         # Number of complete 100-year cycles within the 400-year cycle
 *         n100 = n // 36_524
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n400 * 0x23AB1));

    /* "utils.pxd":4416
 *         n -= n400 * 146_097
 *         # Number of complete 100-year cycles within the 400-year cycle
 *         n100 = n // 36_524             # <<<<<<<<<<<<<<
 *         n -= n100 * 36_524
 *         # Number of complete 4-year cycles within the 100-year cycle
 */
    __pyx_v_n100 = __Pyx_div_npy_int64(__pyx_v_n, 0x8EAC);

    /* "utils.pxd":4417
 *         # Number of complete 100-year cycles within the 400-year cycle
 *         n100 = n // 36_524
 *         n -= n100 * 36_524             # <<<<<<<<<<<<<<
 *         # Number of complete 4-year cycles within the 100-year cycle
 *         n4 = n // 1_461
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n100 * 0x8EAC));

    /* "utils.pxd":4419
 *         n -= n100 * 36_524
 *         # Number of complete 4-year cycles within the 100-year cycle
 *         n4 = n // 1_461             # <<<<<<<<<<<<<<
 *         n -= n4 * 1_461
 *         # Number of complete years within the 4-year cycle
 */
    __pyx_v_n4 = __Pyx_div_npy_int64(__pyx_v_n, 0x5B5);

    /* "utils.pxd":4420
 *         # Number of complete 4-year cycles within the 100-year cycle
 *         n4 = n // 1_461
 *         n -= n4 * 1_461             # <<<<<<<<<<<<<<
 *         # Number of complete years within the 4-year cycle
 *         n1 = n // 365
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n4 * 0x5B5));

    /* "utils.pxd":4422
 *         n -= n4 * 1_461
 *         # Number of complete years within the 4-year cycle
 *         n1 = n // 365             # <<<<<<<<<<<<<<
 *         n -= n1 * 365
 *         # Compute the year
 */
    __pyx_v_n1 = __Pyx_div_npy_int64(__pyx_v_n, 0x16D);

    /* "utils.pxd":4423
 *         # Number of complete years within the 4-year cycle
 *         n1 = n // 365
 *         n -= n1 * 365             # <<<<<<<<<<<<<<
 *         # Compute the year
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1
 */
    __pyx_v_n = (__pyx_v_n - (__pyx_v_n1 * 0x16D));

    /* "utils.pxd":4425
 *         n -= n1 * 365
 *         # Compute the year
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1             # <<<<<<<<<<<<<<
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:
 */
    __pyx_v_year = ((((__pyx_v_n400 * 0x190) + (__pyx_v_n100 * 0x64)) + (__pyx_v_n4 * 4)) + __pyx_v_n1);

    /* "utils.pxd":4427
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:             # <<<<<<<<<<<<<<
 *             month = 12
 *         else:
 */
    __pyx_t_1 = (__pyx_v_n100 == 4);
    if (!__pyx_t_1) {
    } else {
      __pyx_t_9 = __pyx_t_1;
      goto __pyx_L15_bool_binop_done;
    }
    __pyx_t_1 = (__pyx_v_n1 == 4);
    __pyx_t_9 = __pyx_t_1;
    __pyx_L15_bool_binop_done:;
    if (__pyx_t_9) {

      /* "utils.pxd":4428
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:
 *             month = 12             # <<<<<<<<<<<<<<
 *         else:
 *             year, month = year + 1, (n + 50) >> 5
 */
      __pyx_v_month = 12;

      /* "utils.pxd":4427
 *         year = n400 * 400 + n100 * 100 + n4 * 4 + n1
 *         # Adjust for end-of-cycle dates
 *         if n100 == 4 or n1 == 4:             # <<<<<<<<<<<<<<
 *             month = 12
 *         else:
 */
      goto __pyx_L14;
    }

    /* "utils.pxd":4430
 *             month = 12
 *         else:
 *             year, month = year + 1, (n + 50) >> 5             # <<<<<<<<<<<<<<
 *             if days_bf_month(year, month) > n:
 *                 month -= 1
 */
    /*else*/ {
      __pyx_t_11 = (__pyx_v_year + 1);
      __pyx_t_12 = ((__pyx_v_n + 50) >> 5);
      __pyx_v_year = __pyx_t_11;
      __pyx_v_month = __pyx_t_12;

      /* "utils.pxd":4431
 *         else:
 *             year, month = year + 1, (n + 50) >> 5
 *             if days_bf_month(year, month) > n:             # <<<<<<<<<<<<<<
 *                 month -= 1
 *         # Compute total months
 */
      __pyx_t_2 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4431, __pyx_L1_error)
      __pyx_t_9 = (__pyx_t_2 > __pyx_v_n);
      if (__pyx_t_9) {

        /* "utils.pxd":4432
 *             year, month = year + 1, (n + 50) >> 5
 *             if days_bf_month(year, month) > n:
 *                 month -= 1             # <<<<<<<<<<<<<<
 *         # Compute total months
 *         res_ptr[i] = (year - EPOCH_YEAR) * 12 + (month - 1) + offset
 */
        __pyx_v_month = (__pyx_v_month - 1);

        /* "utils.pxd":4431
 *         else:
 *             year, month = year + 1, (n + 50) >> 5
 *             if days_bf_month(year, month) > n:             # <<<<<<<<<<<<<<
 *                 month -= 1
 *         # Compute total months
 */
      }
    }
    __pyx_L14:;

    /* "utils.pxd":4434
 *                 month -= 1
 *         # Compute total months
 *         res_ptr[i] = (year - EPOCH_YEAR) * 12 + (month - 1) + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((((__pyx_v_year - __pyx_v_7cytimes_5utils_EPOCH_YEAR) * 12) + (__pyx_v_month - 1)) + __pyx_v_offset);
  }

  /* "utils.pxd":4435
 *         # Compute total months
 *         res_ptr[i] = (year - EPOCH_YEAR) * 12 + (month - 1) + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_int64_W(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":4351
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_as_int64_M(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'M' (month)
 *     resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64_M", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4437
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_as_int64_W(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'W' (week)
 *     resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_W(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_W *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_v;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_2;
  npy_intp __pyx_t_3[1];
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64_W", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4445
 *     """
 *     # Cast to int64[D]
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute week
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":4449
 *     # Compute week
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":4450
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4450, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":4451
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i, v
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":4452
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, v
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":4455
 *         np.npy_int64 i, v
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         v = arr_ptr[i]
 *         res_ptr[i] = v // 7 + offset
 */
  __pyx_t_4 = __pyx_v_size;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":4456
 * 
 *     for i in range(size):
 *         v = arr_ptr[i]             # <<<<<<<<<<<<<<
 *         res_ptr[i] = v // 7 + offset
 *     return res
 */
    __pyx_v_v = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "utils.pxd":4457
 *     for i in range(size):
 *         v = arr_ptr[i]
 *         res_ptr[i] = v // 7 + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__Pyx_div_npy_int64(__pyx_v_v, 7) + __pyx_v_offset);
  }

  /* "utils.pxd":4458
 *         v = arr_ptr[i]
 *         res_ptr[i] = v // 7 + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_int64_D(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":4437
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_as_int64_W(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'W' (week)
 *     resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64_W", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4460
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_as_int64_D(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'D' (day)
 *     resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_floor_div __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_W_as_int64_D __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_M_as_int64_D __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_Y_as_int64_D __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64_D", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4468
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":4469
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "utils.pxd":4468
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "utils.pxd":4473
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "utils.pxd":4474
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'D' resolution")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "utils.pxd":4475
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'D' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "utils.pxd":4476
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'D' resolution")             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_kp_u_int64_under_D_resolution); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 4476, __pyx_L1_error)

      /* "utils.pxd":4475
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'D' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "utils.pxd":4477
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'D' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4477, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "utils.pxd":4478
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'D' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4478, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "utils.pxd":4474
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'D' resolution")
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":4479
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "utils.pxd":4480
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4480, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "utils.pxd":4479
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":4482
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only datetime64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4482, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "utils.pxd":4486
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "utils.pxd":4487
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_DAY, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4487, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4486
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "utils.pxd":4488
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "utils.pxd":4489
 *         return arr_floor_div(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_DAY, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4489, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4488
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "utils.pxd":4490
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "utils.pxd":4491
 *         return arr_floor_div(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_DAY, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4490
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "utils.pxd":4492
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "utils.pxd":4493
 *         return arr_floor_div(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_floor_div(arr, 1440, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_DAY, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4492
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "utils.pxd":4494
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, 1440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "utils.pxd":4495
 *         return arr_floor_div(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_floor_div(arr, 1440, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_floor_div(arr, 24, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, 0x5A0, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4494
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, 1440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "utils.pxd":4496
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_floor_div(arr, 1440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "utils.pxd":4497
 *         return arr_floor_div(arr, 1440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_floor_div(arr, 24, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, 24, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4496
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_floor_div(arr, 1440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "utils.pxd":4498
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_floor_div(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_1) {

    /* "utils.pxd":4499
 *         return arr_floor_div(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 1, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = (__pyx_v_offset == 0);
    if (__pyx_t_1) {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 4499, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_arr, __pyx_v_offset)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 4499, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    }
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4498
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_floor_div(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  }

  /* "utils.pxd":4500
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, 1, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "utils.pxd":4501
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 1, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 1, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 2;
    __pyx_t_6.factor = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_W_as_int64_D(__pyx_v_arr, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4500
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, 1, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  }

  /* "utils.pxd":4502
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 1, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, 1, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "utils.pxd":4503
 *         return _dt64arr_W_as_int64_D(arr, 1, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 1, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, 1, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_7.__pyx_n = 2;
    __pyx_t_7.factor = 1;
    __pyx_t_7.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_M_as_int64_D(__pyx_v_arr, &__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4502
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 1, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, 1, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  }

  /* "utils.pxd":4504
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 1, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, 1, offset)
 *     # . unsupported
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "utils.pxd":4505
 *         return _dt64arr_M_as_int64_D(arr, 1, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, 1, offset)             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("D", unit)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.factor = 1;
    __pyx_t_8.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_Y_as_int64_D(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4504
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 1, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, 1, offset)
 *     # . unsupported
 */
  }

  /* "utils.pxd":4507
 *         return _dt64arr_Y_as_int64_D(arr, 1, offset)
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("D", unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_int64_h(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(__pyx_n_u_D, __pyx_v_unit, NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 4507, __pyx_L1_error)

  /* "utils.pxd":4460
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_as_int64_D(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'D' (day)
 *     resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64_D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4509
 *     _raise_dt64arr_as_int64_unit_error("D", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_h(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'h' (hour)
 *     resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_h(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_h *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_floor_div __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_mul __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_W_as_int64_D __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_M_as_int64_D __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_Y_as_int64_D __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64_h", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4517
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":4518
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "utils.pxd":4517
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "utils.pxd":4522
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "utils.pxd":4523
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'h' resolution")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "utils.pxd":4524
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'h' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "utils.pxd":4525
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'h' resolution")             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_kp_u_int64_under_h_resolution); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 4525, __pyx_L1_error)

      /* "utils.pxd":4524
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'h' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "utils.pxd":4526
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'h' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4526, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "utils.pxd":4527
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'h' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "utils.pxd":4523
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'h' resolution")
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":4528
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "utils.pxd":4529
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4529, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "utils.pxd":4528
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":4531
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only datetime64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4531, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "utils.pxd":4535
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "utils.pxd":4536
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_HOUR, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_HOUR, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_HOUR, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4535
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "utils.pxd":4537
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "utils.pxd":4538
 *         return arr_floor_div(arr, NS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_HOUR, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_HOUR, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_HOUR, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4537
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "utils.pxd":4539
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, MS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "utils.pxd":4540
 *         return arr_floor_div(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_HOUR, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_HOUR, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_HOUR, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4540, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4539
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, MS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "utils.pxd":4541
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, SS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "utils.pxd":4542
 *         return arr_floor_div(arr, MS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_HOUR, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_floor_div(arr, 60, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_HOUR, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4541
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, SS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "utils.pxd":4543
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, 60, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "utils.pxd":4544
 *         return arr_floor_div(arr, SS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_floor_div(arr, 60, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, 60, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4543
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, 60, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "utils.pxd":4545
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_floor_div(arr, 60, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "utils.pxd":4546
 *         return arr_floor_div(arr, 60, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, 24, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = (__pyx_v_offset == 0);
    if (__pyx_t_1) {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 4546, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_arr, __pyx_v_offset)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 4546, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    }
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4545
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_floor_div(arr, 60, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "utils.pxd":4547
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_1) {

    /* "utils.pxd":4548
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, 24, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 24, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, 24, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4547
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  }

  /* "utils.pxd":4549
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "utils.pxd":4550
 *         return arr_mul(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 24, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 24, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_7.__pyx_n = 2;
    __pyx_t_7.factor = 24;
    __pyx_t_7.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_W_as_int64_D(__pyx_v_arr, &__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4550, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4549
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  }

  /* "utils.pxd":4551
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "utils.pxd":4552
 *         return _dt64arr_W_as_int64_D(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 24, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, 24, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.factor = 24;
    __pyx_t_8.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_M_as_int64_D(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4552, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4551
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  }

  /* "utils.pxd":4553
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, 24, offset)
 *     # . unsupported
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "utils.pxd":4554
 *         return _dt64arr_M_as_int64_D(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, 24, offset)             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("h", unit)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_9.__pyx_n = 2;
    __pyx_t_9.factor = 24;
    __pyx_t_9.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_Y_as_int64_D(__pyx_v_arr, &__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4553
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 24, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, 24, offset)
 *     # . unsupported
 */
  }

  /* "utils.pxd":4556
 *         return _dt64arr_Y_as_int64_D(arr, 24, offset)
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("h", unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_int64_m(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(__pyx_n_u_h, __pyx_v_unit, NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 4556, __pyx_L1_error)

  /* "utils.pxd":4509
 *     _raise_dt64arr_as_int64_unit_error("D", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_h(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'h' (hour)
 *     resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64_h", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4558
 *     _raise_dt64arr_as_int64_unit_error("h", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_m(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'm' (minute)
 *     resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_m(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_m *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_floor_div __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_mul __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_W_as_int64_D __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_M_as_int64_D __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_Y_as_int64_D __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64_m", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4566
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":4567
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "utils.pxd":4566
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "utils.pxd":4571
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "utils.pxd":4572
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'm' resolution")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "utils.pxd":4573
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'm' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "utils.pxd":4574
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'm' resolution")             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_kp_u_int64_under_m_resolution); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 4574, __pyx_L1_error)

      /* "utils.pxd":4573
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'm' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "utils.pxd":4575
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'm' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4575, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "utils.pxd":4576
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'm' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "utils.pxd":4572
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'm' resolution")
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":4577
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "utils.pxd":4578
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4578, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "utils.pxd":4577
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":4580
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only datetime64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4580, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "utils.pxd":4584
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "utils.pxd":4585
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MINUTE, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_MINUTE, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MINUTE, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4584
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "utils.pxd":4586
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "utils.pxd":4587
 *         return arr_floor_div(arr, NS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_MINUTE, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_MINUTE, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MINUTE, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4586
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "utils.pxd":4588
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, MS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "utils.pxd":4589
 *         return arr_floor_div(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_MINUTE, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_MINUTE, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_MINUTE, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4588
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, MS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "utils.pxd":4590
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, SS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "utils.pxd":4591
 *         return arr_floor_div(arr, MS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_MINUTE, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_MINUTE, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4590
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, SS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "utils.pxd":4592
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "utils.pxd":4593
 *         return arr_floor_div(arr, SS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, 60, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = (__pyx_v_offset == 0);
    if (__pyx_t_1) {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 4593, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_arr, __pyx_v_offset)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 4593, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    }
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4592
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_floor_div(arr, SS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "utils.pxd":4594
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, 60, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "utils.pxd":4595
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, 60, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, 1_440, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, 60, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4594
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, 60, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "utils.pxd":4596
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, 60, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_1) {

    /* "utils.pxd":4597
 *         return arr_mul(arr, 60, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, 1_440, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 1_440, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, 0x5A0, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4596
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, 60, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  }

  /* "utils.pxd":4598
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "utils.pxd":4599
 *         return arr_mul(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 1_440, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 1_440, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_7.__pyx_n = 2;
    __pyx_t_7.factor = 0x5A0;
    __pyx_t_7.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_W_as_int64_D(__pyx_v_arr, &__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4598
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  }

  /* "utils.pxd":4600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "utils.pxd":4601
 *         return _dt64arr_W_as_int64_D(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 1_440, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, 1_440, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.factor = 0x5A0;
    __pyx_t_8.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_M_as_int64_D(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4601, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  }

  /* "utils.pxd":4602
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, 1_440, offset)
 *     # . unsupported
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "utils.pxd":4603
 *         return _dt64arr_M_as_int64_D(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, 1_440, offset)             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("m", unit)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_9.__pyx_n = 2;
    __pyx_t_9.factor = 0x5A0;
    __pyx_t_9.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_Y_as_int64_D(__pyx_v_arr, &__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4603, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4602
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, 1_440, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, 1_440, offset)
 *     # . unsupported
 */
  }

  /* "utils.pxd":4605
 *         return _dt64arr_Y_as_int64_D(arr, 1_440, offset)
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("m", unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_int64_s(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(__pyx_n_u_m, __pyx_v_unit, NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 4605, __pyx_L1_error)

  /* "utils.pxd":4558
 *     _raise_dt64arr_as_int64_unit_error("h", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_m(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'm' (minute)
 *     resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64_m", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4607
 *     _raise_dt64arr_as_int64_unit_error("m", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_s(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 's' (second)
 *     resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_s(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_s *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_floor_div __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_mul __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_W_as_int64_D __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_M_as_int64_D __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_Y_as_int64_D __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64_s", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4615
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":4616
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "utils.pxd":4615
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "utils.pxd":4620
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "utils.pxd":4621
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 's' resolution")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "utils.pxd":4622
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 's' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "utils.pxd":4623
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 's' resolution")             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_kp_u_int64_under_s_resolution); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 4623, __pyx_L1_error)

      /* "utils.pxd":4622
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 's' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "utils.pxd":4624
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 's' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4624, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "utils.pxd":4625
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 's' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4625, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "utils.pxd":4621
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 's' resolution")
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":4626
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "utils.pxd":4627
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4627, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "utils.pxd":4626
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":4629
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only datetime64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4629, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "utils.pxd":4633
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "utils.pxd":4634
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_SECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_SECOND, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_SECOND, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4634, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4633
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "utils.pxd":4635
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "utils.pxd":4636
 *         return arr_floor_div(arr, NS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_SECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_SECOND, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_SECOND, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4635
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "utils.pxd":4637
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, MS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "utils.pxd":4638
 *         return arr_floor_div(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_SECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_SECOND, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4637
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, MS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "utils.pxd":4639
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "utils.pxd":4640
 *         return arr_floor_div(arr, MS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, SS_MINUTE, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = (__pyx_v_offset == 0);
    if (__pyx_t_1) {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 4640, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_arr, __pyx_v_offset)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 4640, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    }
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4639
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_floor_div(arr, MS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "utils.pxd":4641
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, SS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "utils.pxd":4642
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, SS_MINUTE, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, SS_HOUR, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_MINUTE, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4642, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4641
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, SS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "utils.pxd":4643
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, SS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, SS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "utils.pxd":4644
 *         return arr_mul(arr, SS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, SS_HOUR, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, SS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_HOUR, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4643
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, SS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, SS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "utils.pxd":4645
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, SS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_1) {

    /* "utils.pxd":4646
 *         return arr_mul(arr, SS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, SS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, SS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_DAY, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4646, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4645
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, SS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  }

  /* "utils.pxd":4647
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "utils.pxd":4648
 *         return arr_mul(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, SS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, SS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_7.__pyx_n = 2;
    __pyx_t_7.factor = __pyx_v_7cytimes_5utils_SS_DAY;
    __pyx_t_7.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_W_as_int64_D(__pyx_v_arr, &__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4647
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  }

  /* "utils.pxd":4649
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "utils.pxd":4650
 *         return _dt64arr_W_as_int64_D(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, SS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, SS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.factor = __pyx_v_7cytimes_5utils_SS_DAY;
    __pyx_t_8.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_M_as_int64_D(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4650, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4649
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  }

  /* "utils.pxd":4651
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, SS_DAY, offset)
 *     # . unsupported
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "utils.pxd":4652
 *         return _dt64arr_M_as_int64_D(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, SS_DAY, offset)             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("s", unit)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_9.__pyx_n = 2;
    __pyx_t_9.factor = __pyx_v_7cytimes_5utils_SS_DAY;
    __pyx_t_9.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_Y_as_int64_D(__pyx_v_arr, &__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4651
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, SS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, SS_DAY, offset)
 *     # . unsupported
 */
  }

  /* "utils.pxd":4654
 *         return _dt64arr_Y_as_int64_D(arr, SS_DAY, offset)
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("s", unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_int64_ms(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(__pyx_n_u_s, __pyx_v_unit, NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 4654, __pyx_L1_error)

  /* "utils.pxd":4607
 *     _raise_dt64arr_as_int64_unit_error("m", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_s(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 's' (second)
 *     resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64_s", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4656
 *     _raise_dt64arr_as_int64_unit_error("s", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_ms(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'ms' (millisecond)
 *     resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_ms(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ms *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_floor_div __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_mul __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_W_as_int64_D __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_M_as_int64_D __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_Y_as_int64_D __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64_ms", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4664
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":4665
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "utils.pxd":4664
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "utils.pxd":4669
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "utils.pxd":4670
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ms' resolution")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "utils.pxd":4671
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ms' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "utils.pxd":4672
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ms' resolution")             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_kp_u_int64_under_ms_resolution); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 4672, __pyx_L1_error)

      /* "utils.pxd":4671
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ms' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "utils.pxd":4673
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ms' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4673, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "utils.pxd":4674
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ms' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "utils.pxd":4670
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ms' resolution")
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":4675
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "utils.pxd":4676
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4676, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "utils.pxd":4675
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":4678
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only datetime64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4678, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "utils.pxd":4682
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "utils.pxd":4683
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MILLISECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_MILLISECOND, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MILLISECOND, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4683, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4682
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "utils.pxd":4684
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "utils.pxd":4685
 *         return arr_floor_div(arr, NS_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_MILLISECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MILLISECOND, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4685, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4684
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "utils.pxd":4686
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "utils.pxd":4687
 *         return arr_floor_div(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, MS_SECOND, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = (__pyx_v_offset == 0);
    if (__pyx_t_1) {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 4687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_arr, __pyx_v_offset)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 4687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    }
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4686
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_floor_div(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "utils.pxd":4688
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, MS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "utils.pxd":4689
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, MS_SECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, MS_MINUTE, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_SECOND, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4688
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, MS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "utils.pxd":4690
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, MS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, MS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "utils.pxd":4691
 *         return arr_mul(arr, MS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, MS_MINUTE, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, MS_HOUR, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_MINUTE, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4690
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, MS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, MS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "utils.pxd":4692
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, MS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, MS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "utils.pxd":4693
 *         return arr_mul(arr, MS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, MS_HOUR, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, MS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_HOUR, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4692
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, MS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, MS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "utils.pxd":4694
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, MS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_1) {

    /* "utils.pxd":4695
 *         return arr_mul(arr, MS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, MS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, MS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_DAY, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4694
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, MS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  }

  /* "utils.pxd":4696
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "utils.pxd":4697
 *         return arr_mul(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, MS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, MS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_7.__pyx_n = 2;
    __pyx_t_7.factor = __pyx_v_7cytimes_5utils_MS_DAY;
    __pyx_t_7.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_W_as_int64_D(__pyx_v_arr, &__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4696
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  }

  /* "utils.pxd":4698
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "utils.pxd":4699
 *         return _dt64arr_W_as_int64_D(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, MS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, MS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.factor = __pyx_v_7cytimes_5utils_MS_DAY;
    __pyx_t_8.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_M_as_int64_D(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4698
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  }

  /* "utils.pxd":4700
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, MS_DAY, offset)
 *     # . unsupported
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "utils.pxd":4701
 *         return _dt64arr_M_as_int64_D(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, MS_DAY, offset)             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("ms", unit)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_9.__pyx_n = 2;
    __pyx_t_9.factor = __pyx_v_7cytimes_5utils_MS_DAY;
    __pyx_t_9.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_Y_as_int64_D(__pyx_v_arr, &__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4700
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, MS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, MS_DAY, offset)
 *     # . unsupported
 */
  }

  /* "utils.pxd":4703
 *         return _dt64arr_Y_as_int64_D(arr, MS_DAY, offset)
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("ms", unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_int64_us(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(__pyx_n_u_ms, __pyx_v_unit, NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 4703, __pyx_L1_error)

  /* "utils.pxd":4656
 *     _raise_dt64arr_as_int64_unit_error("s", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_ms(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'ms' (millisecond)
 *     resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64_ms", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4705
 *     _raise_dt64arr_as_int64_unit_error("ms", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_us(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'us' (microsecond)
 *     resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_us(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_us *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_floor_div __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_mul __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_W_as_int64_D __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_M_as_int64_D __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_Y_as_int64_D __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64_us", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4713
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":4714
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "utils.pxd":4713
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "utils.pxd":4718
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "utils.pxd":4719
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "utils.pxd":4720
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "utils.pxd":4721
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_kp_u_int64_under_us_resolution); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 4721, __pyx_L1_error)

      /* "utils.pxd":4720
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "utils.pxd":4722
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4722, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "utils.pxd":4723
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "utils.pxd":4719
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":4724
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "utils.pxd":4725
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4725, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "utils.pxd":4724
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":4727
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only datetime64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4727, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "utils.pxd":4731
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "utils.pxd":4732
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MICROSECOND, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4732, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4731
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "utils.pxd":4733
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "utils.pxd":4734
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, US_MILLISECOND, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = (__pyx_v_offset == 0);
    if (__pyx_t_1) {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 4734, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_arr, __pyx_v_offset)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 4734, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    }
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4733
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "utils.pxd":4735
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "utils.pxd":4736
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, US_MILLISECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, US_SECOND, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MILLISECOND, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4735
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "utils.pxd":4737
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "utils.pxd":4738
 *         return arr_mul(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, US_SECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, US_MINUTE, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_SECOND, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4738, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4737
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "utils.pxd":4739
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "utils.pxd":4740
 *         return arr_mul(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, US_MINUTE, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, US_HOUR, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MINUTE, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4740, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4739
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "utils.pxd":4741
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "utils.pxd":4742
 *         return arr_mul(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, US_HOUR, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, US_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_HOUR, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4742, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4741
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "utils.pxd":4743
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_1) {

    /* "utils.pxd":4744
 *         return arr_mul(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, US_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_DAY, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4743
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  }

  /* "utils.pxd":4745
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "utils.pxd":4746
 *         return arr_mul(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, US_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_7.__pyx_n = 2;
    __pyx_t_7.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_7.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_W_as_int64_D(__pyx_v_arr, &__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4745
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  }

  /* "utils.pxd":4747
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "utils.pxd":4748
 *         return _dt64arr_W_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, US_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_8.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_M_as_int64_D(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4747
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  }

  /* "utils.pxd":4749
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, US_DAY, offset)
 *     # . unsupported
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "utils.pxd":4750
 *         return _dt64arr_M_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("us", unit)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_9.__pyx_n = 2;
    __pyx_t_9.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_9.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_Y_as_int64_D(__pyx_v_arr, &__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4749
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, US_DAY, offset)
 *     # . unsupported
 */
  }

  /* "utils.pxd":4752
 *         return _dt64arr_Y_as_int64_D(arr, US_DAY, offset)
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("us", unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_int64_ns(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(__pyx_n_u_us, __pyx_v_unit, NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 4752, __pyx_L1_error)

  /* "utils.pxd":4705
 *     _raise_dt64arr_as_int64_unit_error("ms", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_us(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'us' (microsecond)
 *     resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64_us", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4754
 *     _raise_dt64arr_as_int64_unit_error("us", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_ns(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'ns' (nanosecond)
 *     resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_int64_ns(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ns *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  PyArrayObject *__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_7cytimes_5utils_arr_mul __pyx_t_5;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_W_as_int64_D __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_M_as_int64_D __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils__dt64arr_Y_as_int64_D __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_int64_ns", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4762
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":4763
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "utils.pxd":4762
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "utils.pxd":4767
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "utils.pxd":4768
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ns' resolution")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "utils.pxd":4769
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ns' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "utils.pxd":4770
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ns' resolution")             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_kp_u_int64_under_ns_resolution); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 4770, __pyx_L1_error)

      /* "utils.pxd":4769
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ns' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "utils.pxd":4771
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ns' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4771, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "utils.pxd":4772
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ns' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4772, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "utils.pxd":4768
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'ns' resolution")
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":4773
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "utils.pxd":4774
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4774, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "utils.pxd":4773
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":4776
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only datetime64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4776, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "utils.pxd":4780
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "utils.pxd":4781
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_mul(arr, NS_MICROSECOND, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = (__pyx_v_offset == 0);
    if (__pyx_t_1) {
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 4781, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __pyx_t_4;
      __pyx_t_4 = 0;
    } else {
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_arr, __pyx_v_offset)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 4781, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __pyx_t_4;
      __pyx_t_4 = 0;
    }
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4780
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "utils.pxd":4782
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "utils.pxd":4783
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_mul(arr, NS_MICROSECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, NS_MILLISECOND, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MICROSECOND, &__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4782
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "utils.pxd":4784
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_mul(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "utils.pxd":4785
 *         return arr_mul(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, NS_MILLISECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, NS_SECOND, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MILLISECOND, &__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4785, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4784
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_mul(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "utils.pxd":4786
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, NS_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "utils.pxd":4787
 *         return arr_mul(arr, NS_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, NS_SECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, NS_MINUTE, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_SECOND, &__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4787, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4786
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, NS_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "utils.pxd":4788
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, NS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "utils.pxd":4789
 *         return arr_mul(arr, NS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, NS_MINUTE, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, NS_HOUR, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MINUTE, &__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4788
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, NS_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "utils.pxd":4790
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, NS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "utils.pxd":4791
 *         return arr_mul(arr, NS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, NS_HOUR, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, NS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_HOUR, &__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4790
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, NS_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "utils.pxd":4792
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, NS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_1) {

    /* "utils.pxd":4793
 *         return arr_mul(arr, NS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, NS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, NS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_DAY, &__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4793, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4792
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, NS_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  }

  /* "utils.pxd":4794
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "utils.pxd":4795
 *         return arr_mul(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, NS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, NS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 2;
    __pyx_t_6.factor = __pyx_v_7cytimes_5utils_NS_DAY;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_W_as_int64_D(__pyx_v_arr, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4795, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4794
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _dt64arr_W_as_int64_D(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  }

  /* "utils.pxd":4796
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "utils.pxd":4797
 *         return _dt64arr_W_as_int64_D(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, NS_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, NS_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_7.__pyx_n = 2;
    __pyx_t_7.factor = __pyx_v_7cytimes_5utils_NS_DAY;
    __pyx_t_7.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_M_as_int64_D(__pyx_v_arr, &__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4797, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4796
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _dt64arr_W_as_int64_D(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _dt64arr_M_as_int64_D(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  }

  /* "utils.pxd":4798
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, NS_DAY, offset)
 *     # . unsupported
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "utils.pxd":4799
 *         return _dt64arr_M_as_int64_D(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _dt64arr_Y_as_int64_D(arr, NS_DAY, offset)             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("ns", unit)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.factor = __pyx_v_7cytimes_5utils_NS_DAY;
    __pyx_t_8.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__dt64arr_Y_as_int64_D(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4798
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _dt64arr_M_as_int64_D(arr, NS_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _dt64arr_Y_as_int64_D(arr, NS_DAY, offset)
 *     # . unsupported
 */
  }

  /* "utils.pxd":4801
 *         return _dt64arr_Y_as_int64_D(arr, NS_DAY, offset)
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("ns", unit)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray _dt64arr_Y_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(__pyx_n_u_ns, __pyx_v_unit, NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 4801, __pyx_L1_error)

  /* "utils.pxd":4754
 *     _raise_dt64arr_as_int64_unit_error("us", unit)
 * 
 * cdef inline np.ndarray dt64arr_as_int64_ns(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 under 'ns' (nanosecond)
 *     resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_int64_ns", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4803
 *     _raise_dt64arr_as_int64_unit_error("ns", unit)
 * 
 * cdef inline np.ndarray _dt64arr_Y_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[datetime64[Y]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__dt64arr_Y_as_int64_D(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils__dt64arr_Y_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_year;
  npy_int64 __pyx_v_y_1;
  npy_int64 __pyx_v_year_since_epoch;
  npy_int64 __pyx_v_leaps;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp __pyx_t_2[1];
  npy_int64 __pyx_t_3;
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_dt64arr_Y_as_int64_D", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4807
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 *     """
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":4809
 *     arr = arr_assure_int64_like(arr)
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":4810
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_2[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_2, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4810, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":4811
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i, year, y_1, year_since_epoch, leaps
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":4812
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, year, y_1, year_since_epoch, leaps
 * 
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":4815
 *         np.npy_int64 i, year, y_1, year_since_epoch, leaps
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         year_since_epoch = arr_ptr[i]
 *         year = year_since_epoch + EPOCH_YEAR
 */
  __pyx_t_3 = __pyx_v_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "utils.pxd":4816
 * 
 *     for i in range(size):
 *         year_since_epoch = arr_ptr[i]             # <<<<<<<<<<<<<<
 *         year = year_since_epoch + EPOCH_YEAR
 *         # Compute leap years
 */
    __pyx_v_year_since_epoch = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "utils.pxd":4817
 *     for i in range(size):
 *         year_since_epoch = arr_ptr[i]
 *         year = year_since_epoch + EPOCH_YEAR             # <<<<<<<<<<<<<<
 *         # Compute leap years
 *         y_1 = year - 1
 */
    __pyx_v_year = (__pyx_v_year_since_epoch + __pyx_v_7cytimes_5utils_EPOCH_YEAR);

    /* "utils.pxd":4819
 *         year = year_since_epoch + EPOCH_YEAR
 *         # Compute leap years
 *         y_1 = year - 1             # <<<<<<<<<<<<<<
 *         leaps = (
 *             (y_1 // 4 - 1970 // 4)
 */
    __pyx_v_y_1 = (__pyx_v_year - 1);

    /* "utils.pxd":4823
 *             (y_1 // 4 - 1970 // 4)
 *             - (y_1 // 100 - 1970 // 100)
 *             + (y_1 // 400 - 1970 // 400)             # <<<<<<<<<<<<<<
 *         )
 *         # Compute total days
 */
    __pyx_v_leaps = (((__Pyx_div_npy_int64(__pyx_v_y_1, 4) - 0x1ec) - (__Pyx_div_npy_int64(__pyx_v_y_1, 0x64) - 0x13)) + (__Pyx_div_npy_int64(__pyx_v_y_1, 0x190) - 0x4));

    /* "utils.pxd":4826
 *         )
 *         # Compute total days
 *         res_ptr[i] = (year_since_epoch * 365 + leaps) * factor + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = ((((__pyx_v_year_since_epoch * 0x16D) + __pyx_v_leaps) * __pyx_v_factor) + __pyx_v_offset);
  }

  /* "utils.pxd":4827
 *         # Compute total days
 *         res_ptr[i] = (year_since_epoch * 365 + leaps) * factor + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray _dt64arr_M_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":4803
 *     _raise_dt64arr_as_int64_unit_error("ns", unit)
 * 
 * cdef inline np.ndarray _dt64arr_Y_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[datetime64[Y]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils._dt64arr_Y_as_int64_D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4829
 *     return res
 * 
 * cdef inline np.ndarray _dt64arr_M_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[datetime64[M]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__dt64arr_M_as_int64_D(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils__dt64arr_M_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_v;
  npy_int64 __pyx_v_year;
  npy_int64 __pyx_v_y_1;
  npy_int64 __pyx_v_year_ep;
  npy_int64 __pyx_v_leaps;
  npy_int64 __pyx_v_month;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp __pyx_t_2[1];
  npy_int64 __pyx_t_3;
  npy_int64 __pyx_t_4;
  npy_int64 __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_dt64arr_M_as_int64_D", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4833
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 *     """
 *     arr = arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":4835
 *     arr = arr_assure_int64_like(arr)
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":4836
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_2[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_2, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4836, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":4837
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 i, v
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":4838
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, v
 *         np.npy_int64 year, y_1, year_ep, leaps
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":4843
 *         np.npy_int64 month, days_bf_mm
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         v = arr_ptr[i]
 *         year_ep = v // 12
 */
  __pyx_t_3 = __pyx_v_size;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "utils.pxd":4844
 * 
 *     for i in range(size):
 *         v = arr_ptr[i]             # <<<<<<<<<<<<<<
 *         year_ep = v // 12
 *         year = year_ep + EPOCH_YEAR
 */
    __pyx_v_v = (__pyx_v_arr_ptr[__pyx_v_i]);

    /* "utils.pxd":4845
 *     for i in range(size):
 *         v = arr_ptr[i]
 *         year_ep = v // 12             # <<<<<<<<<<<<<<
 *         year = year_ep + EPOCH_YEAR
 *         month = v % 12 + 1
 */
    __pyx_v_year_ep = __Pyx_div_npy_int64(__pyx_v_v, 12);

    /* "utils.pxd":4846
 *         v = arr_ptr[i]
 *         year_ep = v // 12
 *         year = year_ep + EPOCH_YEAR             # <<<<<<<<<<<<<<
 *         month = v % 12 + 1
 *         # Compute leap years
 */
    __pyx_v_year = (__pyx_v_year_ep + __pyx_v_7cytimes_5utils_EPOCH_YEAR);

    /* "utils.pxd":4847
 *         year_ep = v // 12
 *         year = year_ep + EPOCH_YEAR
 *         month = v % 12 + 1             # <<<<<<<<<<<<<<
 *         # Compute leap years
 *         y_1 = year - 1
 */
    __pyx_v_month = (__Pyx_mod_npy_int64(__pyx_v_v, 12) + 1);

    /* "utils.pxd":4849
 *         month = v % 12 + 1
 *         # Compute leap years
 *         y_1 = year - 1             # <<<<<<<<<<<<<<
 *         leaps = (
 *             (y_1 // 4 - 1970 // 4)
 */
    __pyx_v_y_1 = (__pyx_v_year - 1);

    /* "utils.pxd":4853
 *             (y_1 // 4 - 1970 // 4)
 *             - (y_1 // 100 - 1970 // 100)
 *             + (y_1 // 400 - 1970 // 400)             # <<<<<<<<<<<<<<
 *         )
 *         # Compute total days
 */
    __pyx_v_leaps = (((__Pyx_div_npy_int64(__pyx_v_y_1, 4) - 0x1ec) - (__Pyx_div_npy_int64(__pyx_v_y_1, 0x64) - 0x13)) + (__Pyx_div_npy_int64(__pyx_v_y_1, 0x190) - 0x4));

    /* "utils.pxd":4856
 *         )
 *         # Compute total days
 *         res_ptr[i] = (year_ep * 365 + leaps + days_bf_month(year, month)) * factor + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    __pyx_t_6 = __pyx_f_7cytimes_5utils_days_bf_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(5, 4856, __pyx_L1_error)
    (__pyx_v_res_ptr[__pyx_v_i]) = (((((__pyx_v_year_ep * 0x16D) + __pyx_v_leaps) + __pyx_t_6) * __pyx_v_factor) + __pyx_v_offset);
  }

  /* "utils.pxd":4857
 *         # Compute total days
 *         res_ptr[i] = (year_ep * 365 + leaps + days_bf_month(year, month)) * factor + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray _dt64arr_W_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":4829
 *     return res
 * 
 * cdef inline np.ndarray _dt64arr_M_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[datetime64[M]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils._dt64arr_M_as_int64_D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4859
 *     return res
 * 
 * cdef inline np.ndarray _dt64arr_W_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[datetime64[W]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__dt64arr_W_as_int64_D(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils__dt64arr_W_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_mul __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_dt64arr_W_as_int64_D", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }

  /* "utils.pxd":4863
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 *     """
 *     return arr_mul(arr, 7 * factor, offset)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_as_iso_W(np.ndarray arr, int weekday, str arr_unit=None, np.npy_int64 offset=0):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.offset = __pyx_v_offset;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, (7 * __pyx_v_factor), &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "utils.pxd":4859
 *     return res
 * 
 * cdef inline np.ndarray _dt64arr_W_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[datetime64[W]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils._dt64arr_W_as_int64_D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4865
 *     return arr_mul(arr, 7 * factor, offset)
 * 
 * cdef inline np.ndarray dt64arr_as_iso_W(np.ndarray arr, int weekday, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 with 'W' (week)
 *     resolution, aligned to the specified ISO 'weekday' `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_iso_W(PyArrayObject *__pyx_v_arr, int __pyx_v_weekday, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_iso_W *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  npy_int64 __pyx_v_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_wkd_off;
  npy_int64 __pyx_v_i;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_2;
  npy_intp __pyx_t_3[1];
  long __pyx_t_4;
  long __pyx_t_5;
  int __pyx_t_6;
  long __pyx_t_7;
  int __pyx_t_8;
  npy_int64 __pyx_t_9;
  npy_int64 __pyx_t_10;
  npy_int64 __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_iso_W", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4877
 *     """
 *     # Cast to int64[D]
 *     arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *     # Compute week
 */
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "utils.pxd":4881
 *     # Compute week
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]             # <<<<<<<<<<<<<<
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 */
  __pyx_v_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]);

  /* "utils.pxd":4882
 *     cdef:
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 */
  __pyx_t_3[0] = __pyx_v_size;
  __pyx_t_1 = PyArray_EMPTY(1, __pyx_t_3, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4882, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":4883
 *         np.npy_int64 size = arr.shape[0]
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 wkd_off = 4 - min(max(weekday, 1), 7)
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":4884
 *         np.ndarray res = np.PyArray_EMPTY(1, [size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)             # <<<<<<<<<<<<<<
 *         np.npy_int64 wkd_off = 4 - min(max(weekday, 1), 7)
 *         np.npy_int64 i
 */
  __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

  /* "utils.pxd":4885
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr_ptr = <np.npy_int64*> np.PyArray_DATA(arr)
 *         np.npy_int64 wkd_off = 4 - min(max(weekday, 1), 7)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i
 * 
 */
  __pyx_t_4 = 7;
  __pyx_t_5 = 1;
  __pyx_t_6 = __pyx_v_weekday;
  __pyx_t_8 = (__pyx_t_5 > __pyx_t_6);
  if (__pyx_t_8) {
    __pyx_t_7 = __pyx_t_5;
  } else {
    __pyx_t_7 = __pyx_t_6;
  }
  __pyx_t_5 = __pyx_t_7;
  __pyx_t_8 = (__pyx_t_4 < __pyx_t_5);
  if (__pyx_t_8) {
    __pyx_t_7 = __pyx_t_4;
  } else {
    __pyx_t_7 = __pyx_t_5;
  }
  __pyx_v_wkd_off = (4 - __pyx_t_7);

  /* "utils.pxd":4888
 *         np.npy_int64 i
 * 
 *     for i in range(size):             # <<<<<<<<<<<<<<
 *         res_ptr[i] = (arr_ptr[i] + wkd_off) // 7 + offset
 *     return res
 */
  __pyx_t_9 = __pyx_v_size;
  __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;

    /* "utils.pxd":4889
 * 
 *     for i in range(size):
 *         res_ptr[i] = (arr_ptr[i] + wkd_off) // 7 + offset             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = (__Pyx_div_npy_int64(((__pyx_v_arr_ptr[__pyx_v_i]) + __pyx_v_wkd_off), 7) + __pyx_v_offset);
  }

  /* "utils.pxd":4890
 *     for i in range(size):
 *         res_ptr[i] = (arr_ptr[i] + wkd_off) // 7 + offset
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_to_ordinal(np.ndarray arr, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":4865
 *     return arr_mul(arr, 7 * factor, offset)
 * 
 * cdef inline np.ndarray dt64arr_as_iso_W(np.ndarray arr, int weekday, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[datetime64] to int64 with 'W' (week)
 *     resolution, aligned to the specified ISO 'weekday' `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_as_iso_W", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4892
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_to_ordinal(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Convert np.ndarray[datetime64] to proleptic Gregorian
 *     ordinals `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_to_ordinal(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_to_ordinal *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_to_ordinal", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }

  /* "utils.pxd":4898
 *     '0001-01-01' is day 1 (ordinal=1).
 *     """
 *     return dt64arr_as_int64_D(arr, arr_unit, EPOCH_DAY)             # <<<<<<<<<<<<<<
 * 
 * # . conversion: float64
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.arr_unit = __pyx_v_arr_unit;
  __pyx_t_2.offset = __pyx_v_7cytimes_5utils_EPOCH_DAY;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "utils.pxd":4892
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_to_ordinal(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Convert np.ndarray[datetime64] to proleptic Gregorian
 *     ordinals `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_to_ordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4901
 * 
 * # . conversion: float64
 * cdef inline np.ndarray dt64arr_to_ts(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Convert np.ndarray[datetime64] to timestamps `<'ndarray[float64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_to_ts(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_dt64arr_to_ts *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_us __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_to_ts", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":4907
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":4908
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Convert to seconds[float64]
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "utils.pxd":4907
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "utils.pxd":4911
 * 
 *     # Convert to seconds[float64]
 *     arr = dt64arr_as_int64_us(arr, arr_unit, 0)  # int64[us]             # <<<<<<<<<<<<<<
 *     return arr_div(arr, US_SECOND)  # float64[s]
 * 
 */
  __pyx_t_3.__pyx_n = 2;
  __pyx_t_3.arr_unit = __pyx_v_arr_unit;
  __pyx_t_3.offset = 0;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_us(__pyx_v_arr, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 4911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "utils.pxd":4912
 *     # Convert to seconds[float64]
 *     arr = dt64arr_as_int64_us(arr, arr_unit, 0)  # int64[us]
 *     return arr_div(arr, US_SECOND)  # float64[s]             # <<<<<<<<<<<<<<
 * 
 * # . conversion: unit
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_SECOND, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 4912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "utils.pxd":4901
 * 
 * # . conversion: float64
 * cdef inline np.ndarray dt64arr_to_ts(np.ndarray arr, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Convert np.ndarray[datetime64] to timestamps `<'ndarray[float64]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_to_ts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":4915
 * 
 * # . conversion: unit
 * cdef inline np.ndarray dt64arr_as_unit(np.ndarray arr, str unit, str arr_unit=None, bint limit=False):             # <<<<<<<<<<<<<<
 *     """Convert np.ndarray[datetime64] to the specified unit `<'ndarray[datetime64]'>`.
 * 
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_as_unit(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_unit, struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_unit *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  int __pyx_v_limit = ((int)0);
  int __pyx_v_my_unit;
  int __pyx_v_to_unit;
  int __pyx_v_dtype;
  int __pyx_v_ns_safe;
  PyArrayObject *__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;
  unsigned int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_UCS4 __pyx_t_11;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_12;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_us __pyx_t_13;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ns __pyx_t_14;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_ms __pyx_t_15;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_s __pyx_t_16;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_m __pyx_t_17;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_h __pyx_t_18;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_19;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_W __pyx_t_20;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_21;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_as_unit", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_limit = __pyx_optional_args->limit;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_INCREF(__pyx_v_arr_unit);

  /* "utils.pxd":4925
 *     """
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":4926
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "utils.pxd":4925
 *     """
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "utils.pxd":4930
 *     # Get time unit
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "utils.pxd":4931
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "utils.pxd":4932
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "utils.pxd":4933
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *         arr_unit = map_nptime_unit_int2str(my_unit)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_n_u_int64); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 4933, __pyx_L1_error)

      /* "utils.pxd":4932
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "utils.pxd":4934
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr_unit = map_nptime_unit_int2str(my_unit)
 *         arr = arr.astype("datetime64[%s]" % arr_unit)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4934, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;

    /* "utils.pxd":4935
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *         arr_unit = map_nptime_unit_int2str(my_unit)             # <<<<<<<<<<<<<<
 *         arr = arr.astype("datetime64[%s]" % arr_unit)
 *     elif arr_unit is not None:
 */
    __pyx_t_3 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_my_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4935, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr_unit, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "utils.pxd":4936
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *         arr_unit = map_nptime_unit_int2str(my_unit)
 *         arr = arr.astype("datetime64[%s]" % arr_unit)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 4936, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_arr_unit); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 4936, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4936, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4936, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "utils.pxd":4931
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":4937
 *         arr_unit = map_nptime_unit_int2str(my_unit)
 *         arr = arr.astype("datetime64[%s]" % arr_unit)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "utils.pxd":4938
 *         arr = arr.astype("datetime64[%s]" % arr_unit)
 *     elif arr_unit is not None:
 *         my_unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4938, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;

    /* "utils.pxd":4937
 *         arr_unit = map_nptime_unit_int2str(my_unit)
 *         arr = arr.astype("datetime64[%s]" % arr_unit)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":4940
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     to_unit = map_nptime_unit_str2int(unit)
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4940, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "utils.pxd":4941
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)
 *     to_unit = map_nptime_unit_str2int(unit)             # <<<<<<<<<<<<<<
 * 
 *     # Check limit
 */
  __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 4941, __pyx_L1_error)
  __pyx_v_to_unit = __pyx_t_2;

  /* "utils.pxd":4944
 * 
 *     # Check limit
 *     if limit:             # <<<<<<<<<<<<<<
 *         if to_unit not in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 */
  if (__pyx_v_limit) {

    /* "utils.pxd":4945
 *     # Check limit
 *     if limit:
 *         if to_unit not in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
    switch (__pyx_v_to_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":4946
 *     if limit:
 *         if to_unit not in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,
 *             np.NPY_DATETIMEUNIT.NPY_FR_ms,
 */
      case NPY_FR_us:

      /* "utils.pxd":4947
 *         if to_unit not in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_ms,
 *             np.NPY_DATETIMEUNIT.NPY_FR_s,
 */
      case NPY_FR_ms:

      /* "utils.pxd":4948
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,
 *             np.NPY_DATETIMEUNIT.NPY_FR_ms,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         ) or my_unit not in (
 */
      case NPY_FR_s:

      /* "utils.pxd":4945
 *     # Check limit
 *     if limit:
 *         if to_unit not in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
      __pyx_t_8 = 0;
      break;
      default:
      __pyx_t_8 = 1;
      break;
    }
    __pyx_t_9 = __pyx_t_8;
    if (!__pyx_t_9) {
    } else {
      __pyx_t_1 = __pyx_t_9;
      goto __pyx_L8_bool_binop_done;
    }

    /* "utils.pxd":4950
 *             np.NPY_DATETIMEUNIT.NPY_FR_ms,
 *             np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         ) or my_unit not in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":4951
 *             np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         ) or my_unit not in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,
 *             np.NPY_DATETIMEUNIT.NPY_FR_ms,
 */
      case NPY_FR_us:

      /* "utils.pxd":4952
 *         ) or my_unit not in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_ms,
 *             np.NPY_DATETIMEUNIT.NPY_FR_s,
 */
      case NPY_FR_ms:

      /* "utils.pxd":4953
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,
 *             np.NPY_DATETIMEUNIT.NPY_FR_ms,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         ):
 */
      case NPY_FR_s:

      /* "utils.pxd":4950
 *             np.NPY_DATETIMEUNIT.NPY_FR_ms,
 *             np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         ) or my_unit not in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
      __pyx_t_9 = 0;
      break;
      default:
      __pyx_t_9 = 1;
      break;
    }
    __pyx_t_8 = __pyx_t_9;
    __pyx_t_1 = __pyx_t_8;
    __pyx_L8_bool_binop_done:;

    /* "utils.pxd":4945
 *     # Check limit
 *     if limit:
 *         if to_unit not in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
    if (unlikely(__pyx_t_1)) {

      /* "utils.pxd":4957
 *         ):
 *             raise ValueError(
 *                 "cannot convert ndarray from datetime64[%s] to datetime64[%s].\n"             # <<<<<<<<<<<<<<
 *                 "Conversion limits to datetime units between ['s', 'ms', 'us', 'ns']."
 *                 % (map_nptime_unit_int2str(my_unit), map_nptime_unit_int2str(to_unit))
 */
      __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = 0;
      __pyx_t_11 = 127;
      __Pyx_INCREF(__pyx_kp_u_cannot_convert_ndarray_from_date);
      __pyx_t_10 += 39;
      __Pyx_GIVEREF(__pyx_kp_u_cannot_convert_ndarray_from_date);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_cannot_convert_ndarray_from_date);

      /* "utils.pxd":4959
 *                 "cannot convert ndarray from datetime64[%s] to datetime64[%s].\n"
 *                 "Conversion limits to datetime units between ['s', 'ms', 'us', 'ns']."
 *                 % (map_nptime_unit_int2str(my_unit), map_nptime_unit_int2str(to_unit))             # <<<<<<<<<<<<<<
 *             )
 * 
 */
      __pyx_t_4 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_my_unit); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 4959, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyUnicode_Unicode(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 4959, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_11;
      __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_INCREF(__pyx_kp_u_to_datetime64);
      __pyx_t_10 += 16;
      __Pyx_GIVEREF(__pyx_kp_u_to_datetime64);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_to_datetime64);
      __pyx_t_5 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_to_unit); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 4959, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 4959, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_11;
      __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_INCREF(__pyx_kp_u_Conversion_limits_to_datetime_u);
      __pyx_t_10 += 71;
      __Pyx_GIVEREF(__pyx_kp_u_Conversion_limits_to_datetime_u);
      PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u_Conversion_limits_to_datetime_u);

      /* "utils.pxd":4957
 *         ):
 *             raise ValueError(
 *                 "cannot convert ndarray from datetime64[%s] to datetime64[%s].\n"             # <<<<<<<<<<<<<<
 *                 "Conversion limits to datetime units between ['s', 'ms', 'us', 'ns']."
 *                 % (map_nptime_unit_int2str(my_unit), map_nptime_unit_int2str(to_unit))
 */
      __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 4957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "utils.pxd":4956
 *             np.NPY_DATETIMEUNIT.NPY_FR_s,
 *         ):
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "cannot convert ndarray from datetime64[%s] to datetime64[%s].\n"
 *                 "Conversion limits to datetime units between ['s', 'ms', 'us', 'ns']."
 */
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4956, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(5, 4956, __pyx_L1_error)

      /* "utils.pxd":4945
 *     # Check limit
 *     if limit:
 *         if to_unit not in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_us,
 */
    }

    /* "utils.pxd":4944
 * 
 *     # Check limit
 *     if limit:             # <<<<<<<<<<<<<<
 *         if to_unit not in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 */
  }

  /* "utils.pxd":4963
 * 
 *     # Fast-path: same unit
 *     if my_unit == to_unit:             # <<<<<<<<<<<<<<
 *         return arr
 * 
 */
  __pyx_t_1 = (__pyx_v_my_unit == __pyx_v_to_unit);
  if (__pyx_t_1) {

    /* "utils.pxd":4964
 *     # Fast-path: same unit
 *     if my_unit == to_unit:
 *         return arr             # <<<<<<<<<<<<<<
 * 
 *     # To nanosecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "utils.pxd":4963
 * 
 *     # Fast-path: same unit
 *     if my_unit == to_unit:             # <<<<<<<<<<<<<<
 *         return arr
 * 
 */
  }

  /* "utils.pxd":4968
 *     # To nanosecond
 *     cdef bint ns_safe
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         # check 'ns' overflow
 *         ns_safe = is_dt64arr_ns_safe(arr, arr_unit)
 */
  __pyx_t_1 = (__pyx_v_to_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "utils.pxd":4970
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         # check 'ns' overflow
 *         ns_safe = is_dt64arr_ns_safe(arr, arr_unit)             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [ns]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
    __pyx_t_12.__pyx_n = 1;
    __pyx_t_12.arr_unit = __pyx_v_arr_unit;
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_12); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 4970, __pyx_L1_error)
    __pyx_v_ns_safe = __pyx_t_1;

    /* "utils.pxd":4972
 *         ns_safe = is_dt64arr_ns_safe(arr, arr_unit)
 *         # my_unit [us] -> to_unit [ns]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             if not ns_safe:
 *                 return arr
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_us:

      /* "utils.pxd":4973
 *         # my_unit [us] -> to_unit [ns]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             if not ns_safe:             # <<<<<<<<<<<<<<
 *                 return arr
 *             return arr.astype("datetime64[ns]")
 */
      __pyx_t_1 = (!__pyx_v_ns_safe);
      if (__pyx_t_1) {

        /* "utils.pxd":4974
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             if not ns_safe:
 *                 return arr             # <<<<<<<<<<<<<<
 *             return arr.astype("datetime64[ns]")
 *         # my_unit [M, Y] -> to_unit [ns]
 */
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __Pyx_INCREF((PyObject *)__pyx_v_arr);
        __pyx_r = __pyx_v_arr;
        goto __pyx_L0;

        /* "utils.pxd":4973
 *         # my_unit [us] -> to_unit [ns]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             if not ns_safe:             # <<<<<<<<<<<<<<
 *                 return arr
 *             return arr.astype("datetime64[ns]")
 */
      }

      /* "utils.pxd":4975
 *             if not ns_safe:
 *                 return arr
 *             return arr.astype("datetime64[ns]")             # <<<<<<<<<<<<<<
 *         # my_unit [M, Y] -> to_unit [ns]
 *         elif my_unit in (
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 4975, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (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 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_ns};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4975, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4975, __pyx_L1_error)
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "utils.pxd":4972
 *         ns_safe = is_dt64arr_ns_safe(arr, arr_unit)
 *         # my_unit [us] -> to_unit [ns]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             if not ns_safe:
 *                 return arr
 */
      break;
      case NPY_FR_M:

      /* "utils.pxd":4978
 *         # my_unit [M, Y] -> to_unit [ns]
 *         elif my_unit in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 */
      case NPY_FR_Y:

      /* "utils.pxd":4981
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 *             if not ns_safe:             # <<<<<<<<<<<<<<
 *                 arr = dt64arr_as_int64_us(arr, arr_unit, 0)
 *                 return arr.astype("datetime64[us]")
 */
      __pyx_t_1 = (!__pyx_v_ns_safe);
      if (__pyx_t_1) {

        /* "utils.pxd":4982
 *         ):
 *             if not ns_safe:
 *                 arr = dt64arr_as_int64_us(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *                 return arr.astype("datetime64[us]")
 *             arr = dt64arr_as_int64_ns(arr, arr_unit, 0)
 */
        __pyx_t_13.__pyx_n = 2;
        __pyx_t_13.arr_unit = __pyx_v_arr_unit;
        __pyx_t_13.offset = 0;
        __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_us(__pyx_v_arr, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4982, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "utils.pxd":4983
 *             if not ns_safe:
 *                 arr = dt64arr_as_int64_us(arr, arr_unit, 0)
 *                 return arr.astype("datetime64[us]")             # <<<<<<<<<<<<<<
 *             arr = dt64arr_as_int64_ns(arr, arr_unit, 0)
 *             return arr.astype("datetime64[ns]")
 */
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 4983, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = NULL;
        __pyx_t_7 = 0;
        #if CYTHON_UNPACK_METHODS
        if (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 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_us};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4983, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4983, __pyx_L1_error)
        __pyx_r = ((PyArrayObject *)__pyx_t_3);
        __pyx_t_3 = 0;
        goto __pyx_L0;

        /* "utils.pxd":4981
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 *             if not ns_safe:             # <<<<<<<<<<<<<<
 *                 arr = dt64arr_as_int64_us(arr, arr_unit, 0)
 *                 return arr.astype("datetime64[us]")
 */
      }

      /* "utils.pxd":4984
 *                 arr = dt64arr_as_int64_us(arr, arr_unit, 0)
 *                 return arr.astype("datetime64[us]")
 *             arr = dt64arr_as_int64_ns(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *             return arr.astype("datetime64[ns]")
 *         # my_unit [rest] -> to_unit [ns]
 */
      __pyx_t_14.__pyx_n = 2;
      __pyx_t_14.arr_unit = __pyx_v_arr_unit;
      __pyx_t_14.offset = 0;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_ns(__pyx_v_arr, &__pyx_t_14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4984, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "utils.pxd":4985
 *                 return arr.astype("datetime64[us]")
 *             arr = dt64arr_as_int64_ns(arr, arr_unit, 0)
 *             return arr.astype("datetime64[ns]")             # <<<<<<<<<<<<<<
 *         # my_unit [rest] -> to_unit [ns]
 *         if not ns_safe:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 4985, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (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 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_ns};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4985, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4985, __pyx_L1_error)
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "utils.pxd":4977
 *             return arr.astype("datetime64[ns]")
 *         # my_unit [M, Y] -> to_unit [ns]
 *         elif my_unit in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 */
      break;
      default: break;
    }

    /* "utils.pxd":4987
 *             return arr.astype("datetime64[ns]")
 *         # my_unit [rest] -> to_unit [ns]
 *         if not ns_safe:             # <<<<<<<<<<<<<<
 *             return arr.astype("datetime64[us]")
 *         return arr.astype("datetime64[ns]")
 */
    __pyx_t_1 = (!__pyx_v_ns_safe);
    if (__pyx_t_1) {

      /* "utils.pxd":4988
 *         # my_unit [rest] -> to_unit [ns]
 *         if not ns_safe:
 *             return arr.astype("datetime64[us]")             # <<<<<<<<<<<<<<
 *         return arr.astype("datetime64[ns]")
 * 
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 4988, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (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 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_us};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4988, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4988, __pyx_L1_error)
      __pyx_r = ((PyArrayObject *)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "utils.pxd":4987
 *             return arr.astype("datetime64[ns]")
 *         # my_unit [rest] -> to_unit [ns]
 *         if not ns_safe:             # <<<<<<<<<<<<<<
 *             return arr.astype("datetime64[us]")
 *         return arr.astype("datetime64[ns]")
 */
    }

    /* "utils.pxd":4989
 *         if not ns_safe:
 *             return arr.astype("datetime64[us]")
 *         return arr.astype("datetime64[ns]")             # <<<<<<<<<<<<<<
 * 
 *     # To microsecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 4989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_ns};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 4989, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4968
 *     # To nanosecond
 *     cdef bint ns_safe
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         # check 'ns' overflow
 *         ns_safe = is_dt64arr_ns_safe(arr, arr_unit)
 */
  }

  /* "utils.pxd":4992
 * 
 *     # To microsecond
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  __pyx_t_1 = (__pyx_v_to_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "utils.pxd":4994
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_MICROSECOND)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":4995
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_MICROSECOND)
 *         # my_unit [M, Y] -> to_unit [us]
 */
      __pyx_t_12.__pyx_n = 1;
      __pyx_t_12.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_12); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 4995, __pyx_L1_error)
      __pyx_t_8 = (!__pyx_t_1);
      if (__pyx_t_8) {

        /* "utils.pxd":4996
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_MICROSECOND)             # <<<<<<<<<<<<<<
 *         # my_unit [M, Y] -> to_unit [us]
 *         elif my_unit in (
 */
        __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 4996, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "utils.pxd":4995
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_MICROSECOND)
 *         # my_unit [M, Y] -> to_unit [us]
 */
      }

      /* "utils.pxd":4994
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_MICROSECOND)
 */
      break;
      case NPY_FR_M:

      /* "utils.pxd":4999
 *         # my_unit [M, Y] -> to_unit [us]
 *         elif my_unit in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 */
      case NPY_FR_Y:

      /* "utils.pxd":5002
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 *             arr = dt64arr_as_int64_us(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *         # my_unit [rest] -> to_unit [us]
 *         return arr.astype("datetime64[us]")
 */
      __pyx_t_13.__pyx_n = 2;
      __pyx_t_13.arr_unit = __pyx_v_arr_unit;
      __pyx_t_13.offset = 0;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_us(__pyx_v_arr, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5002, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "utils.pxd":4998
 *                 arr = arr_floor_div(arr, NS_MICROSECOND)
 *         # my_unit [M, Y] -> to_unit [us]
 *         elif my_unit in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 */
      break;
      default: break;
    }

    /* "utils.pxd":5004
 *             arr = dt64arr_as_int64_us(arr, arr_unit, 0)
 *         # my_unit [rest] -> to_unit [us]
 *         return arr.astype("datetime64[us]")             # <<<<<<<<<<<<<<
 * 
 *     # To millisecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5004, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_us};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5004, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 5004, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":4992
 * 
 *     # To microsecond
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  }

  /* "utils.pxd":5007
 * 
 *     # To millisecond
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  __pyx_t_8 = (__pyx_v_to_unit == NPY_FR_ms);
  if (__pyx_t_8) {

    /* "utils.pxd":5009
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_MILLISECOND)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":5010
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_MILLISECOND)
 *         # my_unit [M, Y] -> to_unit [ms]
 */
      __pyx_t_12.__pyx_n = 1;
      __pyx_t_12.arr_unit = __pyx_n_u_ns;
      __pyx_t_8 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_12); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 5010, __pyx_L1_error)
      __pyx_t_1 = (!__pyx_t_8);
      if (__pyx_t_1) {

        /* "utils.pxd":5011
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_MILLISECOND)             # <<<<<<<<<<<<<<
 *         # my_unit [M, Y] -> to_unit [ms]
 *         elif my_unit in (
 */
        __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MILLISECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5011, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "utils.pxd":5010
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_MILLISECOND)
 *         # my_unit [M, Y] -> to_unit [ms]
 */
      }

      /* "utils.pxd":5009
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_MILLISECOND)
 */
      break;
      case NPY_FR_M:

      /* "utils.pxd":5014
 *         # my_unit [M, Y] -> to_unit [ms]
 *         elif my_unit in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 */
      case NPY_FR_Y:

      /* "utils.pxd":5017
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 *             arr = dt64arr_as_int64_ms(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *         # my_unit [rest] -> to_unit [ms]
 *         return arr.astype("datetime64[ms]")
 */
      __pyx_t_15.__pyx_n = 2;
      __pyx_t_15.arr_unit = __pyx_v_arr_unit;
      __pyx_t_15.offset = 0;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_ms(__pyx_v_arr, &__pyx_t_15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5017, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "utils.pxd":5013
 *                 arr = arr_floor_div(arr, NS_MILLISECOND)
 *         # my_unit [M, Y] -> to_unit [ms]
 *         elif my_unit in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 */
      break;
      default: break;
    }

    /* "utils.pxd":5019
 *             arr = dt64arr_as_int64_ms(arr, arr_unit, 0)
 *         # my_unit [rest] -> to_unit [ms]
 *         return arr.astype("datetime64[ms]")             # <<<<<<<<<<<<<<
 * 
 *     # To second
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5019, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_ms};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5019, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 5019, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5007
 * 
 *     # To millisecond
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  }

  /* "utils.pxd":5022
 * 
 *     # To second
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  __pyx_t_1 = (__pyx_v_to_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "utils.pxd":5024
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_SECOND)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":5025
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_SECOND)
 *         # my_unit [M, Y] -> to_unit [s]
 */
      __pyx_t_12.__pyx_n = 1;
      __pyx_t_12.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_12); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5025, __pyx_L1_error)
      __pyx_t_8 = (!__pyx_t_1);
      if (__pyx_t_8) {

        /* "utils.pxd":5026
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_SECOND)             # <<<<<<<<<<<<<<
 *         # my_unit [M, Y] -> to_unit [s]
 *         elif my_unit in (
 */
        __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_SECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5026, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "utils.pxd":5025
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_SECOND)
 *         # my_unit [M, Y] -> to_unit [s]
 */
      }

      /* "utils.pxd":5024
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_SECOND)
 */
      break;
      case NPY_FR_M:

      /* "utils.pxd":5029
 *         # my_unit [M, Y] -> to_unit [s]
 *         elif my_unit in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 */
      case NPY_FR_Y:

      /* "utils.pxd":5032
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 *             arr = dt64arr_as_int64_s(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *         # my_unit [rest] -> to_unit [s]
 *         return arr.astype("datetime64[s]")
 */
      __pyx_t_16.__pyx_n = 2;
      __pyx_t_16.arr_unit = __pyx_v_arr_unit;
      __pyx_t_16.offset = 0;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_s(__pyx_v_arr, &__pyx_t_16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5032, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "utils.pxd":5028
 *                 arr = arr_floor_div(arr, NS_SECOND)
 *         # my_unit [M, Y] -> to_unit [s]
 *         elif my_unit in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 */
      break;
      default: break;
    }

    /* "utils.pxd":5034
 *             arr = dt64arr_as_int64_s(arr, arr_unit, 0)
 *         # my_unit [rest] -> to_unit [s]
 *         return arr.astype("datetime64[s]")             # <<<<<<<<<<<<<<
 * 
 *     # To minute
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5034, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_s_2};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5034, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 5034, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5022
 * 
 *     # To second
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  }

  /* "utils.pxd":5037
 * 
 *     # To minute
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  __pyx_t_8 = (__pyx_v_to_unit == NPY_FR_m);
  if (__pyx_t_8) {

    /* "utils.pxd":5039
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_MINUTE)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":5040
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_MINUTE)
 *         # my_unit [M, Y] -> to_unit [m]
 */
      __pyx_t_12.__pyx_n = 1;
      __pyx_t_12.arr_unit = __pyx_n_u_ns;
      __pyx_t_8 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_12); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 5040, __pyx_L1_error)
      __pyx_t_1 = (!__pyx_t_8);
      if (__pyx_t_1) {

        /* "utils.pxd":5041
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_MINUTE)             # <<<<<<<<<<<<<<
 *         # my_unit [M, Y] -> to_unit [m]
 *         elif my_unit in (
 */
        __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MINUTE, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5041, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "utils.pxd":5040
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_MINUTE)
 *         # my_unit [M, Y] -> to_unit [m]
 */
      }

      /* "utils.pxd":5039
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_MINUTE)
 */
      break;
      case NPY_FR_M:

      /* "utils.pxd":5044
 *         # my_unit [M, Y] -> to_unit [m]
 *         elif my_unit in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 */
      case NPY_FR_Y:

      /* "utils.pxd":5047
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 *             arr = dt64arr_as_int64_m(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *         # my_unit [rest] -> to_unit [m]
 *         return arr.astype("datetime64[m]")
 */
      __pyx_t_17.__pyx_n = 2;
      __pyx_t_17.arr_unit = __pyx_v_arr_unit;
      __pyx_t_17.offset = 0;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_m(__pyx_v_arr, &__pyx_t_17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5047, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "utils.pxd":5043
 *                 arr = arr_floor_div(arr, NS_MINUTE)
 *         # my_unit [M, Y] -> to_unit [m]
 *         elif my_unit in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 */
      break;
      default: break;
    }

    /* "utils.pxd":5049
 *             arr = dt64arr_as_int64_m(arr, arr_unit, 0)
 *         # my_unit [rest] -> to_unit [m]
 *         return arr.astype("datetime64[m]")             # <<<<<<<<<<<<<<
 * 
 *     # To hour
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_m};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5049, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 5049, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5037
 * 
 *     # To minute
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  }

  /* "utils.pxd":5052
 * 
 *     # To hour
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  __pyx_t_1 = (__pyx_v_to_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "utils.pxd":5054
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_HOUR)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":5055
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_HOUR)
 *         # my_unit [M, Y] -> to_unit [h]
 */
      __pyx_t_12.__pyx_n = 1;
      __pyx_t_12.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_12); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5055, __pyx_L1_error)
      __pyx_t_8 = (!__pyx_t_1);
      if (__pyx_t_8) {

        /* "utils.pxd":5056
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_HOUR)             # <<<<<<<<<<<<<<
 *         # my_unit [M, Y] -> to_unit [h]
 *         elif my_unit in (
 */
        __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_HOUR, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5056, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "utils.pxd":5055
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_HOUR)
 *         # my_unit [M, Y] -> to_unit [h]
 */
      }

      /* "utils.pxd":5054
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_HOUR)
 */
      break;
      case NPY_FR_M:

      /* "utils.pxd":5059
 *         # my_unit [M, Y] -> to_unit [h]
 *         elif my_unit in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 */
      case NPY_FR_Y:

      /* "utils.pxd":5062
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 *             arr = dt64arr_as_int64_h(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *         # my_unit [rest] -> to_unit [h]
 *         return arr.astype("datetime64[h]")
 */
      __pyx_t_18.__pyx_n = 2;
      __pyx_t_18.arr_unit = __pyx_v_arr_unit;
      __pyx_t_18.offset = 0;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_h(__pyx_v_arr, &__pyx_t_18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5062, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "utils.pxd":5058
 *                 arr = arr_floor_div(arr, NS_HOUR)
 *         # my_unit [M, Y] -> to_unit [h]
 *         elif my_unit in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 */
      break;
      default: break;
    }

    /* "utils.pxd":5064
 *             arr = dt64arr_as_int64_h(arr, arr_unit, 0)
 *         # my_unit [rest] -> to_unit [h]
 *         return arr.astype("datetime64[h]")             # <<<<<<<<<<<<<<
 * 
 *     # To day
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_h};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5064, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 5064, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5052
 * 
 *     # To hour
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  }

  /* "utils.pxd":5067
 * 
 *     # To day
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  __pyx_t_8 = (__pyx_v_to_unit == NPY_FR_D);
  if (__pyx_t_8) {

    /* "utils.pxd":5069
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_DAY)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":5070
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_DAY)
 *         # my_unit [M, Y] -> to_unit [D]
 */
      __pyx_t_12.__pyx_n = 1;
      __pyx_t_12.arr_unit = __pyx_n_u_ns;
      __pyx_t_8 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_12); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 5070, __pyx_L1_error)
      __pyx_t_1 = (!__pyx_t_8);
      if (__pyx_t_1) {

        /* "utils.pxd":5071
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_DAY)             # <<<<<<<<<<<<<<
 *         # my_unit [M, Y] -> to_unit [D]
 *         elif my_unit in (
 */
        __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_DAY, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5071, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "utils.pxd":5070
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_DAY)
 *         # my_unit [M, Y] -> to_unit [D]
 */
      }

      /* "utils.pxd":5069
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_DAY)
 */
      break;
      case NPY_FR_M:

      /* "utils.pxd":5074
 *         # my_unit [M, Y] -> to_unit [D]
 *         elif my_unit in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 */
      case NPY_FR_Y:

      /* "utils.pxd":5077
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 *             arr = dt64arr_as_int64_D(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *         # my_unit [rest] -> to_unit [D]
 *         return arr.astype("datetime64[D]")
 */
      __pyx_t_19.__pyx_n = 2;
      __pyx_t_19.arr_unit = __pyx_v_arr_unit;
      __pyx_t_19.offset = 0;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_19)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5077, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "utils.pxd":5073
 *                 arr = arr_floor_div(arr, NS_DAY)
 *         # my_unit [M, Y] -> to_unit [D]
 *         elif my_unit in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 */
      break;
      default: break;
    }

    /* "utils.pxd":5079
 *             arr = dt64arr_as_int64_D(arr, arr_unit, 0)
 *         # my_unit [rest] -> to_unit [D]
 *         return arr.astype("datetime64[D]")             # <<<<<<<<<<<<<<
 * 
 *     # To week
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5079, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_D};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5079, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 5079, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5067
 * 
 *     # To day
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  }

  /* "utils.pxd":5082
 * 
 *     # To week
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_W:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [W]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  __pyx_t_1 = (__pyx_v_to_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "utils.pxd":5084
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_W:
 *         # my_unit [ns] -> to_unit [W]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_DAY * 7)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":5085
 *         # my_unit [ns] -> to_unit [W]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_DAY * 7)
 *         # my_unit [M, Y] -> to_unit [W]
 */
      __pyx_t_12.__pyx_n = 1;
      __pyx_t_12.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_12); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5085, __pyx_L1_error)
      __pyx_t_8 = (!__pyx_t_1);
      if (__pyx_t_8) {

        /* "utils.pxd":5086
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_DAY * 7)             # <<<<<<<<<<<<<<
 *         # my_unit [M, Y] -> to_unit [W]
 *         elif my_unit in (
 */
        __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, (__pyx_v_7cytimes_5utils_NS_DAY * 7), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5086, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "utils.pxd":5085
 *         # my_unit [ns] -> to_unit [W]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if not is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_div(arr, NS_DAY * 7)
 *         # my_unit [M, Y] -> to_unit [W]
 */
      }

      /* "utils.pxd":5084
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_W:
 *         # my_unit [ns] -> to_unit [W]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if not is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_div(arr, NS_DAY * 7)
 */
      break;
      case NPY_FR_M:

      /* "utils.pxd":5089
 *         # my_unit [M, Y] -> to_unit [W]
 *         elif my_unit in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 */
      case NPY_FR_Y:

      /* "utils.pxd":5092
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 *             arr = dt64arr_as_int64_W(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *         # my_unit [rest] -> to_unit [D]
 *         return arr.astype("datetime64[W]")
 */
      __pyx_t_20.__pyx_n = 2;
      __pyx_t_20.arr_unit = __pyx_v_arr_unit;
      __pyx_t_20.offset = 0;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_W(__pyx_v_arr, &__pyx_t_20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5092, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "utils.pxd":5088
 *                 arr = arr_floor_div(arr, NS_DAY * 7)
 *         # my_unit [M, Y] -> to_unit [W]
 *         elif my_unit in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_M,
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 */
      break;
      default: break;
    }

    /* "utils.pxd":5094
 *             arr = dt64arr_as_int64_W(arr, arr_unit, 0)
 *         # my_unit [rest] -> to_unit [D]
 *         return arr.astype("datetime64[W]")             # <<<<<<<<<<<<<<
 * 
 *     # To month
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_W};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5094, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 5094, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5082
 * 
 *     # To week
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_W:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [W]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  }

  /* "utils.pxd":5097
 * 
 *     # To month
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_M:             # <<<<<<<<<<<<<<
 *         # my_unit [ns, Y] -> to_unit [M]
 *         if my_unit in (
 */
  __pyx_t_8 = (__pyx_v_to_unit == NPY_FR_M);
  if (__pyx_t_8) {

    /* "utils.pxd":5099
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 *         # my_unit [ns, Y] -> to_unit [M]
 *         if my_unit in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":5100
 *         # my_unit [ns, Y] -> to_unit [M]
 *         if my_unit in (
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 */
      case NPY_FR_Y:

      /* "utils.pxd":5103
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 *         ):
 *             arr = dt64arr_as_int64_M(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *         # my_unit [rest] -> to_unit [M]
 *         return arr.astype("datetime64[M]")
 */
      __pyx_t_21.__pyx_n = 2;
      __pyx_t_21.arr_unit = __pyx_v_arr_unit;
      __pyx_t_21.offset = 0;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_arr, &__pyx_t_21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5103, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "utils.pxd":5099
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 *         # my_unit [ns, Y] -> to_unit [M]
 *         if my_unit in (             # <<<<<<<<<<<<<<
 *             np.NPY_DATETIMEUNIT.NPY_FR_ns,
 *             np.NPY_DATETIMEUNIT.NPY_FR_Y,
 */
      break;
      default: break;
    }

    /* "utils.pxd":5105
 *             arr = dt64arr_as_int64_M(arr, arr_unit, 0)
 *         # my_unit [rest] -> to_unit [M]
 *         return arr.astype("datetime64[M]")             # <<<<<<<<<<<<<<
 * 
 *     # To year
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_M};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5105, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 5105, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5097
 * 
 *     # To month
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_M:             # <<<<<<<<<<<<<<
 *         # my_unit [ns, Y] -> to_unit [M]
 *         if my_unit in (
 */
  }

  /* "utils.pxd":5108
 * 
 *     # To year
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:             # <<<<<<<<<<<<<<
 *         arr = dt64arr_as_int64_Y(arr, arr_unit, 0)
 *         return arr.astype("datetime64[Y]")
 */
  __pyx_t_8 = (__pyx_v_to_unit == NPY_FR_Y);
  if (__pyx_t_8) {

    /* "utils.pxd":5109
 *     # To year
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:
 *         arr = dt64arr_as_int64_Y(arr, arr_unit, 0)             # <<<<<<<<<<<<<<
 *         return arr.astype("datetime64[Y]")
 * 
 */
    __pyx_t_22.__pyx_n = 2;
    __pyx_t_22.arr_unit = __pyx_v_arr_unit;
    __pyx_t_22.offset = 0;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_22)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "utils.pxd":5110
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:
 *         arr = dt64arr_as_int64_Y(arr, arr_unit, 0)
 *         return arr.astype("datetime64[Y]")             # <<<<<<<<<<<<<<
 * 
 *     # Rest
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_datetime64_Y};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5110, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 5110, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5108
 * 
 *     # To year
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:             # <<<<<<<<<<<<<<
 *         arr = dt64arr_as_int64_Y(arr, arr_unit, 0)
 *         return arr.astype("datetime64[Y]")
 */
  }

  /* "utils.pxd":5113
 * 
 *     # Rest
 *     return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(to_unit))             # <<<<<<<<<<<<<<
 * 
 * # . arithmetic
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_to_unit); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 5113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 5113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 5113, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "utils.pxd":4915
 * 
 * # . conversion: unit
 * cdef inline np.ndarray dt64arr_as_unit(np.ndarray arr, str unit, str arr_unit=None, bint limit=False):             # <<<<<<<<<<<<<<
 *     """Convert np.ndarray[datetime64] to the specified unit `<'ndarray[datetime64]'>`.
 * 
 */

  /* 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("cytimes.utils.dt64arr_as_unit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_arr_unit);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":5116
 * 
 * # . arithmetic
 * cdef inline np.ndarray dt64arr_round(np.ndarray arr, str unit, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Perform round operation on the np.ndarray[datetime64] to the
 *     specified unit `<'ndarray[datetime64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_round(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_unit, struct __pyx_opt_args_7cytimes_5utils_dt64arr_round *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  int __pyx_v_my_unit;
  int __pyx_v_to_unit;
  int __pyx_v_dtype;
  PyObject *__pyx_v_to_dtype = NULL;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_arr_round_to_mul __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_round", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":5124
 *     """
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":5125
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "utils.pxd":5124
 *     """
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "utils.pxd":5129
 *     # Get time unit
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "utils.pxd":5130
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "utils.pxd":5131
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "utils.pxd":5132
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_n_u_int64); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5132, __pyx_L1_error)

      /* "utils.pxd":5131
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "utils.pxd":5133
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 5133, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;

    /* "utils.pxd":5130
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":5134
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "utils.pxd":5135
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:
 *         my_unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 5135, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;

    /* "utils.pxd":5134
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":5137
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     to_unit = map_nptime_unit_str2int(unit)
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 5137, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "utils.pxd":5138
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)
 *     to_unit = map_nptime_unit_str2int(unit)             # <<<<<<<<<<<<<<
 * 
 *     # Fast-path
 */
  __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 5138, __pyx_L1_error)
  __pyx_v_to_unit = __pyx_t_2;

  /* "utils.pxd":5143
 *     #: 1. same or my_unit is lower than to_unit (ms is lower than us)
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr
 */
  __pyx_t_3 = (__pyx_v_my_unit <= __pyx_v_to_unit);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_to_unit == NPY_FR_ns);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_1) {

    /* "utils.pxd":5144
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *             return arr
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))
 */
    __pyx_t_1 = (__pyx_v_dtype == NPY_DATETIME);
    if (__pyx_t_1) {

      /* "utils.pxd":5145
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr             # <<<<<<<<<<<<<<
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))
 * 
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "utils.pxd":5144
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *             return arr
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))
 */
    }

    /* "utils.pxd":5146
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))             # <<<<<<<<<<<<<<
 * 
 *     # To microsecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 5146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_my_unit); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 5146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 5146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 5146, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5143
 *     #: 1. same or my_unit is lower than to_unit (ms is lower than us)
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr
 */
  }

  /* "utils.pxd":5149
 * 
 *     # To microsecond
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  switch (__pyx_v_to_unit) {
    case NPY_FR_us:

    /* "utils.pxd":5151
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MICROSECOND)
 */
    __pyx_t_1 = (__pyx_v_my_unit == NPY_FR_ns);
    if (__pyx_t_1) {

      /* "utils.pxd":5152
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5152, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "utils.pxd":5153
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MICROSECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5153, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5154
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_round_div(arr, NS_MICROSECOND)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "utils.pxd":5152
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L11;
      }

      /* "utils.pxd":5156
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_round_div(arr, NS_MICROSECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [D...us] are lower units, which is covered
 */
      /*else*/ {
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5156, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5157
 *             else:
 *                 arr = arr_round_div(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...us] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L11:;

      /* "utils.pxd":5151
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MICROSECOND)
 */
      goto __pyx_L10;
    }

    /* "utils.pxd":5161
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("round", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To millisecond
 */
    /*else*/ {
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_round, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5161, __pyx_L1_error)
    }
    __pyx_L10:;

    /* "utils.pxd":5149
 * 
 *     # To microsecond
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_ms:

    /* "utils.pxd":5166
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MILLISECOND)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":5167
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_MILLISECOND)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5167, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "utils.pxd":5168
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MILLISECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MILLISECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5168, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5169
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MILLISECOND)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_MILLISECOND, US_MILLISECOND)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "utils.pxd":5167
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_MILLISECOND)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L12;
      }

      /* "utils.pxd":5171
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_MILLISECOND, US_MILLISECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [ms]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_MILLISECOND;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MILLISECOND, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5171, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5172
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_MILLISECOND, US_MILLISECOND)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [ms]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L12:;

      /* "utils.pxd":5166
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MILLISECOND)
 */
      break;
      case NPY_FR_us:

      /* "utils.pxd":5175
 *         # my_unit [us] -> to_unit [ms]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_round_to_mul(arr, US_MILLISECOND)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [D...ms] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MILLISECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5176
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_round_to_mul(arr, US_MILLISECOND)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...ms] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "utils.pxd":5174
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [ms]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, US_MILLISECOND)
 *             to_dtype = "datetime64[us]"
 */
      break;
      default:

      /* "utils.pxd":5180
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("round", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To second
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_round, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5180, __pyx_L1_error)
      break;
    }

    /* "utils.pxd":5164
 * 
 *     # To millisecond
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_s:

    /* "utils.pxd":5185
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_SECOND)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":5186
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_SECOND)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5186, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "utils.pxd":5187
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_SECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_SECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5187, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5188
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_SECOND)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_SECOND, US_SECOND)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "utils.pxd":5186
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_SECOND)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L13;
      }

      /* "utils.pxd":5190
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_SECOND, US_SECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [s]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_SECOND;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_SECOND, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5190, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5191
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_SECOND, US_SECOND)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L13:;

      /* "utils.pxd":5185
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_SECOND)
 */
      break;
      case NPY_FR_us:

      /* "utils.pxd":5194
 *         # my_unit [us] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_round_to_mul(arr, US_SECOND)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [s]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_SECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5195
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_round_to_mul(arr, US_SECOND)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "utils.pxd":5193
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, US_SECOND)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "utils.pxd":5198
 *         # my_unit [ms] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_round_to_mul(arr, MS_SECOND)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [D...s] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_SECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5199
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_round_to_mul(arr, MS_SECOND)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...s] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "utils.pxd":5197
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, MS_SECOND)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      default:

      /* "utils.pxd":5203
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("round", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To minute
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_round, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5203, __pyx_L1_error)
      break;
    }

    /* "utils.pxd":5183
 * 
 *     # To second
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_m:

    /* "utils.pxd":5208
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MINUTE)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":5209
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_MINUTE)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5209, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "utils.pxd":5210
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MINUTE)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5210, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5211
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MINUTE)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_MINUTE, US_MINUTE)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "utils.pxd":5209
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_MINUTE)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L14;
      }

      /* "utils.pxd":5213
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_MINUTE, US_MINUTE)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [m]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_MINUTE;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MINUTE, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5213, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5214
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_MINUTE, US_MINUTE)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L14:;

      /* "utils.pxd":5208
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_MINUTE)
 */
      break;
      case NPY_FR_us:

      /* "utils.pxd":5217
 *         # my_unit [us] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_round_to_mul(arr, US_MINUTE)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [m]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5217, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5218
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_round_to_mul(arr, US_MINUTE)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "utils.pxd":5216
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, US_MINUTE)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "utils.pxd":5221
 *         # my_unit [ms] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_round_to_mul(arr, MS_MINUTE)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [m]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5221, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5222
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_round_to_mul(arr, MS_MINUTE)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [s] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "utils.pxd":5220
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, MS_MINUTE)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      case NPY_FR_s:

      /* "utils.pxd":5225
 *         # my_unit [s] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_round_to_mul(arr, SS_MINUTE)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[s]"
 *         # my_unit [D...m] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5225, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5226
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_round_to_mul(arr, SS_MINUTE)
 *             to_dtype = "datetime64[s]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...m] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_s_2);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_s_2;

      /* "utils.pxd":5224
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, SS_MINUTE)
 *             to_dtype = "datetime64[s]"
 */
      break;
      default:

      /* "utils.pxd":5230
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("round", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To hour
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_round, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5230, __pyx_L1_error)
      break;
    }

    /* "utils.pxd":5206
 * 
 *     # To minute
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_h:

    /* "utils.pxd":5235
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_HOUR)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":5236
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_HOUR)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5236, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "utils.pxd":5237
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_HOUR)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5237, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5238
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_HOUR)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_HOUR, US_HOUR)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "utils.pxd":5236
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_HOUR)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L15;
      }

      /* "utils.pxd":5240
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_HOUR, US_HOUR)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [h]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_HOUR;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_HOUR, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5241
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_HOUR, US_HOUR)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L15:;

      /* "utils.pxd":5235
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_HOUR)
 */
      break;
      case NPY_FR_us:

      /* "utils.pxd":5244
 *         # my_unit [us] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_round_to_mul(arr, US_HOUR)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [h]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5244, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5245
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_round_to_mul(arr, US_HOUR)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "utils.pxd":5243
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, US_HOUR)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "utils.pxd":5248
 *         # my_unit [ms] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_round_to_mul(arr, MS_HOUR)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [h]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5248, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5249
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_round_to_mul(arr, MS_HOUR)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [s] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "utils.pxd":5247
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, MS_HOUR)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      case NPY_FR_s:

      /* "utils.pxd":5252
 *         # my_unit [s] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_round_to_mul(arr, SS_HOUR)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [h]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5253
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_round_to_mul(arr, SS_HOUR)
 *             to_dtype = "datetime64[s]"             # <<<<<<<<<<<<<<
 *         # my_unit [m] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_s_2);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_s_2;

      /* "utils.pxd":5251
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, SS_HOUR)
 *             to_dtype = "datetime64[s]"
 */
      break;
      case NPY_FR_m:

      /* "utils.pxd":5256
 *         # my_unit [m] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_round_to_mul(arr, 60)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[m]"
 *         # my_unit [D...h] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, 60, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5257
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_round_to_mul(arr, 60)
 *             to_dtype = "datetime64[m]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...h] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_m);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_m;

      /* "utils.pxd":5255
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, 60)
 *             to_dtype = "datetime64[m]"
 */
      break;
      default:

      /* "utils.pxd":5261
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("round", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To day
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_round, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5261, __pyx_L1_error)
      break;
    }

    /* "utils.pxd":5233
 * 
 *     # To hour
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_D:

    /* "utils.pxd":5266
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_DAY)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":5267
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_DAY)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5267, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "utils.pxd":5268
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_DAY)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5268, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5269
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_DAY)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_DAY, US_DAY)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "utils.pxd":5267
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_round_to_mul(arr, NS_DAY)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L16;
      }

      /* "utils.pxd":5271
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_DAY, US_DAY)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [D]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_DAY;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_DAY, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5271, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5272
 *             else:
 *                 arr = arr_round_to_mul(arr, NS_DAY, US_DAY)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L16:;

      /* "utils.pxd":5266
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_round_to_mul(arr, NS_DAY)
 */
      break;
      case NPY_FR_us:

      /* "utils.pxd":5275
 *         # my_unit [us] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_round_to_mul(arr, US_DAY)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5275, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5276
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_round_to_mul(arr, US_DAY)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "utils.pxd":5274
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, US_DAY)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "utils.pxd":5279
 *         # my_unit [ms] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_round_to_mul(arr, MS_DAY)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5279, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5280
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_round_to_mul(arr, MS_DAY)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [s] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "utils.pxd":5278
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, MS_DAY)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      case NPY_FR_s:

      /* "utils.pxd":5283
 *         # my_unit [s] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_round_to_mul(arr, SS_DAY)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5283, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5284
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_round_to_mul(arr, SS_DAY)
 *             to_dtype = "datetime64[s]"             # <<<<<<<<<<<<<<
 *         # my_unit [m] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_s_2);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_s_2;

      /* "utils.pxd":5282
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, SS_DAY)
 *             to_dtype = "datetime64[s]"
 */
      break;
      case NPY_FR_m:

      /* "utils.pxd":5287
 *         # my_unit [m] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_round_to_mul(arr, 1440)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[m]"
 *         # my_unit [h] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, 0x5A0, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5288
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_round_to_mul(arr, 1440)
 *             to_dtype = "datetime64[m]"             # <<<<<<<<<<<<<<
 *         # my_unit [h] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_m);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_m;

      /* "utils.pxd":5286
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, 1440)
 *             to_dtype = "datetime64[m]"
 */
      break;
      case NPY_FR_h:

      /* "utils.pxd":5291
 *         # my_unit [h] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *             arr = arr_round_to_mul(arr, 24)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[h]"
 *         # my_unit [D] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_round_to_mul(__pyx_v_arr, 24, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5292
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *             arr = arr_round_to_mul(arr, 24)
 *             to_dtype = "datetime64[h]"             # <<<<<<<<<<<<<<
 *         # my_unit [D] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_h);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_h;

      /* "utils.pxd":5290
 *             to_dtype = "datetime64[m]"
 *         # my_unit [h] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:             # <<<<<<<<<<<<<<
 *             arr = arr_round_to_mul(arr, 24)
 *             to_dtype = "datetime64[h]"
 */
      break;
      default:

      /* "utils.pxd":5296
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("round", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # Invalid unit
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_round, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5296, __pyx_L1_error)
      break;
    }

    /* "utils.pxd":5264
 * 
 *     # To day
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    default:

    /* "utils.pxd":5300
 *     # Invalid unit
 *     else:
 *         _raise_dt64arr_rcl_unsupport_unit_error("round", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # Convert to datetime64
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_round, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5300, __pyx_L1_error)
    break;
  }

  /* "utils.pxd":5303
 * 
 *     # Convert to datetime64
 *     return arr.astype(to_dtype)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_ceil(np.ndarray arr, str unit, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 5303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(!__pyx_v_to_dtype)) { __Pyx_RaiseUnboundLocalError("to_dtype"); __PYX_ERR(5, 5303, __pyx_L1_error) }
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(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_8 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_to_dtype};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 5303, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "utils.pxd":5116
 * 
 * # . arithmetic
 * cdef inline np.ndarray dt64arr_round(np.ndarray arr, str unit, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Perform round operation on the np.ndarray[datetime64] to the
 *     specified unit `<'ndarray[datetime64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_round", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_to_dtype);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":5305
 *     return arr.astype(to_dtype)
 * 
 * cdef inline np.ndarray dt64arr_ceil(np.ndarray arr, str unit, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Perform ceil operation on the np.ndarray[datetime64] to the
 *     specified unit `<'ndarray[datetime64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_ceil(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_unit, struct __pyx_opt_args_7cytimes_5utils_dt64arr_ceil *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  int __pyx_v_my_unit;
  int __pyx_v_to_unit;
  int __pyx_v_dtype;
  PyObject *__pyx_v_to_dtype = NULL;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_arr_ceil_to_mul __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_ceil", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":5313
 *     """
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":5314
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "utils.pxd":5313
 *     """
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "utils.pxd":5318
 *     # Get time unit
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "utils.pxd":5319
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "utils.pxd":5320
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "utils.pxd":5321
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_n_u_int64); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5321, __pyx_L1_error)

      /* "utils.pxd":5320
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "utils.pxd":5322
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 5322, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;

    /* "utils.pxd":5319
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":5323
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "utils.pxd":5324
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:
 *         my_unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 5324, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;

    /* "utils.pxd":5323
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":5326
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     to_unit = map_nptime_unit_str2int(unit)
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 5326, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "utils.pxd":5327
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)
 *     to_unit = map_nptime_unit_str2int(unit)             # <<<<<<<<<<<<<<
 * 
 *     # Fast-path
 */
  __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 5327, __pyx_L1_error)
  __pyx_v_to_unit = __pyx_t_2;

  /* "utils.pxd":5332
 *     #: 1. same or my_unit is lower than to_unit (ms is lower than us)
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr
 */
  __pyx_t_3 = (__pyx_v_my_unit <= __pyx_v_to_unit);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_to_unit == NPY_FR_ns);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_1) {

    /* "utils.pxd":5333
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *             return arr
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))
 */
    __pyx_t_1 = (__pyx_v_dtype == NPY_DATETIME);
    if (__pyx_t_1) {

      /* "utils.pxd":5334
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr             # <<<<<<<<<<<<<<
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))
 * 
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "utils.pxd":5333
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *             return arr
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))
 */
    }

    /* "utils.pxd":5335
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))             # <<<<<<<<<<<<<<
 * 
 *     # To microsecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 5335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_my_unit); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 5335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 5335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5335, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 5335, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5332
 *     #: 1. same or my_unit is lower than to_unit (ms is lower than us)
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr
 */
  }

  /* "utils.pxd":5338
 * 
 *     # To microsecond
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  switch (__pyx_v_to_unit) {
    case NPY_FR_us:

    /* "utils.pxd":5340
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MICROSECOND)
 */
    __pyx_t_1 = (__pyx_v_my_unit == NPY_FR_ns);
    if (__pyx_t_1) {

      /* "utils.pxd":5341
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5341, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "utils.pxd":5342
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MICROSECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5342, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5343
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_ceil_div(arr, NS_MICROSECOND)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "utils.pxd":5341
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L11;
      }

      /* "utils.pxd":5345
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_ceil_div(arr, NS_MICROSECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [D...us] are lower units, which is covered
 */
      /*else*/ {
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5345, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5346
 *             else:
 *                 arr = arr_ceil_div(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...us] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L11:;

      /* "utils.pxd":5340
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MICROSECOND)
 */
      goto __pyx_L10;
    }

    /* "utils.pxd":5350
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("ceil", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To millisecond
 */
    /*else*/ {
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_ceil, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5350, __pyx_L1_error)
    }
    __pyx_L10:;

    /* "utils.pxd":5338
 * 
 *     # To microsecond
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_ms:

    /* "utils.pxd":5355
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MILLISECOND)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":5356
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_MILLISECOND)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5356, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "utils.pxd":5357
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MILLISECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MILLISECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5357, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5358
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MILLISECOND)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_MILLISECOND, US_MILLISECOND)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "utils.pxd":5356
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_MILLISECOND)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L12;
      }

      /* "utils.pxd":5360
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_MILLISECOND, US_MILLISECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [ms]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_MILLISECOND;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MILLISECOND, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5360, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5361
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_MILLISECOND, US_MILLISECOND)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [ms]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L12:;

      /* "utils.pxd":5355
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MILLISECOND)
 */
      break;
      case NPY_FR_us:

      /* "utils.pxd":5364
 *         # my_unit [us] -> to_unit [ms]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_ceil_to_mul(arr, US_MILLISECOND)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [D...ms] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MILLISECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5364, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5365
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_ceil_to_mul(arr, US_MILLISECOND)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...ms] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "utils.pxd":5363
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [ms]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, US_MILLISECOND)
 *             to_dtype = "datetime64[us]"
 */
      break;
      default:

      /* "utils.pxd":5369
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("ceil", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To second
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_ceil, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5369, __pyx_L1_error)
      break;
    }

    /* "utils.pxd":5353
 * 
 *     # To millisecond
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_s:

    /* "utils.pxd":5374
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_SECOND)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":5375
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_SECOND)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5375, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "utils.pxd":5376
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_SECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_SECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5376, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5377
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_SECOND)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_SECOND, US_SECOND)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "utils.pxd":5375
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_SECOND)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L13;
      }

      /* "utils.pxd":5379
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_SECOND, US_SECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [s]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_SECOND;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_SECOND, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5379, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5380
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_SECOND, US_SECOND)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L13:;

      /* "utils.pxd":5374
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_SECOND)
 */
      break;
      case NPY_FR_us:

      /* "utils.pxd":5383
 *         # my_unit [us] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_ceil_to_mul(arr, US_SECOND)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [s]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_SECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5383, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5384
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_ceil_to_mul(arr, US_SECOND)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "utils.pxd":5382
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, US_SECOND)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "utils.pxd":5387
 *         # my_unit [ms] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_ceil_to_mul(arr, MS_SECOND)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [D...s] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_SECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5387, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5388
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_ceil_to_mul(arr, MS_SECOND)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...s] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "utils.pxd":5386
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, MS_SECOND)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      default:

      /* "utils.pxd":5392
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("ceil", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To minute
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_ceil, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5392, __pyx_L1_error)
      break;
    }

    /* "utils.pxd":5372
 * 
 *     # To second
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_m:

    /* "utils.pxd":5397
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MINUTE)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":5398
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_MINUTE)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5398, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "utils.pxd":5399
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MINUTE)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5400
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MINUTE)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_MINUTE, US_MINUTE)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "utils.pxd":5398
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_MINUTE)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L14;
      }

      /* "utils.pxd":5402
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_MINUTE, US_MINUTE)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [m]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_MINUTE;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MINUTE, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5402, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5403
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_MINUTE, US_MINUTE)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L14:;

      /* "utils.pxd":5397
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_MINUTE)
 */
      break;
      case NPY_FR_us:

      /* "utils.pxd":5406
 *         # my_unit [us] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_ceil_to_mul(arr, US_MINUTE)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [m]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5406, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5407
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_ceil_to_mul(arr, US_MINUTE)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "utils.pxd":5405
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, US_MINUTE)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "utils.pxd":5410
 *         # my_unit [ms] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_ceil_to_mul(arr, MS_MINUTE)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [m]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5410, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5411
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_ceil_to_mul(arr, MS_MINUTE)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [s] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "utils.pxd":5409
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, MS_MINUTE)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      case NPY_FR_s:

      /* "utils.pxd":5414
 *         # my_unit [s] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_ceil_to_mul(arr, SS_MINUTE)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[s]"
 *         # my_unit [D...m] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5414, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5415
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_ceil_to_mul(arr, SS_MINUTE)
 *             to_dtype = "datetime64[s]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...m] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_s_2);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_s_2;

      /* "utils.pxd":5413
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, SS_MINUTE)
 *             to_dtype = "datetime64[s]"
 */
      break;
      default:

      /* "utils.pxd":5419
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("ceil", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To hour
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_ceil, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5419, __pyx_L1_error)
      break;
    }

    /* "utils.pxd":5395
 * 
 *     # To minute
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_h:

    /* "utils.pxd":5424
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_HOUR)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":5425
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_HOUR)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5425, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "utils.pxd":5426
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_HOUR)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5426, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5427
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_HOUR)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_HOUR, US_HOUR)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "utils.pxd":5425
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_HOUR)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L15;
      }

      /* "utils.pxd":5429
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_HOUR, US_HOUR)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [h]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_HOUR;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_HOUR, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5429, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5430
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_HOUR, US_HOUR)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L15:;

      /* "utils.pxd":5424
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_HOUR)
 */
      break;
      case NPY_FR_us:

      /* "utils.pxd":5433
 *         # my_unit [us] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_ceil_to_mul(arr, US_HOUR)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [h]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5433, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5434
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_ceil_to_mul(arr, US_HOUR)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "utils.pxd":5432
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, US_HOUR)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "utils.pxd":5437
 *         # my_unit [ms] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_ceil_to_mul(arr, MS_HOUR)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [h]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5438
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_ceil_to_mul(arr, MS_HOUR)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [s] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "utils.pxd":5436
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, MS_HOUR)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      case NPY_FR_s:

      /* "utils.pxd":5441
 *         # my_unit [s] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_ceil_to_mul(arr, SS_HOUR)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [h]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5441, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5442
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_ceil_to_mul(arr, SS_HOUR)
 *             to_dtype = "datetime64[s]"             # <<<<<<<<<<<<<<
 *         # my_unit [m] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_s_2);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_s_2;

      /* "utils.pxd":5440
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, SS_HOUR)
 *             to_dtype = "datetime64[s]"
 */
      break;
      case NPY_FR_m:

      /* "utils.pxd":5445
 *         # my_unit [m] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_ceil_to_mul(arr, 60)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[m]"
 *         # my_unit [D...h] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, 60, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5445, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5446
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_ceil_to_mul(arr, 60)
 *             to_dtype = "datetime64[m]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...h] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_m);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_m;

      /* "utils.pxd":5444
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, 60)
 *             to_dtype = "datetime64[m]"
 */
      break;
      default:

      /* "utils.pxd":5450
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("ceil", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To day
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_ceil, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5450, __pyx_L1_error)
      break;
    }

    /* "utils.pxd":5422
 * 
 *     # To hour
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_D:

    /* "utils.pxd":5455
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_DAY)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":5456
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_DAY)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5456, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "utils.pxd":5457
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_DAY)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5457, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5458
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_DAY)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_DAY, US_DAY)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "utils.pxd":5456
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_ceil_to_mul(arr, NS_DAY)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L16;
      }

      /* "utils.pxd":5460
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_DAY, US_DAY)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [D]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_DAY;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_DAY, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5460, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5461
 *             else:
 *                 arr = arr_ceil_to_mul(arr, NS_DAY, US_DAY)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L16:;

      /* "utils.pxd":5455
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_ceil_to_mul(arr, NS_DAY)
 */
      break;
      case NPY_FR_us:

      /* "utils.pxd":5464
 *         # my_unit [us] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_ceil_to_mul(arr, US_DAY)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5464, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5465
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_ceil_to_mul(arr, US_DAY)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "utils.pxd":5463
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, US_DAY)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "utils.pxd":5468
 *         # my_unit [ms] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_ceil_to_mul(arr, MS_DAY)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5468, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5469
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_ceil_to_mul(arr, MS_DAY)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [s] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "utils.pxd":5467
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, MS_DAY)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      case NPY_FR_s:

      /* "utils.pxd":5472
 *         # my_unit [s] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_ceil_to_mul(arr, SS_DAY)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5472, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5473
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_ceil_to_mul(arr, SS_DAY)
 *             to_dtype = "datetime64[s]"             # <<<<<<<<<<<<<<
 *         # my_unit [m] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_s_2);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_s_2;

      /* "utils.pxd":5471
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, SS_DAY)
 *             to_dtype = "datetime64[s]"
 */
      break;
      case NPY_FR_m:

      /* "utils.pxd":5476
 *         # my_unit [m] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_ceil_to_mul(arr, 1440)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[m]"
 *         # my_unit [h] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, 0x5A0, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5476, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5477
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_ceil_to_mul(arr, 1440)
 *             to_dtype = "datetime64[m]"             # <<<<<<<<<<<<<<
 *         # my_unit [h] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_m);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_m;

      /* "utils.pxd":5475
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, 1440)
 *             to_dtype = "datetime64[m]"
 */
      break;
      case NPY_FR_h:

      /* "utils.pxd":5480
 *         # my_unit [h] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *             arr = arr_ceil_to_mul(arr, 24)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[h]"
 *         # my_unit [D] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_ceil_to_mul(__pyx_v_arr, 24, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5480, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5481
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *             arr = arr_ceil_to_mul(arr, 24)
 *             to_dtype = "datetime64[h]"             # <<<<<<<<<<<<<<
 *         # my_unit [D] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_h);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_h;

      /* "utils.pxd":5479
 *             to_dtype = "datetime64[m]"
 *         # my_unit [h] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:             # <<<<<<<<<<<<<<
 *             arr = arr_ceil_to_mul(arr, 24)
 *             to_dtype = "datetime64[h]"
 */
      break;
      default:

      /* "utils.pxd":5485
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("ceil", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # Invalid unit
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_ceil, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5485, __pyx_L1_error)
      break;
    }

    /* "utils.pxd":5453
 * 
 *     # To day
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    default:

    /* "utils.pxd":5489
 *     # Invalid unit
 *     else:
 *         _raise_dt64arr_rcl_unsupport_unit_error("ceil", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # Convert to datetime64
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_ceil, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5489, __pyx_L1_error)
    break;
  }

  /* "utils.pxd":5492
 * 
 *     # Convert to datetime64
 *     return arr.astype(to_dtype)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_floor(np.ndarray arr, str unit, str arr_unit=None):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 5492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(!__pyx_v_to_dtype)) { __Pyx_RaiseUnboundLocalError("to_dtype"); __PYX_ERR(5, 5492, __pyx_L1_error) }
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(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_8 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_to_dtype};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 5492, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "utils.pxd":5305
 *     return arr.astype(to_dtype)
 * 
 * cdef inline np.ndarray dt64arr_ceil(np.ndarray arr, str unit, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Perform ceil operation on the np.ndarray[datetime64] to the
 *     specified unit `<'ndarray[datetime64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_to_dtype);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":5494
 *     return arr.astype(to_dtype)
 * 
 * cdef inline np.ndarray dt64arr_floor(np.ndarray arr, str unit, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Perform floor operation on the np.ndarray[datetime64] to the
 *     specified unit `<'ndarray[datetime64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_floor(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_unit, struct __pyx_opt_args_7cytimes_5utils_dt64arr_floor *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  int __pyx_v_my_unit;
  int __pyx_v_to_unit;
  int __pyx_v_dtype;
  PyObject *__pyx_v_to_dtype = NULL;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_arr_floor_to_mul __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_floor", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":5502
 *     """
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":5503
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "utils.pxd":5502
 *     """
 *     # Validate array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "utils.pxd":5507
 *     # Get time unit
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "utils.pxd":5508
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_DATETIME);
  if (__pyx_t_1) {

    /* "utils.pxd":5509
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "utils.pxd":5510
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_n_u_int64); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5510, __pyx_L1_error)

      /* "utils.pxd":5509
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "utils.pxd":5511
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 5511, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;

    /* "utils.pxd":5508
 *     cdef int my_unit, to_unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":5512
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "utils.pxd":5513
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:
 *         my_unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 5513, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;

    /* "utils.pxd":5512
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64")
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":5515
 *         my_unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     to_unit = map_nptime_unit_str2int(unit)
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 5515, __pyx_L1_error)
    __pyx_v_my_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "utils.pxd":5516
 *     else:
 *         my_unit = get_arr_nptime_unit(arr)
 *     to_unit = map_nptime_unit_str2int(unit)             # <<<<<<<<<<<<<<
 * 
 *     # Fast-path
 */
  __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 5516, __pyx_L1_error)
  __pyx_v_to_unit = __pyx_t_2;

  /* "utils.pxd":5521
 *     #: 1. same or my_unit is lower than to_unit (ms is lower than us)
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr
 */
  __pyx_t_3 = (__pyx_v_my_unit <= __pyx_v_to_unit);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_to_unit == NPY_FR_ns);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_1) {

    /* "utils.pxd":5522
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *             return arr
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))
 */
    __pyx_t_1 = (__pyx_v_dtype == NPY_DATETIME);
    if (__pyx_t_1) {

      /* "utils.pxd":5523
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr             # <<<<<<<<<<<<<<
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))
 * 
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "utils.pxd":5522
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:             # <<<<<<<<<<<<<<
 *             return arr
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))
 */
    }

    /* "utils.pxd":5524
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr
 *         return arr.astype("datetime64[%s]" % map_nptime_unit_int2str(my_unit))             # <<<<<<<<<<<<<<
 * 
 *     # To microsecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 5524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_my_unit); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 5524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 5524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 5524, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5521
 *     #: 1. same or my_unit is lower than to_unit (ms is lower than us)
 *     #: 2. to nanosecond (ns is the highest supported unit)
 *     if my_unit <= to_unit or to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         if dtype == np.NPY_TYPES.NPY_DATETIME:
 *             return arr
 */
  }

  /* "utils.pxd":5527
 * 
 *     # To microsecond
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
  switch (__pyx_v_to_unit) {
    case NPY_FR_us:

    /* "utils.pxd":5529
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MICROSECOND)
 */
    __pyx_t_1 = (__pyx_v_my_unit == NPY_FR_ns);
    if (__pyx_t_1) {

      /* "utils.pxd":5530
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5530, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "utils.pxd":5531
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MICROSECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5531, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5532
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_floor_div(arr, NS_MICROSECOND)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "utils.pxd":5530
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L11;
      }

      /* "utils.pxd":5534
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_floor_div(arr, NS_MICROSECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [D...us] are lower units, which is covered
 */
      /*else*/ {
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5534, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5535
 *             else:
 *                 arr = arr_floor_div(arr, NS_MICROSECOND)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...us] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L11:;

      /* "utils.pxd":5529
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MICROSECOND)
 */
      goto __pyx_L10;
    }

    /* "utils.pxd":5539
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("floor", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To millisecond
 */
    /*else*/ {
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_floor, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5539, __pyx_L1_error)
    }
    __pyx_L10:;

    /* "utils.pxd":5527
 * 
 *     # To microsecond
 *     if to_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [us]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_ms:

    /* "utils.pxd":5544
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MILLISECOND)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":5545
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_MILLISECOND)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5545, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "utils.pxd":5546
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MILLISECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MILLISECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5546, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5547
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MILLISECOND)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_MILLISECOND, US_MILLISECOND)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "utils.pxd":5545
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_MILLISECOND)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L12;
      }

      /* "utils.pxd":5549
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_MILLISECOND, US_MILLISECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [ms]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_MILLISECOND;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MILLISECOND, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5549, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5550
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_MILLISECOND, US_MILLISECOND)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [ms]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L12:;

      /* "utils.pxd":5544
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MILLISECOND)
 */
      break;
      case NPY_FR_us:

      /* "utils.pxd":5553
 *         # my_unit [us] -> to_unit [ms]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_floor_to_mul(arr, US_MILLISECOND)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [D...ms] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MILLISECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5553, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5554
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_floor_to_mul(arr, US_MILLISECOND)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...ms] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "utils.pxd":5552
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [ms]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, US_MILLISECOND)
 *             to_dtype = "datetime64[us]"
 */
      break;
      default:

      /* "utils.pxd":5558
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("floor", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To second
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_floor, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5558, __pyx_L1_error)
      break;
    }

    /* "utils.pxd":5542
 * 
 *     # To millisecond
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [ms]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_s:

    /* "utils.pxd":5563
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_SECOND)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":5564
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_SECOND)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5564, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "utils.pxd":5565
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_SECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_SECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5565, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5566
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_SECOND)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_SECOND, US_SECOND)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "utils.pxd":5564
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_SECOND)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L13;
      }

      /* "utils.pxd":5568
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_SECOND, US_SECOND)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [s]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_SECOND;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_SECOND, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5568, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5569
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_SECOND, US_SECOND)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L13:;

      /* "utils.pxd":5563
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_SECOND)
 */
      break;
      case NPY_FR_us:

      /* "utils.pxd":5572
 *         # my_unit [us] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_floor_to_mul(arr, US_SECOND)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [s]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_SECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5572, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5573
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_floor_to_mul(arr, US_SECOND)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "utils.pxd":5571
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, US_SECOND)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "utils.pxd":5576
 *         # my_unit [ms] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_floor_to_mul(arr, MS_SECOND)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [D...s] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_SECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5577
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_floor_to_mul(arr, MS_SECOND)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...s] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "utils.pxd":5575
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [s]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, MS_SECOND)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      default:

      /* "utils.pxd":5581
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("floor", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To minute
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_floor, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5581, __pyx_L1_error)
      break;
    }

    /* "utils.pxd":5561
 * 
 *     # To second
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [s]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_m:

    /* "utils.pxd":5586
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MINUTE)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":5587
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_MINUTE)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5587, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "utils.pxd":5588
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MINUTE)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5588, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5589
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MINUTE)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_MINUTE, US_MINUTE)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "utils.pxd":5587
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_MINUTE)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L14;
      }

      /* "utils.pxd":5591
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_MINUTE, US_MINUTE)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [m]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_MINUTE;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MINUTE, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5591, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5592
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_MINUTE, US_MINUTE)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L14:;

      /* "utils.pxd":5586
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_MINUTE)
 */
      break;
      case NPY_FR_us:

      /* "utils.pxd":5595
 *         # my_unit [us] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_floor_to_mul(arr, US_MINUTE)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [m]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5595, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5596
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_floor_to_mul(arr, US_MINUTE)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "utils.pxd":5594
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, US_MINUTE)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "utils.pxd":5599
 *         # my_unit [ms] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_floor_to_mul(arr, MS_MINUTE)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [m]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5599, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5600
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_floor_to_mul(arr, MS_MINUTE)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [s] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "utils.pxd":5598
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, MS_MINUTE)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      case NPY_FR_s:

      /* "utils.pxd":5603
 *         # my_unit [s] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_floor_to_mul(arr, SS_MINUTE)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[s]"
 *         # my_unit [D...m] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_MINUTE, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5603, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5604
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_floor_to_mul(arr, SS_MINUTE)
 *             to_dtype = "datetime64[s]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...m] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_s_2);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_s_2;

      /* "utils.pxd":5602
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [m]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, SS_MINUTE)
 *             to_dtype = "datetime64[s]"
 */
      break;
      default:

      /* "utils.pxd":5608
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("floor", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To hour
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_floor, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5608, __pyx_L1_error)
      break;
    }

    /* "utils.pxd":5584
 * 
 *     # To minute
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [m]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_h:

    /* "utils.pxd":5613
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_HOUR)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":5614
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_HOUR)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5614, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "utils.pxd":5615
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_HOUR)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5615, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5616
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_HOUR)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_HOUR, US_HOUR)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "utils.pxd":5614
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_HOUR)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L15;
      }

      /* "utils.pxd":5618
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_HOUR, US_HOUR)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [h]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_HOUR;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_HOUR, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5618, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5619
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_HOUR, US_HOUR)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L15:;

      /* "utils.pxd":5613
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_HOUR)
 */
      break;
      case NPY_FR_us:

      /* "utils.pxd":5622
 *         # my_unit [us] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_floor_to_mul(arr, US_HOUR)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [h]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5622, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5623
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_floor_to_mul(arr, US_HOUR)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "utils.pxd":5621
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, US_HOUR)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "utils.pxd":5626
 *         # my_unit [ms] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_floor_to_mul(arr, MS_HOUR)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [h]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5626, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5627
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_floor_to_mul(arr, MS_HOUR)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [s] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "utils.pxd":5625
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, MS_HOUR)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      case NPY_FR_s:

      /* "utils.pxd":5630
 *         # my_unit [s] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_floor_to_mul(arr, SS_HOUR)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [h]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_HOUR, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5630, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5631
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_floor_to_mul(arr, SS_HOUR)
 *             to_dtype = "datetime64[s]"             # <<<<<<<<<<<<<<
 *         # my_unit [m] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_s_2);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_s_2;

      /* "utils.pxd":5629
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, SS_HOUR)
 *             to_dtype = "datetime64[s]"
 */
      break;
      case NPY_FR_m:

      /* "utils.pxd":5634
 *         # my_unit [m] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_floor_to_mul(arr, 60)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[m]"
 *         # my_unit [D...h] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, 60, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5634, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5635
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_floor_to_mul(arr, 60)
 *             to_dtype = "datetime64[m]"             # <<<<<<<<<<<<<<
 *         # my_unit [D...h] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_m);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_m;

      /* "utils.pxd":5633
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [h]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, 60)
 *             to_dtype = "datetime64[m]"
 */
      break;
      default:

      /* "utils.pxd":5639
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("floor", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # To day
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_floor, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5639, __pyx_L1_error)
      break;
    }

    /* "utils.pxd":5611
 * 
 *     # To hour
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [h]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    case NPY_FR_D:

    /* "utils.pxd":5644
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_DAY)
 */
    switch (__pyx_v_my_unit) {
      case NPY_FR_ns:

      /* "utils.pxd":5645
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_DAY)
 *                 to_dtype = "datetime64[ns]"
 */
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5645, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "utils.pxd":5646
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_DAY)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[ns]"
 *             else:
 */
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5646, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5647
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_DAY)
 *                 to_dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_DAY, US_DAY)
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_ns;

        /* "utils.pxd":5645
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 *             if is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = arr_floor_to_mul(arr, NS_DAY)
 *                 to_dtype = "datetime64[ns]"
 */
        goto __pyx_L16;
      }

      /* "utils.pxd":5649
 *                 to_dtype = "datetime64[ns]"
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_DAY, US_DAY)             # <<<<<<<<<<<<<<
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [D]
 */
      /*else*/ {
        __pyx_t_10.__pyx_n = 1;
        __pyx_t_10.multiple = __pyx_v_7cytimes_5utils_US_DAY;
        __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_DAY, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5649, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "utils.pxd":5650
 *             else:
 *                 arr = arr_floor_to_mul(arr, NS_DAY, US_DAY)
 *                 to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [us] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L16:;

      /* "utils.pxd":5644
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *             if is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = arr_floor_to_mul(arr, NS_DAY)
 */
      break;
      case NPY_FR_us:

      /* "utils.pxd":5653
 *         # my_unit [us] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_floor_to_mul(arr, US_DAY)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5653, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5654
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 *             arr = arr_floor_to_mul(arr, US_DAY)
 *             to_dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         # my_unit [ms] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_us;

      /* "utils.pxd":5652
 *                 to_dtype = "datetime64[us]"
 *         # my_unit [us] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_us:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, US_DAY)
 *             to_dtype = "datetime64[us]"
 */
      break;
      case NPY_FR_ms:

      /* "utils.pxd":5657
 *         # my_unit [ms] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_floor_to_mul(arr, MS_DAY)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_MS_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5657, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5658
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:
 *             arr = arr_floor_to_mul(arr, MS_DAY)
 *             to_dtype = "datetime64[ms]"             # <<<<<<<<<<<<<<
 *         # my_unit [s] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ms);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_ms;

      /* "utils.pxd":5656
 *             to_dtype = "datetime64[us]"
 *         # my_unit [ms] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, MS_DAY)
 *             to_dtype = "datetime64[ms]"
 */
      break;
      case NPY_FR_s:

      /* "utils.pxd":5661
 *         # my_unit [s] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_floor_to_mul(arr, SS_DAY)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_SS_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5661, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5662
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:
 *             arr = arr_floor_to_mul(arr, SS_DAY)
 *             to_dtype = "datetime64[s]"             # <<<<<<<<<<<<<<
 *         # my_unit [m] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_s_2);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_s_2;

      /* "utils.pxd":5660
 *             to_dtype = "datetime64[ms]"
 *         # my_unit [s] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_s:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, SS_DAY)
 *             to_dtype = "datetime64[s]"
 */
      break;
      case NPY_FR_m:

      /* "utils.pxd":5665
 *         # my_unit [m] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_floor_to_mul(arr, 1440)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[m]"
 *         # my_unit [h] -> to_unit [D]
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, 0x5A0, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5665, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5666
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:
 *             arr = arr_floor_to_mul(arr, 1440)
 *             to_dtype = "datetime64[m]"             # <<<<<<<<<<<<<<
 *         # my_unit [h] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_m);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_m;

      /* "utils.pxd":5664
 *             to_dtype = "datetime64[s]"
 *         # my_unit [m] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_m:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, 1440)
 *             to_dtype = "datetime64[m]"
 */
      break;
      case NPY_FR_h:

      /* "utils.pxd":5669
 *         # my_unit [h] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *             arr = arr_floor_to_mul(arr, 24)             # <<<<<<<<<<<<<<
 *             to_dtype = "datetime64[h]"
 *         # my_unit [D] are lower units, which is covered
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, 24, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5669, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "utils.pxd":5670
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *             arr = arr_floor_to_mul(arr, 24)
 *             to_dtype = "datetime64[h]"             # <<<<<<<<<<<<<<
 *         # my_unit [D] are lower units, which is covered
 *         # by fast-path. Other units are not supported.
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_h);
      __pyx_v_to_dtype = __pyx_kp_u_datetime64_h;

      /* "utils.pxd":5668
 *             to_dtype = "datetime64[m]"
 *         # my_unit [h] -> to_unit [D]
 *         elif my_unit == np.NPY_DATETIMEUNIT.NPY_FR_h:             # <<<<<<<<<<<<<<
 *             arr = arr_floor_to_mul(arr, 24)
 *             to_dtype = "datetime64[h]"
 */
      break;
      default:

      /* "utils.pxd":5674
 *         # by fast-path. Other units are not supported.
 *         else:
 *             _raise_dt64arr_rcl_unsupport_unit_error("floor", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # Invalid unit
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_floor, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5674, __pyx_L1_error)
      break;
    }

    /* "utils.pxd":5642
 * 
 *     # To day
 *     elif to_unit == np.NPY_DATETIMEUNIT.NPY_FR_D:             # <<<<<<<<<<<<<<
 *         # my_unit [ns] -> to_unit [D]
 *         if my_unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:
 */
    break;
    default:

    /* "utils.pxd":5678
 *     # Invalid unit
 *     else:
 *         _raise_dt64arr_rcl_unsupport_unit_error("floor", to_unit, my_unit)             # <<<<<<<<<<<<<<
 * 
 *     # Convert to datetime64
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(__pyx_n_u_floor, __pyx_v_to_unit, __pyx_v_my_unit); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5678, __pyx_L1_error)
    break;
  }

  /* "utils.pxd":5681
 * 
 *     # Convert to datetime64
 *     return arr.astype(to_dtype)             # <<<<<<<<<<<<<<
 * 
 * # . comparison
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 5681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(!__pyx_v_to_dtype)) { __Pyx_RaiseUnboundLocalError("to_dtype"); __PYX_ERR(5, 5681, __pyx_L1_error) }
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(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_8 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_to_dtype};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 5681, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "utils.pxd":5494
 *     return arr.astype(to_dtype)
 * 
 * cdef inline np.ndarray dt64arr_floor(np.ndarray arr, str unit, str arr_unit=None):             # <<<<<<<<<<<<<<
 *     """Perform floor operation on the np.ndarray[datetime64] to the
 *     specified unit `<'ndarray[datetime64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_to_dtype);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":5684
 * 
 * # . comparison
 * cdef inline np.ndarray dt64arr_find_closest(np.ndarray arr1, np.ndarray arr2):             # <<<<<<<<<<<<<<
 *     """For each element in 'arr1', find the closest values in 'arr2' `<'ndarray[int64]'>`."""
 *     # Validate
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_find_closest(PyArrayObject *__pyx_v_arr1, PyArrayObject *__pyx_v_arr2) {
  npy_int64 __pyx_v_arr1_size;
  npy_int64 __pyx_v_arr2_size;
  PyArrayObject *__pyx_v_arrS = 0;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr1_ptr;
  npy_int64 *__pyx_v_arrS_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_targ;
  npy_int64 __pyx_v_left;
  npy_int64 __pyx_v_right;
  npy_int64 __pyx_v_mid;
  npy_int64 __pyx_v_cur_num;
  npy_int64 __pyx_v_cls_num;
  npy_int64 __pyx_v_min_diff;
  npy_int64 __pyx_v_cur_diff;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  npy_intp __pyx_t_5[1];
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  npy_int64 __pyx_t_8;
  npy_int64 __pyx_t_9;
  npy_int64 __pyx_t_10;
  npy_int64 __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_find_closest", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr1);
  __Pyx_INCREF((PyObject *)__pyx_v_arr2);

  /* "utils.pxd":5687
 *     """For each element in 'arr1', find the closest values in 'arr2' `<'ndarray[int64]'>`."""
 *     # Validate
 *     cdef np.npy_int64 arr1_size = arr1.shape[0]             # <<<<<<<<<<<<<<
 *     cdef np.npy_int64 arr2_size = arr2.shape[0]
 *     if arr1_size <= 0 or arr2_size <= 0:
 */
  __pyx_v_arr1_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr1)[0]);

  /* "utils.pxd":5688
 *     # Validate
 *     cdef np.npy_int64 arr1_size = arr1.shape[0]
 *     cdef np.npy_int64 arr2_size = arr2.shape[0]             # <<<<<<<<<<<<<<
 *     if arr1_size <= 0 or arr2_size <= 0:
 *         raise ValueError("For comparision, array size must be > 0.")
 */
  __pyx_v_arr2_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr2)[0]);

  /* "utils.pxd":5689
 *     cdef np.npy_int64 arr1_size = arr1.shape[0]
 *     cdef np.npy_int64 arr2_size = arr2.shape[0]
 *     if arr1_size <= 0 or arr2_size <= 0:             # <<<<<<<<<<<<<<
 *         raise ValueError("For comparision, array size must be > 0.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  __pyx_t_2 = (__pyx_v_arr1_size <= 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_arr2_size <= 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":5690
 *     cdef np.npy_int64 arr2_size = arr2.shape[0]
 *     if arr1_size <= 0 or arr2_size <= 0:
 *         raise ValueError("For comparision, array size must be > 0.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5690, __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(5, 5690, __pyx_L1_error)

    /* "utils.pxd":5689
 *     cdef np.npy_int64 arr1_size = arr1.shape[0]
 *     cdef np.npy_int64 arr2_size = arr2.shape[0]
 *     if arr1_size <= 0 or arr2_size <= 0:             # <<<<<<<<<<<<<<
 *         raise ValueError("For comparision, array size must be > 0.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  }

  /* "utils.pxd":5691
 *     if arr1_size <= 0 or arr2_size <= 0:
 *         raise ValueError("For comparision, array size must be > 0.")
 *     arr1 = arr_assure_int64_like(arr1)             # <<<<<<<<<<<<<<
 *     arr2 = arr_assure_int64_like(arr2)
 * 
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr1, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "utils.pxd":5692
 *         raise ValueError("For comparision, array size must be > 0.")
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)             # <<<<<<<<<<<<<<
 * 
 *     # Sort arr2
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr2, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "utils.pxd":5695
 * 
 *     # Sort arr2
 *     cdef np.ndarray arrS = np.PyArray_Copy(arr2)             # <<<<<<<<<<<<<<
 *     np.PyArray_Sort(arrS, 0, np.NPY_SORTKIND.NPY_QUICKSORT)
 * 
 */
  __pyx_t_3 = PyArray_Copy(__pyx_v_arr2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 5695, __pyx_L1_error)
  __pyx_v_arrS = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "utils.pxd":5696
 *     # Sort arr2
 *     cdef np.ndarray arrS = np.PyArray_Copy(arr2)
 *     np.PyArray_Sort(arrS, 0, np.NPY_SORTKIND.NPY_QUICKSORT)             # <<<<<<<<<<<<<<
 * 
 *     # Prepare result and pointers
 */
  __pyx_t_4 = PyArray_Sort(__pyx_v_arrS, 0, NPY_QUICKSORT); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 5696, __pyx_L1_error)

  /* "utils.pxd":5700
 *     # Prepare result and pointers
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [arr1_size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 */
  __pyx_t_5[0] = __pyx_v_arr1_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_5, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 5700, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "utils.pxd":5701
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [arr1_size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arrS_ptr = <np.npy_int64*> np.PyArray_DATA(arrS)
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":5702
 *         np.ndarray res = np.PyArray_EMPTY(1, [arr1_size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arrS_ptr = <np.npy_int64*> np.PyArray_DATA(arrS)
 *         np.npy_int64 i, targ, left, right, mid
 */
  __pyx_v_arr1_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr1));

  /* "utils.pxd":5703
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arrS_ptr = <np.npy_int64*> np.PyArray_DATA(arrS)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, targ, left, right, mid
 *         np.npy_int64 cur_num, cls_num, min_diff, cur_diff
 */
  __pyx_v_arrS_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arrS));

  /* "utils.pxd":5708
 * 
 *     # Find closest for elements in 'arr1'
 *     for i in range(arr1_size):             # <<<<<<<<<<<<<<
 *         targ, left, right = arr1_ptr[i], 0, arr2_size - 1
 *         cls_num = arrS_ptr[left]
 */
  __pyx_t_6 = __pyx_v_arr1_size;
  __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;

    /* "utils.pxd":5709
 *     # Find closest for elements in 'arr1'
 *     for i in range(arr1_size):
 *         targ, left, right = arr1_ptr[i], 0, arr2_size - 1             # <<<<<<<<<<<<<<
 *         cls_num = arrS_ptr[left]
 *         min_diff = targ - cls_num if cls_num < targ else cls_num - targ
 */
    __pyx_t_9 = (__pyx_v_arr1_ptr[__pyx_v_i]);
    __pyx_t_10 = 0;
    __pyx_t_11 = (__pyx_v_arr2_size - 1);
    __pyx_v_targ = __pyx_t_9;
    __pyx_v_left = __pyx_t_10;
    __pyx_v_right = __pyx_t_11;

    /* "utils.pxd":5710
 *     for i in range(arr1_size):
 *         targ, left, right = arr1_ptr[i], 0, arr2_size - 1
 *         cls_num = arrS_ptr[left]             # <<<<<<<<<<<<<<
 *         min_diff = targ - cls_num if cls_num < targ else cls_num - targ
 *         # Binary search
 */
    __pyx_v_cls_num = (__pyx_v_arrS_ptr[__pyx_v_left]);

    /* "utils.pxd":5711
 *         targ, left, right = arr1_ptr[i], 0, arr2_size - 1
 *         cls_num = arrS_ptr[left]
 *         min_diff = targ - cls_num if cls_num < targ else cls_num - targ             # <<<<<<<<<<<<<<
 *         # Binary search
 *         while left <= right:
 */
    __pyx_t_1 = (__pyx_v_cls_num < __pyx_v_targ);
    if (__pyx_t_1) {
      __pyx_t_11 = (__pyx_v_targ - __pyx_v_cls_num);
    } else {
      __pyx_t_11 = (__pyx_v_cls_num - __pyx_v_targ);
    }
    __pyx_v_min_diff = __pyx_t_11;

    /* "utils.pxd":5713
 *         min_diff = targ - cls_num if cls_num < targ else cls_num - targ
 *         # Binary search
 *         while left <= right:             # <<<<<<<<<<<<<<
 *             mid = (left + right) // 2
 *             cur_num = arrS_ptr[mid]
 */
    while (1) {
      __pyx_t_1 = (__pyx_v_left <= __pyx_v_right);
      if (!__pyx_t_1) break;

      /* "utils.pxd":5714
 *         # Binary search
 *         while left <= right:
 *             mid = (left + right) // 2             # <<<<<<<<<<<<<<
 *             cur_num = arrS_ptr[mid]
 *             cur_diff = targ - cur_num if cur_num < targ else cur_num - targ
 */
      __pyx_v_mid = __Pyx_div_npy_int64((__pyx_v_left + __pyx_v_right), 2);

      /* "utils.pxd":5715
 *         while left <= right:
 *             mid = (left + right) // 2
 *             cur_num = arrS_ptr[mid]             # <<<<<<<<<<<<<<
 *             cur_diff = targ - cur_num if cur_num < targ else cur_num - targ
 * 
 */
      __pyx_v_cur_num = (__pyx_v_arrS_ptr[__pyx_v_mid]);

      /* "utils.pxd":5716
 *             mid = (left + right) // 2
 *             cur_num = arrS_ptr[mid]
 *             cur_diff = targ - cur_num if cur_num < targ else cur_num - targ             # <<<<<<<<<<<<<<
 * 
 *             # Update closest number
 */
      __pyx_t_1 = (__pyx_v_cur_num < __pyx_v_targ);
      if (__pyx_t_1) {
        __pyx_t_11 = (__pyx_v_targ - __pyx_v_cur_num);
      } else {
        __pyx_t_11 = (__pyx_v_cur_num - __pyx_v_targ);
      }
      __pyx_v_cur_diff = __pyx_t_11;

      /* "utils.pxd":5719
 * 
 *             # Update closest number
 *             if cur_diff < min_diff:             # <<<<<<<<<<<<<<
 *                 cls_num, min_diff = cur_num, cur_diff
 *             elif cur_diff == min_diff:
 */
      __pyx_t_1 = (__pyx_v_cur_diff < __pyx_v_min_diff);
      if (__pyx_t_1) {

        /* "utils.pxd":5720
 *             # Update closest number
 *             if cur_diff < min_diff:
 *                 cls_num, min_diff = cur_num, cur_diff             # <<<<<<<<<<<<<<
 *             elif cur_diff == min_diff:
 *                 # Choose the smaller number in case of a tie
 */
        __pyx_t_11 = __pyx_v_cur_num;
        __pyx_t_10 = __pyx_v_cur_diff;
        __pyx_v_cls_num = __pyx_t_11;
        __pyx_v_min_diff = __pyx_t_10;

        /* "utils.pxd":5719
 * 
 *             # Update closest number
 *             if cur_diff < min_diff:             # <<<<<<<<<<<<<<
 *                 cls_num, min_diff = cur_num, cur_diff
 *             elif cur_diff == min_diff:
 */
        goto __pyx_L10;
      }

      /* "utils.pxd":5721
 *             if cur_diff < min_diff:
 *                 cls_num, min_diff = cur_num, cur_diff
 *             elif cur_diff == min_diff:             # <<<<<<<<<<<<<<
 *                 # Choose the smaller number in case of a tie
 *                 if cur_num < cls_num:
 */
      __pyx_t_1 = (__pyx_v_cur_diff == __pyx_v_min_diff);
      if (__pyx_t_1) {

        /* "utils.pxd":5723
 *             elif cur_diff == min_diff:
 *                 # Choose the smaller number in case of a tie
 *                 if cur_num < cls_num:             # <<<<<<<<<<<<<<
 *                     cls_num = cur_num
 * 
 */
        __pyx_t_1 = (__pyx_v_cur_num < __pyx_v_cls_num);
        if (__pyx_t_1) {

          /* "utils.pxd":5724
 *                 # Choose the smaller number in case of a tie
 *                 if cur_num < cls_num:
 *                     cls_num = cur_num             # <<<<<<<<<<<<<<
 * 
 *             if cur_num < targ:
 */
          __pyx_v_cls_num = __pyx_v_cur_num;

          /* "utils.pxd":5723
 *             elif cur_diff == min_diff:
 *                 # Choose the smaller number in case of a tie
 *                 if cur_num < cls_num:             # <<<<<<<<<<<<<<
 *                     cls_num = cur_num
 * 
 */
        }

        /* "utils.pxd":5721
 *             if cur_diff < min_diff:
 *                 cls_num, min_diff = cur_num, cur_diff
 *             elif cur_diff == min_diff:             # <<<<<<<<<<<<<<
 *                 # Choose the smaller number in case of a tie
 *                 if cur_num < cls_num:
 */
      }
      __pyx_L10:;

      /* "utils.pxd":5726
 *                     cls_num = cur_num
 * 
 *             if cur_num < targ:             # <<<<<<<<<<<<<<
 *                 left = mid + 1
 *             elif cur_num > targ:
 */
      __pyx_t_1 = (__pyx_v_cur_num < __pyx_v_targ);
      if (__pyx_t_1) {

        /* "utils.pxd":5727
 * 
 *             if cur_num < targ:
 *                 left = mid + 1             # <<<<<<<<<<<<<<
 *             elif cur_num > targ:
 *                 right = mid - 1
 */
        __pyx_v_left = (__pyx_v_mid + 1);

        /* "utils.pxd":5726
 *                     cls_num = cur_num
 * 
 *             if cur_num < targ:             # <<<<<<<<<<<<<<
 *                 left = mid + 1
 *             elif cur_num > targ:
 */
        goto __pyx_L12;
      }

      /* "utils.pxd":5728
 *             if cur_num < targ:
 *                 left = mid + 1
 *             elif cur_num > targ:             # <<<<<<<<<<<<<<
 *                 right = mid - 1
 *             else:
 */
      __pyx_t_1 = (__pyx_v_cur_num > __pyx_v_targ);
      if (__pyx_t_1) {

        /* "utils.pxd":5729
 *                 left = mid + 1
 *             elif cur_num > targ:
 *                 right = mid - 1             # <<<<<<<<<<<<<<
 *             else:
 *                 # Exact match found
 */
        __pyx_v_right = (__pyx_v_mid - 1);

        /* "utils.pxd":5728
 *             if cur_num < targ:
 *                 left = mid + 1
 *             elif cur_num > targ:             # <<<<<<<<<<<<<<
 *                 right = mid - 1
 *             else:
 */
        goto __pyx_L12;
      }

      /* "utils.pxd":5732
 *             else:
 *                 # Exact match found
 *                 cls_num = cur_num             # <<<<<<<<<<<<<<
 *                 break  # exit loop
 * 
 */
      /*else*/ {
        __pyx_v_cls_num = __pyx_v_cur_num;

        /* "utils.pxd":5733
 *                 # Exact match found
 *                 cls_num = cur_num
 *                 break  # exit loop             # <<<<<<<<<<<<<<
 * 
 *         res_ptr[i] = cls_num
 */
        goto __pyx_L9_break;
      }
      __pyx_L12:;
    }
    __pyx_L9_break:;

    /* "utils.pxd":5735
 *                 break  # exit loop
 * 
 *         res_ptr[i] = cls_num             # <<<<<<<<<<<<<<
 * 
 *     # Return result
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_v_cls_num;
  }

  /* "utils.pxd":5738
 * 
 *     # Return result
 *     return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray dt64arr_find_farthest(np.ndarray arr1, np.ndarray arr2):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":5684
 * 
 * # . comparison
 * cdef inline np.ndarray dt64arr_find_closest(np.ndarray arr1, np.ndarray arr2):             # <<<<<<<<<<<<<<
 *     """For each element in 'arr1', find the closest values in 'arr2' `<'ndarray[int64]'>`."""
 *     # Validate
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_find_closest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arrS);
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr1);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr2);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":5740
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_find_farthest(np.ndarray arr1, np.ndarray arr2):             # <<<<<<<<<<<<<<
 *     """For each element in 'arr1', find the farthest values in 'arr2' `<'ndarray[int64]'>`."""
 *     # Validate
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_dt64arr_find_farthest(PyArrayObject *__pyx_v_arr1, PyArrayObject *__pyx_v_arr2) {
  npy_int64 __pyx_v_arr1_size;
  npy_int64 __pyx_v_arr2_size;
  PyArrayObject *__pyx_v_res = 0;
  npy_int64 *__pyx_v_res_ptr;
  npy_int64 *__pyx_v_arr1_ptr;
  npy_int64 *__pyx_v_arr2_ptr;
  npy_int64 __pyx_v_i;
  npy_int64 __pyx_v_num;
  npy_int64 __pyx_v_min_num;
  npy_int64 __pyx_v_max_num;
  npy_int64 __pyx_v_tie_num;
  npy_int64 __pyx_v_targ;
  npy_int64 __pyx_v_far_num;
  npy_int64 __pyx_v_diff_min;
  npy_int64 __pyx_v_diff_max;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  npy_intp __pyx_t_4[1];
  npy_int64 __pyx_t_5;
  npy_int64 __pyx_t_6;
  npy_int64 __pyx_t_7;
  npy_int64 __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64arr_find_farthest", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr1);
  __Pyx_INCREF((PyObject *)__pyx_v_arr2);

  /* "utils.pxd":5743
 *     """For each element in 'arr1', find the farthest values in 'arr2' `<'ndarray[int64]'>`."""
 *     # Validate
 *     cdef np.npy_int64 arr1_size = arr1.shape[0]             # <<<<<<<<<<<<<<
 *     cdef np.npy_int64 arr2_size = arr2.shape[0]
 *     if arr1_size <= 0 or arr2_size <= 0:
 */
  __pyx_v_arr1_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr1)[0]);

  /* "utils.pxd":5744
 *     # Validate
 *     cdef np.npy_int64 arr1_size = arr1.shape[0]
 *     cdef np.npy_int64 arr2_size = arr2.shape[0]             # <<<<<<<<<<<<<<
 *     if arr1_size <= 0 or arr2_size <= 0:
 *         raise ValueError("For comparision, array size must be > 0.")
 */
  __pyx_v_arr2_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr2)[0]);

  /* "utils.pxd":5745
 *     cdef np.npy_int64 arr1_size = arr1.shape[0]
 *     cdef np.npy_int64 arr2_size = arr2.shape[0]
 *     if arr1_size <= 0 or arr2_size <= 0:             # <<<<<<<<<<<<<<
 *         raise ValueError("For comparision, array size must be > 0.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  __pyx_t_2 = (__pyx_v_arr1_size <= 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_arr2_size <= 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "utils.pxd":5746
 *     cdef np.npy_int64 arr2_size = arr2.shape[0]
 *     if arr1_size <= 0 or arr2_size <= 0:
 *         raise ValueError("For comparision, array size must be > 0.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5746, __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(5, 5746, __pyx_L1_error)

    /* "utils.pxd":5745
 *     cdef np.npy_int64 arr1_size = arr1.shape[0]
 *     cdef np.npy_int64 arr2_size = arr2.shape[0]
 *     if arr1_size <= 0 or arr2_size <= 0:             # <<<<<<<<<<<<<<
 *         raise ValueError("For comparision, array size must be > 0.")
 *     arr1 = arr_assure_int64_like(arr1)
 */
  }

  /* "utils.pxd":5747
 *     if arr1_size <= 0 or arr2_size <= 0:
 *         raise ValueError("For comparision, array size must be > 0.")
 *     arr1 = arr_assure_int64_like(arr1)             # <<<<<<<<<<<<<<
 *     arr2 = arr_assure_int64_like(arr2)
 * 
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr1, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "utils.pxd":5748
 *         raise ValueError("For comparision, array size must be > 0.")
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)             # <<<<<<<<<<<<<<
 * 
 *     # Prepare result and pointers
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_arr2, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "utils.pxd":5752
 *     # Prepare result and pointers
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [arr1_size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 */
  __pyx_t_4[0] = __pyx_v_arr1_size;
  __pyx_t_3 = PyArray_EMPTY(1, __pyx_t_4, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(5, 5752, __pyx_L1_error)
  __pyx_v_res = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "utils.pxd":5753
 *     cdef:
 *         np.ndarray res = np.PyArray_EMPTY(1, [arr1_size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 */
  __pyx_v_res_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_res));

  /* "utils.pxd":5754
 *         np.ndarray res = np.PyArray_EMPTY(1, [arr1_size], np.NPY_TYPES.NPY_INT64, 0)
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)             # <<<<<<<<<<<<<<
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)
 *         np.npy_int64 i, num, min_num, max_num, tie_num
 */
  __pyx_v_arr1_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr1));

  /* "utils.pxd":5755
 *         np.npy_int64* res_ptr = <np.npy_int64*> np.PyArray_DATA(res)
 *         np.npy_int64* arr1_ptr = <np.npy_int64*> np.PyArray_DATA(arr1)
 *         np.npy_int64* arr2_ptr = <np.npy_int64*> np.PyArray_DATA(arr2)             # <<<<<<<<<<<<<<
 *         np.npy_int64 i, num, min_num, max_num, tie_num
 *         np.npy_int64 targ, far_num, diff_min, diff_max
 */
  __pyx_v_arr2_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr2));

  /* "utils.pxd":5760
 * 
 *     # Find the min & max values in 'arr2'
 *     min_num = arr2_ptr[0]             # <<<<<<<<<<<<<<
 *     max_num = min_num
 *     for i in range(1, arr2_size):
 */
  __pyx_v_min_num = (__pyx_v_arr2_ptr[0]);

  /* "utils.pxd":5761
 *     # Find the min & max values in 'arr2'
 *     min_num = arr2_ptr[0]
 *     max_num = min_num             # <<<<<<<<<<<<<<
 *     for i in range(1, arr2_size):
 *         num = arr2_ptr[i]
 */
  __pyx_v_max_num = __pyx_v_min_num;

  /* "utils.pxd":5762
 *     min_num = arr2_ptr[0]
 *     max_num = min_num
 *     for i in range(1, arr2_size):             # <<<<<<<<<<<<<<
 *         num = arr2_ptr[i]
 *         if num < min_num:
 */
  __pyx_t_5 = __pyx_v_arr2_size;
  __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;

    /* "utils.pxd":5763
 *     max_num = min_num
 *     for i in range(1, arr2_size):
 *         num = arr2_ptr[i]             # <<<<<<<<<<<<<<
 *         if num < min_num:
 *             min_num = num
 */
    __pyx_v_num = (__pyx_v_arr2_ptr[__pyx_v_i]);

    /* "utils.pxd":5764
 *     for i in range(1, arr2_size):
 *         num = arr2_ptr[i]
 *         if num < min_num:             # <<<<<<<<<<<<<<
 *             min_num = num
 *         elif num > max_num:
 */
    __pyx_t_1 = (__pyx_v_num < __pyx_v_min_num);
    if (__pyx_t_1) {

      /* "utils.pxd":5765
 *         num = arr2_ptr[i]
 *         if num < min_num:
 *             min_num = num             # <<<<<<<<<<<<<<
 *         elif num > max_num:
 *             max_num = num
 */
      __pyx_v_min_num = __pyx_v_num;

      /* "utils.pxd":5764
 *     for i in range(1, arr2_size):
 *         num = arr2_ptr[i]
 *         if num < min_num:             # <<<<<<<<<<<<<<
 *             min_num = num
 *         elif num > max_num:
 */
      goto __pyx_L8;
    }

    /* "utils.pxd":5766
 *         if num < min_num:
 *             min_num = num
 *         elif num > max_num:             # <<<<<<<<<<<<<<
 *             max_num = num
 *     tie_num = min(min_num, max_num)
 */
    __pyx_t_1 = (__pyx_v_num > __pyx_v_max_num);
    if (__pyx_t_1) {

      /* "utils.pxd":5767
 *             min_num = num
 *         elif num > max_num:
 *             max_num = num             # <<<<<<<<<<<<<<
 *     tie_num = min(min_num, max_num)
 * 
 */
      __pyx_v_max_num = __pyx_v_num;

      /* "utils.pxd":5766
 *         if num < min_num:
 *             min_num = num
 *         elif num > max_num:             # <<<<<<<<<<<<<<
 *             max_num = num
 *     tie_num = min(min_num, max_num)
 */
    }
    __pyx_L8:;
  }

  /* "utils.pxd":5768
 *         elif num > max_num:
 *             max_num = num
 *     tie_num = min(min_num, max_num)             # <<<<<<<<<<<<<<
 * 
 *     # Find the furthest for elements in 'arr1'
 */
  __pyx_t_5 = __pyx_v_max_num;
  __pyx_t_6 = __pyx_v_min_num;
  __pyx_t_1 = (__pyx_t_5 < __pyx_t_6);
  if (__pyx_t_1) {
    __pyx_t_7 = __pyx_t_5;
  } else {
    __pyx_t_7 = __pyx_t_6;
  }
  __pyx_v_tie_num = __pyx_t_7;

  /* "utils.pxd":5771
 * 
 *     # Find the furthest for elements in 'arr1'
 *     for i in range(arr1_size):             # <<<<<<<<<<<<<<
 *         targ = arr1_ptr[i]
 *         diff_min = targ - min_num if min_num < targ else min_num - targ
 */
  __pyx_t_7 = __pyx_v_arr1_size;
  __pyx_t_5 = __pyx_t_7;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "utils.pxd":5772
 *     # Find the furthest for elements in 'arr1'
 *     for i in range(arr1_size):
 *         targ = arr1_ptr[i]             # <<<<<<<<<<<<<<
 *         diff_min = targ - min_num if min_num < targ else min_num - targ
 *         diff_max = targ - max_num if max_num < targ else max_num - targ
 */
    __pyx_v_targ = (__pyx_v_arr1_ptr[__pyx_v_i]);

    /* "utils.pxd":5773
 *     for i in range(arr1_size):
 *         targ = arr1_ptr[i]
 *         diff_min = targ - min_num if min_num < targ else min_num - targ             # <<<<<<<<<<<<<<
 *         diff_max = targ - max_num if max_num < targ else max_num - targ
 * 
 */
    __pyx_t_1 = (__pyx_v_min_num < __pyx_v_targ);
    if (__pyx_t_1) {
      __pyx_t_8 = (__pyx_v_targ - __pyx_v_min_num);
    } else {
      __pyx_t_8 = (__pyx_v_min_num - __pyx_v_targ);
    }
    __pyx_v_diff_min = __pyx_t_8;

    /* "utils.pxd":5774
 *         targ = arr1_ptr[i]
 *         diff_min = targ - min_num if min_num < targ else min_num - targ
 *         diff_max = targ - max_num if max_num < targ else max_num - targ             # <<<<<<<<<<<<<<
 * 
 *         if diff_min > diff_max:
 */
    __pyx_t_1 = (__pyx_v_max_num < __pyx_v_targ);
    if (__pyx_t_1) {
      __pyx_t_8 = (__pyx_v_targ - __pyx_v_max_num);
    } else {
      __pyx_t_8 = (__pyx_v_max_num - __pyx_v_targ);
    }
    __pyx_v_diff_max = __pyx_t_8;

    /* "utils.pxd":5776
 *         diff_max = targ - max_num if max_num < targ else max_num - targ
 * 
 *         if diff_min > diff_max:             # <<<<<<<<<<<<<<
 *             far_num = min_num
 *         elif diff_min < diff_max:
 */
    __pyx_t_1 = (__pyx_v_diff_min > __pyx_v_diff_max);
    if (__pyx_t_1) {

      /* "utils.pxd":5777
 * 
 *         if diff_min > diff_max:
 *             far_num = min_num             # <<<<<<<<<<<<<<
 *         elif diff_min < diff_max:
 *             far_num = max_num
 */
      __pyx_v_far_num = __pyx_v_min_num;

      /* "utils.pxd":5776
 *         diff_max = targ - max_num if max_num < targ else max_num - targ
 * 
 *         if diff_min > diff_max:             # <<<<<<<<<<<<<<
 *             far_num = min_num
 *         elif diff_min < diff_max:
 */
      goto __pyx_L11;
    }

    /* "utils.pxd":5778
 *         if diff_min > diff_max:
 *             far_num = min_num
 *         elif diff_min < diff_max:             # <<<<<<<<<<<<<<
 *             far_num = max_num
 *         else:
 */
    __pyx_t_1 = (__pyx_v_diff_min < __pyx_v_diff_max);
    if (__pyx_t_1) {

      /* "utils.pxd":5779
 *             far_num = min_num
 *         elif diff_min < diff_max:
 *             far_num = max_num             # <<<<<<<<<<<<<<
 *         else:
 *             far_num = tie_num
 */
      __pyx_v_far_num = __pyx_v_max_num;

      /* "utils.pxd":5778
 *         if diff_min > diff_max:
 *             far_num = min_num
 *         elif diff_min < diff_max:             # <<<<<<<<<<<<<<
 *             far_num = max_num
 *         else:
 */
      goto __pyx_L11;
    }

    /* "utils.pxd":5781
 *             far_num = max_num
 *         else:
 *             far_num = tie_num             # <<<<<<<<<<<<<<
 * 
 *         res_ptr[i] = far_num
 */
    /*else*/ {
      __pyx_v_far_num = __pyx_v_tie_num;
    }
    __pyx_L11:;

    /* "utils.pxd":5783
 *             far_num = tie_num
 * 
 *         res_ptr[i] = far_num             # <<<<<<<<<<<<<<
 * 
 *     # Return result
 */
    (__pyx_v_res_ptr[__pyx_v_i]) = __pyx_v_far_num;
  }

  /* "utils.pxd":5786
 * 
 *     # Return result
 *     return res             # <<<<<<<<<<<<<<
 * 
 * # . errors: internal
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "utils.pxd":5740
 *     return res
 * 
 * cdef inline np.ndarray dt64arr_find_farthest(np.ndarray arr1, np.ndarray arr2):             # <<<<<<<<<<<<<<
 *     """For each element in 'arr1', find the farthest values in 'arr2' `<'ndarray[int64]'>`."""
 *     # Validate
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils.dt64arr_find_farthest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr1);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr2);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":5789
 * 
 * # . errors: internal
 * cdef inline bint _raise_dt64arr_as_int64_unit_error(str reso, int unit, bint is_dt64=True) except -1:             # <<<<<<<<<<<<<<
 *     """(internal) Raise unsupported unit for 'dt64arr_as_int64*()' functions."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(PyObject *__pyx_v_reso, int __pyx_v_unit, struct __pyx_opt_args_7cytimes_5utils__raise_dt64arr_as_int64_unit_error *__pyx_optional_args) {
  int __pyx_v_is_dt64 = ((int)1);
  PyObject *__pyx_v_obj_type = NULL;
  PyObject *__pyx_v_unit_str = NULL;
  PyObject *__pyx_v_err = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  char const *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_raise_dt64arr_as_int64_unit_error", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_is_dt64 = __pyx_optional_args->is_dt64;
    }
  }

  /* "utils.pxd":5791
 * cdef inline bint _raise_dt64arr_as_int64_unit_error(str reso, int unit, bint is_dt64=True) except -1:
 *     """(internal) Raise unsupported unit for 'dt64arr_as_int64*()' functions."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"             # <<<<<<<<<<<<<<
 *     try:
 *         unit_str = map_nptime_unit_int2str(unit)
 */
  if (__pyx_v_is_dt64) {
    __Pyx_INCREF(__pyx_n_u_datetime64);
    __pyx_t_1 = __pyx_n_u_datetime64;
  } else {
    __Pyx_INCREF(__pyx_n_u_timedelta64);
    __pyx_t_1 = __pyx_n_u_timedelta64;
  }
  __pyx_v_obj_type = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":5792
 *     """(internal) Raise unsupported unit for 'dt64arr_as_int64*()' functions."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 *     try:             # <<<<<<<<<<<<<<
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:
 */
  {
    __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:*/ {

      /* "utils.pxd":5793
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 *     try:
 *         unit_str = map_nptime_unit_int2str(unit)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *         raise ValueError(
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 5793, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_unit_str = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "utils.pxd":5792
 *     """(internal) Raise unsupported unit for 'dt64arr_as_int64*()' functions."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 *     try:             # <<<<<<<<<<<<<<
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:
 */
    }

    /* "utils.pxd":5801
 *         ) from err
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "cannot cast ndarray[%s[%s]] to int64 under '%s' resolution.\n"
 *             "Array with dtype of '%s[%s]' is not supported."
 */
    /*else:*/ {

      /* "utils.pxd":5802
 *     else:
 *         raise ValueError(
 *             "cannot cast ndarray[%s[%s]] to int64 under '%s' resolution.\n"             # <<<<<<<<<<<<<<
 *             "Array with dtype of '%s[%s]' is not supported."
 *             % (obj_type, unit_str, reso, obj_type, unit_str)
 */
      __pyx_t_1 = PyTuple_New(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 5802, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = 0;
      __pyx_t_6 = 127;
      __Pyx_INCREF(__pyx_kp_u_cannot_cast_ndarray_2);
      __pyx_t_5 += 20;
      __Pyx_GIVEREF(__pyx_kp_u_cannot_cast_ndarray_2);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_cannot_cast_ndarray_2);

      /* "utils.pxd":5804
 *             "cannot cast ndarray[%s[%s]] to int64 under '%s' resolution.\n"
 *             "Array with dtype of '%s[%s]' is not supported."
 *             % (obj_type, unit_str, reso, obj_type, unit_str)             # <<<<<<<<<<<<<<
 *         )
 * 
 */
      __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_obj_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 5804, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
      __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u__19);
      __pyx_t_5 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__19);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__19);
      __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_unit_str); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 5804, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
      __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u_to_int64_under_2);
      __pyx_t_5 += 19;
      __Pyx_GIVEREF(__pyx_kp_u_to_int64_under_2);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_to_int64_under_2);
      __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_reso); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 5804, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
      __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u_resolution_Array_with_dtype_of);
      __pyx_t_5 += 35;
      __Pyx_GIVEREF(__pyx_kp_u_resolution_Array_with_dtype_of);
      PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u_resolution_Array_with_dtype_of);
      __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_obj_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 5804, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
      __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u__19);
      __pyx_t_5 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__19);
      PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u__19);
      __pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_v_unit_str); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 5804, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
      __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u_is_not_supported_3);
      __pyx_t_5 += 20;
      __Pyx_GIVEREF(__pyx_kp_u_is_not_supported_3);
      PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_kp_u_is_not_supported_3);

      /* "utils.pxd":5802
 *     else:
 *         raise ValueError(
 *             "cannot cast ndarray[%s[%s]] to int64 under '%s' resolution.\n"             # <<<<<<<<<<<<<<
 *             "Array with dtype of '%s[%s]' is not supported."
 *             % (obj_type, unit_str, reso, obj_type, unit_str)
 */
      __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_1, 11, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 5802, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "utils.pxd":5801
 *         ) from err
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "cannot cast ndarray[%s[%s]] to int64 under '%s' resolution.\n"
 *             "Array with dtype of '%s[%s]' is not supported."
 */
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 5801, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(5, 5801, __pyx_L5_except_error)
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "utils.pxd":5794
 *     try:
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "cannot cast ndarray[%s] to int64 under '%s' resolution.\n"
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("cytimes.utils._raise_dt64arr_as_int64_unit_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(5, 5794, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_v_err = __pyx_t_7;
      /*try:*/ {

        /* "utils.pxd":5796
 *     except Exception as err:
 *         raise ValueError(
 *             "cannot cast ndarray[%s] to int64 under '%s' resolution.\n"             # <<<<<<<<<<<<<<
 *             "Array with datetime unit '%d' is not supported."
 *             % (obj_type, reso, unit)
 */
        __pyx_t_10 = PyTuple_New(7); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 5796, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_5 = 0;
        __pyx_t_6 = 127;
        __Pyx_INCREF(__pyx_kp_u_cannot_cast_ndarray_2);
        __pyx_t_5 += 20;
        __Pyx_GIVEREF(__pyx_kp_u_cannot_cast_ndarray_2);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_kp_u_cannot_cast_ndarray_2);

        /* "utils.pxd":5798
 *             "cannot cast ndarray[%s] to int64 under '%s' resolution.\n"
 *             "Array with datetime unit '%d' is not supported."
 *             % (obj_type, reso, unit)             # <<<<<<<<<<<<<<
 *         ) from err
 *     else:
 */
        __pyx_t_11 = __Pyx_PyUnicode_Unicode(__pyx_v_obj_type); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 5798, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_6;
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11);
        __pyx_t_11 = 0;
        __Pyx_INCREF(__pyx_kp_u_to_int64_under_3);
        __pyx_t_5 += 18;
        __Pyx_GIVEREF(__pyx_kp_u_to_int64_under_3);
        PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_kp_u_to_int64_under_3);
        __pyx_t_11 = __Pyx_PyUnicode_Unicode(__pyx_v_reso); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 5798, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_6;
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_11);
        __pyx_t_11 = 0;
        __Pyx_INCREF(__pyx_kp_u_resolution_Array_with_datetime);
        __pyx_t_5 += 40;
        __Pyx_GIVEREF(__pyx_kp_u_resolution_Array_with_datetime);
        PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_kp_u_resolution_Array_with_datetime);
        __pyx_t_11 = __Pyx_PyUnicode_From_int(__pyx_v_unit, 0, ' ', 'd'); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 5798, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_11);
        __pyx_t_11 = 0;
        __Pyx_INCREF(__pyx_kp_u_is_not_supported);
        __pyx_t_5 += 19;
        __Pyx_GIVEREF(__pyx_kp_u_is_not_supported);
        PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_kp_u_is_not_supported);

        /* "utils.pxd":5796
 *     except Exception as err:
 *         raise ValueError(
 *             "cannot cast ndarray[%s] to int64 under '%s' resolution.\n"             # <<<<<<<<<<<<<<
 *             "Array with datetime unit '%d' is not supported."
 *             % (obj_type, reso, unit)
 */
        __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_10, 7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 5796, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "utils.pxd":5795
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "cannot cast ndarray[%s] to int64 under '%s' resolution.\n"
 *             "Array with datetime unit '%d' is not supported."
 */
        __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 5795, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "utils.pxd":5799
 *             "Array with datetime unit '%d' is not supported."
 *             % (obj_type, reso, unit)
 *         ) from err             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
        __Pyx_Raise(__pyx_t_10, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __PYX_ERR(5, 5795, __pyx_L14_error)
      }

      /* "utils.pxd":5794
 *     try:
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "cannot cast ndarray[%s] to int64 under '%s' resolution.\n"
 */
      /*finally:*/ {
        __pyx_L14_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_8 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          }
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "utils.pxd":5792
 *     """(internal) Raise unsupported unit for 'dt64arr_as_int64*()' functions."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 *     try:             # <<<<<<<<<<<<<<
 *         unit_str = map_nptime_unit_int2str(unit)
 *     except Exception as err:
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
  }

  /* "utils.pxd":5789
 * 
 * # . errors: internal
 * cdef inline bint _raise_dt64arr_as_int64_unit_error(str reso, int unit, bint is_dt64=True) except -1:             # <<<<<<<<<<<<<<
 *     """(internal) Raise unsupported unit for 'dt64arr_as_int64*()' functions."""
 *     obj_type = "datetime64" if is_dt64 else "timedelta64"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.utils._raise_dt64arr_as_int64_unit_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_XDECREF(__pyx_v_obj_type);
  __Pyx_XDECREF(__pyx_v_unit_str);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":5807
 *         )
 * 
 * cdef inline bint _raise_dt64arr_rcl_unsupport_unit_error(str ops, int to_unit, int my_unit) except -1:             # <<<<<<<<<<<<<<
 *     """(internal) Raise unsupported unit for 'dt64arr_round/ceil/floor()' functions."""
 *     my_unit_str = map_nptime_unit_int2str(my_unit)
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils__raise_dt64arr_rcl_unsupport_unit_error(PyObject *__pyx_v_ops, int __pyx_v_to_unit, int __pyx_v_my_unit) {
  PyObject *__pyx_v_my_unit_str = NULL;
  PyObject *__pyx_v_to_unit_str = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_raise_dt64arr_rcl_unsupport_unit_error", 1);

  /* "utils.pxd":5809
 * cdef inline bint _raise_dt64arr_rcl_unsupport_unit_error(str ops, int to_unit, int my_unit) except -1:
 *     """(internal) Raise unsupported unit for 'dt64arr_round/ceil/floor()' functions."""
 *     my_unit_str = map_nptime_unit_int2str(my_unit)             # <<<<<<<<<<<<<<
 *     to_unit_str = map_nptime_unit_int2str(to_unit)
 *     raise ValueError(
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_my_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 5809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_my_unit_str = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":5810
 *     """(internal) Raise unsupported unit for 'dt64arr_round/ceil/floor()' functions."""
 *     my_unit_str = map_nptime_unit_int2str(my_unit)
 *     to_unit_str = map_nptime_unit_int2str(to_unit)             # <<<<<<<<<<<<<<
 *     raise ValueError(
 *         "%s operation on <'ndarray[datetime64[%s]]'> to "
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_map_nptime_unit_int2str(__pyx_v_to_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 5810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_to_unit_str = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "utils.pxd":5812
 *     to_unit_str = map_nptime_unit_int2str(to_unit)
 *     raise ValueError(
 *         "%s operation on <'ndarray[datetime64[%s]]'> to "             # <<<<<<<<<<<<<<
 *         "'%s' resolution is not supported." % (ops, my_unit_str, to_unit_str)
 *     )
 */
  __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 5812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;

  /* "utils.pxd":5813
 *     raise ValueError(
 *         "%s operation on <'ndarray[datetime64[%s]]'> to "
 *         "'%s' resolution is not supported." % (ops, my_unit_str, to_unit_str)             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_ops); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_operation_on_ndarray_datetime64);
  __pyx_t_2 += 35;
  __Pyx_GIVEREF(__pyx_kp_u_operation_on_ndarray_datetime64);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_operation_on_ndarray_datetime64);
  __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_my_unit_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_to);
  __pyx_t_2 += 9;
  __Pyx_GIVEREF(__pyx_kp_u_to);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_to);
  __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_to_unit_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_resolution_is_not_supported);
  __pyx_t_2 += 30;
  __Pyx_GIVEREF(__pyx_kp_u_resolution_is_not_supported);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u_resolution_is_not_supported);

  /* "utils.pxd":5812
 *     to_unit_str = map_nptime_unit_int2str(to_unit)
 *     raise ValueError(
 *         "%s operation on <'ndarray[datetime64[%s]]'> to "             # <<<<<<<<<<<<<<
 *         "'%s' resolution is not supported." % (ops, my_unit_str, to_unit_str)
 *     )
 */
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 6, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "utils.pxd":5811
 *     my_unit_str = map_nptime_unit_int2str(my_unit)
 *     to_unit_str = map_nptime_unit_int2str(to_unit)
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "%s operation on <'ndarray[datetime64[%s]]'> to "
 *         "'%s' resolution is not supported." % (ops, my_unit_str, to_unit_str)
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 5811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(5, 5811, __pyx_L1_error)

  /* "utils.pxd":5807
 *         )
 * 
 * cdef inline bint _raise_dt64arr_rcl_unsupport_unit_error(str ops, int to_unit, int my_unit) except -1:             # <<<<<<<<<<<<<<
 *     """(internal) Raise unsupported unit for 'dt64arr_round/ceil/floor()' functions."""
 *     my_unit_str = map_nptime_unit_int2str(my_unit)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils._raise_dt64arr_rcl_unsupport_unit_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_XDECREF(__pyx_v_my_unit_str);
  __Pyx_XDECREF(__pyx_v_to_unit_str);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":5816
 *     )
 * 
 * cdef inline bint _raise_dt64arr_convert_arr_unit_error(np.ndarray arr, str msg) except -1:             # <<<<<<<<<<<<<<
 *     raise ValueError(
 *         "cannot convert <'ndarray[%s]'> to %s without "
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_msg) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_raise_dt64arr_convert_arr_unit_error", 1);

  /* "utils.pxd":5818
 * cdef inline bint _raise_dt64arr_convert_arr_unit_error(np.ndarray arr, str msg) except -1:
 *     raise ValueError(
 *         "cannot convert <'ndarray[%s]'> to %s without "             # <<<<<<<<<<<<<<
 *         "specifying the array datetime unit." % (arr.dtype, msg)
 *     )
 */
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 5818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u_cannot_convert_ndarray);
  __pyx_t_2 += 25;
  __Pyx_GIVEREF(__pyx_kp_u_cannot_convert_ndarray);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_cannot_convert_ndarray);

  /* "utils.pxd":5819
 *     raise ValueError(
 *         "cannot convert <'ndarray[%s]'> to %s without "
 *         "specifying the array datetime unit." % (arr.dtype, msg)             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 5819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u_to_2);
  __pyx_t_2 += 7;
  __Pyx_GIVEREF(__pyx_kp_u_to_2);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_to_2);
  __pyx_t_5 = __Pyx_PyUnicode_Unicode(__pyx_v_msg); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 5819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u_without_specifying_the_array_da);
  __pyx_t_2 += 44;
  __Pyx_GIVEREF(__pyx_kp_u_without_specifying_the_array_da);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_without_specifying_the_array_da);

  /* "utils.pxd":5818
 * cdef inline bint _raise_dt64arr_convert_arr_unit_error(np.ndarray arr, str msg) except -1:
 *     raise ValueError(
 *         "cannot convert <'ndarray[%s]'> to %s without "             # <<<<<<<<<<<<<<
 *         "specifying the array datetime unit." % (arr.dtype, msg)
 *     )
 */
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 5818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "utils.pxd":5817
 * 
 * cdef inline bint _raise_dt64arr_convert_arr_unit_error(np.ndarray arr, str msg) except -1:
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "cannot convert <'ndarray[%s]'> to %s without "
 *         "specifying the array datetime unit." % (arr.dtype, msg)
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 5817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(5, 5817, __pyx_L1_error)

  /* "utils.pxd":5816
 *     )
 * 
 * cdef inline bint _raise_dt64arr_convert_arr_unit_error(np.ndarray arr, str msg) except -1:             # <<<<<<<<<<<<<<
 *     raise ValueError(
 *         "cannot convert <'ndarray[%s]'> to %s without "
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils._raise_dt64arr_convert_arr_unit_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":5824
 * # NumPy: ndarray[timedelta64] --------------------------------------------------------------------------
 * # . type check
 * cdef inline bint is_td64arr(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the given array is dtype of 'timedelta64' `<'bool'>`.
 * 
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_is_td64arr(PyArrayObject *__pyx_v_arr) {
  int __pyx_r;

  /* "utils.pxd":5830
 *     >>> isinstance(arr.dtype, np.dtypes.TimeDelta64DType)
 *     """
 *     return np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_TIMEDELTA             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint validate_td64arr(np.ndarray arr) except -1:
 */
  __pyx_r = (PyArray_TYPE(__pyx_v_arr) == NPY_TIMEDELTA);
  goto __pyx_L0;

  /* "utils.pxd":5824
 * # NumPy: ndarray[timedelta64] --------------------------------------------------------------------------
 * # . type check
 * cdef inline bint is_td64arr(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Check if the given array is dtype of 'timedelta64' `<'bool'>`.
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "utils.pxd":5832
 *     return np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_TIMEDELTA
 * 
 * cdef inline bint validate_td64arr(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Validate if the given array is dtype of 'timedelta64',
 *     raises `TypeError` if dtype is incorrect.
 */

static CYTHON_INLINE int __pyx_f_7cytimes_5utils_validate_td64arr(PyArrayObject *__pyx_v_arr) {
  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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("validate_td64arr", 1);

  /* "utils.pxd":5836
 *     raises `TypeError` if dtype is incorrect.
 *     """
 *     if not is_td64arr(arr):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects np.ndarray[timedelta64], got '%s'." % arr.dtype)
 *     return True
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_is_td64arr(__pyx_v_arr); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5836, __pyx_L1_error)
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {

    /* "utils.pxd":5837
 *     """
 *     if not is_td64arr(arr):
 *         raise TypeError("expects np.ndarray[timedelta64], got '%s'." % arr.dtype)             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_expects_np_ndarray_timedelta64_g, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 5837, __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_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(5, 5837, __pyx_L1_error)

    /* "utils.pxd":5836
 *     raises `TypeError` if dtype is incorrect.
 *     """
 *     if not is_td64arr(arr):             # <<<<<<<<<<<<<<
 *         raise TypeError("expects np.ndarray[timedelta64], got '%s'." % arr.dtype)
 *     return True
 */
  }

  /* "utils.pxd":5838
 *     if not is_td64arr(arr):
 *         raise TypeError("expects np.ndarray[timedelta64], got '%s'." % arr.dtype)
 *     return True             # <<<<<<<<<<<<<<
 * 
 * # . conversion
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "utils.pxd":5832
 *     return np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_TIMEDELTA
 * 
 * cdef inline bint validate_td64arr(np.ndarray arr) except -1:             # <<<<<<<<<<<<<<
 *     """Validate if the given array is dtype of 'timedelta64',
 *     raises `TypeError` if dtype is incorrect.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.utils.validate_td64arr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":5841
 * 
 * # . conversion
 * cdef inline np.ndarray td64arr_as_int64_us(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[timedelta64] to int64 under 'us' (microsecond)
 *     resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils_td64arr_as_int64_us(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils_td64arr_as_int64_us *__pyx_optional_args) {
  PyObject *__pyx_v_arr_unit = ((PyObject*)Py_None);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  int __pyx_v_unit;
  int __pyx_v_dtype;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_floor_div __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_mul __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils__td64arr_W_as_int64_D __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils__td64arr_M_as_int64_D __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils__td64arr_Y_as_int64_D __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils__raise_dt64arr_as_int64_unit_error __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("td64arr_as_int64_us", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_arr_unit = __pyx_optional_args->arr_unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "utils.pxd":5849
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  __pyx_t_1 = (PyArray_SIZE(__pyx_v_arr) == 0);
  if (__pyx_t_1) {

    /* "utils.pxd":5850
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:
 *         return arr  # exit: empty array             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "utils.pxd":5849
 *     """
 *     # Empty array
 *     if np.PyArray_SIZE(arr) == 0:             # <<<<<<<<<<<<<<
 *         return arr  # exit: empty array
 * 
 */
  }

  /* "utils.pxd":5854
 *     # Get time unit
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)             # <<<<<<<<<<<<<<
 *     if dtype != np.NPY_TYPES.NPY_TIMEDELTA:
 *         if arr_unit is None:
 */
  __pyx_v_dtype = PyArray_TYPE(__pyx_v_arr);

  /* "utils.pxd":5855
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_TIMEDELTA:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 */
  __pyx_t_1 = (__pyx_v_dtype != NPY_TIMEDELTA);
  if (__pyx_t_1) {

    /* "utils.pxd":5856
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_TIMEDELTA:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_1 = (__pyx_v_arr_unit == ((PyObject*)Py_None));
    if (__pyx_t_1) {

      /* "utils.pxd":5857
 *     if dtype != np.NPY_TYPES.NPY_TIMEDELTA:
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 */
      __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_convert_arr_unit_error(__pyx_v_arr, __pyx_kp_u_int64_under_us_resolution); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5857, __pyx_L1_error)

      /* "utils.pxd":5856
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_TIMEDELTA:
 *         if arr_unit is None:             # <<<<<<<<<<<<<<
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    }

    /* "utils.pxd":5858
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 5858, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "utils.pxd":5859
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)             # <<<<<<<<<<<<<<
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5859, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "utils.pxd":5855
 *     cdef int unit
 *     cdef int dtype = np.PyArray_TYPE(arr)
 *     if dtype != np.NPY_TYPES.NPY_TIMEDELTA:             # <<<<<<<<<<<<<<
 *         if arr_unit is None:
 *             _raise_dt64arr_convert_arr_unit_error(arr, "int64 under 'us' resolution")
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":5860
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr_unit != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "utils.pxd":5861
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:
 *         unit = map_nptime_unit_str2int(arr_unit)             # <<<<<<<<<<<<<<
 *     else:
 *         unit = get_arr_nptime_unit(arr)
 */
    __pyx_t_2 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_arr_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 5861, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;

    /* "utils.pxd":5860
 *         unit = map_nptime_unit_str2int(arr_unit)
 *         arr = arr_assure_int64(arr)
 *     elif arr_unit is not None:             # <<<<<<<<<<<<<<
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "utils.pxd":5863
 *         unit = map_nptime_unit_str2int(arr_unit)
 *     else:
 *         unit = get_arr_nptime_unit(arr)             # <<<<<<<<<<<<<<
 *     #: arr can only be only timedelta64 or int64 afterwords
 * 
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_7cytimes_5utils_get_arr_nptime_unit(__pyx_v_arr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 5863, __pyx_L1_error)
    __pyx_v_unit = __pyx_t_2;
  }
  __pyx_L4:;

  /* "utils.pxd":5867
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_1) {

    /* "utils.pxd":5868
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_7cytimes_5utils_NS_MICROSECOND, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5868, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5867
 * 
 *     # Conversion
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "utils.pxd":5869
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_1) {

    /* "utils.pxd":5870
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, US_MILLISECOND, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = (__pyx_v_offset == 0);
    if (__pyx_t_1) {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(__pyx_v_arr)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 5870, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_arr, __pyx_v_offset)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 5870, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    }
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5869
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr_floor_div(arr, NS_MICROSECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "utils.pxd":5871
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_1) {

    /* "utils.pxd":5872
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, US_MILLISECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, US_SECOND, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MILLISECOND, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5871
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr_assure_int64(arr) if offset == 0 else arr_add(arr, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "utils.pxd":5873
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_1) {

    /* "utils.pxd":5874
 *         return arr_mul(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, US_SECOND, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, US_MINUTE, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_SECOND, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5873
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr_mul(arr, US_MILLISECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "utils.pxd":5875
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_1) {

    /* "utils.pxd":5876
 *         return arr_mul(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, US_MINUTE, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, US_HOUR, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_MINUTE, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5876, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5875
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr_mul(arr, US_SECOND, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "utils.pxd":5877
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_1) {

    /* "utils.pxd":5878
 *         return arr_mul(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, US_HOUR, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, US_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_HOUR, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5878, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5877
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr_mul(arr, US_MINUTE, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "utils.pxd":5879
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_1) {

    /* "utils.pxd":5880
 *         return arr_mul(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _td64arr_W_as_int64_D(arr, US_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_DAY, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5880, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5879
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr_mul(arr, US_HOUR, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 */
  }

  /* "utils.pxd":5881
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _td64arr_W_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_1) {

    /* "utils.pxd":5882
 *         return arr_mul(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _td64arr_W_as_int64_D(arr, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _td64arr_M_as_int64_D(arr, US_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_7.__pyx_n = 2;
    __pyx_t_7.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_7.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__td64arr_W_as_int64_D(__pyx_v_arr, &__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5882, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5881
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr_mul(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week             # <<<<<<<<<<<<<<
 *         return _td64arr_W_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 */
  }

  /* "utils.pxd":5883
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _td64arr_W_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _td64arr_M_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_1) {

    /* "utils.pxd":5884
 *         return _td64arr_W_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _td64arr_M_as_int64_D(arr, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _td64arr_Y_as_int64_D(arr, US_DAY, offset)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_8.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__td64arr_M_as_int64_D(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5884, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5883
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:  # week
 *         return _td64arr_W_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month             # <<<<<<<<<<<<<<
 *         return _td64arr_M_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 */
  }

  /* "utils.pxd":5885
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _td64arr_M_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _td64arr_Y_as_int64_D(arr, US_DAY, offset)
 *     # . unsupported
 */
  __pyx_t_1 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_1) {

    /* "utils.pxd":5886
 *         return _td64arr_M_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year
 *         return _td64arr_Y_as_int64_D(arr, US_DAY, offset)             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("us", unit, False)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_9.__pyx_n = 2;
    __pyx_t_9.factor = __pyx_v_7cytimes_5utils_US_DAY;
    __pyx_t_9.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils__td64arr_Y_as_int64_D(__pyx_v_arr, &__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5885
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:  # month
 *         return _td64arr_M_as_int64_D(arr, US_DAY, offset)
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:  # year             # <<<<<<<<<<<<<<
 *         return _td64arr_Y_as_int64_D(arr, US_DAY, offset)
 *     # . unsupported
 */
  }

  /* "utils.pxd":5888
 *         return _td64arr_Y_as_int64_D(arr, US_DAY, offset)
 *     # . unsupported
 *     _raise_dt64arr_as_int64_unit_error("us", unit, False)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray _td64arr_Y_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __pyx_t_10.__pyx_n = 1;
  __pyx_t_10.is_dt64 = 0;
  __pyx_t_1 = __pyx_f_7cytimes_5utils__raise_dt64arr_as_int64_unit_error(__pyx_n_u_us, __pyx_v_unit, &__pyx_t_10); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 5888, __pyx_L1_error)

  /* "utils.pxd":5841
 * 
 * # . conversion
 * cdef inline np.ndarray td64arr_as_int64_us(np.ndarray arr, str arr_unit=None, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """Cast np.ndarray[timedelta64] to int64 under 'us' (microsecond)
 *     resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.utils.td64arr_as_int64_us", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":5890
 *     _raise_dt64arr_as_int64_unit_error("us", unit, False)
 * 
 * cdef inline np.ndarray _td64arr_Y_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[timedelta64[Y]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__td64arr_Y_as_int64_D(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils__td64arr_Y_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_floor_div __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_td64arr_Y_as_int64_D", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }

  /* "utils.pxd":5897
 *     # We use integer arithmetic by scaling to avoid floating-point inaccuracies.
 *     # Multiply by 3652425 and divide by 10000 to represent 365.2425 days/year.
 *     if factor == 1:  # day             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 3_652_425), 10_000, offset) # arr * 365.2425
 *     if factor == 24:  # hour
 */
  __pyx_t_1 = (__pyx_v_factor == 1);
  if (__pyx_t_1) {

    /* "utils.pxd":5898
 *     # Multiply by 3652425 and divide by 10000 to represent 365.2425 days/year.
 *     if factor == 1:  # day
 *         return arr_floor_div(arr_mul(arr, 3_652_425), 10_000, offset) # arr * 365.2425             # <<<<<<<<<<<<<<
 *     if factor == 24:  # hour
 *         return arr_floor_div(arr_mul(arr, 876_582), 100, offset) # arr * 8765.82 (365.2425 * 24)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, 0x37BB49, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 5898, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(((PyArrayObject *)__pyx_t_2), 0x2710, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5898, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5897
 *     # We use integer arithmetic by scaling to avoid floating-point inaccuracies.
 *     # Multiply by 3652425 and divide by 10000 to represent 365.2425 days/year.
 *     if factor == 1:  # day             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 3_652_425), 10_000, offset) # arr * 365.2425
 *     if factor == 24:  # hour
 */
  }

  /* "utils.pxd":5899
 *     if factor == 1:  # day
 *         return arr_floor_div(arr_mul(arr, 3_652_425), 10_000, offset) # arr * 365.2425
 *     if factor == 24:  # hour             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 876_582), 100, offset) # arr * 8765.82 (365.2425 * 24)
 *     if factor == 1_440:  # minute
 */
  __pyx_t_1 = (__pyx_v_factor == 24);
  if (__pyx_t_1) {

    /* "utils.pxd":5900
 *         return arr_floor_div(arr_mul(arr, 3_652_425), 10_000, offset) # arr * 365.2425
 *     if factor == 24:  # hour
 *         return arr_floor_div(arr_mul(arr, 876_582), 100, offset) # arr * 8765.82 (365.2425 * 24)             # <<<<<<<<<<<<<<
 *     if factor == 1_440:  # minute
 *         return arr_floor_div(arr_mul(arr, 5_259_492), 10, offset) # arr * 8765.82 (365.2425 * 24)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, 0xD6026, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(((PyArrayObject *)__pyx_t_3), 0x64, &__pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 5900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5899
 *     if factor == 1:  # day
 *         return arr_floor_div(arr_mul(arr, 3_652_425), 10_000, offset) # arr * 365.2425
 *     if factor == 24:  # hour             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 876_582), 100, offset) # arr * 8765.82 (365.2425 * 24)
 *     if factor == 1_440:  # minute
 */
  }

  /* "utils.pxd":5901
 *     if factor == 24:  # hour
 *         return arr_floor_div(arr_mul(arr, 876_582), 100, offset) # arr * 8765.82 (365.2425 * 24)
 *     if factor == 1_440:  # minute             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 5_259_492), 10, offset) # arr * 8765.82 (365.2425 * 24)
 *     if factor == SS_DAY:  # second
 */
  __pyx_t_1 = (__pyx_v_factor == 0x5A0);
  if (__pyx_t_1) {

    /* "utils.pxd":5902
 *         return arr_floor_div(arr_mul(arr, 876_582), 100, offset) # arr * 8765.82 (365.2425 * 24)
 *     if factor == 1_440:  # minute
 *         return arr_floor_div(arr_mul(arr, 5_259_492), 10, offset) # arr * 8765.82 (365.2425 * 24)             # <<<<<<<<<<<<<<
 *     if factor == SS_DAY:  # second
 *         return arr_mul(arr, TD64_YY_SECOND)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, 0x5040E4, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 5902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(((PyArrayObject *)__pyx_t_2), 10, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5901
 *     if factor == 24:  # hour
 *         return arr_floor_div(arr_mul(arr, 876_582), 100, offset) # arr * 8765.82 (365.2425 * 24)
 *     if factor == 1_440:  # minute             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 5_259_492), 10, offset) # arr * 8765.82 (365.2425 * 24)
 *     if factor == SS_DAY:  # second
 */
  }

  /* "utils.pxd":5903
 *     if factor == 1_440:  # minute
 *         return arr_floor_div(arr_mul(arr, 5_259_492), 10, offset) # arr * 8765.82 (365.2425 * 24)
 *     if factor == SS_DAY:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_YY_SECOND)
 *     if factor == MS_DAY:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_SS_DAY);
  if (__pyx_t_1) {

    /* "utils.pxd":5904
 *         return arr_floor_div(arr_mul(arr, 5_259_492), 10, offset) # arr * 8765.82 (365.2425 * 24)
 *     if factor == SS_DAY:  # second
 *         return arr_mul(arr, TD64_YY_SECOND)             # <<<<<<<<<<<<<<
 *     if factor == MS_DAY:  # millisecond
 *         return arr_mul(arr, TD64_YY_MILLISECOND)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_TD64_YY_SECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5904, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5903
 *     if factor == 1_440:  # minute
 *         return arr_floor_div(arr_mul(arr, 5_259_492), 10, offset) # arr * 8765.82 (365.2425 * 24)
 *     if factor == SS_DAY:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_YY_SECOND)
 *     if factor == MS_DAY:  # millisecond
 */
  }

  /* "utils.pxd":5905
 *     if factor == SS_DAY:  # second
 *         return arr_mul(arr, TD64_YY_SECOND)
 *     if factor == MS_DAY:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_YY_MILLISECOND)
 *     if factor == US_DAY:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_MS_DAY);
  if (__pyx_t_1) {

    /* "utils.pxd":5906
 *         return arr_mul(arr, TD64_YY_SECOND)
 *     if factor == MS_DAY:  # millisecond
 *         return arr_mul(arr, TD64_YY_MILLISECOND)             # <<<<<<<<<<<<<<
 *     if factor == US_DAY:  # microsecond
 *         return arr_mul(arr, TD64_YY_MICROSECOND)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_TD64_YY_MILLISECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5905
 *     if factor == SS_DAY:  # second
 *         return arr_mul(arr, TD64_YY_SECOND)
 *     if factor == MS_DAY:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_YY_MILLISECOND)
 *     if factor == US_DAY:  # microsecond
 */
  }

  /* "utils.pxd":5907
 *     if factor == MS_DAY:  # millisecond
 *         return arr_mul(arr, TD64_YY_MILLISECOND)
 *     if factor == US_DAY:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_YY_MICROSECOND)
 *     if factor == NS_DAY:  # nanosecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_US_DAY);
  if (__pyx_t_1) {

    /* "utils.pxd":5908
 *         return arr_mul(arr, TD64_YY_MILLISECOND)
 *     if factor == US_DAY:  # microsecond
 *         return arr_mul(arr, TD64_YY_MICROSECOND)             # <<<<<<<<<<<<<<
 *     if factor == NS_DAY:  # nanosecond
 *         return arr_mul(arr, TD64_YY_NANOSECOND)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_TD64_YY_MICROSECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5908, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5907
 *     if factor == MS_DAY:  # millisecond
 *         return arr_mul(arr, TD64_YY_MILLISECOND)
 *     if factor == US_DAY:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_YY_MICROSECOND)
 *     if factor == NS_DAY:  # nanosecond
 */
  }

  /* "utils.pxd":5909
 *     if factor == US_DAY:  # microsecond
 *         return arr_mul(arr, TD64_YY_MICROSECOND)
 *     if factor == NS_DAY:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_YY_NANOSECOND)
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_NS_DAY);
  if (__pyx_t_1) {

    /* "utils.pxd":5910
 *         return arr_mul(arr, TD64_YY_MICROSECOND)
 *     if factor == NS_DAY:  # nanosecond
 *         return arr_mul(arr, TD64_YY_NANOSECOND)             # <<<<<<<<<<<<<<
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)
 * 
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_TD64_YY_NANOSECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5910, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5909
 *     if factor == US_DAY:  # microsecond
 *         return arr_mul(arr, TD64_YY_MICROSECOND)
 *     if factor == NS_DAY:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_YY_NANOSECOND)
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)
 */
  }

  /* "utils.pxd":5911
 *     if factor == NS_DAY:  # nanosecond
 *         return arr_mul(arr, TD64_YY_NANOSECOND)
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray _td64arr_M_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_unsupported_factor_d_for_timedel, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 5911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5911, __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(5, 5911, __pyx_L1_error)

  /* "utils.pxd":5890
 *     _raise_dt64arr_as_int64_unit_error("us", unit, False)
 * 
 * cdef inline np.ndarray _td64arr_Y_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[timedelta64[Y]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils._td64arr_Y_as_int64_D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":5913
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)
 * 
 * cdef inline np.ndarray _td64arr_M_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[timedelta64[M]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__td64arr_M_as_int64_D(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils__td64arr_M_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_floor_div __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_td64arr_M_as_int64_D", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }

  /* "utils.pxd":5920
 *     # We use integer arithmetic by scaling to avoid floating-point inaccuracies.
 *     # Multiply by 30436875 and divide by 1000000 to represent 30.436875 days/month.
 *     if factor == 1:  # day             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 30_436_875), 1_000_000, offset) # arr * 30.436875
 *     if factor == 24:  # hour
 */
  __pyx_t_1 = (__pyx_v_factor == 1);
  if (__pyx_t_1) {

    /* "utils.pxd":5921
 *     # Multiply by 30436875 and divide by 1000000 to represent 30.436875 days/month.
 *     if factor == 1:  # day
 *         return arr_floor_div(arr_mul(arr, 30_436_875), 1_000_000, offset) # arr * 30.436875             # <<<<<<<<<<<<<<
 *     if factor == 24:  # hour
 *         return arr_floor_div(arr_mul(arr, 730_485), 1_000, offset) # arr * 730.485 (30.436875 * 24)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, 0x1D06E0B, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 5921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(((PyArrayObject *)__pyx_t_2), 0xF4240, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5920
 *     # We use integer arithmetic by scaling to avoid floating-point inaccuracies.
 *     # Multiply by 30436875 and divide by 1000000 to represent 30.436875 days/month.
 *     if factor == 1:  # day             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 30_436_875), 1_000_000, offset) # arr * 30.436875
 *     if factor == 24:  # hour
 */
  }

  /* "utils.pxd":5922
 *     if factor == 1:  # day
 *         return arr_floor_div(arr_mul(arr, 30_436_875), 1_000_000, offset) # arr * 30.436875
 *     if factor == 24:  # hour             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 730_485), 1_000, offset) # arr * 730.485 (30.436875 * 24)
 *     if factor == 1_440:  # minute
 */
  __pyx_t_1 = (__pyx_v_factor == 24);
  if (__pyx_t_1) {

    /* "utils.pxd":5923
 *         return arr_floor_div(arr_mul(arr, 30_436_875), 1_000_000, offset) # arr * 30.436875
 *     if factor == 24:  # hour
 *         return arr_floor_div(arr_mul(arr, 730_485), 1_000, offset) # arr * 730.485 (30.436875 * 24)             # <<<<<<<<<<<<<<
 *     if factor == 1_440:  # minute
 *         return arr_floor_div(arr_mul(arr, 438_291), 10, offset) # arr * 43829.1 (30.436875 * 1440)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, 0xB2575, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5923, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(((PyArrayObject *)__pyx_t_3), 0x3E8, &__pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 5923, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5922
 *     if factor == 1:  # day
 *         return arr_floor_div(arr_mul(arr, 30_436_875), 1_000_000, offset) # arr * 30.436875
 *     if factor == 24:  # hour             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 730_485), 1_000, offset) # arr * 730.485 (30.436875 * 24)
 *     if factor == 1_440:  # minute
 */
  }

  /* "utils.pxd":5924
 *     if factor == 24:  # hour
 *         return arr_floor_div(arr_mul(arr, 730_485), 1_000, offset) # arr * 730.485 (30.436875 * 24)
 *     if factor == 1_440:  # minute             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 438_291), 10, offset) # arr * 43829.1 (30.436875 * 1440)
 *     if factor == SS_DAY:  # second
 */
  __pyx_t_1 = (__pyx_v_factor == 0x5A0);
  if (__pyx_t_1) {

    /* "utils.pxd":5925
 *         return arr_floor_div(arr_mul(arr, 730_485), 1_000, offset) # arr * 730.485 (30.436875 * 24)
 *     if factor == 1_440:  # minute
 *         return arr_floor_div(arr_mul(arr, 438_291), 10, offset) # arr * 43829.1 (30.436875 * 1440)             # <<<<<<<<<<<<<<
 *     if factor == SS_DAY:  # second
 *         return arr_mul(arr, TD64_MM_SECOND)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, 0x6B013, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 5925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.offset = __pyx_v_offset;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(((PyArrayObject *)__pyx_t_2), 10, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5924
 *     if factor == 24:  # hour
 *         return arr_floor_div(arr_mul(arr, 730_485), 1_000, offset) # arr * 730.485 (30.436875 * 24)
 *     if factor == 1_440:  # minute             # <<<<<<<<<<<<<<
 *         return arr_floor_div(arr_mul(arr, 438_291), 10, offset) # arr * 43829.1 (30.436875 * 1440)
 *     if factor == SS_DAY:  # second
 */
  }

  /* "utils.pxd":5926
 *     if factor == 1_440:  # minute
 *         return arr_floor_div(arr_mul(arr, 438_291), 10, offset) # arr * 43829.1 (30.436875 * 1440)
 *     if factor == SS_DAY:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_MM_SECOND)
 *     if factor == MS_DAY:  # millisecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_SS_DAY);
  if (__pyx_t_1) {

    /* "utils.pxd":5927
 *         return arr_floor_div(arr_mul(arr, 438_291), 10, offset) # arr * 43829.1 (30.436875 * 1440)
 *     if factor == SS_DAY:  # second
 *         return arr_mul(arr, TD64_MM_SECOND)             # <<<<<<<<<<<<<<
 *     if factor == MS_DAY:  # millisecond
 *         return arr_mul(arr, TD64_MM_MILLISECOND)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_TD64_MM_SECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5927, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5926
 *     if factor == 1_440:  # minute
 *         return arr_floor_div(arr_mul(arr, 438_291), 10, offset) # arr * 43829.1 (30.436875 * 1440)
 *     if factor == SS_DAY:  # second             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_MM_SECOND)
 *     if factor == MS_DAY:  # millisecond
 */
  }

  /* "utils.pxd":5928
 *     if factor == SS_DAY:  # second
 *         return arr_mul(arr, TD64_MM_SECOND)
 *     if factor == MS_DAY:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_MM_MILLISECOND)
 *     if factor == US_DAY:  # microsecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_MS_DAY);
  if (__pyx_t_1) {

    /* "utils.pxd":5929
 *         return arr_mul(arr, TD64_MM_SECOND)
 *     if factor == MS_DAY:  # millisecond
 *         return arr_mul(arr, TD64_MM_MILLISECOND)             # <<<<<<<<<<<<<<
 *     if factor == US_DAY:  # microsecond
 *         return arr_mul(arr, TD64_MM_MICROSECOND)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_TD64_MM_MILLISECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5929, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5928
 *     if factor == SS_DAY:  # second
 *         return arr_mul(arr, TD64_MM_SECOND)
 *     if factor == MS_DAY:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_MM_MILLISECOND)
 *     if factor == US_DAY:  # microsecond
 */
  }

  /* "utils.pxd":5930
 *     if factor == MS_DAY:  # millisecond
 *         return arr_mul(arr, TD64_MM_MILLISECOND)
 *     if factor == US_DAY:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_MM_MICROSECOND)
 *     if factor == NS_DAY:  # nanosecond
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_US_DAY);
  if (__pyx_t_1) {

    /* "utils.pxd":5931
 *         return arr_mul(arr, TD64_MM_MILLISECOND)
 *     if factor == US_DAY:  # microsecond
 *         return arr_mul(arr, TD64_MM_MICROSECOND)             # <<<<<<<<<<<<<<
 *     if factor == NS_DAY:  # nanosecond
 *         return arr_mul(arr, TD64_MM_NANOSECOND)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_TD64_MM_MICROSECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5930
 *     if factor == MS_DAY:  # millisecond
 *         return arr_mul(arr, TD64_MM_MILLISECOND)
 *     if factor == US_DAY:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_MM_MICROSECOND)
 *     if factor == NS_DAY:  # nanosecond
 */
  }

  /* "utils.pxd":5932
 *     if factor == US_DAY:  # microsecond
 *         return arr_mul(arr, TD64_MM_MICROSECOND)
 *     if factor == NS_DAY:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_MM_NANOSECOND)
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)
 */
  __pyx_t_1 = (__pyx_v_factor == __pyx_v_7cytimes_5utils_NS_DAY);
  if (__pyx_t_1) {

    /* "utils.pxd":5933
 *         return arr_mul(arr, TD64_MM_MICROSECOND)
 *     if factor == NS_DAY:  # nanosecond
 *         return arr_mul(arr, TD64_MM_NANOSECOND)             # <<<<<<<<<<<<<<
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)
 * 
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_TD64_MM_NANOSECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5933, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "utils.pxd":5932
 *     if factor == US_DAY:  # microsecond
 *         return arr_mul(arr, TD64_MM_MICROSECOND)
 *     if factor == NS_DAY:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr_mul(arr, TD64_MM_NANOSECOND)
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)
 */
  }

  /* "utils.pxd":5934
 *     if factor == NS_DAY:  # nanosecond
 *         return arr_mul(arr, TD64_MM_NANOSECOND)
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)             # <<<<<<<<<<<<<<
 * 
 * cdef inline np.ndarray _td64arr_W_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):
 */
  __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_unsupported_factor_d_for_timedel_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 5934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 5934, __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(5, 5934, __pyx_L1_error)

  /* "utils.pxd":5913
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'Y' conversion." % factor)
 * 
 * cdef inline np.ndarray _td64arr_M_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[timedelta64[M]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.utils._td64arr_M_as_int64_D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "utils.pxd":5936
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)
 * 
 * cdef inline np.ndarray _td64arr_W_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[timedelta64[W]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

static CYTHON_INLINE PyArrayObject *__pyx_f_7cytimes_5utils__td64arr_W_as_int64_D(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_7cytimes_5utils__td64arr_W_as_int64_D *__pyx_optional_args) {
  npy_int64 __pyx_v_factor = ((npy_int64)1);
  npy_int64 __pyx_v_offset = ((npy_int64)0);
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_arr_mul __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_td64arr_W_as_int64_D", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_factor = __pyx_optional_args->factor;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_offset = __pyx_optional_args->offset;
      }
    }
  }

  /* "utils.pxd":5940
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 *     """
 *     return arr_mul(arr, 7 * factor, offset)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.offset = __pyx_v_offset;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, (7 * __pyx_v_factor), &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 5940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "utils.pxd":5936
 *     raise AssertionError("unsupported factor '%d' for timedelta unit 'M' conversion." % factor)
 * 
 * cdef inline np.ndarray _td64arr_W_as_int64_D(np.ndarray arr, np.npy_int64 factor=1, np.npy_int64 offset=0):             # <<<<<<<<<<<<<<
 *     """(internal) Cast np.ndarray[timedelta64[W]] to int64
 *     under 'D' (day) resolution `<'ndarray[int64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.utils._td64arr_W_as_int64_D", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":38
 * 
 * # Utils ---------------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def pddt_new(
 */

static PyObject *__pyx_f_7cytimes_4pddt_pddt_new(PyObject *__pyx_v_data, struct __pyx_opt_args_7cytimes_4pddt_pddt_new *__pyx_optional_args) {

  /* "cytimes/pddt.py":42
 * def pddt_new(
 *     data: object,
 *     freq: object | None = None,             # <<<<<<<<<<<<<<
 *     tz: datetime.tzinfo | str | None = None,
 *     ambiguous: object = "raise",
 */
  PyObject *__pyx_v_freq = ((PyObject *)Py_None);

  /* "cytimes/pddt.py":43
 *     data: object,
 *     freq: object | None = None,
 *     tz: datetime.tzinfo | str | None = None,             # <<<<<<<<<<<<<<
 *     ambiguous: object = "raise",
 *     year1st: bool | None = False,
 */
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  PyObject *__pyx_v_ambiguous = ((PyObject *)__pyx_n_u_raise);

  /* "cytimes/pddt.py":45
 *     tz: datetime.tzinfo | str | None = None,
 *     ambiguous: object = "raise",
 *     year1st: bool | None = False,             # <<<<<<<<<<<<<<
 *     day1st: bool | None = False,
 *     cfg: Configs = None,
 */
  PyObject *__pyx_v_year1st = ((PyObject *)Py_False);

  /* "cytimes/pddt.py":46
 *     ambiguous: object = "raise",
 *     year1st: bool | None = False,
 *     day1st: bool | None = False,             # <<<<<<<<<<<<<<
 *     cfg: Configs = None,
 *     unit: str = None,
 */
  PyObject *__pyx_v_day1st = ((PyObject *)Py_False);

  /* "cytimes/pddt.py":47
 *     year1st: bool | None = False,
 *     day1st: bool | None = False,
 *     cfg: Configs = None,             # <<<<<<<<<<<<<<
 *     unit: str = None,
 *     name: Hashable | None = None,
 */
  struct __pyx_obj_7cytimes_6parser_Configs *__pyx_v_cfg = ((struct __pyx_obj_7cytimes_6parser_Configs *)Py_None);

  /* "cytimes/pddt.py":48
 *     day1st: bool | None = False,
 *     cfg: Configs = None,
 *     unit: str = None,             # <<<<<<<<<<<<<<
 *     name: Hashable | None = None,
 *     copy: bool = False,
 */
  PyObject *__pyx_v_unit = ((PyObject*)Py_None);

  /* "cytimes/pddt.py":49
 *     cfg: Configs = None,
 *     unit: str = None,
 *     name: Hashable | None = None,             # <<<<<<<<<<<<<<
 *     copy: bool = False,
 * ) -> object:
 */
  PyObject *__pyx_v_name = ((PyObject *)Py_None);

  /* "cytimes/pddt.py":50
 *     unit: str = None,
 *     name: Hashable | None = None,
 *     copy: bool = False,             # <<<<<<<<<<<<<<
 * ) -> object:
 *     """(cfunc) Construct a new Pddt instance `<'Pddt'>`.
 */
  PyObject *__pyx_v_copy = ((PyObject *)Py_False);
  PyObject *__pyx_v_y1st = NULL;
  PyObject *__pyx_v_d1st = NULL;
  PyObject *__pyx_v_pt = NULL;
  PyObject *__pyx_v_err = 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;
  struct __pyx_opt_args_7cytimes_4pddt__pddt_new __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  struct __pyx_opt_args_7cytimes_4pddt__pddt_new_cytimes __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  unsigned int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  char const *__pyx_t_23;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pddt_new", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_freq = __pyx_optional_args->freq;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_tz = __pyx_optional_args->tz;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_ambiguous = __pyx_optional_args->ambiguous;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_year1st = __pyx_optional_args->year1st;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_day1st = __pyx_optional_args->day1st;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_cfg = __pyx_optional_args->cfg;
                if (__pyx_optional_args->__pyx_n > 6) {
                  __pyx_v_unit = __pyx_optional_args->unit;
                  if (__pyx_optional_args->__pyx_n > 7) {
                    __pyx_v_name = __pyx_optional_args->name;
                    if (__pyx_optional_args->__pyx_n > 8) {
                      __pyx_v_copy = __pyx_optional_args->copy;
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }

  /* "cytimes/pddt.py":86
 *     :param copy `<'bool'>`: Whether to make a copy of the 'data', defaults to `False`.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *         # Default: DatetimeIndex
 *         y1st = cfg._year1st if year1st is None else year1st
 */
  {
    __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:*/ {

      /* "cytimes/pddt.py":88
 *     try:
 *         # Default: DatetimeIndex
 *         y1st = cfg._year1st if year1st is None else year1st             # <<<<<<<<<<<<<<
 *         d1st = cfg._day1st if day1st is None else day1st
 *         pt: Pddt = _pddt_new(data, freq, tz, ambiguous, y1st, d1st, name, copy)
 */
      __pyx_t_5 = (__pyx_v_year1st == Py_None);
      if (__pyx_t_5) {
        __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_cfg->_year1st); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 88, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_4 = __pyx_t_6;
        __pyx_t_6 = 0;
      } else {
        __Pyx_INCREF(__pyx_v_year1st);
        __pyx_t_4 = __pyx_v_year1st;
      }
      __pyx_v_y1st = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "cytimes/pddt.py":89
 *         # Default: DatetimeIndex
 *         y1st = cfg._year1st if year1st is None else year1st
 *         d1st = cfg._day1st if day1st is None else day1st             # <<<<<<<<<<<<<<
 *         pt: Pddt = _pddt_new(data, freq, tz, ambiguous, y1st, d1st, name, copy)
 *     except (pd_err.OutOfBoundsDatetime, DateParseError):
 */
      __pyx_t_5 = (__pyx_v_day1st == Py_None);
      if (__pyx_t_5) {
        __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_cfg->_day1st); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_4 = __pyx_t_6;
        __pyx_t_6 = 0;
      } else {
        __Pyx_INCREF(__pyx_v_day1st);
        __pyx_t_4 = __pyx_v_day1st;
      }
      __pyx_v_d1st = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "cytimes/pddt.py":90
 *         y1st = cfg._year1st if year1st is None else year1st
 *         d1st = cfg._day1st if day1st is None else day1st
 *         pt: Pddt = _pddt_new(data, freq, tz, ambiguous, y1st, d1st, name, copy)             # <<<<<<<<<<<<<<
 *     except (pd_err.OutOfBoundsDatetime, DateParseError):
 *         # Fallback: cytimes parser
 */
      __pyx_t_7.__pyx_n = 7;
      __pyx_t_7.freq = __pyx_v_freq;
      __pyx_t_7.tz = __pyx_v_tz;
      __pyx_t_7.ambiguous = __pyx_v_ambiguous;
      __pyx_t_7.year1st = __pyx_v_y1st;
      __pyx_t_7.day1st = __pyx_v_d1st;
      __pyx_t_7.name = __pyx_v_name;
      __pyx_t_7.copy = __pyx_v_copy;
      __pyx_t_4 = __pyx_f_7cytimes_4pddt__pddt_new(__pyx_v_data, &__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_pt = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "cytimes/pddt.py":86
 *     :param copy `<'bool'>`: Whether to make a copy of the 'data', defaults to `False`.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *         # Default: DatetimeIndex
 *         y1st = cfg._year1st if year1st is None else year1st
 */
    }
    __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_6); __pyx_t_6 = 0;

    /* "cytimes/pddt.py":91
 *         d1st = cfg._day1st if day1st is None else day1st
 *         pt: Pddt = _pddt_new(data, freq, tz, ambiguous, y1st, d1st, name, copy)
 *     except (pd_err.OutOfBoundsDatetime, DateParseError):             # <<<<<<<<<<<<<<
 *         # Fallback: cytimes parser
 *         pt: Pddt = _pddt_new_cytimes(
 */
    __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_6, &__pyx_t_8);
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_pd_err); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 91, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_OutOfBoundsDatetime); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 91, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_DateParseError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 91, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches2(__pyx_t_4, __pyx_t_10, __pyx_t_9);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_ErrRestore(__pyx_t_4, __pyx_t_6, __pyx_t_8);
    __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_8 = 0;
    if (__pyx_t_11) {
      __Pyx_AddTraceback("cytimes.pddt.pddt_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(0, 91, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);

      /* "cytimes/pddt.py":93
 *     except (pd_err.OutOfBoundsDatetime, DateParseError):
 *         # Fallback: cytimes parser
 *         pt: Pddt = _pddt_new_cytimes(             # <<<<<<<<<<<<<<
 *             data, freq, tz, ambiguous, year1st, day1st, cfg, name
 *         )
 */
      __pyx_t_12.__pyx_n = 7;
      __pyx_t_12.freq = __pyx_v_freq;
      __pyx_t_12.tz = __pyx_v_tz;
      __pyx_t_12.ambiguous = __pyx_v_ambiguous;
      __pyx_t_12.year1st = __pyx_v_year1st;
      __pyx_t_12.day1st = __pyx_v_day1st;
      __pyx_t_12.cfg = __pyx_v_cfg;
      __pyx_t_12.name = __pyx_v_name;
      __pyx_t_9 = __pyx_f_7cytimes_4pddt__pddt_new_cytimes(__pyx_v_data, &__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 93, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_9);
      __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L4_exception_handled;
    }

    /* "cytimes/pddt.py":96
 *             data, freq, tz, ambiguous, year1st, day1st, cfg, name
 *         )
 *     except errors.InvalidArgumentError:             # <<<<<<<<<<<<<<
 *         raise
 *     except pytz_err.AmbiguousTimeError as err:
 */
    __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_6, &__pyx_t_8);
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_errors); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 96, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 96, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_10);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_ErrRestore(__pyx_t_4, __pyx_t_6, __pyx_t_8);
    __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_8 = 0;
    if (__pyx_t_11) {
      __Pyx_AddTraceback("cytimes.pddt.pddt_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(0, 96, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);

      /* "cytimes/pddt.py":97
 *         )
 *     except errors.InvalidArgumentError:
 *         raise             # <<<<<<<<<<<<<<
 *     except pytz_err.AmbiguousTimeError as err:
 *         raise errors.AmbiguousTimeError(err) from err
 */
      __Pyx_GIVEREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ErrRestoreWithState(__pyx_t_8, __pyx_t_6, __pyx_t_4);
      __pyx_t_8 = 0; __pyx_t_6 = 0; __pyx_t_4 = 0; 
      __PYX_ERR(0, 97, __pyx_L5_except_error)
    }

    /* "cytimes/pddt.py":98
 *     except errors.InvalidArgumentError:
 *         raise
 *     except pytz_err.AmbiguousTimeError as err:             # <<<<<<<<<<<<<<
 *         raise errors.AmbiguousTimeError(err) from err
 *     except Exception as err:
 */
    __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_6, &__pyx_t_8);
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_pytz_err); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 98, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_AmbiguousTimeError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 98, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_9);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_ErrRestore(__pyx_t_4, __pyx_t_6, __pyx_t_8);
    __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_8 = 0;
    if (__pyx_t_11) {
      __Pyx_AddTraceback("cytimes.pddt.pddt_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(0, 98, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/pddt.py":99
 *         raise
 *     except pytz_err.AmbiguousTimeError as err:
 *         raise errors.AmbiguousTimeError(err) from err             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *         raise errors.InvalidArgumentError(err) from err
 */
        __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_errors); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 99, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_AmbiguousTimeError); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 99, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = NULL;
        __pyx_t_14 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
            __pyx_t_14 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_err};
          __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 99, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
        __Pyx_Raise(__pyx_t_9, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __PYX_ERR(0, 99, __pyx_L18_error)
      }

      /* "cytimes/pddt.py":98
 *     except errors.InvalidArgumentError:
 *         raise
 *     except pytz_err.AmbiguousTimeError as err:             # <<<<<<<<<<<<<<
 *         raise errors.AmbiguousTimeError(err) from err
 *     except Exception as err:
 */
      /*finally:*/ {
        __pyx_L18_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_11 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
      }
    }

    /* "cytimes/pddt.py":100
 *     except pytz_err.AmbiguousTimeError as err:
 *         raise errors.AmbiguousTimeError(err) from err
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise errors.InvalidArgumentError(err) from err
 * 
 */
    __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_15) {
      __Pyx_AddTraceback("cytimes.pddt.pddt_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(0, 100, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/pddt.py":101
 *         raise errors.AmbiguousTimeError(err) from err
 *     except Exception as err:
 *         raise errors.InvalidArgumentError(err) from err             # <<<<<<<<<<<<<<
 * 
 *     # Convert to specified unit
 */
        __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_errors); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 101, __pyx_L29_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 101, __pyx_L29_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
            __pyx_t_14 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_v_err};
          __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 101, __pyx_L29_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_Raise(__pyx_t_9, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __PYX_ERR(0, 101, __pyx_L29_error)
      }

      /* "cytimes/pddt.py":100
 *     except pytz_err.AmbiguousTimeError as err:
 *         raise errors.AmbiguousTimeError(err) from err
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise errors.InvalidArgumentError(err) from err
 * 
 */
      /*finally:*/ {
        __pyx_L29_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_18, &__pyx_t_17);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_22);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_17);
          __pyx_t_15 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_23 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_18, __pyx_t_17);
          }
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_ErrRestore(__pyx_t_22, __pyx_t_21, __pyx_t_20);
          __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0;
          __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_23;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/pddt.py":86
 *     :param copy `<'bool'>`: Whether to make a copy of the 'data', defaults to `False`.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *         # Default: DatetimeIndex
 *         y1st = cfg._year1st if year1st is None else year1st
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "cytimes/pddt.py":104
 * 
 *     # Convert to specified unit
 *     return pt if unit is None else pt.as_unit(unit)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = (__pyx_v_unit == ((PyObject*)Py_None));
  if (__pyx_t_5) {
    __Pyx_INCREF(__pyx_v_pt);
    __pyx_t_8 = __pyx_v_pt;
  } else {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt, __pyx_n_s_as_unit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = NULL;
    __pyx_t_14 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_14 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_unit};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 104, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_8 = __pyx_t_6;
    __pyx_t_6 = 0;
  }
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":38
 * 
 * # Utils ---------------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def pddt_new(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("cytimes.pddt.pddt_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_y1st);
  __Pyx_XDECREF(__pyx_v_d1st);
  __Pyx_XDECREF(__pyx_v_pt);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":107
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def pddt_new_simple(
 */

static PyObject *__pyx_f_7cytimes_4pddt_pddt_new_simple(PyObject *__pyx_v_data, struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple *__pyx_optional_args) {

  /* "cytimes/pddt.py":111
 * def pddt_new_simple(
 *     data: object,
 *     tz: datetime.tzinfo | str | None = None,             # <<<<<<<<<<<<<<
 *     unit: str = None,
 *     name: Hashable | None = None,
 */
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);

  /* "cytimes/pddt.py":112
 *     data: object,
 *     tz: datetime.tzinfo | str | None = None,
 *     unit: str = None,             # <<<<<<<<<<<<<<
 *     name: Hashable | None = None,
 * ) -> object:
 */
  PyObject *__pyx_v_unit = ((PyObject*)Py_None);

  /* "cytimes/pddt.py":113
 *     tz: datetime.tzinfo | str | None = None,
 *     unit: str = None,
 *     name: Hashable | None = None,             # <<<<<<<<<<<<<<
 * ) -> object:
 *     """(cfunc) Construct a new Pddt instance (simplified arguments) `<'Pddt'>`.
 */
  PyObject *__pyx_v_name = ((PyObject *)Py_None);
  PyObject *__pyx_v_pt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pddt_new_simple", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_unit = __pyx_optional_args->unit;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_name = __pyx_optional_args->name;
        }
      }
    }
  }

  /* "cytimes/pddt.py":129
 *     :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.
 *     """
 *     pt: Pddt = pddt_new(             # <<<<<<<<<<<<<<
 *         data, None, None, "raise", False, False, None, unit, name, False
 *     )
 */
  __pyx_t_2.__pyx_n = 9;
  __pyx_t_2.freq = Py_None;
  __pyx_t_2.tz = Py_None;
  __pyx_t_2.ambiguous = __pyx_n_u_raise;
  __pyx_t_2.year1st = Py_False;
  __pyx_t_2.day1st = Py_False;
  __pyx_t_2.cfg = ((struct __pyx_obj_7cytimes_6parser_Configs *)Py_None);
  __pyx_t_2.unit = __pyx_v_unit;
  __pyx_t_2.name = __pyx_v_name;
  __pyx_t_2.copy = Py_False;
  __pyx_t_1 = __pyx_f_7cytimes_4pddt_pddt_new(__pyx_v_data, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pt = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":132
 *         data, None, None, "raise", False, False, None, unit, name, False
 *     )
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         return pt
 *     return pt.tz_localize(tz, "infer", "shift_forward")
 */
  __pyx_t_3 = (__pyx_v_tz == Py_None);
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":133
 *     )
 *     if tz is None:
 *         return pt             # <<<<<<<<<<<<<<
 *     return pt.tz_localize(tz, "infer", "shift_forward")
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_pt);
    __pyx_r = __pyx_v_pt;
    goto __pyx_L0;

    /* "cytimes/pddt.py":132
 *         data, None, None, "raise", False, False, None, unit, name, False
 *     )
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         return pt
 *     return pt.tz_localize(tz, "infer", "shift_forward")
 */
  }

  /* "cytimes/pddt.py":134
 *     if tz is None:
 *         return pt
 *     return pt.tz_localize(tz, "infer", "shift_forward")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt, __pyx_n_s_tz_localize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_tz, __pyx_n_u_infer, __pyx_n_u_shift_forward};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":107
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def pddt_new_simple(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.pddt.pddt_new_simple", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":137
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def _pddt_new(
 */

static PyObject *__pyx_f_7cytimes_4pddt__pddt_new(PyObject *__pyx_v_data, struct __pyx_opt_args_7cytimes_4pddt__pddt_new *__pyx_optional_args) {

  /* "cytimes/pddt.py":141
 * def _pddt_new(
 *     data: object,
 *     freq: object | None = None,             # <<<<<<<<<<<<<<
 *     tz: datetime.tzinfo | str | None = None,
 *     ambiguous: object = "raise",
 */
  PyObject *__pyx_v_freq = ((PyObject *)Py_None);

  /* "cytimes/pddt.py":142
 *     data: object,
 *     freq: object | None = None,
 *     tz: datetime.tzinfo | str | None = None,             # <<<<<<<<<<<<<<
 *     ambiguous: object = "raise",
 *     year1st: bool = False,
 */
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  PyObject *__pyx_v_ambiguous = ((PyObject *)__pyx_n_u_raise);

  /* "cytimes/pddt.py":144
 *     tz: datetime.tzinfo | str | None = None,
 *     ambiguous: object = "raise",
 *     year1st: bool = False,             # <<<<<<<<<<<<<<
 *     day1st: bool = False,
 *     name: Hashable | None = None,
 */
  PyObject *__pyx_v_year1st = ((PyObject *)Py_False);

  /* "cytimes/pddt.py":145
 *     ambiguous: object = "raise",
 *     year1st: bool = False,
 *     day1st: bool = False,             # <<<<<<<<<<<<<<
 *     name: Hashable | None = None,
 *     copy: bool = False,
 */
  PyObject *__pyx_v_day1st = ((PyObject *)Py_False);

  /* "cytimes/pddt.py":146
 *     year1st: bool = False,
 *     day1st: bool = False,
 *     name: Hashable | None = None,             # <<<<<<<<<<<<<<
 *     copy: bool = False,
 * ) -> object:
 */
  PyObject *__pyx_v_name = ((PyObject *)Py_None);

  /* "cytimes/pddt.py":147
 *     day1st: bool = False,
 *     name: Hashable | None = None,
 *     copy: bool = False,             # <<<<<<<<<<<<<<
 * ) -> object:
 *     """(internal) Construct a new Pddt instance `<'Pddt'>`.
 */
  PyObject *__pyx_v_copy = ((PyObject *)Py_False);
  PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_v_msg = 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;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_pddt_new", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_freq = __pyx_optional_args->freq;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_tz = __pyx_optional_args->tz;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_ambiguous = __pyx_optional_args->ambiguous;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_year1st = __pyx_optional_args->year1st;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_day1st = __pyx_optional_args->day1st;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_name = __pyx_optional_args->name;
                if (__pyx_optional_args->__pyx_n > 6) {
                  __pyx_v_copy = __pyx_optional_args->copy;
                }
              }
            }
          }
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_freq);
  __Pyx_INCREF(__pyx_v_tz);

  /* "cytimes/pddt.py":156
 *     """
 *     # Parse frequency
 *     if freq is None:             # <<<<<<<<<<<<<<
 *         freq = lib.no_default
 *     elif freq == "m":
 */
  __pyx_t_1 = (__pyx_v_freq == Py_None);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":157
 *     # Parse frequency
 *     if freq is None:
 *         freq = lib.no_default             # <<<<<<<<<<<<<<
 *     elif freq == "m":
 *         freq = "min"
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_no_default); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_freq, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":156
 *     """
 *     # Parse frequency
 *     if freq is None:             # <<<<<<<<<<<<<<
 *         freq = lib.no_default
 *     elif freq == "m":
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":158
 *     if freq is None:
 *         freq = lib.no_default
 *     elif freq == "m":             # <<<<<<<<<<<<<<
 *         freq = "min"
 *     # Prase timezone
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_freq, __pyx_n_u_m, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 158, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":159
 *         freq = lib.no_default
 *     elif freq == "m":
 *         freq = "min"             # <<<<<<<<<<<<<<
 *     # Prase timezone
 *     tz = utils.tz_parse(tz)
 */
    __Pyx_INCREF(__pyx_n_u_min);
    __Pyx_DECREF_SET(__pyx_v_freq, __pyx_n_u_min);

    /* "cytimes/pddt.py":158
 *     if freq is None:
 *         freq = lib.no_default
 *     elif freq == "m":             # <<<<<<<<<<<<<<
 *         freq = "min"
 *     # Prase timezone
 */
  }
  __pyx_L3:;

  /* "cytimes/pddt.py":161
 *         freq = "min"
 *     # Prase timezone
 *     tz = utils.tz_parse(tz)             # <<<<<<<<<<<<<<
 *     if tz is None:
 *         tz = lib.no_default
 */
  __pyx_t_3 = __pyx_f_7cytimes_5utils_tz_parse(__pyx_v_tz); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":162
 *     # Prase timezone
 *     tz = utils.tz_parse(tz)
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         tz = lib.no_default
 *     elif ambiguous == "NaT":
 */
  __pyx_t_1 = (__pyx_v_tz == Py_None);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":163
 *     tz = utils.tz_parse(tz)
 *     if tz is None:
 *         tz = lib.no_default             # <<<<<<<<<<<<<<
 *     elif ambiguous == "NaT":
 *         raise errors.InvalidArgumentError("ambiguous='NaT' is not supported.")
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":162
 *     # Prase timezone
 *     tz = utils.tz_parse(tz)
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         tz = lib.no_default
 *     elif ambiguous == "NaT":
 */
    goto __pyx_L4;
  }

  /* "cytimes/pddt.py":164
 *     if tz is None:
 *         tz = lib.no_default
 *     elif ambiguous == "NaT":             # <<<<<<<<<<<<<<
 *         raise errors.InvalidArgumentError("ambiguous='NaT' is not supported.")
 *     # New instance
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_ambiguous, __pyx_n_u_NaT, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 164, __pyx_L1_error)
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/pddt.py":165
 *         tz = lib.no_default
 *     elif ambiguous == "NaT":
 *         raise errors.InvalidArgumentError("ambiguous='NaT' is not supported.")             # <<<<<<<<<<<<<<
 *     # New instance
 *     try:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __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
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_ambiguous_NaT_is_not_supported};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 165, __pyx_L1_error)

    /* "cytimes/pddt.py":164
 *     if tz is None:
 *         tz = lib.no_default
 *     elif ambiguous == "NaT":             # <<<<<<<<<<<<<<
 *         raise errors.InvalidArgumentError("ambiguous='NaT' is not supported.")
 *     # New instance
 */
  }
  __pyx_L4:;

  /* "cytimes/pddt.py":167
 *         raise errors.InvalidArgumentError("ambiguous='NaT' is not supported.")
 *     # New instance
 *     try:             # <<<<<<<<<<<<<<
 *         return DatetimeIndex.__new__(
 *             Pddt,
 */
  {
    __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:*/ {

      /* "cytimes/pddt.py":168
 *     # New instance
 *     try:
 *         return DatetimeIndex.__new__(             # <<<<<<<<<<<<<<
 *             Pddt,
 *             data=data,
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DatetimeIndex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_new); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cytimes/pddt.py":169
 *     try:
 *         return DatetimeIndex.__new__(
 *             Pddt,             # <<<<<<<<<<<<<<
 *             data=data,
 *             freq=freq,
 */
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Pddt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "cytimes/pddt.py":168
 *     # New instance
 *     try:
 *         return DatetimeIndex.__new__(             # <<<<<<<<<<<<<<
 *             Pddt,
 *             data=data,
 */
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 168, __pyx_L5_error);
      __pyx_t_2 = 0;

      /* "cytimes/pddt.py":170
 *         return DatetimeIndex.__new__(
 *             Pddt,
 *             data=data,             # <<<<<<<<<<<<<<
 *             freq=freq,
 *             tz=tz,
 */
      __pyx_t_2 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_data, __pyx_v_data) < 0) __PYX_ERR(0, 170, __pyx_L5_error)

      /* "cytimes/pddt.py":171
 *             Pddt,
 *             data=data,
 *             freq=freq,             # <<<<<<<<<<<<<<
 *             tz=tz,
 *             ambiguous=ambiguous,
 */
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_freq, __pyx_v_freq) < 0) __PYX_ERR(0, 170, __pyx_L5_error)

      /* "cytimes/pddt.py":172
 *             data=data,
 *             freq=freq,
 *             tz=tz,             # <<<<<<<<<<<<<<
 *             ambiguous=ambiguous,
 *             dayfirst=day1st,
 */
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tz, __pyx_v_tz) < 0) __PYX_ERR(0, 170, __pyx_L5_error)

      /* "cytimes/pddt.py":173
 *             freq=freq,
 *             tz=tz,
 *             ambiguous=ambiguous,             # <<<<<<<<<<<<<<
 *             dayfirst=day1st,
 *             yearfirst=year1st,
 */
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ambiguous, __pyx_v_ambiguous) < 0) __PYX_ERR(0, 170, __pyx_L5_error)

      /* "cytimes/pddt.py":174
 *             tz=tz,
 *             ambiguous=ambiguous,
 *             dayfirst=day1st,             # <<<<<<<<<<<<<<
 *             yearfirst=year1st,
 *             dtype=None,
 */
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dayfirst, __pyx_v_day1st) < 0) __PYX_ERR(0, 170, __pyx_L5_error)

      /* "cytimes/pddt.py":175
 *             ambiguous=ambiguous,
 *             dayfirst=day1st,
 *             yearfirst=year1st,             # <<<<<<<<<<<<<<
 *             dtype=None,
 *             copy=copy,
 */
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_yearfirst, __pyx_v_year1st) < 0) __PYX_ERR(0, 170, __pyx_L5_error)

      /* "cytimes/pddt.py":176
 *             dayfirst=day1st,
 *             yearfirst=year1st,
 *             dtype=None,             # <<<<<<<<<<<<<<
 *             copy=copy,
 *             name=name,
 */
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, Py_None) < 0) __PYX_ERR(0, 170, __pyx_L5_error)

      /* "cytimes/pddt.py":177
 *             yearfirst=year1st,
 *             dtype=None,
 *             copy=copy,             # <<<<<<<<<<<<<<
 *             name=name,
 *         )
 */
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, __pyx_v_copy) < 0) __PYX_ERR(0, 170, __pyx_L5_error)

      /* "cytimes/pddt.py":178
 *             dtype=None,
 *             copy=copy,
 *             name=name,             # <<<<<<<<<<<<<<
 *         )
 *     except (TypeError, ValueError) as err:
 */
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 170, __pyx_L5_error)

      /* "cytimes/pddt.py":168
 *     # New instance
 *     try:
 *         return DatetimeIndex.__new__(             # <<<<<<<<<<<<<<
 *             Pddt,
 *             data=data,
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 168, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_9;
      __pyx_t_9 = 0;
      goto __pyx_L9_try_return;

      /* "cytimes/pddt.py":167
 *         raise errors.InvalidArgumentError("ambiguous='NaT' is not supported.")
 *     # New instance
 *     try:             # <<<<<<<<<<<<<<
 *         return DatetimeIndex.__new__(
 *             Pddt,
 */
    }
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cytimes/pddt.py":180
 *             name=name,
 *         )
 *     except (TypeError, ValueError) as err:             # <<<<<<<<<<<<<<
 *         msg: str = str(err)
 *         if "mixed timezones" not in msg and "unless utc=True" not in msg:
 */
    __pyx_t_10 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_TypeError, __pyx_builtin_ValueError);
    if (__pyx_t_10) {
      __Pyx_AddTraceback("cytimes.pddt._pddt_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 180, __pyx_L7_except_error)
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_v_err = __pyx_t_2;
      /*try:*/ {

        /* "cytimes/pddt.py":181
 *         )
 *     except (TypeError, ValueError) as err:
 *         msg: str = str(err)             # <<<<<<<<<<<<<<
 *         if "mixed timezones" not in msg and "unless utc=True" not in msg:
 *             raise err
 */
        __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_v_msg = ((PyObject*)__pyx_t_4);
        __pyx_t_4 = 0;

        /* "cytimes/pddt.py":182
 *     except (TypeError, ValueError) as err:
 *         msg: str = str(err)
 *         if "mixed timezones" not in msg and "unless utc=True" not in msg:             # <<<<<<<<<<<<<<
 *             raise err
 *         return DatetimeIndex.__new__(
 */
        __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u_mixed_timezones, __pyx_v_msg, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 182, __pyx_L16_error)
        if (__pyx_t_11) {
        } else {
          __pyx_t_1 = __pyx_t_11;
          goto __pyx_L19_bool_binop_done;
        }
        __pyx_t_11 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u_unless_utc_True, __pyx_v_msg, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 182, __pyx_L16_error)
        __pyx_t_1 = __pyx_t_11;
        __pyx_L19_bool_binop_done:;
        if (unlikely(__pyx_t_1)) {

          /* "cytimes/pddt.py":183
 *         msg: str = str(err)
 *         if "mixed timezones" not in msg and "unless utc=True" not in msg:
 *             raise err             # <<<<<<<<<<<<<<
 *         return DatetimeIndex.__new__(
 *             Pddt,
 */
          __Pyx_Raise(__pyx_v_err, 0, 0, 0);
          __PYX_ERR(0, 183, __pyx_L16_error)

          /* "cytimes/pddt.py":182
 *     except (TypeError, ValueError) as err:
 *         msg: str = str(err)
 *         if "mixed timezones" not in msg and "unless utc=True" not in msg:             # <<<<<<<<<<<<<<
 *             raise err
 *         return DatetimeIndex.__new__(
 */
        }

        /* "cytimes/pddt.py":184
 *         if "mixed timezones" not in msg and "unless utc=True" not in msg:
 *             raise err
 *         return DatetimeIndex.__new__(             # <<<<<<<<<<<<<<
 *             Pddt,
 *             data=data,
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DatetimeIndex); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_new); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 184, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "cytimes/pddt.py":185
 *             raise err
 *         return DatetimeIndex.__new__(
 *             Pddt,             # <<<<<<<<<<<<<<
 *             data=data,
 *             freq=freq,
 */
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Pddt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_4);

        /* "cytimes/pddt.py":184
 *         if "mixed timezones" not in msg and "unless utc=True" not in msg:
 *             raise err
 *         return DatetimeIndex.__new__(             # <<<<<<<<<<<<<<
 *             Pddt,
 *             data=data,
 */
        __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 184, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_GIVEREF(__pyx_t_4);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4)) __PYX_ERR(0, 184, __pyx_L16_error);
        __pyx_t_4 = 0;

        /* "cytimes/pddt.py":186
 *         return DatetimeIndex.__new__(
 *             Pddt,
 *             data=data,             # <<<<<<<<<<<<<<
 *             freq=freq,
 *             tz=utils.UTC,
 */
        __pyx_t_4 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_data, __pyx_v_data) < 0) __PYX_ERR(0, 186, __pyx_L16_error)

        /* "cytimes/pddt.py":187
 *             Pddt,
 *             data=data,
 *             freq=freq,             # <<<<<<<<<<<<<<
 *             tz=utils.UTC,
 *             ambiguous=ambiguous,
 */
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_freq, __pyx_v_freq) < 0) __PYX_ERR(0, 186, __pyx_L16_error)

        /* "cytimes/pddt.py":188
 *             data=data,
 *             freq=freq,
 *             tz=utils.UTC,             # <<<<<<<<<<<<<<
 *             ambiguous=ambiguous,
 *             dayfirst=day1st,
 */
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_tz, ((PyObject *)__pyx_v_7cytimes_5utils_UTC)) < 0) __PYX_ERR(0, 186, __pyx_L16_error)

        /* "cytimes/pddt.py":189
 *             freq=freq,
 *             tz=utils.UTC,
 *             ambiguous=ambiguous,             # <<<<<<<<<<<<<<
 *             dayfirst=day1st,
 *             yearfirst=year1st,
 */
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ambiguous, __pyx_v_ambiguous) < 0) __PYX_ERR(0, 186, __pyx_L16_error)

        /* "cytimes/pddt.py":190
 *             tz=utils.UTC,
 *             ambiguous=ambiguous,
 *             dayfirst=day1st,             # <<<<<<<<<<<<<<
 *             yearfirst=year1st,
 *             dtype=None,
 */
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dayfirst, __pyx_v_day1st) < 0) __PYX_ERR(0, 186, __pyx_L16_error)

        /* "cytimes/pddt.py":191
 *             ambiguous=ambiguous,
 *             dayfirst=day1st,
 *             yearfirst=year1st,             # <<<<<<<<<<<<<<
 *             dtype=None,
 *             copy=copy,
 */
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_yearfirst, __pyx_v_year1st) < 0) __PYX_ERR(0, 186, __pyx_L16_error)

        /* "cytimes/pddt.py":192
 *             dayfirst=day1st,
 *             yearfirst=year1st,
 *             dtype=None,             # <<<<<<<<<<<<<<
 *             copy=copy,
 *             name=name,
 */
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, Py_None) < 0) __PYX_ERR(0, 186, __pyx_L16_error)

        /* "cytimes/pddt.py":193
 *             yearfirst=year1st,
 *             dtype=None,
 *             copy=copy,             # <<<<<<<<<<<<<<
 *             name=name,
 *         )
 */
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_copy, __pyx_v_copy) < 0) __PYX_ERR(0, 186, __pyx_L16_error)

        /* "cytimes/pddt.py":194
 *             dtype=None,
 *             copy=copy,
 *             name=name,             # <<<<<<<<<<<<<<
 *         )
 * 
 */
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 186, __pyx_L16_error)

        /* "cytimes/pddt.py":184
 *         if "mixed timezones" not in msg and "unless utc=True" not in msg:
 *             raise err
 *         return DatetimeIndex.__new__(             # <<<<<<<<<<<<<<
 *             Pddt,
 *             data=data,
 */
        __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, __pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 184, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_r = __pyx_t_14;
        __pyx_t_14 = 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_L15_return;
      }

      /* "cytimes/pddt.py":180
 *             name=name,
 *         )
 *     except (TypeError, ValueError) as err:             # <<<<<<<<<<<<<<
 *         msg: str = str(err)
 *         if "mixed timezones" not in msg and "unless utc=True" not in msg:
 */
      /*finally:*/ {
        __pyx_L16_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_10 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L7_except_error;
        }
        __pyx_L15_return: {
          __pyx_t_22 = __pyx_r;
          __pyx_r = 0;
          __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          __pyx_r = __pyx_t_22;
          __pyx_t_22 = 0;
          goto __pyx_L8_except_return;
        }
      }
    }
    goto __pyx_L7_except_error;

    /* "cytimes/pddt.py":167
 *         raise errors.InvalidArgumentError("ambiguous='NaT' is not supported.")
 *     # New instance
 *     try:             # <<<<<<<<<<<<<<
 *         return DatetimeIndex.__new__(
 *             Pddt,
 */
    __pyx_L7_except_error:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_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;
  }

  /* "cytimes/pddt.py":137
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def _pddt_new(
 */

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("cytimes.pddt._pddt_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XDECREF(__pyx_v_freq);
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":198
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def _pddt_new_cytimes(
 */

static PyObject *__pyx_f_7cytimes_4pddt__pddt_new_cytimes(PyObject *__pyx_v_data, struct __pyx_opt_args_7cytimes_4pddt__pddt_new_cytimes *__pyx_optional_args) {

  /* "cytimes/pddt.py":202
 * def _pddt_new_cytimes(
 *     data: object,
 *     freq: object | None = None,             # <<<<<<<<<<<<<<
 *     tz: datetime.tzinfo | str | None = None,
 *     ambiguous: np.ndarray[np.bool_] | Literal["infer", "raise"] = "raise",
 */
  PyObject *__pyx_v_freq = ((PyObject *)Py_None);

  /* "cytimes/pddt.py":203
 *     data: object,
 *     freq: object | None = None,
 *     tz: datetime.tzinfo | str | None = None,             # <<<<<<<<<<<<<<
 *     ambiguous: np.ndarray[np.bool_] | Literal["infer", "raise"] = "raise",
 *     year1st: bool | None = None,
 */
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  PyObject *__pyx_v_ambiguous = ((PyObject *)__pyx_n_u_raise);

  /* "cytimes/pddt.py":205
 *     tz: datetime.tzinfo | str | None = None,
 *     ambiguous: np.ndarray[np.bool_] | Literal["infer", "raise"] = "raise",
 *     year1st: bool | None = None,             # <<<<<<<<<<<<<<
 *     day1st: bool | None = None,
 *     cfg: Configs = None,
 */
  PyObject *__pyx_v_year1st = ((PyObject *)Py_None);

  /* "cytimes/pddt.py":206
 *     ambiguous: np.ndarray[np.bool_] | Literal["infer", "raise"] = "raise",
 *     year1st: bool | None = None,
 *     day1st: bool | None = None,             # <<<<<<<<<<<<<<
 *     cfg: Configs = None,
 *     name: Hashable | None = None,
 */
  PyObject *__pyx_v_day1st = ((PyObject *)Py_None);

  /* "cytimes/pddt.py":207
 *     year1st: bool | None = None,
 *     day1st: bool | None = None,
 *     cfg: Configs = None,             # <<<<<<<<<<<<<<
 *     name: Hashable | None = None,
 * ) -> object:
 */
  struct __pyx_obj_7cytimes_6parser_Configs *__pyx_v_cfg = ((struct __pyx_obj_7cytimes_6parser_Configs *)Py_None);

  /* "cytimes/pddt.py":208
 *     day1st: bool | None = None,
 *     cfg: Configs = None,
 *     name: Hashable | None = None,             # <<<<<<<<<<<<<<
 * ) -> object:
 *     """(internal) Construct a new Pddt instance using
 */
  PyObject *__pyx_v_name = ((PyObject *)Py_None);
  Py_ssize_t __pyx_v_arr_size;
  PyObject *__pyx_v_tz_repl = NULL;
  PyArrayObject *__pyx_v_arr = 0;
  npy_int64 *__pyx_v_arr_ptr;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_item = NULL;
  PyDateTime_DateTime *__pyx_v_dt = 0;
  PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_v_pt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  npy_intp __pyx_t_7[1];
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  struct __pyx_opt_args_7cytimes_6parser_parse_dtobj __pyx_t_10;
  struct __pyx_opt_args_7cytimes_5utils_dt_astimezone __pyx_t_11;
  PY_LONG_LONG __pyx_t_12;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_us __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  unsigned int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_t_20;
  char const *__pyx_t_21;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  char const *__pyx_t_28;
  struct __pyx_opt_args_7cytimes_4pddt__pddt_new __pyx_t_29;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_pddt_new_cytimes", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_freq = __pyx_optional_args->freq;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_tz = __pyx_optional_args->tz;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_ambiguous = __pyx_optional_args->ambiguous;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_year1st = __pyx_optional_args->year1st;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_day1st = __pyx_optional_args->day1st;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_cfg = __pyx_optional_args->cfg;
                if (__pyx_optional_args->__pyx_n > 6) {
                  __pyx_v_name = __pyx_optional_args->name;
                }
              }
            }
          }
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_tz);

  /* "cytimes/pddt.py":218
 *     """
 *     # Get array size
 *     arr_size = _parse_arr_size(data)             # <<<<<<<<<<<<<<
 * 
 *     # Parse with cytimes
 */
  __pyx_t_1 = __pyx_f_7cytimes_4pddt__parse_arr_size(__pyx_v_data); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-2L))) __PYX_ERR(0, 218, __pyx_L1_error)
  __pyx_v_arr_size = __pyx_t_1;

  /* "cytimes/pddt.py":221
 * 
 *     # Parse with cytimes
 *     try:             # <<<<<<<<<<<<<<
 *         tz = utils.tz_parse(tz)
 *         tz_repl = utils.UTC if tz is None else tz
 */
  {
    __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:*/ {

      /* "cytimes/pddt.py":222
 *     # Parse with cytimes
 *     try:
 *         tz = utils.tz_parse(tz)             # <<<<<<<<<<<<<<
 *         tz_repl = utils.UTC if tz is None else tz
 *         arr: np.ndarray = np.PyArray_EMPTY(1, [arr_size], np.NPY_TYPES.NPY_INT64, 0)
 */
      __pyx_t_5 = __pyx_f_7cytimes_5utils_tz_parse(__pyx_v_tz); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "cytimes/pddt.py":223
 *     try:
 *         tz = utils.tz_parse(tz)
 *         tz_repl = utils.UTC if tz is None else tz             # <<<<<<<<<<<<<<
 *         arr: np.ndarray = np.PyArray_EMPTY(1, [arr_size], np.NPY_TYPES.NPY_INT64, 0)
 *         arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 */
      __pyx_t_6 = (__pyx_v_tz == Py_None);
      if (__pyx_t_6) {
        __Pyx_INCREF((PyObject *)__pyx_v_7cytimes_5utils_UTC);
        __pyx_t_5 = ((PyObject *)__pyx_v_7cytimes_5utils_UTC);
      } else {
        __Pyx_INCREF(__pyx_v_tz);
        __pyx_t_5 = __pyx_v_tz;
      }
      __pyx_v_tz_repl = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "cytimes/pddt.py":224
 *         tz = utils.tz_parse(tz)
 *         tz_repl = utils.UTC if tz is None else tz
 *         arr: np.ndarray = np.PyArray_EMPTY(1, [arr_size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *         arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 *         i: cython.Py_ssize_t = 0
 */
      __pyx_t_7[0] = __pyx_v_arr_size;
      __pyx_t_5 = PyArray_EMPTY(1, __pyx_t_7, NPY_INT64, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 224, __pyx_L3_error)
      __pyx_v_arr = ((PyArrayObject *)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "cytimes/pddt.py":225
 *         tz_repl = utils.UTC if tz is None else tz
 *         arr: np.ndarray = np.PyArray_EMPTY(1, [arr_size], np.NPY_TYPES.NPY_INT64, 0)
 *         arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))             # <<<<<<<<<<<<<<
 *         i: cython.Py_ssize_t = 0
 *         for item in data:
 */
      __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

      /* "cytimes/pddt.py":226
 *         arr: np.ndarray = np.PyArray_EMPTY(1, [arr_size], np.NPY_TYPES.NPY_INT64, 0)
 *         arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 *         i: cython.Py_ssize_t = 0             # <<<<<<<<<<<<<<
 *         for item in data:
 *             dt: datetime.datetime = _parse(
 */
      __pyx_v_i = 0;

      /* "cytimes/pddt.py":227
 *         arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 *         i: cython.Py_ssize_t = 0
 *         for item in data:             # <<<<<<<<<<<<<<
 *             dt: datetime.datetime = _parse(
 *                 item, None, year1st, day1st, False, True, cfg
 */
      if (likely(PyList_CheckExact(__pyx_v_data)) || PyTuple_CheckExact(__pyx_v_data)) {
        __pyx_t_5 = __pyx_v_data; __Pyx_INCREF(__pyx_t_5);
        __pyx_t_1 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_1 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 227, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 227, __pyx_L3_error)
      }
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 227, __pyx_L3_error)
              #endif
              if (__pyx_t_1 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_9 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_9); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 227, __pyx_L3_error)
            #else
            __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 227, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 227, __pyx_L3_error)
              #endif
              if (__pyx_t_1 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_9); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 227, __pyx_L3_error)
            #else
            __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 227, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            #endif
          }
        } else {
          __pyx_t_9 = __pyx_t_8(__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, 227, __pyx_L3_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_9);
        }
        __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_9);
        __pyx_t_9 = 0;

        /* "cytimes/pddt.py":228
 *         i: cython.Py_ssize_t = 0
 *         for item in data:
 *             dt: datetime.datetime = _parse(             # <<<<<<<<<<<<<<
 *                 item, None, year1st, day1st, False, True, cfg
 *             )
 */
        __pyx_t_10.__pyx_n = 6;
        __pyx_t_10.__pyx_default = Py_None;
        __pyx_t_10.year1st = __pyx_v_year1st;
        __pyx_t_10.day1st = __pyx_v_day1st;
        __pyx_t_10.ignoretz = 0;
        __pyx_t_10.isoformat = 1;
        __pyx_t_10.cfg = __pyx_v_cfg;
        __pyx_t_9 = ((PyObject *)__pyx_f_7cytimes_6parser_parse_dtobj(__pyx_v_item, 0, &__pyx_t_10)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 228, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_9));
        __pyx_t_9 = 0;

        /* "cytimes/pddt.py":231
 *                 item, None, year1st, day1st, False, True, cfg
 *             )
 *             if dt.tzinfo is not None:             # <<<<<<<<<<<<<<
 *                 dt = utils.dt_astimezone(dt, tz_repl)
 *                 if tz is None:
 */
        __pyx_t_9 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 231, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_6 = (__pyx_t_9 != Py_None);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_6) {

          /* "cytimes/pddt.py":232
 *             )
 *             if dt.tzinfo is not None:
 *                 dt = utils.dt_astimezone(dt, tz_repl)             # <<<<<<<<<<<<<<
 *                 if tz is None:
 *                     tz = utils.UTC
 */
          __pyx_t_11.__pyx_n = 1;
          __pyx_t_11.tz = __pyx_v_tz_repl;
          __pyx_t_9 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_astimezone(__pyx_v_dt, &__pyx_t_11)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 232, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_9));
          __pyx_t_9 = 0;

          /* "cytimes/pddt.py":233
 *             if dt.tzinfo is not None:
 *                 dt = utils.dt_astimezone(dt, tz_repl)
 *                 if tz is None:             # <<<<<<<<<<<<<<
 *                     tz = utils.UTC
 *             arr_ptr[i] = utils.dt_to_us(dt, False)
 */
          __pyx_t_6 = (__pyx_v_tz == Py_None);
          if (__pyx_t_6) {

            /* "cytimes/pddt.py":234
 *                 dt = utils.dt_astimezone(dt, tz_repl)
 *                 if tz is None:
 *                     tz = utils.UTC             # <<<<<<<<<<<<<<
 *             arr_ptr[i] = utils.dt_to_us(dt, False)
 *             i += 1
 */
            __Pyx_INCREF((PyObject *)__pyx_v_7cytimes_5utils_UTC);
            __Pyx_DECREF_SET(__pyx_v_tz, ((PyObject *)__pyx_v_7cytimes_5utils_UTC));

            /* "cytimes/pddt.py":233
 *             if dt.tzinfo is not None:
 *                 dt = utils.dt_astimezone(dt, tz_repl)
 *                 if tz is None:             # <<<<<<<<<<<<<<
 *                     tz = utils.UTC
 *             arr_ptr[i] = utils.dt_to_us(dt, False)
 */
          }

          /* "cytimes/pddt.py":231
 *                 item, None, year1st, day1st, False, True, cfg
 *             )
 *             if dt.tzinfo is not None:             # <<<<<<<<<<<<<<
 *                 dt = utils.dt_astimezone(dt, tz_repl)
 *                 if tz is None:
 */
        }

        /* "cytimes/pddt.py":235
 *                 if tz is None:
 *                     tz = utils.UTC
 *             arr_ptr[i] = utils.dt_to_us(dt, False)             # <<<<<<<<<<<<<<
 *             i += 1
 *         arr = arr.astype("datetime64[us]")
 */
        __pyx_t_13.__pyx_n = 1;
        __pyx_t_13.utc = 0;
        __pyx_t_12 = __pyx_f_7cytimes_5utils_dt_to_us(__pyx_v_dt, &__pyx_t_13); if (unlikely(__pyx_t_12 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 235, __pyx_L3_error)
        (__pyx_v_arr_ptr[__pyx_v_i]) = __pyx_t_12;

        /* "cytimes/pddt.py":236
 *                     tz = utils.UTC
 *             arr_ptr[i] = utils.dt_to_us(dt, False)
 *             i += 1             # <<<<<<<<<<<<<<
 *         arr = arr.astype("datetime64[us]")
 *     except errors.ParserError as err:
 */
        __pyx_v_i = (__pyx_v_i + 1);

        /* "cytimes/pddt.py":227
 *         arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 *         i: cython.Py_ssize_t = 0
 *         for item in data:             # <<<<<<<<<<<<<<
 *             dt: datetime.datetime = _parse(
 *                 item, None, year1st, day1st, False, True, cfg
 */
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cytimes/pddt.py":237
 *             arr_ptr[i] = utils.dt_to_us(dt, False)
 *             i += 1
 *         arr = arr.astype("datetime64[us]")             # <<<<<<<<<<<<<<
 *     except errors.ParserError as err:
 *         raise errors.InvalidArgumentError(err) from err
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 237, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_14 = NULL;
      __pyx_t_15 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_14)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_14);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_15 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_kp_u_datetime64_us};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15);
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 237, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 237, __pyx_L3_error)
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "cytimes/pddt.py":221
 * 
 *     # Parse with cytimes
 *     try:             # <<<<<<<<<<<<<<
 *         tz = utils.tz_parse(tz)
 *         tz_repl = utils.UTC if tz is None else tz
 */
    }
    __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_14); __pyx_t_14 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cytimes/pddt.py":238
 *             i += 1
 *         arr = arr.astype("datetime64[us]")
 *     except errors.ParserError as err:             # <<<<<<<<<<<<<<
 *         raise errors.InvalidArgumentError(err) from err
 *     except errors.InvalidArgumentError:
 */
    __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_9, &__pyx_t_14);
    __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_errors); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 238, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_ParserError); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 238, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_17);
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __pyx_t_18 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_5, __pyx_t_17);
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_ErrRestore(__pyx_t_5, __pyx_t_9, __pyx_t_14);
    __pyx_t_5 = 0; __pyx_t_9 = 0; __pyx_t_14 = 0;
    if (__pyx_t_18) {
      __Pyx_AddTraceback("cytimes.pddt._pddt_new_cytimes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_9, &__pyx_t_5) < 0) __PYX_ERR(0, 238, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_9);
      __pyx_v_err = __pyx_t_9;
      /*try:*/ {

        /* "cytimes/pddt.py":239
 *         arr = arr.astype("datetime64[us]")
 *     except errors.ParserError as err:
 *         raise errors.InvalidArgumentError(err) from err             # <<<<<<<<<<<<<<
 *     except errors.InvalidArgumentError:
 *         raise
 */
        __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_errors); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 239, __pyx_L19_error)
        __Pyx_GOTREF(__pyx_t_16);
        __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 239, __pyx_L19_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __pyx_t_16 = NULL;
        __pyx_t_15 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_19))) {
          __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_19);
          if (likely(__pyx_t_16)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
            __Pyx_INCREF(__pyx_t_16);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_19, function);
            __pyx_t_15 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_v_err};
          __pyx_t_17 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15);
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 239, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        }
        __Pyx_Raise(__pyx_t_17, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __PYX_ERR(0, 239, __pyx_L19_error)
      }

      /* "cytimes/pddt.py":238
 *             i += 1
 *         arr = arr.astype("datetime64[us]")
 *     except errors.ParserError as err:             # <<<<<<<<<<<<<<
 *         raise errors.InvalidArgumentError(err) from err
 *     except errors.InvalidArgumentError:
 */
      /*finally:*/ {
        __pyx_L19_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0;
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
          __Pyx_XGOTREF(__pyx_t_22);
          __Pyx_XGOTREF(__pyx_t_23);
          __Pyx_XGOTREF(__pyx_t_24);
          __Pyx_XGOTREF(__pyx_t_25);
          __Pyx_XGOTREF(__pyx_t_26);
          __Pyx_XGOTREF(__pyx_t_27);
          __pyx_t_18 = __pyx_lineno; __pyx_t_20 = __pyx_clineno; __pyx_t_21 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_25);
            __Pyx_XGIVEREF(__pyx_t_26);
            __Pyx_XGIVEREF(__pyx_t_27);
            __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_26, __pyx_t_27);
          }
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_23);
          __Pyx_XGIVEREF(__pyx_t_24);
          __Pyx_ErrRestore(__pyx_t_22, __pyx_t_23, __pyx_t_24);
          __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0;
          __pyx_lineno = __pyx_t_18; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_21;
          goto __pyx_L5_except_error;
        }
      }
    }

    /* "cytimes/pddt.py":240
 *     except errors.ParserError as err:
 *         raise errors.InvalidArgumentError(err) from err
 *     except errors.InvalidArgumentError:             # <<<<<<<<<<<<<<
 *         raise
 *     except Exception as err:
 */
    __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_9, &__pyx_t_14);
    __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_errors); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 240, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_17);
    __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 240, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __pyx_t_20 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_5, __pyx_t_19);
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_ErrRestore(__pyx_t_5, __pyx_t_9, __pyx_t_14);
    __pyx_t_5 = 0; __pyx_t_9 = 0; __pyx_t_14 = 0;
    if (__pyx_t_20) {
      __Pyx_AddTraceback("cytimes.pddt._pddt_new_cytimes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_9, &__pyx_t_5) < 0) __PYX_ERR(0, 240, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_5);

      /* "cytimes/pddt.py":241
 *         raise errors.InvalidArgumentError(err) from err
 *     except errors.InvalidArgumentError:
 *         raise             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *         raise errors.InvalidArgumentError(err) from err
 */
      __Pyx_GIVEREF(__pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ErrRestoreWithState(__pyx_t_14, __pyx_t_9, __pyx_t_5);
      __pyx_t_14 = 0; __pyx_t_9 = 0; __pyx_t_5 = 0; 
      __PYX_ERR(0, 241, __pyx_L5_except_error)
    }

    /* "cytimes/pddt.py":242
 *     except errors.InvalidArgumentError:
 *         raise
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise errors.InvalidArgumentError(err) from err
 * 
 */
    __pyx_t_20 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_20) {
      __Pyx_AddTraceback("cytimes.pddt._pddt_new_cytimes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_14) < 0) __PYX_ERR(0, 242, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_INCREF(__pyx_t_9);
      __pyx_v_err = __pyx_t_9;
      /*try:*/ {

        /* "cytimes/pddt.py":243
 *         raise
 *     except Exception as err:
 *         raise errors.InvalidArgumentError(err) from err             # <<<<<<<<<<<<<<
 * 
 *     # New instance
 */
        __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_errors); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 243, __pyx_L32_error)
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 243, __pyx_L32_error)
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __pyx_t_17 = NULL;
        __pyx_t_15 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_16))) {
          __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16);
          if (likely(__pyx_t_17)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
            __Pyx_INCREF(__pyx_t_17);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_16, function);
            __pyx_t_15 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_v_err};
          __pyx_t_19 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15);
          __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
          if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 243, __pyx_L32_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        }
        __Pyx_Raise(__pyx_t_19, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __PYX_ERR(0, 243, __pyx_L32_error)
      }

      /* "cytimes/pddt.py":242
 *     except errors.InvalidArgumentError:
 *         raise
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise errors.InvalidArgumentError(err) from err
 * 
 */
      /*finally:*/ {
        __pyx_L32_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_27 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0;
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25) < 0)) __Pyx_ErrFetch(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25);
          __Pyx_XGOTREF(__pyx_t_27);
          __Pyx_XGOTREF(__pyx_t_26);
          __Pyx_XGOTREF(__pyx_t_25);
          __Pyx_XGOTREF(__pyx_t_24);
          __Pyx_XGOTREF(__pyx_t_23);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_20 = __pyx_lineno; __pyx_t_18 = __pyx_clineno; __pyx_t_28 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_24);
            __Pyx_XGIVEREF(__pyx_t_23);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_23, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_27);
          __Pyx_XGIVEREF(__pyx_t_26);
          __Pyx_XGIVEREF(__pyx_t_25);
          __Pyx_ErrRestore(__pyx_t_27, __pyx_t_26, __pyx_t_25);
          __pyx_t_27 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_20; __pyx_clineno = __pyx_t_18; __pyx_filename = __pyx_t_28;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/pddt.py":221
 * 
 *     # Parse with cytimes
 *     try:             # <<<<<<<<<<<<<<
 *         tz = utils.tz_parse(tz)
 *         tz_repl = utils.UTC if tz is None else tz
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "cytimes/pddt.py":246
 * 
 *     # New instance
 *     pt: Pddt = _pddt_new(arr, freq, None, ambiguous, False, False, name, False)             # <<<<<<<<<<<<<<
 *     # . apply timezone
 *     if tz is None:
 */
  __pyx_t_29.__pyx_n = 7;
  __pyx_t_29.freq = __pyx_v_freq;
  __pyx_t_29.tz = Py_None;
  __pyx_t_29.ambiguous = __pyx_v_ambiguous;
  __pyx_t_29.year1st = Py_False;
  __pyx_t_29.day1st = Py_False;
  __pyx_t_29.name = __pyx_v_name;
  __pyx_t_29.copy = Py_False;
  __pyx_t_14 = __pyx_f_7cytimes_4pddt__pddt_new(((PyObject *)__pyx_v_arr), &__pyx_t_29); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_v_pt = __pyx_t_14;
  __pyx_t_14 = 0;

  /* "cytimes/pddt.py":248
 *     pt: Pddt = _pddt_new(arr, freq, None, ambiguous, False, False, name, False)
 *     # . apply timezone
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         return pt
 *     return pt.tz_localize(tz, ambiguous, "shift_forward")
 */
  __pyx_t_6 = (__pyx_v_tz == Py_None);
  if (__pyx_t_6) {

    /* "cytimes/pddt.py":249
 *     # . apply timezone
 *     if tz is None:
 *         return pt             # <<<<<<<<<<<<<<
 *     return pt.tz_localize(tz, ambiguous, "shift_forward")
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_pt);
    __pyx_r = __pyx_v_pt;
    goto __pyx_L0;

    /* "cytimes/pddt.py":248
 *     pt: Pddt = _pddt_new(arr, freq, None, ambiguous, False, False, name, False)
 *     # . apply timezone
 *     if tz is None:             # <<<<<<<<<<<<<<
 *         return pt
 *     return pt.tz_localize(tz, ambiguous, "shift_forward")
 */
  }

  /* "cytimes/pddt.py":250
 *     if tz is None:
 *         return pt
 *     return pt.tz_localize(tz, ambiguous, "shift_forward")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt, __pyx_n_s_tz_localize); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_5 = NULL;
  __pyx_t_15 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(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_15 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_tz, __pyx_v_ambiguous, __pyx_n_u_shift_forward};
    __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_15, 3+__pyx_t_15);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __pyx_r = __pyx_t_14;
  __pyx_t_14 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":198
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def _pddt_new_cytimes(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("cytimes.pddt._pddt_new_cytimes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tz_repl);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF((PyObject *)__pyx_v_dt);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XDECREF(__pyx_v_pt);
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":253
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def _pddt_fr_dt(
 */

static PyObject *__pyx_f_7cytimes_4pddt__pddt_fr_dt(PyDateTime_DateTime *__pyx_v_dt, Py_ssize_t __pyx_v_size, struct __pyx_opt_args_7cytimes_4pddt__pddt_fr_dt *__pyx_optional_args) {

  /* "cytimes/pddt.py":258
 *     dt: datetime.datetime,
 *     size: cython.Py_ssize_t,
 *     unit: str = None,             # <<<<<<<<<<<<<<
 *     name: Hashable | None = None,
 * ) -> object:
 */
  PyObject *__pyx_v_unit = ((PyObject*)Py_None);

  /* "cytimes/pddt.py":259
 *     size: cython.Py_ssize_t,
 *     unit: str = None,
 *     name: Hashable | None = None,             # <<<<<<<<<<<<<<
 * ) -> object:
 *     """(internal) Construct a new Pddt instance from
 */
  PyObject *__pyx_v_name = ((PyObject *)Py_None);
  PY_LONG_LONG __pyx_v_us;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PY_LONG_LONG __pyx_t_1;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_us __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  struct __pyx_opt_args_7cytimes_4pddt__pddt_fr_us __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_pddt_fr_dt", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_unit = __pyx_optional_args->unit;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_name = __pyx_optional_args->name;
      }
    }
  }

  /* "cytimes/pddt.py":264
 *     an instance of datetime `<'Pddt'>`.
 *     """
 *     us = utils.dt_to_us(dt, False)             # <<<<<<<<<<<<<<
 *     return _pddt_fr_us(us, size, dt.tzinfo, unit, name)
 * 
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.utc = 0;
  __pyx_t_1 = __pyx_f_7cytimes_5utils_dt_to_us(__pyx_v_dt, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L1_error)
  __pyx_v_us = __pyx_t_1;

  /* "cytimes/pddt.py":265
 *     """
 *     us = utils.dt_to_us(dt, False)
 *     return _pddt_fr_us(us, size, dt.tzinfo, unit, name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5.__pyx_n = 3;
  __pyx_t_5.tz = __pyx_t_3;
  __pyx_t_5.unit = __pyx_v_unit;
  __pyx_t_5.name = __pyx_v_name;
  __pyx_t_4 = __pyx_f_7cytimes_4pddt__pddt_fr_us(__pyx_v_us, __pyx_v_size, &__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __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;

  /* "cytimes/pddt.py":253
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def _pddt_fr_dt(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.pddt._pddt_fr_dt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":268
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def _pddt_fr_us(
 */

static PyObject *__pyx_f_7cytimes_4pddt__pddt_fr_us(PY_LONG_LONG __pyx_v_val, Py_ssize_t __pyx_v_size, struct __pyx_opt_args_7cytimes_4pddt__pddt_fr_us *__pyx_optional_args) {

  /* "cytimes/pddt.py":273
 *     val: cython.longlong,
 *     size: cython.Py_ssize_t,
 *     tz: datetime.tzinfo | None = None,             # <<<<<<<<<<<<<<
 *     unit: str = None,
 *     name: Hashable | None = None,
 */
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);

  /* "cytimes/pddt.py":274
 *     size: cython.Py_ssize_t,
 *     tz: datetime.tzinfo | None = None,
 *     unit: str = None,             # <<<<<<<<<<<<<<
 *     name: Hashable | None = None,
 * ) -> object:
 */
  PyObject *__pyx_v_unit = ((PyObject*)Py_None);

  /* "cytimes/pddt.py":275
 *     tz: datetime.tzinfo | None = None,
 *     unit: str = None,
 *     name: Hashable | None = None,             # <<<<<<<<<<<<<<
 * ) -> object:
 *     """(internal) Construct a new Pddt instance from
 */
  PyObject *__pyx_v_name = ((PyObject *)Py_None);
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_pddt_fr_us", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_unit = __pyx_optional_args->unit;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_name = __pyx_optional_args->name;
        }
      }
    }
  }

  /* "cytimes/pddt.py":280
 *     total microseconds since Unix Epoch `<'Pddt'>`.
 *     """
 *     arr: np.ndarray = utils.dt64arr_fr_int64(val, "us", size)             # <<<<<<<<<<<<<<
 *     return pddt_new_simple(arr, tz, unit, name)
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_fr_int64(__pyx_v_val, __pyx_n_u_us, __pyx_v_size)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":281
 *     """
 *     arr: np.ndarray = utils.dt64arr_fr_int64(val, "us", size)
 *     return pddt_new_simple(arr, tz, unit, name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.tz = __pyx_v_tz;
  __pyx_t_2.unit = __pyx_v_unit;
  __pyx_t_2.name = __pyx_v_name;
  __pyx_t_1 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":268
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def _pddt_fr_us(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.pddt._pddt_fr_us", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":284
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def _parse_dtobj(
 */

static PyDateTime_DateTime *__pyx_f_7cytimes_4pddt__parse_dtobj(PyObject *__pyx_v_dtobj, struct __pyx_opt_args_7cytimes_4pddt__parse_dtobj *__pyx_optional_args) {

  /* "cytimes/pddt.py":288
 * def _parse_dtobj(
 *     dtobj: object,
 *     default: object | None = None,             # <<<<<<<<<<<<<<
 *     year1st: bool | None = None,
 *     day1st: bool | None = None,
 */
  PyObject *__pyx_v_default = ((PyObject *)Py_None);

  /* "cytimes/pddt.py":289
 *     dtobj: object,
 *     default: object | None = None,
 *     year1st: bool | None = None,             # <<<<<<<<<<<<<<
 *     day1st: bool | None = None,
 *     ignoretz: cython.bint = False,
 */
  PyObject *__pyx_v_year1st = ((PyObject *)Py_None);

  /* "cytimes/pddt.py":290
 *     default: object | None = None,
 *     year1st: bool | None = None,
 *     day1st: bool | None = None,             # <<<<<<<<<<<<<<
 *     ignoretz: cython.bint = False,
 *     isoformat: cython.bint = True,
 */
  PyObject *__pyx_v_day1st = ((PyObject *)Py_None);

  /* "cytimes/pddt.py":291
 *     year1st: bool | None = None,
 *     day1st: bool | None = None,
 *     ignoretz: cython.bint = False,             # <<<<<<<<<<<<<<
 *     isoformat: cython.bint = True,
 *     cfg: Configs = None,
 */
  int __pyx_v_ignoretz = ((int)0);

  /* "cytimes/pddt.py":292
 *     day1st: bool | None = None,
 *     ignoretz: cython.bint = False,
 *     isoformat: cython.bint = True,             # <<<<<<<<<<<<<<
 *     cfg: Configs = None,
 * ) -> datetime.datetime:
 */
  int __pyx_v_isoformat = ((int)1);

  /* "cytimes/pddt.py":293
 *     ignoretz: cython.bint = False,
 *     isoformat: cython.bint = True,
 *     cfg: Configs = None,             # <<<<<<<<<<<<<<
 * ) -> datetime.datetime:
 *     """(internal) Parse datetime-like object into
 */
  struct __pyx_obj_7cytimes_6parser_Configs *__pyx_v_cfg = ((struct __pyx_obj_7cytimes_6parser_Configs *)Py_None);
  PyObject *__pyx_v_err = NULL;
  PyDateTime_DateTime *__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;
  struct __pyx_opt_args_7cytimes_6parser_parse_dtobj __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  unsigned int __pyx_t_12;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_parse_dtobj", 1);
  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_year1st = __pyx_optional_args->year1st;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_day1st = __pyx_optional_args->day1st;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_ignoretz = __pyx_optional_args->ignoretz;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_isoformat = __pyx_optional_args->isoformat;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_cfg = __pyx_optional_args->cfg;
              }
            }
          }
        }
      }
    }
  }

  /* "cytimes/pddt.py":301
 *     the 'cytimes.parser.parse_dtobj()' function.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *         return _parse(dtobj, default, year1st, day1st, ignoretz, isoformat, cfg)
 *     except Exception as err:
 */
  {
    __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:*/ {

      /* "cytimes/pddt.py":302
 *     """
 *     try:
 *         return _parse(dtobj, default, year1st, day1st, ignoretz, isoformat, cfg)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *         raise errors.InvalidArgumentError(err) from err
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_5.__pyx_n = 6;
      __pyx_t_5.__pyx_default = __pyx_v_default;
      __pyx_t_5.year1st = __pyx_v_year1st;
      __pyx_t_5.day1st = __pyx_v_day1st;
      __pyx_t_5.ignoretz = __pyx_v_ignoretz;
      __pyx_t_5.isoformat = __pyx_v_isoformat;
      __pyx_t_5.cfg = __pyx_v_cfg;
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_6parser_parse_dtobj(__pyx_v_dtobj, 0, &__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = ((PyDateTime_DateTime *)__pyx_t_4);
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "cytimes/pddt.py":301
 *     the 'cytimes.parser.parse_dtobj()' function.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *         return _parse(dtobj, default, year1st, day1st, ignoretz, isoformat, cfg)
 *     except Exception as err:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cytimes/pddt.py":303
 *     try:
 *         return _parse(dtobj, default, year1st, day1st, ignoretz, isoformat, cfg)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise errors.InvalidArgumentError(err) from err
 * 
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_6) {
      __Pyx_AddTraceback("cytimes.pddt._parse_dtobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 303, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_v_err = __pyx_t_7;
      /*try:*/ {

        /* "cytimes/pddt.py":304
 *         return _parse(dtobj, default, year1st, day1st, ignoretz, isoformat, cfg)
 *     except Exception as err:
 *         raise errors.InvalidArgumentError(err) from err             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_errors); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 304, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 304, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = NULL;
        __pyx_t_12 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_11))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_11, function);
            __pyx_t_12 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_err};
          __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 304, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        __Pyx_Raise(__pyx_t_9, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __PYX_ERR(0, 304, __pyx_L14_error)
      }

      /* "cytimes/pddt.py":303
 *     try:
 *         return _parse(dtobj, default, year1st, day1st, ignoretz, isoformat, cfg)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise errors.InvalidArgumentError(err) from err
 * 
 */
      /*finally:*/ {
        __pyx_L14_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_6 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/pddt.py":301
 *     the 'cytimes.parser.parse_dtobj()' function.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *         return _parse(dtobj, default, year1st, day1st, ignoretz, isoformat, cfg)
 *     except Exception as err:
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "cytimes/pddt.py":284
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def _parse_dtobj(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.pddt._parse_dtobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":307
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-2, check=False)
 */

static int __pyx_f_7cytimes_4pddt__parse_month(PyObject *__pyx_v_month, int __pyx_v_raise_error) {
  PY_LONG_LONG __pyx_v_num;
  PyObject *__pyx_v_mth = 0;
  PyObject *__pyx_v_val;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PY_LONG_LONG __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_parse_month", 1);

  /* "cytimes/pddt.py":325
 *     """
 *     # <'None'>
 *     if month is None:             # <<<<<<<<<<<<<<
 *         return -1  # exit
 * 
 */
  __pyx_t_1 = (__pyx_v_month == Py_None);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":326
 *     # <'None'>
 *     if month is None:
 *         return -1  # exit             # <<<<<<<<<<<<<<
 * 
 *     # <'int'>
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "cytimes/pddt.py":325
 *     """
 *     # <'None'>
 *     if month is None:             # <<<<<<<<<<<<<<
 *         return -1  # exit
 * 
 */
  }

  /* "cytimes/pddt.py":329
 * 
 *     # <'int'>
 *     if isinstance(month, int):             # <<<<<<<<<<<<<<
 *         num: cython.longlong = month
 *         if num == -1:
 */
  __pyx_t_1 = PyInt_Check(__pyx_v_month); 
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":330
 *     # <'int'>
 *     if isinstance(month, int):
 *         num: cython.longlong = month             # <<<<<<<<<<<<<<
 *         if num == -1:
 *             return -1  # exit
 */
    __pyx_t_2 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_v_month); if (unlikely((__pyx_t_2 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L1_error)
    __pyx_v_num = __pyx_t_2;

    /* "cytimes/pddt.py":331
 *     if isinstance(month, int):
 *         num: cython.longlong = month
 *         if num == -1:             # <<<<<<<<<<<<<<
 *             return -1  # exit
 *         if not 1 <= num <= 12:
 */
    __pyx_t_1 = (__pyx_v_num == -1LL);
    if (__pyx_t_1) {

      /* "cytimes/pddt.py":332
 *         num: cython.longlong = month
 *         if num == -1:
 *             return -1  # exit             # <<<<<<<<<<<<<<
 *         if not 1 <= num <= 12:
 *             if raise_error:
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "cytimes/pddt.py":331
 *     if isinstance(month, int):
 *         num: cython.longlong = month
 *         if num == -1:             # <<<<<<<<<<<<<<
 *             return -1  # exit
 *         if not 1 <= num <= 12:
 */
    }

    /* "cytimes/pddt.py":333
 *         if num == -1:
 *             return -1  # exit
 *         if not 1 <= num <= 12:             # <<<<<<<<<<<<<<
 *             if raise_error:
 *                 raise errors.InvalidMonthError(
 */
    __pyx_t_1 = (1 <= __pyx_v_num);
    if (__pyx_t_1) {
      __pyx_t_1 = (__pyx_v_num <= 12);
    }
    __pyx_t_3 = (!__pyx_t_1);
    if (__pyx_t_3) {

      /* "cytimes/pddt.py":334
 *             return -1  # exit
 *         if not 1 <= num <= 12:
 *             if raise_error:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidMonthError(
 *                     "invalid month number '%d', must betweem 1(Jan)...12(Dec)." % num
 */
      if (unlikely(__pyx_v_raise_error)) {

        /* "cytimes/pddt.py":335
 *         if not 1 <= num <= 12:
 *             if raise_error:
 *                 raise errors.InvalidMonthError(             # <<<<<<<<<<<<<<
 *                     "invalid month number '%d', must betweem 1(Jan)...12(Dec)." % num
 *                 )
 */
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_errors); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 335, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_InvalidMonthError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 335, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "cytimes/pddt.py":336
 *             if raise_error:
 *                 raise errors.InvalidMonthError(
 *                     "invalid month number '%d', must betweem 1(Jan)...12(Dec)." % num             # <<<<<<<<<<<<<<
 *                 )
 *             return -1  # exit
 */
        __pyx_t_5 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_num); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_invalid_month_number_d_must_betw, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 336, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        __pyx_t_8 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __PYX_ERR(0, 335, __pyx_L1_error)

        /* "cytimes/pddt.py":334
 *             return -1  # exit
 *         if not 1 <= num <= 12:
 *             if raise_error:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidMonthError(
 *                     "invalid month number '%d', must betweem 1(Jan)...12(Dec)." % num
 */
      }

      /* "cytimes/pddt.py":338
 *                     "invalid month number '%d', must betweem 1(Jan)...12(Dec)." % num
 *                 )
 *             return -1  # exit             # <<<<<<<<<<<<<<
 *         return num  # exit
 * 
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "cytimes/pddt.py":333
 *         if num == -1:
 *             return -1  # exit
 *         if not 1 <= num <= 12:             # <<<<<<<<<<<<<<
 *             if raise_error:
 *                 raise errors.InvalidMonthError(
 */
    }

    /* "cytimes/pddt.py":339
 *                 )
 *             return -1  # exit
 *         return num  # exit             # <<<<<<<<<<<<<<
 * 
 *     # <'str'>
 */
    __pyx_r = __pyx_v_num;
    goto __pyx_L0;

    /* "cytimes/pddt.py":329
 * 
 *     # <'int'>
 *     if isinstance(month, int):             # <<<<<<<<<<<<<<
 *         num: cython.longlong = month
 *         if num == -1:
 */
  }

  /* "cytimes/pddt.py":342
 * 
 *     # <'str'>
 *     if isinstance(month, str):             # <<<<<<<<<<<<<<
 *         mth: str = month
 *         val = dict_getitem(CONFIG_MONTH, mth.lower())
 */
  __pyx_t_3 = PyUnicode_Check(__pyx_v_month); 
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":343
 *     # <'str'>
 *     if isinstance(month, str):
 *         mth: str = month             # <<<<<<<<<<<<<<
 *         val = dict_getitem(CONFIG_MONTH, mth.lower())
 *         if val == cython.NULL:
 */
    if (!(likely(PyUnicode_CheckExact(__pyx_v_month))||((__pyx_v_month) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_month))) __PYX_ERR(0, 343, __pyx_L1_error)
    __pyx_t_4 = __pyx_v_month;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_mth = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":344
 *     if isinstance(month, str):
 *         mth: str = month
 *         val = dict_getitem(CONFIG_MONTH, mth.lower())             # <<<<<<<<<<<<<<
 *         if val == cython.NULL:
 *             if raise_error:
 */
    __pyx_t_4 = __pyx_v_7cytimes_6parser_CONFIG_MONTH;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyUnicode_Type_lower, __pyx_v_mth); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_v_val = PyDict_GetItem(__pyx_t_4, __pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cytimes/pddt.py":345
 *         mth: str = month
 *         val = dict_getitem(CONFIG_MONTH, mth.lower())
 *         if val == cython.NULL:             # <<<<<<<<<<<<<<
 *             if raise_error:
 *                 raise errors.InvalidMonthError("invalid month name '%s'." % mth)
 */
    __pyx_t_3 = (__pyx_v_val == NULL);
    if (__pyx_t_3) {

      /* "cytimes/pddt.py":346
 *         val = dict_getitem(CONFIG_MONTH, mth.lower())
 *         if val == cython.NULL:
 *             if raise_error:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidMonthError("invalid month name '%s'." % mth)
 *             return -1  # eixt
 */
      if (unlikely(__pyx_v_raise_error)) {

        /* "cytimes/pddt.py":347
 *         if val == cython.NULL:
 *             if raise_error:
 *                 raise errors.InvalidMonthError("invalid month name '%s'." % mth)             # <<<<<<<<<<<<<<
 *             return -1  # eixt
 *         return cython.cast(object, val)  # exit
 */
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InvalidMonthError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 347, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_invalid_month_name_s, __pyx_v_mth); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = NULL;
        __pyx_t_8 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
            __pyx_t_8 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 347, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_Raise(__pyx_t_6, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __PYX_ERR(0, 347, __pyx_L1_error)

        /* "cytimes/pddt.py":346
 *         val = dict_getitem(CONFIG_MONTH, mth.lower())
 *         if val == cython.NULL:
 *             if raise_error:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidMonthError("invalid month name '%s'." % mth)
 *             return -1  # eixt
 */
      }

      /* "cytimes/pddt.py":348
 *             if raise_error:
 *                 raise errors.InvalidMonthError("invalid month name '%s'." % mth)
 *             return -1  # eixt             # <<<<<<<<<<<<<<
 *         return cython.cast(object, val)  # exit
 * 
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "cytimes/pddt.py":345
 *         mth: str = month
 *         val = dict_getitem(CONFIG_MONTH, mth.lower())
 *         if val == cython.NULL:             # <<<<<<<<<<<<<<
 *             if raise_error:
 *                 raise errors.InvalidMonthError("invalid month name '%s'." % mth)
 */
    }

    /* "cytimes/pddt.py":349
 *                 raise errors.InvalidMonthError("invalid month name '%s'." % mth)
 *             return -1  # eixt
 *         return cython.cast(object, val)  # exit             # <<<<<<<<<<<<<<
 * 
 *     # Invalid
 */
    __pyx_t_9 = __Pyx_PyInt_As_int(((PyObject *)__pyx_v_val)); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 349, __pyx_L1_error)
    __pyx_r = __pyx_t_9;
    goto __pyx_L0;

    /* "cytimes/pddt.py":342
 * 
 *     # <'str'>
 *     if isinstance(month, str):             # <<<<<<<<<<<<<<
 *         mth: str = month
 *         val = dict_getitem(CONFIG_MONTH, mth.lower())
 */
  }

  /* "cytimes/pddt.py":352
 * 
 *     # Invalid
 *     if raise_error:             # <<<<<<<<<<<<<<
 *         raise errors.InvalidMonthError(
 *             "unsupported month value type %s, expects <'str/int'>." % type(month)
 */
  if (unlikely(__pyx_v_raise_error)) {

    /* "cytimes/pddt.py":353
 *     # Invalid
 *     if raise_error:
 *         raise errors.InvalidMonthError(             # <<<<<<<<<<<<<<
 *             "unsupported month value type %s, expects <'str/int'>." % type(month)
 *         )
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_errors); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_InvalidMonthError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cytimes/pddt.py":354
 *     if raise_error:
 *         raise errors.InvalidMonthError(
 *             "unsupported month value type %s, expects <'str/int'>." % type(month)             # <<<<<<<<<<<<<<
 *         )
 *     return -1
 */
    __pyx_t_7 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unsupported_month_value_type_s_e, ((PyObject *)Py_TYPE(__pyx_v_month))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 353, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(0, 353, __pyx_L1_error)

    /* "cytimes/pddt.py":352
 * 
 *     # Invalid
 *     if raise_error:             # <<<<<<<<<<<<<<
 *         raise errors.InvalidMonthError(
 *             "unsupported month value type %s, expects <'str/int'>." % type(month)
 */
  }

  /* "cytimes/pddt.py":356
 *             "unsupported month value type %s, expects <'str/int'>." % type(month)
 *         )
 *     return -1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = -1;
  goto __pyx_L0;

  /* "cytimes/pddt.py":307
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-2, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytimes.pddt._parse_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -2;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_mth);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":359
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-2, check=False)
 */

static int __pyx_f_7cytimes_4pddt__parse_weekday(PyObject *__pyx_v_weekday, int __pyx_v_raise_error) {
  PY_LONG_LONG __pyx_v_num;
  PyObject *__pyx_v_wkd = 0;
  PyObject *__pyx_v_val;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PY_LONG_LONG __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_parse_weekday", 1);

  /* "cytimes/pddt.py":377
 *     """
 *     # <'None'>
 *     if weekday is None:             # <<<<<<<<<<<<<<
 *         return -1
 * 
 */
  __pyx_t_1 = (__pyx_v_weekday == Py_None);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":378
 *     # <'None'>
 *     if weekday is None:
 *         return -1             # <<<<<<<<<<<<<<
 * 
 *     # <'int'>
 */
    __pyx_r = -1;
    goto __pyx_L0;

    /* "cytimes/pddt.py":377
 *     """
 *     # <'None'>
 *     if weekday is None:             # <<<<<<<<<<<<<<
 *         return -1
 * 
 */
  }

  /* "cytimes/pddt.py":381
 * 
 *     # <'int'>
 *     if isinstance(weekday, int):             # <<<<<<<<<<<<<<
 *         num: cython.longlong = weekday
 *         if num == -1:
 */
  __pyx_t_1 = PyInt_Check(__pyx_v_weekday); 
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":382
 *     # <'int'>
 *     if isinstance(weekday, int):
 *         num: cython.longlong = weekday             # <<<<<<<<<<<<<<
 *         if num == -1:
 *             return -1  # exit
 */
    __pyx_t_2 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_v_weekday); if (unlikely((__pyx_t_2 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 382, __pyx_L1_error)
    __pyx_v_num = __pyx_t_2;

    /* "cytimes/pddt.py":383
 *     if isinstance(weekday, int):
 *         num: cython.longlong = weekday
 *         if num == -1:             # <<<<<<<<<<<<<<
 *             return -1  # exit
 *         if not 0 <= num <= 6:
 */
    __pyx_t_1 = (__pyx_v_num == -1LL);
    if (__pyx_t_1) {

      /* "cytimes/pddt.py":384
 *         num: cython.longlong = weekday
 *         if num == -1:
 *             return -1  # exit             # <<<<<<<<<<<<<<
 *         if not 0 <= num <= 6:
 *             if raise_error:
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "cytimes/pddt.py":383
 *     if isinstance(weekday, int):
 *         num: cython.longlong = weekday
 *         if num == -1:             # <<<<<<<<<<<<<<
 *             return -1  # exit
 *         if not 0 <= num <= 6:
 */
    }

    /* "cytimes/pddt.py":385
 *         if num == -1:
 *             return -1  # exit
 *         if not 0 <= num <= 6:             # <<<<<<<<<<<<<<
 *             if raise_error:
 *                 raise errors.InvalidWeekdayError(
 */
    __pyx_t_1 = (0 <= __pyx_v_num);
    if (__pyx_t_1) {
      __pyx_t_1 = (__pyx_v_num <= 6);
    }
    __pyx_t_3 = (!__pyx_t_1);
    if (__pyx_t_3) {

      /* "cytimes/pddt.py":386
 *             return -1  # exit
 *         if not 0 <= num <= 6:
 *             if raise_error:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidWeekdayError(
 *                     "invalid weekday number '%d', must betweem 0(Mon)...6(Sun)." % num
 */
      if (unlikely(__pyx_v_raise_error)) {

        /* "cytimes/pddt.py":387
 *         if not 0 <= num <= 6:
 *             if raise_error:
 *                 raise errors.InvalidWeekdayError(             # <<<<<<<<<<<<<<
 *                     "invalid weekday number '%d', must betweem 0(Mon)...6(Sun)." % num
 *                 )
 */
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_errors); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 387, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_InvalidWeekdayError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "cytimes/pddt.py":388
 *             if raise_error:
 *                 raise errors.InvalidWeekdayError(
 *                     "invalid weekday number '%d', must betweem 0(Mon)...6(Sun)." % num             # <<<<<<<<<<<<<<
 *                 )
 *             return -1
 */
        __pyx_t_5 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_num); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 388, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_invalid_weekday_number_d_must_be, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 388, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        __pyx_t_8 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __PYX_ERR(0, 387, __pyx_L1_error)

        /* "cytimes/pddt.py":386
 *             return -1  # exit
 *         if not 0 <= num <= 6:
 *             if raise_error:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidWeekdayError(
 *                     "invalid weekday number '%d', must betweem 0(Mon)...6(Sun)." % num
 */
      }

      /* "cytimes/pddt.py":390
 *                     "invalid weekday number '%d', must betweem 0(Mon)...6(Sun)." % num
 *                 )
 *             return -1             # <<<<<<<<<<<<<<
 *         return num  # exit
 * 
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "cytimes/pddt.py":385
 *         if num == -1:
 *             return -1  # exit
 *         if not 0 <= num <= 6:             # <<<<<<<<<<<<<<
 *             if raise_error:
 *                 raise errors.InvalidWeekdayError(
 */
    }

    /* "cytimes/pddt.py":391
 *                 )
 *             return -1
 *         return num  # exit             # <<<<<<<<<<<<<<
 * 
 *     # <'str'>
 */
    __pyx_r = __pyx_v_num;
    goto __pyx_L0;

    /* "cytimes/pddt.py":381
 * 
 *     # <'int'>
 *     if isinstance(weekday, int):             # <<<<<<<<<<<<<<
 *         num: cython.longlong = weekday
 *         if num == -1:
 */
  }

  /* "cytimes/pddt.py":394
 * 
 *     # <'str'>
 *     if isinstance(weekday, str):             # <<<<<<<<<<<<<<
 *         wkd: str = weekday
 *         val = dict_getitem(CONFIG_WEEKDAY, wkd.lower())
 */
  __pyx_t_3 = PyUnicode_Check(__pyx_v_weekday); 
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":395
 *     # <'str'>
 *     if isinstance(weekday, str):
 *         wkd: str = weekday             # <<<<<<<<<<<<<<
 *         val = dict_getitem(CONFIG_WEEKDAY, wkd.lower())
 *         if val == cython.NULL:
 */
    if (!(likely(PyUnicode_CheckExact(__pyx_v_weekday))||((__pyx_v_weekday) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_weekday))) __PYX_ERR(0, 395, __pyx_L1_error)
    __pyx_t_4 = __pyx_v_weekday;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_wkd = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":396
 *     if isinstance(weekday, str):
 *         wkd: str = weekday
 *         val = dict_getitem(CONFIG_WEEKDAY, wkd.lower())             # <<<<<<<<<<<<<<
 *         if val == cython.NULL:
 *             if raise_error:
 */
    __pyx_t_4 = __pyx_v_7cytimes_6parser_CONFIG_WEEKDAY;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyUnicode_Type_lower, __pyx_v_wkd); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 396, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_v_val = PyDict_GetItem(__pyx_t_4, __pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cytimes/pddt.py":397
 *         wkd: str = weekday
 *         val = dict_getitem(CONFIG_WEEKDAY, wkd.lower())
 *         if val == cython.NULL:             # <<<<<<<<<<<<<<
 *             if raise_error:
 *                 raise errors.InvalidWeekdayError("invalid weekday name '%s'." % wkd)
 */
    __pyx_t_3 = (__pyx_v_val == NULL);
    if (__pyx_t_3) {

      /* "cytimes/pddt.py":398
 *         val = dict_getitem(CONFIG_WEEKDAY, wkd.lower())
 *         if val == cython.NULL:
 *             if raise_error:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidWeekdayError("invalid weekday name '%s'." % wkd)
 *             return -1
 */
      if (unlikely(__pyx_v_raise_error)) {

        /* "cytimes/pddt.py":399
 *         if val == cython.NULL:
 *             if raise_error:
 *                 raise errors.InvalidWeekdayError("invalid weekday name '%s'." % wkd)             # <<<<<<<<<<<<<<
 *             return -1
 *         return cython.cast(object, val)  # exit
 */
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InvalidWeekdayError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_invalid_weekday_name_s, __pyx_v_wkd); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = NULL;
        __pyx_t_8 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
            __pyx_t_8 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_Raise(__pyx_t_6, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __PYX_ERR(0, 399, __pyx_L1_error)

        /* "cytimes/pddt.py":398
 *         val = dict_getitem(CONFIG_WEEKDAY, wkd.lower())
 *         if val == cython.NULL:
 *             if raise_error:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidWeekdayError("invalid weekday name '%s'." % wkd)
 *             return -1
 */
      }

      /* "cytimes/pddt.py":400
 *             if raise_error:
 *                 raise errors.InvalidWeekdayError("invalid weekday name '%s'." % wkd)
 *             return -1             # <<<<<<<<<<<<<<
 *         return cython.cast(object, val)  # exit
 * 
 */
      __pyx_r = -1;
      goto __pyx_L0;

      /* "cytimes/pddt.py":397
 *         wkd: str = weekday
 *         val = dict_getitem(CONFIG_WEEKDAY, wkd.lower())
 *         if val == cython.NULL:             # <<<<<<<<<<<<<<
 *             if raise_error:
 *                 raise errors.InvalidWeekdayError("invalid weekday name '%s'." % wkd)
 */
    }

    /* "cytimes/pddt.py":401
 *                 raise errors.InvalidWeekdayError("invalid weekday name '%s'." % wkd)
 *             return -1
 *         return cython.cast(object, val)  # exit             # <<<<<<<<<<<<<<
 * 
 *     # Invalid
 */
    __pyx_t_9 = __Pyx_PyInt_As_int(((PyObject *)__pyx_v_val)); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 401, __pyx_L1_error)
    __pyx_r = __pyx_t_9;
    goto __pyx_L0;

    /* "cytimes/pddt.py":394
 * 
 *     # <'str'>
 *     if isinstance(weekday, str):             # <<<<<<<<<<<<<<
 *         wkd: str = weekday
 *         val = dict_getitem(CONFIG_WEEKDAY, wkd.lower())
 */
  }

  /* "cytimes/pddt.py":404
 * 
 *     # Invalid
 *     if raise_error:             # <<<<<<<<<<<<<<
 *         raise errors.InvalidWeekdayError(
 *             "unsupported weekday value type %s, expects <'str/int'>." % type(weekday)
 */
  if (unlikely(__pyx_v_raise_error)) {

    /* "cytimes/pddt.py":405
 *     # Invalid
 *     if raise_error:
 *         raise errors.InvalidWeekdayError(             # <<<<<<<<<<<<<<
 *             "unsupported weekday value type %s, expects <'str/int'>." % type(weekday)
 *         )
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_errors); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_InvalidWeekdayError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cytimes/pddt.py":406
 *     if raise_error:
 *         raise errors.InvalidWeekdayError(
 *             "unsupported weekday value type %s, expects <'str/int'>." % type(weekday)             # <<<<<<<<<<<<<<
 *         )
 *     return -1
 */
    __pyx_t_7 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unsupported_weekday_value_type_s, ((PyObject *)Py_TYPE(__pyx_v_weekday))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(0, 405, __pyx_L1_error)

    /* "cytimes/pddt.py":404
 * 
 *     # Invalid
 *     if raise_error:             # <<<<<<<<<<<<<<
 *         raise errors.InvalidWeekdayError(
 *             "unsupported weekday value type %s, expects <'str/int'>." % type(weekday)
 */
  }

  /* "cytimes/pddt.py":408
 *             "unsupported weekday value type %s, expects <'str/int'>." % type(weekday)
 *         )
 *     return -1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = -1;
  goto __pyx_L0;

  /* "cytimes/pddt.py":359
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-2, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytimes.pddt._parse_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -2;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_wkd);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":411
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-2, check=False)
 */

static Py_ssize_t __pyx_f_7cytimes_4pddt__parse_arr_size(PyObject *__pyx_v_obj) {
  Py_ssize_t __pyx_v_size;
  PyObject *__pyx_v_err = NULL;
  Py_ssize_t __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;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  unsigned int __pyx_t_15;
  int __pyx_t_16;
  char const *__pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  char const *__pyx_t_24;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_parse_arr_size", 1);

  /* "cytimes/pddt.py":422
 *     """
 *     # int / str / float / bytes
 *     if isinstance(obj, (int, float, str, bytes)):             # <<<<<<<<<<<<<<
 *         try:
 *             size: cython.Py_ssize_t = int(obj)
 */
  __pyx_t_2 = PyInt_Check(__pyx_v_obj); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyFloat_Check(__pyx_v_obj); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyUnicode_Check(__pyx_v_obj); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyBytes_Check(__pyx_v_obj); 
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":423
 *     # int / str / float / bytes
 *     if isinstance(obj, (int, float, str, bytes)):
 *         try:             # <<<<<<<<<<<<<<
 *             size: cython.Py_ssize_t = int(obj)
 *         except Exception as err:
 */
    {
      __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:*/ {

        /* "cytimes/pddt.py":424
 *     if isinstance(obj, (int, float, str, bytes)):
 *         try:
 *             size: cython.Py_ssize_t = int(obj)             # <<<<<<<<<<<<<<
 *         except Exception as err:
 *             raise errors.InvalidTypeError(
 */
        __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_v_obj); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 424, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 424, __pyx_L8_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_size = __pyx_t_7;

        /* "cytimes/pddt.py":423
 *     # int / str / float / bytes
 *     if isinstance(obj, (int, float, str, bytes)):
 *         try:             # <<<<<<<<<<<<<<
 *             size: cython.Py_ssize_t = int(obj)
 *         except Exception as err:
 */
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L13_try_end;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cytimes/pddt.py":425
 *         try:
 *             size: cython.Py_ssize_t = int(obj)
 *         except Exception as err:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidTypeError(
 *                 "cannot convert '%s' to an integer to represent the array size." % obj
 */
      __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
      if (__pyx_t_8) {
        __Pyx_AddTraceback("cytimes.pddt._parse_arr_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 425, __pyx_L10_except_error)
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_v_err = __pyx_t_9;
        /*try:*/ {

          /* "cytimes/pddt.py":426
 *             size: cython.Py_ssize_t = int(obj)
 *         except Exception as err:
 *             raise errors.InvalidTypeError(             # <<<<<<<<<<<<<<
 *                 "cannot convert '%s' to an integer to represent the array size." % obj
 *             ) from err
 */
          __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_errors); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 426, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_InvalidTypeError); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 426, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

          /* "cytimes/pddt.py":427
 *         except Exception as err:
 *             raise errors.InvalidTypeError(
 *                 "cannot convert '%s' to an integer to represent the array size." % obj             # <<<<<<<<<<<<<<
 *             ) from err
 *     # Possible Array-like
 */
          __pyx_t_12 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_cannot_convert_s_to_an_integer_t, __pyx_v_obj); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 427, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_14 = NULL;
          __pyx_t_15 = 0;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_13))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_13, function);
              __pyx_t_15 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_12};
            __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15);
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 426, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          }

          /* "cytimes/pddt.py":428
 *             raise errors.InvalidTypeError(
 *                 "cannot convert '%s' to an integer to represent the array size." % obj
 *             ) from err             # <<<<<<<<<<<<<<
 *     # Possible Array-like
 *     else:
 */
          __Pyx_Raise(__pyx_t_11, 0, 0, __pyx_v_err);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __PYX_ERR(0, 426, __pyx_L19_error)
        }

        /* "cytimes/pddt.py":425
 *         try:
 *             size: cython.Py_ssize_t = int(obj)
 *         except Exception as err:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidTypeError(
 *                 "cannot convert '%s' to an integer to represent the array size." % obj
 */
        /*finally:*/ {
          __pyx_L19_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_22);
            __Pyx_XGOTREF(__pyx_t_23);
            __pyx_t_8 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
            }
            if (PY_MAJOR_VERSION >= 3) {
              __Pyx_XGIVEREF(__pyx_t_21);
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
            }
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ErrRestore(__pyx_t_18, __pyx_t_19, __pyx_t_20);
            __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
            __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17;
            goto __pyx_L10_except_error;
          }
        }
      }
      goto __pyx_L10_except_error;

      /* "cytimes/pddt.py":423
 *     # int / str / float / bytes
 *     if isinstance(obj, (int, float, str, bytes)):
 *         try:             # <<<<<<<<<<<<<<
 *             size: cython.Py_ssize_t = int(obj)
 *         except Exception as err:
 */
      __pyx_L10_except_error:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L1_error;
      __pyx_L13_try_end:;
    }

    /* "cytimes/pddt.py":422
 *     """
 *     # int / str / float / bytes
 *     if isinstance(obj, (int, float, str, bytes)):             # <<<<<<<<<<<<<<
 *         try:
 *             size: cython.Py_ssize_t = int(obj)
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":431
 *     # Possible Array-like
 *     else:
 *         try:             # <<<<<<<<<<<<<<
 *             size: cython.Py_ssize_t = len(obj)
 *         except Exception as err:
 */
  /*else*/ {
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_3);
      /*try:*/ {

        /* "cytimes/pddt.py":432
 *     else:
 *         try:
 *             size: cython.Py_ssize_t = len(obj)             # <<<<<<<<<<<<<<
 *         except Exception as err:
 *             raise errors.InvalidTypeError(
 */
        __pyx_t_7 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 432, __pyx_L25_error)
        __pyx_v_size = __pyx_t_7;

        /* "cytimes/pddt.py":431
 *     # Possible Array-like
 *     else:
 *         try:             # <<<<<<<<<<<<<<
 *             size: cython.Py_ssize_t = len(obj)
 *         except Exception as err:
 */
      }
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L30_try_end;
      __pyx_L25_error:;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "cytimes/pddt.py":433
 *         try:
 *             size: cython.Py_ssize_t = len(obj)
 *         except Exception as err:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidTypeError(
 *                 "cannot get the length of %s to represent the array size." % type(obj)
 */
      __pyx_t_16 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
      if (__pyx_t_16) {
        __Pyx_AddTraceback("cytimes.pddt._parse_arr_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_9, &__pyx_t_6) < 0) __PYX_ERR(0, 433, __pyx_L27_except_error)
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_v_err = __pyx_t_9;
        /*try:*/ {

          /* "cytimes/pddt.py":434
 *             size: cython.Py_ssize_t = len(obj)
 *         except Exception as err:
 *             raise errors.InvalidTypeError(             # <<<<<<<<<<<<<<
 *                 "cannot get the length of %s to represent the array size." % type(obj)
 *             ) from err
 */
          __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_errors); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 434, __pyx_L36_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_InvalidTypeError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 434, __pyx_L36_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

          /* "cytimes/pddt.py":435
 *         except Exception as err:
 *             raise errors.InvalidTypeError(
 *                 "cannot get the length of %s to represent the array size." % type(obj)             # <<<<<<<<<<<<<<
 *             ) from err
 *     # Validate size
 */
          __pyx_t_13 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_cannot_get_the_length_of_s_to_re, ((PyObject *)Py_TYPE(__pyx_v_obj))); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 435, __pyx_L36_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_14 = NULL;
          __pyx_t_15 = 0;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
              __pyx_t_15 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_13};
            __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15);
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 434, __pyx_L36_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          }

          /* "cytimes/pddt.py":436
 *             raise errors.InvalidTypeError(
 *                 "cannot get the length of %s to represent the array size." % type(obj)
 *             ) from err             # <<<<<<<<<<<<<<
 *     # Validate size
 *     if size < 1:
 */
          __Pyx_Raise(__pyx_t_11, 0, 0, __pyx_v_err);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __PYX_ERR(0, 434, __pyx_L36_error)
        }

        /* "cytimes/pddt.py":433
 *         try:
 *             size: cython.Py_ssize_t = len(obj)
 *         except Exception as err:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidTypeError(
 *                 "cannot get the length of %s to represent the array size." % type(obj)
 */
        /*finally:*/ {
          __pyx_L36_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18);
            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_23);
            __Pyx_XGOTREF(__pyx_t_22);
            __Pyx_XGOTREF(__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_18);
            __pyx_t_16 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_24 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
            }
            if (PY_MAJOR_VERSION >= 3) {
              __Pyx_XGIVEREF(__pyx_t_20);
              __Pyx_XGIVEREF(__pyx_t_19);
              __Pyx_XGIVEREF(__pyx_t_18);
              __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
            }
            __Pyx_XGIVEREF(__pyx_t_23);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ErrRestore(__pyx_t_23, __pyx_t_22, __pyx_t_21);
            __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
            __pyx_lineno = __pyx_t_16; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_24;
            goto __pyx_L27_except_error;
          }
        }
      }
      goto __pyx_L27_except_error;

      /* "cytimes/pddt.py":431
 *     # Possible Array-like
 *     else:
 *         try:             # <<<<<<<<<<<<<<
 *             size: cython.Py_ssize_t = len(obj)
 *         except Exception as err:
 */
      __pyx_L27_except_error:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
      goto __pyx_L1_error;
      __pyx_L30_try_end:;
    }
  }
  __pyx_L3:;

  /* "cytimes/pddt.py":438
 *             ) from err
 *     # Validate size
 *     if size < 1:             # <<<<<<<<<<<<<<
 *         raise errors.InvalidArgumentError(
 *             "array size must be and integer > 0, instead got '%d'." % size
 */
  __pyx_t_1 = (__pyx_v_size < 1);
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/pddt.py":439
 *     # Validate size
 *     if size < 1:
 *         raise errors.InvalidArgumentError(             # <<<<<<<<<<<<<<
 *             "array size must be and integer > 0, instead got '%d'." % size
 *         )
 */
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_errors); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 439, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 439, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cytimes/pddt.py":440
 *     if size < 1:
 *         raise errors.InvalidArgumentError(
 *             "array size must be and integer > 0, instead got '%d'." % size             # <<<<<<<<<<<<<<
 *         )
 *     return size
 */
    __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_11 = PyUnicode_Format(__pyx_kp_u_array_size_must_be_and_integer_0, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = NULL;
    __pyx_t_15 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
        __pyx_t_15 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_11};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 439, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(0, 439, __pyx_L1_error)

    /* "cytimes/pddt.py":438
 *             ) from err
 *     # Validate size
 *     if size < 1:             # <<<<<<<<<<<<<<
 *         raise errors.InvalidArgumentError(
 *             "array size must be and integer > 0, instead got '%d'." % size
 */
  }

  /* "cytimes/pddt.py":442
 *             "array size must be and integer > 0, instead got '%d'." % size
 *         )
 *     return size             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_size;
  goto __pyx_L0;

  /* "cytimes/pddt.py":411
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-2, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("cytimes.pddt._parse_arr_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -2L;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":445
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-2, check=False)
 */

static int __pyx_f_7cytimes_4pddt__raise_incomparable_error(PyObject *__pyx_v_pt1, PyObject *__pyx_v_pt2, struct __pyx_opt_args_7cytimes_4pddt__raise_incomparable_error *__pyx_optional_args) {
  PyObject *__pyx_v_desc = ((PyObject*)__pyx_n_u_compare);
  PyObject *__pyx_v_d1_tz = NULL;
  PyObject *__pyx_v_d2_tz = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  unsigned int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_raise_incomparable_error", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_desc = __pyx_optional_args->desc;
    }
  }

  /* "cytimes/pddt.py":461
 *         Displayed as: 'cannot [desc] between naive & aware datetimes...'
 *     """
 *     d1_tz, d2_tz = pt1.tzinfo, pt2.tzinfo             # <<<<<<<<<<<<<<
 *     assert d1_tz is not d2_tz and (d1_tz is None or d2_tz is None)
 *     if d1_tz is None:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt1, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt2, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_d1_tz = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_d2_tz = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":462
 *     """
 *     d1_tz, d2_tz = pt1.tzinfo, pt2.tzinfo
 *     assert d1_tz is not d2_tz and (d1_tz is None or d2_tz is None)             # <<<<<<<<<<<<<<
 *     if d1_tz is None:
 *         raise errors.IncomparableError(
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = (__pyx_v_d1_tz != __pyx_v_d2_tz);
    if (__pyx_t_4) {
    } else {
      __pyx_t_3 = __pyx_t_4;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_d1_tz == Py_None);
    if (!__pyx_t_4) {
    } else {
      __pyx_t_3 = __pyx_t_4;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_d2_tz == Py_None);
    __pyx_t_3 = __pyx_t_4;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 462, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 462, __pyx_L1_error)
  #endif

  /* "cytimes/pddt.py":463
 *     d1_tz, d2_tz = pt1.tzinfo, pt2.tzinfo
 *     assert d1_tz is not d2_tz and (d1_tz is None or d2_tz is None)
 *     if d1_tz is None:             # <<<<<<<<<<<<<<
 *         raise errors.IncomparableError(
 *             "cannot %s between naive & aware datetimes:\n"
 */
  __pyx_t_3 = (__pyx_v_d1_tz == Py_None);
  if (unlikely(__pyx_t_3)) {

    /* "cytimes/pddt.py":464
 *     assert d1_tz is not d2_tz and (d1_tz is None or d2_tz is None)
 *     if d1_tz is None:
 *         raise errors.IncomparableError(             # <<<<<<<<<<<<<<
 *             "cannot %s between naive & aware datetimes:\n"
 *             "Timezone-naive %s\n"
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_errors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_IncomparableError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/pddt.py":465
 *     if d1_tz is None:
 *         raise errors.IncomparableError(
 *             "cannot %s between naive & aware datetimes:\n"             # <<<<<<<<<<<<<<
 *             "Timezone-naive %s\n"
 *             "Timezone-aware %s" % (desc, pt1.dtype, pt2.dtype)
 */
    __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;
    __Pyx_INCREF(__pyx_kp_u_cannot);
    __pyx_t_6 += 7;
    __Pyx_GIVEREF(__pyx_kp_u_cannot);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_cannot);

    /* "cytimes/pddt.py":467
 *             "cannot %s between naive & aware datetimes:\n"
 *             "Timezone-naive %s\n"
 *             "Timezone-aware %s" % (desc, pt1.dtype, pt2.dtype)             # <<<<<<<<<<<<<<
 *         )
 *     else:
 */
    __Pyx_INCREF(__pyx_v_desc);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_desc) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_desc) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_desc);
    __Pyx_GIVEREF(__pyx_v_desc);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_desc);
    __Pyx_INCREF(__pyx_kp_u_between_naive_aware_datetimes_T);
    __pyx_t_6 += 49;
    __Pyx_GIVEREF(__pyx_kp_u_between_naive_aware_datetimes_T);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_between_naive_aware_datetimes_T);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_8), __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_9);
    __pyx_t_9 = 0;
    __Pyx_INCREF(__pyx_kp_u_Timezone_aware);
    __pyx_t_6 += 16;
    __Pyx_GIVEREF(__pyx_kp_u_Timezone_aware);
    PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_Timezone_aware);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_9), __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "cytimes/pddt.py":465
 *     if d1_tz is None:
 *         raise errors.IncomparableError(
 *             "cannot %s between naive & aware datetimes:\n"             # <<<<<<<<<<<<<<
 *             "Timezone-naive %s\n"
 *             "Timezone-aware %s" % (desc, pt1.dtype, pt2.dtype)
 */
    __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_1, 6, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_10 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_10 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_8};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 464, __pyx_L1_error)

    /* "cytimes/pddt.py":463
 *     d1_tz, d2_tz = pt1.tzinfo, pt2.tzinfo
 *     assert d1_tz is not d2_tz and (d1_tz is None or d2_tz is None)
 *     if d1_tz is None:             # <<<<<<<<<<<<<<
 *         raise errors.IncomparableError(
 *             "cannot %s between naive & aware datetimes:\n"
 */
  }

  /* "cytimes/pddt.py":470
 *         )
 *     else:
 *         raise errors.IncomparableError(             # <<<<<<<<<<<<<<
 *             "cannot %s between naive & aware datetimes:\n"
 *             "Timezone-aware %s\n"
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_errors); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_IncomparableError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 470, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cytimes/pddt.py":471
 *     else:
 *         raise errors.IncomparableError(
 *             "cannot %s between naive & aware datetimes:\n"             # <<<<<<<<<<<<<<
 *             "Timezone-aware %s\n"
 *             "Timezone-naive %s" % (desc, pt1.dtype, pt2.dtype)
 */
    __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 471, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;
    __Pyx_INCREF(__pyx_kp_u_cannot);
    __pyx_t_6 += 7;
    __Pyx_GIVEREF(__pyx_kp_u_cannot);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_cannot);

    /* "cytimes/pddt.py":473
 *             "cannot %s between naive & aware datetimes:\n"
 *             "Timezone-aware %s\n"
 *             "Timezone-naive %s" % (desc, pt1.dtype, pt2.dtype)             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __Pyx_INCREF(__pyx_v_desc);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_desc) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_desc) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_desc);
    __Pyx_GIVEREF(__pyx_v_desc);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_desc);
    __Pyx_INCREF(__pyx_kp_u_between_naive_aware_datetimes_T_2);
    __pyx_t_6 += 49;
    __Pyx_GIVEREF(__pyx_kp_u_between_naive_aware_datetimes_T_2);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_between_naive_aware_datetimes_T_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_1), __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_9);
    __pyx_t_9 = 0;
    __Pyx_INCREF(__pyx_kp_u_Timezone_naive);
    __pyx_t_6 += 16;
    __Pyx_GIVEREF(__pyx_kp_u_Timezone_naive);
    PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u_Timezone_naive);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_9), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":471
 *     else:
 *         raise errors.IncomparableError(
 *             "cannot %s between naive & aware datetimes:\n"             # <<<<<<<<<<<<<<
 *             "Timezone-aware %s\n"
 *             "Timezone-naive %s" % (desc, pt1.dtype, pt2.dtype)
 */
    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_5, 6, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_10 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_10 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 470, __pyx_L1_error)
  }

  /* "cytimes/pddt.py":445
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-2, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("cytimes.pddt._raise_incomparable_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -2;
  __Pyx_XDECREF(__pyx_v_d1_tz);
  __Pyx_XDECREF(__pyx_v_d2_tz);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":484
 *     """
 * 
 *     def __new__(             # <<<<<<<<<<<<<<
 *         cls,
 *         data: object,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_1__new__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt___new__, "A drop-in replacement for Pandas `<'DatetimeIndex'>`\n        class, providing additional functionalities for more\n        convenient datetime operations.\n\n        :param data `<'object'>`: Datetime-like data to construct with.\n\n        :param freq `<'str/timedelta/BaseOffset/None'>`: The frequency of the 'data', defaults to `None`.\n            - `<'str'>` A frequency string (e.g. 'D', 'h', 's', 'ms'), or 'infer' for auto-detection.\n            - `<'timedelta'>` A datetime.timedelta instance representing the frequency.\n            - `<'BaseOffset'>` A pandas Offset instance representing the frequency.\n            - `<'None'>` No specified frequency.\n\n        :param tz `<'str/tzinfo/None'>`: Set the timezone of the index, defaults to `None`.\n            - `<'datetime.tzinfo'>` A subclass of `datetime.tzinfo`.\n            - `<'str'>` Timezone name supported by the 'Zoneinfo' module, or `'local'` for local timezone.\n            - `<'None'>` Timezone-naive.\n\n        :param ambiguous `<'str/ndarray'>`: How to handle ambiguous times, defaults to `'raise'`.\n            - `<'str'>` Accepts 'infer' or 'raise' for ambiguous times handling.\n            - `<'ndarray'>` A boolean array to specify ambiguous times ('True' for DST time).\n\n        :param year1st `<'bool/None'>`: Interpret the first ambiguous Y/M/D value as year, defaults to `None`.\n            If 'year1st=None', use `cfg.year1st` if 'cfg' is specified; otherwise, defaults to `False`.\n\n        :param day1st `<'bool/None'>`: Interpret the first ambiguous Y/M/D values as day, defaults to `None`.\n            If 'day1st=None', use `cfg.day1st` if 'cfg' is specified; otherwise, defaults to `False`.\n\n        :param cfg `<'Configs/None'>`: Custom parser configurations, defaults to `None`.\n\n        :param unit `<'str/None'>`: Set the datetime unit of the index, defaults to `None`.\n            Supported datetime units: 's', 'ms', 'us', 'ns'.\n\n        :param name `<'Hashable/None'>`: The name ass""igned to the index, defaults to `None`.\n\n        :param copy `<'bool'>`: Whether to make a copy of the 'data', defaults to `False`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_1__new__ = {"__new__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_1__new__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt___new__};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_1__new__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_freq = 0;
  PyObject *__pyx_v_tz = 0;
  PyObject *__pyx_v_ambiguous = 0;
  PyObject *__pyx_v_year1st = 0;
  PyObject *__pyx_v_day1st = 0;
  struct __pyx_obj_7cytimes_6parser_Configs *__pyx_v_cfg = 0;
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_copy = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__new__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_data,&__pyx_n_s_freq,&__pyx_n_s_tz,&__pyx_n_s_ambiguous,&__pyx_n_s_year1st,&__pyx_n_s_day1st,&__pyx_n_s_cfg,&__pyx_n_s_unit,&__pyx_n_s_name,&__pyx_n_s_copy,0};

    /* "cytimes/pddt.py":487
 *         cls,
 *         data: object,
 *         freq: object | None = None,             # <<<<<<<<<<<<<<
 *         tz: datetime.tzinfo | str | None = None,
 *         ambiguous: object = "raise",
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "cytimes/pddt.py":488
 *         data: object,
 *         freq: object | None = None,
 *         tz: datetime.tzinfo | str | None = None,             # <<<<<<<<<<<<<<
 *         ambiguous: object = "raise",
 *         year1st: bool | None = None,
 */
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_n_u_raise)));

    /* "cytimes/pddt.py":490
 *         tz: datetime.tzinfo | str | None = None,
 *         ambiguous: object = "raise",
 *         year1st: bool | None = None,             # <<<<<<<<<<<<<<
 *         day1st: bool | None = None,
 *         cfg: Configs = None,
 */
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "cytimes/pddt.py":491
 *         ambiguous: object = "raise",
 *         year1st: bool | None = None,
 *         day1st: bool | None = None,             # <<<<<<<<<<<<<<
 *         cfg: Configs = None,
 *         unit: str = None,
 */
    values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "cytimes/pddt.py":492
 *         year1st: bool | None = None,
 *         day1st: bool | None = None,
 *         cfg: Configs = None,             # <<<<<<<<<<<<<<
 *         unit: str = None,
 *         name: Hashable | None = None,
 */
    values[7] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct __pyx_obj_7cytimes_6parser_Configs *)Py_None));

    /* "cytimes/pddt.py":493
 *         day1st: bool | None = None,
 *         cfg: Configs = None,
 *         unit: str = None,             # <<<<<<<<<<<<<<
 *         name: Hashable | None = None,
 *         copy: bool = False,
 */
    values[8] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));

    /* "cytimes/pddt.py":494
 *         cfg: Configs = None,
 *         unit: str = None,
 *         name: Hashable | None = None,             # <<<<<<<<<<<<<<
 *         copy: bool = False,
 *     ) -> Self:
 */
    values[9] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "cytimes/pddt.py":495
 *         unit: str = None,
 *         name: Hashable | None = None,
 *         copy: bool = False,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """A drop-in replacement for Pandas `<'DatetimeIndex'>`
 */
    values[10] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False)));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 11, 1); __PYX_ERR(0, 484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_freq);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tz);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ambiguous);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_year1st);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_day1st);
          if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cfg);
          if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit);
          if (value) { values[8] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_copy);
          if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__new__") < 0)) __PYX_ERR(0, 484, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_data = values[1];
    __pyx_v_freq = values[2];
    __pyx_v_tz = values[3];
    __pyx_v_ambiguous = values[4];
    __pyx_v_year1st = values[5];
    __pyx_v_day1st = values[6];
    __pyx_v_cfg = ((struct __pyx_obj_7cytimes_6parser_Configs *)values[7]);
    __pyx_v_unit = ((PyObject*)values[8]);
    __pyx_v_name = values[9];
    __pyx_v_copy = values[10];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 11, __pyx_nargs); __PYX_ERR(0, 484, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cfg), __pyx_ptype_7cytimes_6parser_Configs, 1, "cfg", 0))) __PYX_ERR(0, 492, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 1, "unit", 1))) __PYX_ERR(0, 493, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt___new__(__pyx_self, __pyx_v_cls, __pyx_v_data, __pyx_v_freq, __pyx_v_tz, __pyx_v_ambiguous, __pyx_v_year1st, __pyx_v_day1st, __pyx_v_cfg, __pyx_v_unit, __pyx_v_name, __pyx_v_copy);

  /* "cytimes/pddt.py":484
 *     """
 * 
 *     def __new__(             # <<<<<<<<<<<<<<
 *         cls,
 *         data: object,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt___new__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_data, PyObject *__pyx_v_freq, PyObject *__pyx_v_tz, PyObject *__pyx_v_ambiguous, PyObject *__pyx_v_year1st, PyObject *__pyx_v_day1st, struct __pyx_obj_7cytimes_6parser_Configs *__pyx_v_cfg, PyObject *__pyx_v_unit, PyObject *__pyx_v_name, PyObject *__pyx_v_copy) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__new__", 1);

  /* "cytimes/pddt.py":534
 *         """
 *         # fmt: off
 *         return pddt_new(             # <<<<<<<<<<<<<<
 *             data, freq, tz, ambiguous, year1st,
 *             day1st, cfg, unit, name, copy,
 */
  __Pyx_XDECREF(__pyx_r);

  /* "cytimes/pddt.py":536
 *         return pddt_new(
 *             data, freq, tz, ambiguous, year1st,
 *             day1st, cfg, unit, name, copy,             # <<<<<<<<<<<<<<
 *         )
 *         # fmt: on
 */
  __pyx_t_2.__pyx_n = 9;
  __pyx_t_2.freq = __pyx_v_freq;
  __pyx_t_2.tz = __pyx_v_tz;
  __pyx_t_2.ambiguous = __pyx_v_ambiguous;
  __pyx_t_2.year1st = __pyx_v_year1st;
  __pyx_t_2.day1st = __pyx_v_day1st;
  __pyx_t_2.cfg = __pyx_v_cfg;
  __pyx_t_2.unit = __pyx_v_unit;
  __pyx_t_2.name = __pyx_v_name;
  __pyx_t_2.copy = __pyx_v_copy;
  __pyx_t_1 = __pyx_f_7cytimes_4pddt_pddt_new(__pyx_v_data, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":484
 *     """
 * 
 *     def __new__(             # <<<<<<<<<<<<<<
 *         cls,
 *         data: object,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":541
 * 
 *     # Constructor --------------------------------------------------------------------------
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def date_range(
 *         cls,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_3date_range(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_2date_range, "Construct a fixed-frequency index `<'Pddt'>`.\n\n        Construct the range of equally spaced time points at a specified frequency.\n        The datetimes are generated such that each one falls within the interval defined\n        by 'start' and 'end', satisfying 'start <[=] x <[=] end' (the inclusivity can\n        be adjusted with the 'inclusive' parameter). If exactly one of 'start', 'end',\n        or 'freq' is not provided, it can be inferred by specifying periods, the total\n        number of datetimes to generate.\n\n        :param start `<'str/datetime/None'>`: Left bound for generating the index.\n        :param end `<'str/datetime/None'>`: Right bound for generating the index.\n        :param periods `<'int/None'>`: Number of periods to generate.\n        :param freq `<'str/timedelta/BaseOffset/None'>`: The frequency of the index, defaults to `'D'`.\n            - `<'str'>` A frequency string (e.g. 'D', 'h', 's', 'ms').\n            - `<'BaseOffset'>` A pandas Offset instance representing the frequency.\n            - `<'timedelta'>` A datetime.timedelta instance representing the frequency.\n            - `<'None'>` No specified frequency.\n\n        :param tz `<'str/tzinfo/None'>`: Set the timezone of the index, defaults to `None`.\n            - `<'datetime.tzinfo'>` A subclass of `datetime.tzinfo`.\n            - `<'str'>` Timezone name supported by the 'Zoneinfo' module, or `'local'` for local timezone.\n            - `<'None'>` Timezone-naive.\n\n        :param normalize `<'bool'>`: Normalize the start/end dates to midnight, defaults to `False`.\n\n        :param inclusive `<'str'>`: Include boundaries, defaults to `'both'`.\n            - `'left'` Include the left boundary.\n            - `'right'` Include the right boundary.\n            - `'both'` Include both boundaries.\n            - `'neither'` Exclude both boundaries.\n\n        :param unit `<'str/None'>`: Set the datetime unit of the index, defaults to `None`.\n            Supported datetime"" units: 's', 'ms', 'us', 'ns'.\n\n        :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_3date_range = {"date_range", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_3date_range, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_2date_range};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_3date_range(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_end = 0;
  PyObject *__pyx_v_periods = 0;
  PyObject *__pyx_v_freq = 0;
  PyObject *__pyx_v_tz = 0;
  PyObject *__pyx_v_normalize = 0;
  PyObject *__pyx_v_inclusive = 0;
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("date_range (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_periods,&__pyx_n_s_freq,&__pyx_n_s_tz,&__pyx_n_s_normalize,&__pyx_n_s_inclusive,&__pyx_n_s_unit,&__pyx_n_s_name,0};

    /* "cytimes/pddt.py":544
 *     def date_range(
 *         cls,
 *         start: object | None = None,             # <<<<<<<<<<<<<<
 *         end: object | None = None,
 *         periods: int | None = None,
 */
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "cytimes/pddt.py":545
 *         cls,
 *         start: object | None = None,
 *         end: object | None = None,             # <<<<<<<<<<<<<<
 *         periods: int | None = None,
 *         freq: object | None = "D",
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "cytimes/pddt.py":546
 *         start: object | None = None,
 *         end: object | None = None,
 *         periods: int | None = None,             # <<<<<<<<<<<<<<
 *         freq: object | None = "D",
 *         tz: datetime.tzinfo | str | None = None,
 */
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_n_u_D)));

    /* "cytimes/pddt.py":548
 *         periods: int | None = None,
 *         freq: object | None = "D",
 *         tz: datetime.tzinfo | str | None = None,             # <<<<<<<<<<<<<<
 *         normalize: bool = False,
 *         inclusive: str = "both",
 */
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "cytimes/pddt.py":549
 *         freq: object | None = "D",
 *         tz: datetime.tzinfo | str | None = None,
 *         normalize: bool = False,             # <<<<<<<<<<<<<<
 *         inclusive: str = "both",
 *         unit: str = None,
 */
    values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False)));
    values[7] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)((PyObject*)__pyx_n_u_both)));

    /* "cytimes/pddt.py":551
 *         normalize: bool = False,
 *         inclusive: str = "both",
 *         unit: str = None,             # <<<<<<<<<<<<<<
 *         name: Hashable | None = None,
 *     ) -> Self:
 */
    values[8] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));

    /* "cytimes/pddt.py":552
 *         inclusive: str = "both",
 *         unit: str = None,
 *         name: Hashable | None = None,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Construct a fixed-frequency index `<'Pddt'>`.
 */
    values[9] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 541, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 541, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_end);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 541, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_periods);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 541, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_freq);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 541, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tz);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 541, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_normalize);
          if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 541, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_inclusive);
          if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 541, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit);
          if (value) { values[8] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 541, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 541, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "date_range") < 0)) __PYX_ERR(0, 541, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_start = values[1];
    __pyx_v_end = values[2];
    __pyx_v_periods = values[3];
    __pyx_v_freq = values[4];
    __pyx_v_tz = values[5];
    __pyx_v_normalize = values[6];
    __pyx_v_inclusive = ((PyObject*)values[7]);
    __pyx_v_unit = ((PyObject*)values[8]);
    __pyx_v_name = values[9];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("date_range", 0, 1, 10, __pyx_nargs); __PYX_ERR(0, 541, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.date_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_inclusive), (&PyUnicode_Type), 0, "inclusive", 1))) __PYX_ERR(0, 550, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 1, "unit", 1))) __PYX_ERR(0, 551, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_2date_range(__pyx_self, __pyx_v_cls, __pyx_v_start, __pyx_v_end, __pyx_v_periods, __pyx_v_freq, __pyx_v_tz, __pyx_v_normalize, __pyx_v_inclusive, __pyx_v_unit, __pyx_v_name);

  /* "cytimes/pddt.py":541
 * 
 *     # Constructor --------------------------------------------------------------------------
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def date_range(
 *         cls,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_2date_range(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_periods, PyObject *__pyx_v_freq, PyObject *__pyx_v_tz, PyObject *__pyx_v_normalize, PyObject *__pyx_v_inclusive, PyObject *__pyx_v_unit, PyObject *__pyx_v_name) {
  PyObject *__pyx_v_arr = NULL;
  PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  unsigned int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  char const *__pyx_t_22;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_23;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_range", 0);
  __Pyx_INCREF(__pyx_v_freq);

  /* "cytimes/pddt.py":590
 *         :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.
 *         """
 *         if freq is None and (periods is None or start is None or end is None):             # <<<<<<<<<<<<<<
 *             freq = "D"
 *         try:
 */
  __pyx_t_2 = (__pyx_v_freq == Py_None);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_periods == Py_None);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_start == Py_None);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_end == Py_None);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":591
 *         """
 *         if freq is None and (periods is None or start is None or end is None):
 *             freq = "D"             # <<<<<<<<<<<<<<
 *         try:
 *             arr = DatetimeArray._generate_range(
 */
    __Pyx_INCREF(__pyx_n_u_D);
    __Pyx_DECREF_SET(__pyx_v_freq, __pyx_n_u_D);

    /* "cytimes/pddt.py":590
 *         :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.
 *         """
 *         if freq is None and (periods is None or start is None or end is None):             # <<<<<<<<<<<<<<
 *             freq = "D"
 *         try:
 */
  }

  /* "cytimes/pddt.py":592
 *         if freq is None and (periods is None or start is None or end is None):
 *             freq = "D"
 *         try:             # <<<<<<<<<<<<<<
 *             arr = DatetimeArray._generate_range(
 *                 start=start,
 */
  {
    __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:*/ {

      /* "cytimes/pddt.py":593
 *             freq = "D"
 *         try:
 *             arr = DatetimeArray._generate_range(             # <<<<<<<<<<<<<<
 *                 start=start,
 *                 end=end,
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_DatetimeArray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 593, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_generate_range); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 593, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cytimes/pddt.py":594
 *         try:
 *             arr = DatetimeArray._generate_range(
 *                 start=start,             # <<<<<<<<<<<<<<
 *                 end=end,
 *                 periods=periods,
 */
      __pyx_t_6 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 594, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_start, __pyx_v_start) < 0) __PYX_ERR(0, 594, __pyx_L8_error)

      /* "cytimes/pddt.py":595
 *             arr = DatetimeArray._generate_range(
 *                 start=start,
 *                 end=end,             # <<<<<<<<<<<<<<
 *                 periods=periods,
 *                 freq=freq,
 */
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_end, __pyx_v_end) < 0) __PYX_ERR(0, 594, __pyx_L8_error)

      /* "cytimes/pddt.py":596
 *                 start=start,
 *                 end=end,
 *                 periods=periods,             # <<<<<<<<<<<<<<
 *                 freq=freq,
 *                 tz=tz,
 */
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_periods, __pyx_v_periods) < 0) __PYX_ERR(0, 594, __pyx_L8_error)

      /* "cytimes/pddt.py":597
 *                 end=end,
 *                 periods=periods,
 *                 freq=freq,             # <<<<<<<<<<<<<<
 *                 tz=tz,
 *                 normalize=normalize,
 */
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_freq, __pyx_v_freq) < 0) __PYX_ERR(0, 594, __pyx_L8_error)

      /* "cytimes/pddt.py":598
 *                 periods=periods,
 *                 freq=freq,
 *                 tz=tz,             # <<<<<<<<<<<<<<
 *                 normalize=normalize,
 *                 inclusive=inclusive,
 */
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_tz, __pyx_v_tz) < 0) __PYX_ERR(0, 594, __pyx_L8_error)

      /* "cytimes/pddt.py":599
 *                 freq=freq,
 *                 tz=tz,
 *                 normalize=normalize,             # <<<<<<<<<<<<<<
 *                 inclusive=inclusive,
 *                 unit=unit,
 */
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_normalize, __pyx_v_normalize) < 0) __PYX_ERR(0, 594, __pyx_L8_error)

      /* "cytimes/pddt.py":600
 *                 tz=tz,
 *                 normalize=normalize,
 *                 inclusive=inclusive,             # <<<<<<<<<<<<<<
 *                 unit=unit,
 *             )
 */
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_inclusive, __pyx_v_inclusive) < 0) __PYX_ERR(0, 594, __pyx_L8_error)

      /* "cytimes/pddt.py":601
 *                 normalize=normalize,
 *                 inclusive=inclusive,
 *                 unit=unit,             # <<<<<<<<<<<<<<
 *             )
 *         except pd_err.OutOfBoundsDatetime as err:
 */
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_unit, __pyx_v_unit) < 0) __PYX_ERR(0, 594, __pyx_L8_error)

      /* "cytimes/pddt.py":593
 *             freq = "D"
 *         try:
 *             arr = DatetimeArray._generate_range(             # <<<<<<<<<<<<<<
 *                 start=start,
 *                 end=end,
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 593, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_arr = __pyx_t_8;
      __pyx_t_8 = 0;

      /* "cytimes/pddt.py":592
 *         if freq is None and (periods is None or start is None or end is None):
 *             freq = "D"
 *         try:             # <<<<<<<<<<<<<<
 *             arr = DatetimeArray._generate_range(
 *                 start=start,
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L13_try_end;
    __pyx_L8_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cytimes/pddt.py":603
 *                 unit=unit,
 *             )
 *         except pd_err.OutOfBoundsDatetime as err:             # <<<<<<<<<<<<<<
 *             raise errors.OutOfBoundsDatetimeError(err) from err
 *         except Exception as err:
 */
    __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_6, &__pyx_t_7);
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_pd_err); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 603, __pyx_L10_except_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_OutOfBoundsDatetime); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 603, __pyx_L10_except_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_8, __pyx_t_10);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_ErrRestore(__pyx_t_8, __pyx_t_6, __pyx_t_7);
    __pyx_t_8 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0;
    if (__pyx_t_11) {
      __Pyx_AddTraceback("cytimes.pddt.Pddt.date_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(0, 603, __pyx_L10_except_error)
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/pddt.py":604
 *             )
 *         except pd_err.OutOfBoundsDatetime as err:
 *             raise errors.OutOfBoundsDatetimeError(err) from err             # <<<<<<<<<<<<<<
 *         except Exception as err:
 *             raise errors.InvalidArgumentError(err) from err
 */
        __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_errors); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 604, __pyx_L19_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_OutOfBoundsDatetimeError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 604, __pyx_L19_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = NULL;
        __pyx_t_13 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
            __pyx_t_13 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_err};
          __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 604, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_Raise(__pyx_t_10, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __PYX_ERR(0, 604, __pyx_L19_error)
      }

      /* "cytimes/pddt.py":603
 *                 unit=unit,
 *             )
 *         except pd_err.OutOfBoundsDatetime as err:             # <<<<<<<<<<<<<<
 *             raise errors.OutOfBoundsDatetimeError(err) from err
 *         except Exception as err:
 */
      /*finally:*/ {
        __pyx_L19_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_11 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L10_except_error;
        }
      }
    }

    /* "cytimes/pddt.py":605
 *         except pd_err.OutOfBoundsDatetime as err:
 *             raise errors.OutOfBoundsDatetimeError(err) from err
 *         except Exception as err:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidArgumentError(err) from err
 *         return pddt_new_simple(arr, None, unit, name)
 */
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("cytimes.pddt.Pddt.date_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 605, __pyx_L10_except_error)
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/pddt.py":606
 *             raise errors.OutOfBoundsDatetimeError(err) from err
 *         except Exception as err:
 *             raise errors.InvalidArgumentError(err) from err             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(arr, None, unit, name)
 * 
 */
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_errors); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 606, __pyx_L30_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 606, __pyx_L30_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = NULL;
        __pyx_t_13 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
            __pyx_t_13 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_err};
          __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 606, __pyx_L30_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_Raise(__pyx_t_10, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __PYX_ERR(0, 606, __pyx_L30_error)
      }

      /* "cytimes/pddt.py":605
 *         except pd_err.OutOfBoundsDatetime as err:
 *             raise errors.OutOfBoundsDatetimeError(err) from err
 *         except Exception as err:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidArgumentError(err) from err
 *         return pddt_new_simple(arr, None, unit, name)
 */
      /*finally:*/ {
        __pyx_L30_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_16);
          __pyx_t_14 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_22 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_17, __pyx_t_16);
          }
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_21, __pyx_t_20, __pyx_t_19);
          __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_22;
          goto __pyx_L10_except_error;
        }
      }
    }
    goto __pyx_L10_except_error;

    /* "cytimes/pddt.py":592
 *         if freq is None and (periods is None or start is None or end is None):
 *             freq = "D"
 *         try:             # <<<<<<<<<<<<<<
 *             arr = DatetimeArray._generate_range(
 *                 start=start,
 */
    __pyx_L10_except_error:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L13_try_end:;
  }

  /* "cytimes/pddt.py":607
 *         except Exception as err:
 *             raise errors.InvalidArgumentError(err) from err
 *         return pddt_new_simple(arr, None, unit, name)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_23.__pyx_n = 3;
  __pyx_t_23.tz = Py_None;
  __pyx_t_23.unit = __pyx_v_unit;
  __pyx_t_23.name = __pyx_v_name;
  __pyx_t_7 = __pyx_f_7cytimes_4pddt_pddt_new_simple(__pyx_v_arr, &__pyx_t_23); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":541
 * 
 *     # Constructor --------------------------------------------------------------------------
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def date_range(
 *         cls,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.date_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XDECREF(__pyx_v_freq);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":609
 *         return pddt_new_simple(arr, None, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def parse(
 *         cls,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_5parse(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_4parse, "Parse from a datetime-like data `<'Pddt'>`.\n\n        :param data `<'object'>`: Datetime-like data to construct with.\n\n        :param freq `<'str/timedelta/BaseOffset/None'>`: The frequency of the 'data', defaults to `None`.\n            - `<'str'>` A frequency string (e.g. 'D', 'h', 's', 'ms'), or 'infer' for auto-detection.\n            - `<'BaseOffset'>` A pandas Offset instance representing the frequency.\n            - `<'timedelta'>` A datetime.timedelta instance representing the frequency.\n            - `<'None'>` No specified frequency.\n\n        :param tz `<'str/tzinfo/None'>`: Set the timezone of the index, defaults to `None`.\n            - `<'datetime.tzinfo'>` A subclass of `datetime.tzinfo`.\n            - `<'str'>` Timezone name supported by the 'Zoneinfo' module, or `'local'` for local timezone.\n            - `<'None'>` Timezone-naive.\n\n        :param ambiguous `<'str/ndarray'>`: How to handle ambiguous times, defaults to `'raise'`.\n            - `<'str'>` Accepts 'infer' or 'raise' for ambiguous times handling.\n            - `<'ndarray'>` A boolean array to specify ambiguous times ('True' for DST time).\n\n        :param year1st `<'bool/None'>`: Interpret the first ambiguous Y/M/D value as year, defaults to `None`.\n            If 'year1st=None', use `cfg.year1st` if 'cfg' is specified; otherwise, defaults to `False`.\n\n        :param day1st `<'bool/None'>`: Interpret the first ambiguous Y/M/D values as day, defaults to `None`.\n            If 'day1st=None', use `cfg.day1st` if 'cfg' is specified; otherwise, defaults to `False`.\n\n        :param cfg `<'Configs/None'>`: Custom parser configurations, defaults to `None`.\n\n        :param unit `<'str/None'>`: Set the datetime unit of the index, defaults to `None`.\n            Supported datetime units: 's', 'ms', 'us', 'ns'.\n\n        :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.\n\n        :param copy `<'bool'>`: Whether to make a copy of the 'data',"" defaults to `False`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_5parse = {"parse", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_5parse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_4parse};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_5parse(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_freq = 0;
  PyObject *__pyx_v_tz = 0;
  PyObject *__pyx_v_ambiguous = 0;
  PyObject *__pyx_v_year1st = 0;
  PyObject *__pyx_v_day1st = 0;
  struct __pyx_obj_7cytimes_6parser_Configs *__pyx_v_cfg = 0;
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_copy = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("parse (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_data,&__pyx_n_s_freq,&__pyx_n_s_tz,&__pyx_n_s_ambiguous,&__pyx_n_s_year1st,&__pyx_n_s_day1st,&__pyx_n_s_cfg,&__pyx_n_s_unit,&__pyx_n_s_name,&__pyx_n_s_copy,0};

    /* "cytimes/pddt.py":613
 *         cls,
 *         data: object,
 *         freq: object | None = None,             # <<<<<<<<<<<<<<
 *         tz: datetime.tzinfo | str | None = None,
 *         ambiguous: object = "raise",
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "cytimes/pddt.py":614
 *         data: object,
 *         freq: object | None = None,
 *         tz: datetime.tzinfo | str | None = None,             # <<<<<<<<<<<<<<
 *         ambiguous: object = "raise",
 *         year1st: bool | None = None,
 */
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_n_u_raise)));

    /* "cytimes/pddt.py":616
 *         tz: datetime.tzinfo | str | None = None,
 *         ambiguous: object = "raise",
 *         year1st: bool | None = None,             # <<<<<<<<<<<<<<
 *         day1st: bool | None = None,
 *         cfg: Configs = None,
 */
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "cytimes/pddt.py":617
 *         ambiguous: object = "raise",
 *         year1st: bool | None = None,
 *         day1st: bool | None = None,             # <<<<<<<<<<<<<<
 *         cfg: Configs = None,
 *         unit: str = None,
 */
    values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "cytimes/pddt.py":618
 *         year1st: bool | None = None,
 *         day1st: bool | None = None,
 *         cfg: Configs = None,             # <<<<<<<<<<<<<<
 *         unit: str = None,
 *         name: Hashable | None = None,
 */
    values[7] = __Pyx_Arg_NewRef_FASTCALL((PyObject *)((struct __pyx_obj_7cytimes_6parser_Configs *)Py_None));

    /* "cytimes/pddt.py":619
 *         day1st: bool | None = None,
 *         cfg: Configs = None,
 *         unit: str = None,             # <<<<<<<<<<<<<<
 *         name: Hashable | None = None,
 *         copy: bool = False,
 */
    values[8] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));

    /* "cytimes/pddt.py":620
 *         cfg: Configs = None,
 *         unit: str = None,
 *         name: Hashable | None = None,             # <<<<<<<<<<<<<<
 *         copy: bool = False,
 *     ) -> Self:
 */
    values[9] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "cytimes/pddt.py":621
 *         unit: str = None,
 *         name: Hashable | None = None,
 *         copy: bool = False,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Parse from a datetime-like data `<'Pddt'>`.
 */
    values[10] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False)));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("parse", 0, 2, 11, 1); __PYX_ERR(0, 609, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_freq);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tz);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ambiguous);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_year1st);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_day1st);
          if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cfg);
          if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit);
          if (value) { values[8] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_copy);
          if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "parse") < 0)) __PYX_ERR(0, 609, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_data = values[1];
    __pyx_v_freq = values[2];
    __pyx_v_tz = values[3];
    __pyx_v_ambiguous = values[4];
    __pyx_v_year1st = values[5];
    __pyx_v_day1st = values[6];
    __pyx_v_cfg = ((struct __pyx_obj_7cytimes_6parser_Configs *)values[7]);
    __pyx_v_unit = ((PyObject*)values[8]);
    __pyx_v_name = values[9];
    __pyx_v_copy = values[10];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("parse", 0, 2, 11, __pyx_nargs); __PYX_ERR(0, 609, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cfg), __pyx_ptype_7cytimes_6parser_Configs, 1, "cfg", 0))) __PYX_ERR(0, 618, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 1, "unit", 1))) __PYX_ERR(0, 619, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_4parse(__pyx_self, __pyx_v_cls, __pyx_v_data, __pyx_v_freq, __pyx_v_tz, __pyx_v_ambiguous, __pyx_v_year1st, __pyx_v_day1st, __pyx_v_cfg, __pyx_v_unit, __pyx_v_name, __pyx_v_copy);

  /* "cytimes/pddt.py":609
 *         return pddt_new_simple(arr, None, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def parse(
 *         cls,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_4parse(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_data, PyObject *__pyx_v_freq, PyObject *__pyx_v_tz, PyObject *__pyx_v_ambiguous, PyObject *__pyx_v_year1st, PyObject *__pyx_v_day1st, struct __pyx_obj_7cytimes_6parser_Configs *__pyx_v_cfg, PyObject *__pyx_v_unit, PyObject *__pyx_v_name, PyObject *__pyx_v_copy) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse", 1);

  /* "cytimes/pddt.py":658
 *         """
 *         # fmt: off
 *         return pddt_new(             # <<<<<<<<<<<<<<
 *             data, freq, tz, ambiguous, year1st,
 *             day1st, cfg, unit, name, copy,
 */
  __Pyx_XDECREF(__pyx_r);

  /* "cytimes/pddt.py":660
 *         return pddt_new(
 *             data, freq, tz, ambiguous, year1st,
 *             day1st, cfg, unit, name, copy,             # <<<<<<<<<<<<<<
 *         )
 *         # fmt: on
 */
  __pyx_t_2.__pyx_n = 9;
  __pyx_t_2.freq = __pyx_v_freq;
  __pyx_t_2.tz = __pyx_v_tz;
  __pyx_t_2.ambiguous = __pyx_v_ambiguous;
  __pyx_t_2.year1st = __pyx_v_year1st;
  __pyx_t_2.day1st = __pyx_v_day1st;
  __pyx_t_2.cfg = __pyx_v_cfg;
  __pyx_t_2.unit = __pyx_v_unit;
  __pyx_t_2.name = __pyx_v_name;
  __pyx_t_2.copy = __pyx_v_copy;
  __pyx_t_1 = __pyx_f_7cytimes_4pddt_pddt_new(__pyx_v_data, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":609
 *         return pddt_new_simple(arr, None, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def parse(
 *         cls,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":664
 *         # fmt: on
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def now(
 *         cls,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_7now(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_6now, "Construct from the current datetime with optional timezone `<'Pddt'>`.\n\n        :param tz `<'str/tzinfo/None'>`: The timezone of the index, defaults to `None`.\n            - `<'datetime.tzinfo'>` A subclass of `datetime.tzinfo`.\n            - `<'str'>` Timezone name supported by the 'Zoneinfo' module, or `'local'` for local timezone.\n            - `<'None'>` Timezone-naive.\n\n        :param size `<'int/str/bytes/object'>`: The size of the index to generate, defaults to `1`.\n            - `<'int/str/bytes'>` Representing an integer for the number of elements in the index.\n            - `<'object'>` Any object that implements `__len__()`, where its length represents the size of the index.\n\n        :param unit `<'str/None'>`: Set the datetime unit of the index, defaults to `None`.\n            Supported datetime units: 's', 'ms', 'us', 'ns'.\n\n        :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_7now = {"now", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_7now, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_6now};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_7now(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_tz = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("now (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_tz,&__pyx_n_s_size,&__pyx_n_s_unit,&__pyx_n_s_name,0};

    /* "cytimes/pddt.py":667
 *     def now(
 *         cls,
 *         tz: datetime.tzinfo | str | None = None,             # <<<<<<<<<<<<<<
 *         size: object = 1,
 *         unit: str = None,
 */
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1)));

    /* "cytimes/pddt.py":669
 *         tz: datetime.tzinfo | str | None = None,
 *         size: object = 1,
 *         unit: str = None,             # <<<<<<<<<<<<<<
 *         name: Hashable | None = None,
 *     ) -> Self:
 */
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));

    /* "cytimes/pddt.py":670
 *         size: object = 1,
 *         unit: str = None,
 *         name: Hashable | None = None,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Construct from the current datetime with optional timezone `<'Pddt'>`.
 */
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tz);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "now") < 0)) __PYX_ERR(0, 664, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_tz = values[1];
    __pyx_v_size = values[2];
    __pyx_v_unit = ((PyObject*)values[3]);
    __pyx_v_name = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("now", 0, 1, 5, __pyx_nargs); __PYX_ERR(0, 664, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.now", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 1, "unit", 1))) __PYX_ERR(0, 669, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_6now(__pyx_self, __pyx_v_cls, __pyx_v_tz, __pyx_v_size, __pyx_v_unit, __pyx_v_name);

  /* "cytimes/pddt.py":664
 *         # fmt: on
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def now(
 *         cls,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_6now(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_tz, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name) {
  Py_ssize_t __pyx_v_arr_size;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt_now __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  struct __pyx_opt_args_7cytimes_4pddt__pddt_fr_dt __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("now", 0);
  __Pyx_INCREF(__pyx_v_tz);

  /* "cytimes/pddt.py":688
 *         :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.
 *         """
 *         arr_size, tz = _parse_arr_size(size), utils.tz_parse(tz)             # <<<<<<<<<<<<<<
 *         return _pddt_fr_dt(utils.dt_now(tz), arr_size, unit, name)
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_4pddt__parse_arr_size(__pyx_v_size); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-2L))) __PYX_ERR(0, 688, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7cytimes_5utils_tz_parse(__pyx_v_tz); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_arr_size = __pyx_t_1;
  __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":689
 *         """
 *         arr_size, tz = _parse_arr_size(size), utils.tz_parse(tz)
 *         return _pddt_fr_dt(utils.dt_now(tz), arr_size, unit, name)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.tz = __pyx_v_tz;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_now(&__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5.__pyx_n = 2;
  __pyx_t_5.unit = __pyx_v_unit;
  __pyx_t_5.name = __pyx_v_name;
  __pyx_t_4 = __pyx_f_7cytimes_4pddt__pddt_fr_dt(((PyDateTime_DateTime *)__pyx_t_2), __pyx_v_arr_size, &__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":664
 *         # fmt: on
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def now(
 *         cls,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.now", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":691
 *         return _pddt_fr_dt(utils.dt_now(tz), arr_size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def utcnow(
 *         cls,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_9utcnow(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_8utcnow, "Construct from the current UTC datetime `<'Pddt'>`.\n\n        :param size `<'int/str/bytes/object'>`: The size of the index to generate, defaults to `1`.\n            - `<'int/str/bytes'>` Representing an integer for the number of elements in the index.\n            - `<'object'>` Any object that implements `__len__()`, where its length represents the size of the index.\n\n        :param unit `<'str/None'>`: Set the datetime unit of the index, defaults to `None`.\n            Supported datetime units: 's', 'ms', 'us', 'ns'.\n\n        :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_9utcnow = {"utcnow", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_9utcnow, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_8utcnow};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_9utcnow(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("utcnow (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_size,&__pyx_n_s_unit,&__pyx_n_s_name,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1)));

    /* "cytimes/pddt.py":695
 *         cls,
 *         size: object = 1,
 *         unit: str = None,             # <<<<<<<<<<<<<<
 *         name: Hashable | None = None,
 *     ) -> Self:
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));

    /* "cytimes/pddt.py":696
 *         size: object = 1,
 *         unit: str = None,
 *         name: Hashable | None = None,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Construct from the current UTC datetime `<'Pddt'>`.
 */
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 691, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 691, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 691, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 691, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "utcnow") < 0)) __PYX_ERR(0, 691, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_size = values[1];
    __pyx_v_unit = ((PyObject*)values[2]);
    __pyx_v_name = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("utcnow", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 691, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.utcnow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 1, "unit", 1))) __PYX_ERR(0, 695, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_8utcnow(__pyx_self, __pyx_v_cls, __pyx_v_size, __pyx_v_unit, __pyx_v_name);

  /* "cytimes/pddt.py":691
 *         return _pddt_fr_dt(utils.dt_now(tz), arr_size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def utcnow(
 *         cls,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_8utcnow(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name) {
  Py_ssize_t __pyx_v_arr_size;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt_now __pyx_t_4;
  struct __pyx_opt_args_7cytimes_4pddt__pddt_fr_dt __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("utcnow", 1);

  /* "cytimes/pddt.py":709
 *         :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.
 *         """
 *         arr_size = _parse_arr_size(size)             # <<<<<<<<<<<<<<
 *         return _pddt_fr_dt(utils.dt_now(utils.UTC), arr_size, unit, name)
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_4pddt__parse_arr_size(__pyx_v_size); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-2L))) __PYX_ERR(0, 709, __pyx_L1_error)
  __pyx_v_arr_size = __pyx_t_1;

  /* "cytimes/pddt.py":710
 *         """
 *         arr_size = _parse_arr_size(size)
 *         return _pddt_fr_dt(utils.dt_now(utils.UTC), arr_size, unit, name)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_7cytimes_5utils_UTC);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4.__pyx_n = 1;
  __pyx_t_4.tz = __pyx_t_2;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_now(&__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5.__pyx_n = 2;
  __pyx_t_5.unit = __pyx_v_unit;
  __pyx_t_5.name = __pyx_v_name;
  __pyx_t_2 = __pyx_f_7cytimes_4pddt__pddt_fr_dt(((PyDateTime_DateTime *)__pyx_t_3), __pyx_v_arr_size, &__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __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;

  /* "cytimes/pddt.py":691
 *         return _pddt_fr_dt(utils.dt_now(tz), arr_size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def utcnow(
 *         cls,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.utcnow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":712
 *         return _pddt_fr_dt(utils.dt_now(utils.UTC), arr_size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def today(
 *         cls,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_11today(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_10today, "Construct from the current local datetime (timezone-naive) `<'Pddt'>`.\n\n        :param size `<'int/str/bytes/object'>`: The size of the index to generate, defaults to `1`.\n            - `<'int/str/bytes'>` Representing an integer for the number of elements in the index.\n            - `<'object'>` Any object that implements `__len__()`, where its length represents the size of the index.\n\n        :param unit `<'str/None'>`: Set the datetime unit of the index, defaults to `None`.\n            Supported datetime units: 's', 'ms', 'us', 'ns'.\n\n        :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_11today = {"today", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_11today, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_10today};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_11today(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("today (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_size,&__pyx_n_s_unit,&__pyx_n_s_name,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1)));

    /* "cytimes/pddt.py":716
 *         cls,
 *         size: object = 1,
 *         unit: str = None,             # <<<<<<<<<<<<<<
 *         name: Hashable | None = None,
 *     ) -> Self:
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));

    /* "cytimes/pddt.py":717
 *         size: object = 1,
 *         unit: str = None,
 *         name: Hashable | None = None,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Construct from the current local datetime (timezone-naive) `<'Pddt'>`.
 */
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 712, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 712, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 712, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 712, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "today") < 0)) __PYX_ERR(0, 712, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_size = values[1];
    __pyx_v_unit = ((PyObject*)values[2]);
    __pyx_v_name = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("today", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 712, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.today", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 1, "unit", 1))) __PYX_ERR(0, 716, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_10today(__pyx_self, __pyx_v_cls, __pyx_v_size, __pyx_v_unit, __pyx_v_name);

  /* "cytimes/pddt.py":712
 *         return _pddt_fr_dt(utils.dt_now(utils.UTC), arr_size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def today(
 *         cls,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_10today(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name) {
  Py_ssize_t __pyx_v_arr_size;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt_now __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  struct __pyx_opt_args_7cytimes_4pddt__pddt_fr_dt __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("today", 1);

  /* "cytimes/pddt.py":730
 *         :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.
 *         """
 *         arr_size = _parse_arr_size(size)             # <<<<<<<<<<<<<<
 *         return _pddt_fr_dt(utils.dt_now(None), arr_size, unit, name)
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_4pddt__parse_arr_size(__pyx_v_size); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-2L))) __PYX_ERR(0, 730, __pyx_L1_error)
  __pyx_v_arr_size = __pyx_t_1;

  /* "cytimes/pddt.py":731
 *         """
 *         arr_size = _parse_arr_size(size)
 *         return _pddt_fr_dt(utils.dt_now(None), arr_size, unit, name)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.tz = Py_None;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_now(&__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5.__pyx_n = 2;
  __pyx_t_5.unit = __pyx_v_unit;
  __pyx_t_5.name = __pyx_v_name;
  __pyx_t_4 = __pyx_f_7cytimes_4pddt__pddt_fr_dt(((PyDateTime_DateTime *)__pyx_t_2), __pyx_v_arr_size, &__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":712
 *         return _pddt_fr_dt(utils.dt_now(utils.UTC), arr_size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def today(
 *         cls,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.today", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":733
 *         return _pddt_fr_dt(utils.dt_now(None), arr_size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def combine(
 *         cls,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_13combine(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_12combine, "Combine date and time into datetime index `<'Pddt'>`.\n\n        :param date `<'date/str/None'>`: A date-like object, defaults to `None`.\n            - `<'datetime.date'>` An instance of `datetime.date`.\n            - `<'str'>` A date string.\n            - `<'None'>` Use the current local date.\n\n        :param time `<'time/str/None'>`: A time-like object, defaults to `None`.\n            - `<'datetime.time'>` An instance of `datetime.time`.\n            - `<'str'>` A time string.\n            - `<'None'>` Use the current local time.\n\n        :param tz `<'str/tzinfo/None'>`: The timezone of the index, defaults to `None`.\n            - `<'datetime.tzinfo'>` A subclass of `datetime.tzinfo`.\n            - `<'str'>` Timezone name supported by the 'Zoneinfo' module, or `'local'` for local timezone.\n            - `<'None'>` Timezone-naive.\n\n        :param size `<'int/str/bytes/object'>`: The size of the index to generate, defaults to `1`.\n            - `<'int/str/bytes'>` Representing an integer for the number of elements in the index.\n            - `<'object'>` Any object that implements `__len__()`, where its length represents the size of the index.\n\n        :param unit `<'str/None'>`: Set the datetime unit of the index, defaults to `None`.\n            Supported datetime units: 's', 'ms', 'us', 'ns'.\n\n        :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_13combine = {"combine", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_13combine, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_12combine};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_13combine(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_date = 0;
  PyObject *__pyx_v_time = 0;
  PyObject *__pyx_v_tz = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[7] = {0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("combine (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_date,&__pyx_n_s_time,&__pyx_n_s_tz,&__pyx_n_s_size,&__pyx_n_s_unit,&__pyx_n_s_name,0};

    /* "cytimes/pddt.py":736
 *     def combine(
 *         cls,
 *         date: datetime.date | str | None = None,             # <<<<<<<<<<<<<<
 *         time: datetime.time | str | None = None,
 *         tz: datetime.tzinfo | str | None = None,
 */
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "cytimes/pddt.py":737
 *         cls,
 *         date: datetime.date | str | None = None,
 *         time: datetime.time | str | None = None,             # <<<<<<<<<<<<<<
 *         tz: datetime.tzinfo | str | None = None,
 *         size: object = 1,
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "cytimes/pddt.py":738
 *         date: datetime.date | str | None = None,
 *         time: datetime.time | str | None = None,
 *         tz: datetime.tzinfo | str | None = None,             # <<<<<<<<<<<<<<
 *         size: object = 1,
 *         unit: str = None,
 */
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1)));

    /* "cytimes/pddt.py":740
 *         tz: datetime.tzinfo | str | None = None,
 *         size: object = 1,
 *         unit: str = None,             # <<<<<<<<<<<<<<
 *         name: Hashable | None = None,
 *     ) -> Self:
 */
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));

    /* "cytimes/pddt.py":741
 *         size: object = 1,
 *         unit: str = None,
 *         name: Hashable | None = None,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Combine date and time into datetime index `<'Pddt'>`.
 */
    values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 733, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_date);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 733, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_time);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 733, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tz);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 733, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 733, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 733, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 733, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "combine") < 0)) __PYX_ERR(0, 733, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_date = values[1];
    __pyx_v_time = values[2];
    __pyx_v_tz = values[3];
    __pyx_v_size = values[4];
    __pyx_v_unit = ((PyObject*)values[5]);
    __pyx_v_name = values[6];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("combine", 0, 1, 7, __pyx_nargs); __PYX_ERR(0, 733, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.combine", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 1, "unit", 1))) __PYX_ERR(0, 740, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_12combine(__pyx_self, __pyx_v_cls, __pyx_v_date, __pyx_v_time, __pyx_v_tz, __pyx_v_size, __pyx_v_unit, __pyx_v_name);

  /* "cytimes/pddt.py":733
 *         return _pddt_fr_dt(utils.dt_now(None), arr_size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def combine(
 *         cls,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_12combine(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_date, PyObject *__pyx_v_time, PyObject *__pyx_v_tz, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name) {
  Py_ssize_t __pyx_v_arr_size;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  struct __pyx_opt_args_7cytimes_4pddt__parse_dtobj __pyx_t_8;
  unsigned int __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_dt_combine __pyx_t_10;
  struct __pyx_opt_args_7cytimes_4pddt__pddt_fr_dt __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("combine", 0);
  __Pyx_INCREF(__pyx_v_date);
  __Pyx_INCREF(__pyx_v_time);
  __Pyx_INCREF(__pyx_v_tz);

  /* "cytimes/pddt.py":769
 *         :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.
 *         """
 *         arr_size, tz = _parse_arr_size(size), utils.tz_parse(tz)             # <<<<<<<<<<<<<<
 *         if date is not None and not utils.is_date(date):
 *             date = _parse_dtobj(date)
 */
  __pyx_t_1 = __pyx_f_7cytimes_4pddt__parse_arr_size(__pyx_v_size); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-2L))) __PYX_ERR(0, 769, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7cytimes_5utils_tz_parse(__pyx_v_tz); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_arr_size = __pyx_t_1;
  __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":770
 *         """
 *         arr_size, tz = _parse_arr_size(size), utils.tz_parse(tz)
 *         if date is not None and not utils.is_date(date):             # <<<<<<<<<<<<<<
 *             date = _parse_dtobj(date)
 *         if time is not None and not utils.is_time(time):
 */
  __pyx_t_4 = (__pyx_v_date != Py_None);
  if (__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __pyx_f_7cytimes_5utils_is_date(__pyx_v_date); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 770, __pyx_L1_error)
  __pyx_t_5 = (!__pyx_t_4);
  __pyx_t_3 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":771
 *         arr_size, tz = _parse_arr_size(size), utils.tz_parse(tz)
 *         if date is not None and not utils.is_date(date):
 *             date = _parse_dtobj(date)             # <<<<<<<<<<<<<<
 *         if time is not None and not utils.is_time(time):
 *             time = _parse_dtobj(time, datetime.date_new(1970, 1, 1)).timetz()
 */
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_4pddt__parse_dtobj(__pyx_v_date, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_date, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":770
 *         """
 *         arr_size, tz = _parse_arr_size(size), utils.tz_parse(tz)
 *         if date is not None and not utils.is_date(date):             # <<<<<<<<<<<<<<
 *             date = _parse_dtobj(date)
 *         if time is not None and not utils.is_time(time):
 */
  }

  /* "cytimes/pddt.py":772
 *         if date is not None and not utils.is_date(date):
 *             date = _parse_dtobj(date)
 *         if time is not None and not utils.is_time(time):             # <<<<<<<<<<<<<<
 *             time = _parse_dtobj(time, datetime.date_new(1970, 1, 1)).timetz()
 *         return _pddt_fr_dt(utils.dt_combine(date, time, tz), arr_size, unit, name)
 */
  __pyx_t_5 = (__pyx_v_time != Py_None);
  if (__pyx_t_5) {
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_5 = __pyx_f_7cytimes_5utils_is_time(__pyx_v_time); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 772, __pyx_L1_error)
  __pyx_t_4 = (!__pyx_t_5);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":773
 *             date = _parse_dtobj(date)
 *         if time is not None and not utils.is_time(time):
 *             time = _parse_dtobj(time, datetime.date_new(1970, 1, 1)).timetz()             # <<<<<<<<<<<<<<
 *         return _pddt_fr_dt(utils.dt_combine(date, time, tz), arr_size, unit, name)
 * 
 */
    __pyx_t_6 = ((PyObject *)__pyx_f_7cpython_8datetime_date_new(0x7B2, 1, 1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.__pyx_default = __pyx_t_6;
    __pyx_t_7 = ((PyObject *)__pyx_f_7cytimes_4pddt__parse_dtobj(__pyx_v_time, &__pyx_t_8)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_timetz); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 773, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_time, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":772
 *         if date is not None and not utils.is_date(date):
 *             date = _parse_dtobj(date)
 *         if time is not None and not utils.is_time(time):             # <<<<<<<<<<<<<<
 *             time = _parse_dtobj(time, datetime.date_new(1970, 1, 1)).timetz()
 *         return _pddt_fr_dt(utils.dt_combine(date, time, tz), arr_size, unit, name)
 */
  }

  /* "cytimes/pddt.py":774
 *         if time is not None and not utils.is_time(time):
 *             time = _parse_dtobj(time, datetime.date_new(1970, 1, 1)).timetz()
 *         return _pddt_fr_dt(utils.dt_combine(date, time, tz), arr_size, unit, name)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_7cpython_8datetime_date))))) __PYX_ERR(0, 774, __pyx_L1_error)
  if (!(likely(((__pyx_v_time) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_time, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(0, 774, __pyx_L1_error)
  __pyx_t_10.__pyx_n = 3;
  __pyx_t_10.date = ((PyDateTime_Date *)__pyx_v_date);
  __pyx_t_10.time = ((PyDateTime_Time *)__pyx_v_time);
  __pyx_t_10.tz = __pyx_v_tz;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_combine(&__pyx_t_10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11.__pyx_n = 2;
  __pyx_t_11.unit = __pyx_v_unit;
  __pyx_t_11.name = __pyx_v_name;
  __pyx_t_6 = __pyx_f_7cytimes_4pddt__pddt_fr_dt(((PyDateTime_DateTime *)__pyx_t_2), __pyx_v_arr_size, &__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":733
 *         return _pddt_fr_dt(utils.dt_now(None), arr_size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def combine(
 *         cls,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.combine", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_date);
  __Pyx_XDECREF(__pyx_v_time);
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":776
 *         return _pddt_fr_dt(utils.dt_combine(date, time, tz), arr_size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromordinal(
 *         cls,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_15fromordinal(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_14fromordinal, "Construct from Gregorian ordinal days with optional timezone `<'Pddt'>`.\n\n        :param ordinal `<'int/Array-like'>`: The ordinal days to construct with.\n            - `<'int'>` An integer representing the ordinal days.\n            - `<'Array-like'>` An array-like object containing the ordinal days.\n\n        :param tz `<'str/tzinfo/None'>`: The timezone of the index, defaults to `None`.\n            - `<'datetime.tzinfo'>` A subclass of `datetime.tzinfo`.\n            - `<'str'>` Timezone name supported by the 'Zoneinfo' module, or `'local'` for local timezone.\n            - `<'None'>` Timezone-naive.\n\n        :param size `<'int/str/bytes/object'>`: The size of the index to generate, defaults to `1`.\n            - This argument is `ignored` if 'ordinal' is an array-like object.\n            - `<'int/str/bytes'>` Representing an integer for the number of elements in the index.\n            - `<'object'>` Any object that implements `__len__()`, where its length represents the size of the index.\n\n        :param unit `<'str/None'>`: Set the datetime unit of the index, defaults to `None`.\n            Supported datetime units: 's', 'ms', 'us', 'ns'.\n\n        :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_15fromordinal = {"fromordinal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_15fromordinal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_14fromordinal};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_15fromordinal(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_ordinal = 0;
  PyObject *__pyx_v_tz = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fromordinal (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_ordinal,&__pyx_n_s_tz,&__pyx_n_s_size,&__pyx_n_s_unit,&__pyx_n_s_name,0};

    /* "cytimes/pddt.py":780
 *         cls,
 *         ordinal: int | object,
 *         tz: datetime.tzinfo | str | None = None,             # <<<<<<<<<<<<<<
 *         size: object = 1,
 *         unit: str = None,
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1)));

    /* "cytimes/pddt.py":782
 *         tz: datetime.tzinfo | str | None = None,
 *         size: object = 1,
 *         unit: str = None,             # <<<<<<<<<<<<<<
 *         name: Hashable | None = None,
 *     ) -> Self:
 */
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));

    /* "cytimes/pddt.py":783
 *         size: object = 1,
 *         unit: str = None,
 *         name: Hashable | None = None,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Construct from Gregorian ordinal days with optional timezone `<'Pddt'>`.
 */
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ordinal)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("fromordinal", 0, 2, 6, 1); __PYX_ERR(0, 776, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tz);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fromordinal") < 0)) __PYX_ERR(0, 776, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_ordinal = values[1];
    __pyx_v_tz = values[2];
    __pyx_v_size = values[3];
    __pyx_v_unit = ((PyObject*)values[4]);
    __pyx_v_name = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fromordinal", 0, 2, 6, __pyx_nargs); __PYX_ERR(0, 776, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fromordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 1, "unit", 1))) __PYX_ERR(0, 782, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_14fromordinal(__pyx_self, __pyx_v_cls, __pyx_v_ordinal, __pyx_v_tz, __pyx_v_size, __pyx_v_unit, __pyx_v_name);

  /* "cytimes/pddt.py":776
 *         return _pddt_fr_dt(utils.dt_combine(date, time, tz), arr_size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromordinal(
 *         cls,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_14fromordinal(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_ordinal, PyObject *__pyx_v_tz, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name) {
  PyArrayObject *__pyx_v_arr = 0;
  Py_ssize_t __pyx_v_arr_size;
  PY_LONG_LONG __pyx_v_val;
  PyObject *__pyx_v_err = NULL;
  npy_int64 *__pyx_v_arr_ptr;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PY_LONG_LONG __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  unsigned int __pyx_t_16;
  int __pyx_t_17;
  char const *__pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  long __pyx_t_25;
  PY_LONG_LONG __pyx_t_26;
  struct __pyx_opt_args_7cytimes_4pddt__pddt_fr_us __pyx_t_27;
  npy_intp __pyx_t_28[1];
  PyObject *(*__pyx_t_29)(PyObject *);
  PyObject *__pyx_t_30 = NULL;
  char const *__pyx_t_31;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_32;
  struct __pyx_opt_args_7cytimes_5utils_arr_clip __pyx_t_33;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fromordinal", 0);
  __Pyx_INCREF(__pyx_v_ordinal);

  /* "cytimes/pddt.py":812
 * 
 *         # Single value
 *         if isinstance(ordinal, (int, float, str, bytes)):             # <<<<<<<<<<<<<<
 *             # . convert to microseconds
 *             arr_size = _parse_arr_size(size)
 */
  __pyx_t_2 = PyInt_Check(__pyx_v_ordinal); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyFloat_Check(__pyx_v_ordinal); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyUnicode_Check(__pyx_v_ordinal); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyBytes_Check(__pyx_v_ordinal); 
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":814
 *         if isinstance(ordinal, (int, float, str, bytes)):
 *             # . convert to microseconds
 *             arr_size = _parse_arr_size(size)             # <<<<<<<<<<<<<<
 *             try:
 *                 val = int(ordinal)
 */
    __pyx_t_3 = __pyx_f_7cytimes_4pddt__parse_arr_size(__pyx_v_size); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-2L))) __PYX_ERR(0, 814, __pyx_L1_error)
    __pyx_v_arr_size = __pyx_t_3;

    /* "cytimes/pddt.py":815
 *             # . convert to microseconds
 *             arr_size = _parse_arr_size(size)
 *             try:             # <<<<<<<<<<<<<<
 *                 val = int(ordinal)
 *             except Exception as err:
 */
    {
      __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:*/ {

        /* "cytimes/pddt.py":816
 *             arr_size = _parse_arr_size(size)
 *             try:
 *                 val = int(ordinal)             # <<<<<<<<<<<<<<
 *             except Exception as err:
 *                 raise errors.InvalidTypeError(
 */
        __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_v_ordinal); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 816, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_7); if (unlikely((__pyx_t_8 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 816, __pyx_L8_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_val = __pyx_t_8;

        /* "cytimes/pddt.py":815
 *             # . convert to microseconds
 *             arr_size = _parse_arr_size(size)
 *             try:             # <<<<<<<<<<<<<<
 *                 val = int(ordinal)
 *             except Exception as err:
 */
      }
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L13_try_end;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cytimes/pddt.py":817
 *             try:
 *                 val = int(ordinal)
 *             except Exception as err:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidTypeError(
 *                     "cannot convert '%s' to an integer "
 */
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
      if (__pyx_t_9) {
        __Pyx_AddTraceback("cytimes.pddt.Pddt.fromordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_10, &__pyx_t_11) < 0) __PYX_ERR(0, 817, __pyx_L10_except_error)
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_10);
        __pyx_v_err = __pyx_t_10;
        /*try:*/ {

          /* "cytimes/pddt.py":818
 *                 val = int(ordinal)
 *             except Exception as err:
 *                 raise errors.InvalidTypeError(             # <<<<<<<<<<<<<<
 *                     "cannot convert '%s' to an integer "
 *                     "to represent the ordinal value." % ordinal
 */
          __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_errors); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 818, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_InvalidTypeError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 818, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

          /* "cytimes/pddt.py":820
 *                 raise errors.InvalidTypeError(
 *                     "cannot convert '%s' to an integer "
 *                     "to represent the ordinal value." % ordinal             # <<<<<<<<<<<<<<
 *                 ) from err
 *             val = min(max(val, 1), utils.ORDINAL_MAX)
 */
          __pyx_t_13 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_cannot_convert_s_to_an_integer_t_2, __pyx_v_ordinal); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 820, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_15 = NULL;
          __pyx_t_16 = 0;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_14))) {
            __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
            if (likely(__pyx_t_15)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
              __Pyx_INCREF(__pyx_t_15);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_14, function);
              __pyx_t_16 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_13};
            __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 818, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          }

          /* "cytimes/pddt.py":821
 *                     "cannot convert '%s' to an integer "
 *                     "to represent the ordinal value." % ordinal
 *                 ) from err             # <<<<<<<<<<<<<<
 *             val = min(max(val, 1), utils.ORDINAL_MAX)
 *             val = (val - utils.EPOCH_DAY) * utils.US_DAY
 */
          __Pyx_Raise(__pyx_t_12, 0, 0, __pyx_v_err);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __PYX_ERR(0, 818, __pyx_L19_error)
        }

        /* "cytimes/pddt.py":817
 *             try:
 *                 val = int(ordinal)
 *             except Exception as err:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidTypeError(
 *                     "cannot convert '%s' to an integer "
 */
        /*finally:*/ {
          __pyx_L19_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_22);
            __Pyx_XGOTREF(__pyx_t_23);
            __Pyx_XGOTREF(__pyx_t_24);
            __pyx_t_9 = __pyx_lineno; __pyx_t_17 = __pyx_clineno; __pyx_t_18 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
            }
            if (PY_MAJOR_VERSION >= 3) {
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_XGIVEREF(__pyx_t_24);
              __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24);
            }
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ErrRestore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
            __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0;
            __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_17; __pyx_filename = __pyx_t_18;
            goto __pyx_L10_except_error;
          }
        }
      }
      goto __pyx_L10_except_error;

      /* "cytimes/pddt.py":815
 *             # . convert to microseconds
 *             arr_size = _parse_arr_size(size)
 *             try:             # <<<<<<<<<<<<<<
 *                 val = int(ordinal)
 *             except Exception as err:
 */
      __pyx_L10_except_error:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      goto __pyx_L1_error;
      __pyx_L13_try_end:;
    }

    /* "cytimes/pddt.py":822
 *                     "to represent the ordinal value." % ordinal
 *                 ) from err
 *             val = min(max(val, 1), utils.ORDINAL_MAX)             # <<<<<<<<<<<<<<
 *             val = (val - utils.EPOCH_DAY) * utils.US_DAY
 *             # . new instance
 */
    __pyx_t_17 = __pyx_v_7cytimes_5utils_ORDINAL_MAX;
    __pyx_t_25 = 1;
    __pyx_t_8 = __pyx_v_val;
    __pyx_t_1 = (__pyx_t_25 > __pyx_t_8);
    if (__pyx_t_1) {
      __pyx_t_26 = __pyx_t_25;
    } else {
      __pyx_t_26 = __pyx_t_8;
    }
    __pyx_t_8 = __pyx_t_26;
    __pyx_t_1 = (__pyx_t_17 < __pyx_t_8);
    if (__pyx_t_1) {
      __pyx_t_26 = __pyx_t_17;
    } else {
      __pyx_t_26 = __pyx_t_8;
    }
    __pyx_v_val = __pyx_t_26;

    /* "cytimes/pddt.py":823
 *                 ) from err
 *             val = min(max(val, 1), utils.ORDINAL_MAX)
 *             val = (val - utils.EPOCH_DAY) * utils.US_DAY             # <<<<<<<<<<<<<<
 *             # . new instance
 *             return _pddt_fr_us(val, arr_size, tz, unit, name)
 */
    __pyx_v_val = ((__pyx_v_val - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_US_DAY);

    /* "cytimes/pddt.py":825
 *             val = (val - utils.EPOCH_DAY) * utils.US_DAY
 *             # . new instance
 *             return _pddt_fr_us(val, arr_size, tz, unit, name)             # <<<<<<<<<<<<<<
 * 
 *         # <'list'/'tuple'>
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_27.__pyx_n = 3;
    __pyx_t_27.tz = __pyx_v_tz;
    __pyx_t_27.unit = __pyx_v_unit;
    __pyx_t_27.name = __pyx_v_name;
    __pyx_t_11 = __pyx_f_7cytimes_4pddt__pddt_fr_us(__pyx_v_val, __pyx_v_arr_size, &__pyx_t_27); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 825, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_r = __pyx_t_11;
    __pyx_t_11 = 0;
    goto __pyx_L0;

    /* "cytimes/pddt.py":812
 * 
 *         # Single value
 *         if isinstance(ordinal, (int, float, str, bytes)):             # <<<<<<<<<<<<<<
 *             # . convert to microseconds
 *             arr_size = _parse_arr_size(size)
 */
  }

  /* "cytimes/pddt.py":828
 * 
 *         # <'list'/'tuple'>
 *         if isinstance(ordinal, (list, tuple)):             # <<<<<<<<<<<<<<
 *             # . convert to ndarray[datetime64]
 *             arr_size = len(ordinal)
 */
  __pyx_t_2 = PyList_Check(__pyx_v_ordinal); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L26_bool_binop_done;
  }
  __pyx_t_2 = PyTuple_Check(__pyx_v_ordinal); 
  __pyx_t_1 = __pyx_t_2;
  __pyx_L26_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":830
 *         if isinstance(ordinal, (list, tuple)):
 *             # . convert to ndarray[datetime64]
 *             arr_size = len(ordinal)             # <<<<<<<<<<<<<<
 *             arr = np.PyArray_EMPTY(1, [arr_size], np.NPY_TYPES.NPY_INT64, 0)
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 */
    __pyx_t_3 = PyObject_Length(__pyx_v_ordinal); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 830, __pyx_L1_error)
    __pyx_v_arr_size = __pyx_t_3;

    /* "cytimes/pddt.py":831
 *             # . convert to ndarray[datetime64]
 *             arr_size = len(ordinal)
 *             arr = np.PyArray_EMPTY(1, [arr_size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 *             i: cython.Py_ssize_t = 0
 */
    __pyx_t_28[0] = __pyx_v_arr_size;
    __pyx_t_11 = PyArray_EMPTY(1, __pyx_t_28, NPY_INT64, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 831, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 831, __pyx_L1_error)
    __pyx_v_arr = ((PyArrayObject *)__pyx_t_11);
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":832
 *             arr_size = len(ordinal)
 *             arr = np.PyArray_EMPTY(1, [arr_size], np.NPY_TYPES.NPY_INT64, 0)
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))             # <<<<<<<<<<<<<<
 *             i: cython.Py_ssize_t = 0
 *             for item in ordinal:
 */
    __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

    /* "cytimes/pddt.py":833
 *             arr = np.PyArray_EMPTY(1, [arr_size], np.NPY_TYPES.NPY_INT64, 0)
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 *             i: cython.Py_ssize_t = 0             # <<<<<<<<<<<<<<
 *             for item in ordinal:
 *                 try:
 */
    __pyx_v_i = 0;

    /* "cytimes/pddt.py":834
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 *             i: cython.Py_ssize_t = 0
 *             for item in ordinal:             # <<<<<<<<<<<<<<
 *                 try:
 *                     val = int(item)
 */
    if (likely(PyList_CheckExact(__pyx_v_ordinal)) || PyTuple_CheckExact(__pyx_v_ordinal)) {
      __pyx_t_11 = __pyx_v_ordinal; __Pyx_INCREF(__pyx_t_11);
      __pyx_t_3 = 0;
      __pyx_t_29 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_v_ordinal); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 834, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_29 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 834, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_29)) {
        if (likely(PyList_CheckExact(__pyx_t_11))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 834, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_3); __Pyx_INCREF(__pyx_t_10); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 834, __pyx_L1_error)
          #else
          __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 834, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 834, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_3); __Pyx_INCREF(__pyx_t_10); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 834, __pyx_L1_error)
          #else
          __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 834, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        }
      } else {
        __pyx_t_10 = __pyx_t_29(__pyx_t_11);
        if (unlikely(!__pyx_t_10)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 834, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "cytimes/pddt.py":835
 *             i: cython.Py_ssize_t = 0
 *             for item in ordinal:
 *                 try:             # <<<<<<<<<<<<<<
 *                     val = int(item)
 *                 except Exception as err:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_4);
        /*try:*/ {

          /* "cytimes/pddt.py":836
 *             for item in ordinal:
 *                 try:
 *                     val = int(item)             # <<<<<<<<<<<<<<
 *                 except Exception as err:
 *                     raise errors.InvalidTypeError(
 */
          __pyx_t_10 = __Pyx_PyNumber_Int(__pyx_v_item); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 836, __pyx_L30_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_26 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_10); if (unlikely((__pyx_t_26 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 836, __pyx_L30_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_v_val = __pyx_t_26;

          /* "cytimes/pddt.py":835
 *             i: cython.Py_ssize_t = 0
 *             for item in ordinal:
 *                 try:             # <<<<<<<<<<<<<<
 *                     val = int(item)
 *                 except Exception as err:
 */
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L37_try_end;
        __pyx_L30_error:;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "cytimes/pddt.py":837
 *                 try:
 *                     val = int(item)
 *                 except Exception as err:             # <<<<<<<<<<<<<<
 *                     raise errors.InvalidTypeError(
 *                         "cannot convert '%s' to an integer "
 */
        __pyx_t_17 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
        if (__pyx_t_17) {
          __Pyx_AddTraceback("cytimes.pddt.Pddt.fromordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_7, &__pyx_t_12) < 0) __PYX_ERR(0, 837, __pyx_L32_except_error)
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_7);
          __pyx_v_err = __pyx_t_7;
          /*try:*/ {

            /* "cytimes/pddt.py":838
 *                     val = int(item)
 *                 except Exception as err:
 *                     raise errors.InvalidTypeError(             # <<<<<<<<<<<<<<
 *                         "cannot convert '%s' to an integer "
 *                         "to represent the ordinal value." % item
 */
            __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_errors); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 838, __pyx_L43_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_InvalidTypeError); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 838, __pyx_L43_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

            /* "cytimes/pddt.py":840
 *                     raise errors.InvalidTypeError(
 *                         "cannot convert '%s' to an integer "
 *                         "to represent the ordinal value." % item             # <<<<<<<<<<<<<<
 *                     ) from err
 *                 val = min(max(val, 1), utils.ORDINAL_MAX)
 */
            __pyx_t_13 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_cannot_convert_s_to_an_integer_t_2, __pyx_v_item); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 840, __pyx_L43_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_30 = NULL;
            __pyx_t_16 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_15))) {
              __pyx_t_30 = PyMethod_GET_SELF(__pyx_t_15);
              if (likely(__pyx_t_30)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
                __Pyx_INCREF(__pyx_t_30);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_15, function);
                __pyx_t_16 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_30, __pyx_t_13};
              __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
              __Pyx_XDECREF(__pyx_t_30); __pyx_t_30 = 0;
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 838, __pyx_L43_error)
              __Pyx_GOTREF(__pyx_t_14);
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            }

            /* "cytimes/pddt.py":841
 *                         "cannot convert '%s' to an integer "
 *                         "to represent the ordinal value." % item
 *                     ) from err             # <<<<<<<<<<<<<<
 *                 val = min(max(val, 1), utils.ORDINAL_MAX)
 *                 val = (val - utils.EPOCH_DAY) * utils.US_DAY
 */
            __Pyx_Raise(__pyx_t_14, 0, 0, __pyx_v_err);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __PYX_ERR(0, 838, __pyx_L43_error)
          }

          /* "cytimes/pddt.py":837
 *                 try:
 *                     val = int(item)
 *                 except Exception as err:             # <<<<<<<<<<<<<<
 *                     raise errors.InvalidTypeError(
 *                         "cannot convert '%s' to an integer "
 */
          /*finally:*/ {
            __pyx_L43_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0;
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_XDECREF(__pyx_t_30); __pyx_t_30 = 0;
              if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
              if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22) < 0)) __Pyx_ErrFetch(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22);
              __Pyx_XGOTREF(__pyx_t_24);
              __Pyx_XGOTREF(__pyx_t_23);
              __Pyx_XGOTREF(__pyx_t_22);
              __Pyx_XGOTREF(__pyx_t_21);
              __Pyx_XGOTREF(__pyx_t_20);
              __Pyx_XGOTREF(__pyx_t_19);
              __pyx_t_17 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_31 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
              }
              if (PY_MAJOR_VERSION >= 3) {
                __Pyx_XGIVEREF(__pyx_t_21);
                __Pyx_XGIVEREF(__pyx_t_20);
                __Pyx_XGIVEREF(__pyx_t_19);
                __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19);
              }
              __Pyx_XGIVEREF(__pyx_t_24);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_ErrRestore(__pyx_t_24, __pyx_t_23, __pyx_t_22);
              __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0;
              __pyx_lineno = __pyx_t_17; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_31;
              goto __pyx_L32_except_error;
            }
          }
        }
        goto __pyx_L32_except_error;

        /* "cytimes/pddt.py":835
 *             i: cython.Py_ssize_t = 0
 *             for item in ordinal:
 *                 try:             # <<<<<<<<<<<<<<
 *                     val = int(item)
 *                 except Exception as err:
 */
        __pyx_L32_except_error:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4);
        goto __pyx_L1_error;
        __pyx_L37_try_end:;
      }

      /* "cytimes/pddt.py":842
 *                         "to represent the ordinal value." % item
 *                     ) from err
 *                 val = min(max(val, 1), utils.ORDINAL_MAX)             # <<<<<<<<<<<<<<
 *                 val = (val - utils.EPOCH_DAY) * utils.US_DAY
 *                 arr_ptr[i] = val
 */
      __pyx_t_9 = __pyx_v_7cytimes_5utils_ORDINAL_MAX;
      __pyx_t_25 = 1;
      __pyx_t_26 = __pyx_v_val;
      __pyx_t_1 = (__pyx_t_25 > __pyx_t_26);
      if (__pyx_t_1) {
        __pyx_t_8 = __pyx_t_25;
      } else {
        __pyx_t_8 = __pyx_t_26;
      }
      __pyx_t_26 = __pyx_t_8;
      __pyx_t_1 = (__pyx_t_9 < __pyx_t_26);
      if (__pyx_t_1) {
        __pyx_t_8 = __pyx_t_9;
      } else {
        __pyx_t_8 = __pyx_t_26;
      }
      __pyx_v_val = __pyx_t_8;

      /* "cytimes/pddt.py":843
 *                     ) from err
 *                 val = min(max(val, 1), utils.ORDINAL_MAX)
 *                 val = (val - utils.EPOCH_DAY) * utils.US_DAY             # <<<<<<<<<<<<<<
 *                 arr_ptr[i] = val
 *                 i += 1
 */
      __pyx_v_val = ((__pyx_v_val - __pyx_v_7cytimes_5utils_EPOCH_DAY) * __pyx_v_7cytimes_5utils_US_DAY);

      /* "cytimes/pddt.py":844
 *                 val = min(max(val, 1), utils.ORDINAL_MAX)
 *                 val = (val - utils.EPOCH_DAY) * utils.US_DAY
 *                 arr_ptr[i] = val             # <<<<<<<<<<<<<<
 *                 i += 1
 *             arr = arr.astype("datetime64[us]")
 */
      (__pyx_v_arr_ptr[__pyx_v_i]) = __pyx_v_val;

      /* "cytimes/pddt.py":845
 *                 val = (val - utils.EPOCH_DAY) * utils.US_DAY
 *                 arr_ptr[i] = val
 *                 i += 1             # <<<<<<<<<<<<<<
 *             arr = arr.astype("datetime64[us]")
 *             # . new instance
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "cytimes/pddt.py":834
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 *             i: cython.Py_ssize_t = 0
 *             for item in ordinal:             # <<<<<<<<<<<<<<
 *                 try:
 *                     val = int(item)
 */
    }
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "cytimes/pddt.py":846
 *                 arr_ptr[i] = val
 *                 i += 1
 *             arr = arr.astype("datetime64[us]")             # <<<<<<<<<<<<<<
 *             # . new instance
 *             return pddt_new_simple(arr, tz, unit, name)
 */
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 846, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_7 = NULL;
    __pyx_t_16 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
        __pyx_t_16 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_u_datetime64_us};
      __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 846, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 846, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_11));
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":848
 *             arr = arr.astype("datetime64[us]")
 *             # . new instance
 *             return pddt_new_simple(arr, tz, unit, name)             # <<<<<<<<<<<<<<
 * 
 *         # <'pandas.Series'>
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_32.__pyx_n = 3;
    __pyx_t_32.tz = __pyx_v_tz;
    __pyx_t_32.unit = __pyx_v_unit;
    __pyx_t_32.name = __pyx_v_name;
    __pyx_t_11 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_r = __pyx_t_11;
    __pyx_t_11 = 0;
    goto __pyx_L0;

    /* "cytimes/pddt.py":828
 * 
 *         # <'list'/'tuple'>
 *         if isinstance(ordinal, (list, tuple)):             # <<<<<<<<<<<<<<
 *             # . convert to ndarray[datetime64]
 *             arr_size = len(ordinal)
 */
  }

  /* "cytimes/pddt.py":851
 * 
 *         # <'pandas.Series'>
 *         if isinstance(ordinal, (Series, Index)):             # <<<<<<<<<<<<<<
 *             ordinal = ordinal.values
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_Series); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_Index); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_ordinal, __pyx_t_11); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L51_bool_binop_done;
  }
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_ordinal, __pyx_t_12); 
  __pyx_t_1 = __pyx_t_2;
  __pyx_L51_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":852
 *         # <'pandas.Series'>
 *         if isinstance(ordinal, (Series, Index)):
 *             ordinal = ordinal.values             # <<<<<<<<<<<<<<
 * 
 *         # <'numpy.ndarray'>
 */
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_ordinal, __pyx_n_s_values); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 852, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF_SET(__pyx_v_ordinal, __pyx_t_11);
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":851
 * 
 *         # <'pandas.Series'>
 *         if isinstance(ordinal, (Series, Index)):             # <<<<<<<<<<<<<<
 *             ordinal = ordinal.values
 * 
 */
  }

  /* "cytimes/pddt.py":855
 * 
 *         # <'numpy.ndarray'>
 *         if isinstance(ordinal, np.ndarray):             # <<<<<<<<<<<<<<
 *             # . validate array
 *             arr = ordinal
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_ordinal, __pyx_ptype_5numpy_ndarray); 
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":857
 *         if isinstance(ordinal, np.ndarray):
 *             # . validate array
 *             arr = ordinal             # <<<<<<<<<<<<<<
 *             if arr.ndim != 1:
 *                 raise errors.InvalidTypeError(
 */
    if (!(likely(((__pyx_v_ordinal) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_ordinal, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 857, __pyx_L1_error)
    __pyx_t_11 = __pyx_v_ordinal;
    __Pyx_INCREF(__pyx_t_11);
    __pyx_v_arr = ((PyArrayObject *)__pyx_t_11);
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":858
 *             # . validate array
 *             arr = ordinal
 *             if arr.ndim != 1:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidTypeError(
 *                     "must be an 1-dimensional ndarray, instead of %d-dim." % arr.ndim
 */
    __pyx_t_1 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr) != 1);
    if (unlikely(__pyx_t_1)) {

      /* "cytimes/pddt.py":859
 *             arr = ordinal
 *             if arr.ndim != 1:
 *                 raise errors.InvalidTypeError(             # <<<<<<<<<<<<<<
 *                     "must be an 1-dimensional ndarray, instead of %d-dim." % arr.ndim
 *                 )
 */
      __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_errors); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 859, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_InvalidTypeError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 859, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "cytimes/pddt.py":860
 *             if arr.ndim != 1:
 *                 raise errors.InvalidTypeError(
 *                     "must be an 1-dimensional ndarray, instead of %d-dim." % arr.ndim             # <<<<<<<<<<<<<<
 *                 )
 *             # . convert to ndarray[datetime64]
 */
      __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 860, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_10 = PyUnicode_Format(__pyx_kp_u_must_be_an_1_dimensional_ndarray, __pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 860, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = NULL;
      __pyx_t_16 = 0;
      #if CYTHON_UNPACK_METHODS
      if (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_16 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_10};
        __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 859, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_Raise(__pyx_t_11, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __PYX_ERR(0, 859, __pyx_L1_error)

      /* "cytimes/pddt.py":858
 *             # . validate array
 *             arr = ordinal
 *             if arr.ndim != 1:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidTypeError(
 *                     "must be an 1-dimensional ndarray, instead of %d-dim." % arr.ndim
 */
    }

    /* "cytimes/pddt.py":863
 *                 )
 *             # . convert to ndarray[datetime64]
 *             arr = utils.arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 *             arr = utils.arr_clip(arr, 1, utils.ORDINAL_MAX, -utils.EPOCH_DAY)
 *             arr = utils.arr_mul(arr, utils.US_DAY)
 */
    __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_11));
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":864
 *             # . convert to ndarray[datetime64]
 *             arr = utils.arr_assure_int64_like(arr)
 *             arr = utils.arr_clip(arr, 1, utils.ORDINAL_MAX, -utils.EPOCH_DAY)             # <<<<<<<<<<<<<<
 *             arr = utils.arr_mul(arr, utils.US_DAY)
 *             arr = arr.astype("datetime64[us]")
 */
    __pyx_t_33.__pyx_n = 1;
    __pyx_t_33.offset = (-__pyx_v_7cytimes_5utils_EPOCH_DAY);
    __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_clip(__pyx_v_arr, 1, __pyx_v_7cytimes_5utils_ORDINAL_MAX, &__pyx_t_33)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 864, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_11));
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":865
 *             arr = utils.arr_assure_int64_like(arr)
 *             arr = utils.arr_clip(arr, 1, utils.ORDINAL_MAX, -utils.EPOCH_DAY)
 *             arr = utils.arr_mul(arr, utils.US_DAY)             # <<<<<<<<<<<<<<
 *             arr = arr.astype("datetime64[us]")
 *             # . new instance
 */
    __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_DAY, NULL)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 865, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_11));
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":866
 *             arr = utils.arr_clip(arr, 1, utils.ORDINAL_MAX, -utils.EPOCH_DAY)
 *             arr = utils.arr_mul(arr, utils.US_DAY)
 *             arr = arr.astype("datetime64[us]")             # <<<<<<<<<<<<<<
 *             # . new instance
 *             return pddt_new_simple(arr, tz, unit, name)
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 866, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_10 = NULL;
    __pyx_t_16 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_16 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_kp_u_datetime64_us};
      __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 866, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 866, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_11));
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":868
 *             arr = arr.astype("datetime64[us]")
 *             # . new instance
 *             return pddt_new_simple(arr, tz, unit, name)             # <<<<<<<<<<<<<<
 * 
 *         # Invalid
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_32.__pyx_n = 3;
    __pyx_t_32.tz = __pyx_v_tz;
    __pyx_t_32.unit = __pyx_v_unit;
    __pyx_t_32.name = __pyx_v_name;
    __pyx_t_11 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 868, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_r = __pyx_t_11;
    __pyx_t_11 = 0;
    goto __pyx_L0;

    /* "cytimes/pddt.py":855
 * 
 *         # <'numpy.ndarray'>
 *         if isinstance(ordinal, np.ndarray):             # <<<<<<<<<<<<<<
 *             # . validate array
 *             arr = ordinal
 */
  }

  /* "cytimes/pddt.py":871
 * 
 *         # Invalid
 *         raise errors.InvalidTypeError(             # <<<<<<<<<<<<<<
 *             "unsupported type %s for argument 'ordinal'." % type(ordinal)
 *         )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_errors); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_InvalidTypeError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":872
 *         # Invalid
 *         raise errors.InvalidTypeError(
 *             "unsupported type %s for argument 'ordinal'." % type(ordinal)             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_7 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unsupported_type_s_for_argument, ((PyObject *)Py_TYPE(__pyx_v_ordinal))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_12 = NULL;
  __pyx_t_16 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
      __pyx_t_16 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_7};
    __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 871, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __PYX_ERR(0, 871, __pyx_L1_error)

  /* "cytimes/pddt.py":776
 *         return _pddt_fr_dt(utils.dt_combine(date, time, tz), arr_size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromordinal(
 *         cls,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_30);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fromordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_ordinal);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":875
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromseconds(
 *         cls,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_17fromseconds(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_16fromseconds, "Construct from seconds since Unix Epoch with optional timezone `<'Pddt'>`.\n\n        :param seconds `<'int/float/Array-like'>`: The seconds to construct with.\n            - `<'int/float'>` A numeric value representing the seconds since Unix Epoch.\n            - `<'Array-like'>` An array-like object containing the seconds.\n\n        :param tz `<'str/tzinfo/None'>`: The timezone of the index, defaults to `None`.\n            - `<'datetime.tzinfo'>` A subclass of `datetime.tzinfo`.\n            - `<'str'>` Timezone name supported by the 'Zoneinfo' module, or `'local'` for local timezone.\n            - `<'None'>` Timezone-naive.\n\n        :param size `<'int/str/bytes/object'>`: The size of the index to generate, defaults to `1`.\n            - This argument is `ignored` if 'seconds' is an array-like object.\n            - `<'int/str/bytes'>` Representing an integer for the number of elements in the index.\n            - `<'object'>` Any object that implements `__len__()`, where its length represents the size of the index.\n\n        :param unit `<'str/None'>`: Set the datetime unit of the index, defaults to `None`.\n            Supported datetime units: 's', 'ms', 'us', 'ns'.\n\n        :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_17fromseconds = {"fromseconds", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_17fromseconds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_16fromseconds};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_17fromseconds(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_seconds = 0;
  PyObject *__pyx_v_tz = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fromseconds (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_seconds,&__pyx_n_s_tz,&__pyx_n_s_size,&__pyx_n_s_unit,&__pyx_n_s_name,0};

    /* "cytimes/pddt.py":879
 *         cls,
 *         seconds: int | float | object,
 *         tz: datetime.tzinfo | str | None = None,             # <<<<<<<<<<<<<<
 *         size: object = 1,
 *         unit: str = None,
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1)));

    /* "cytimes/pddt.py":881
 *         tz: datetime.tzinfo | str | None = None,
 *         size: object = 1,
 *         unit: str = None,             # <<<<<<<<<<<<<<
 *         name: Hashable | None = None,
 *     ) -> Self:
 */
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));

    /* "cytimes/pddt.py":882
 *         size: object = 1,
 *         unit: str = None,
 *         name: Hashable | None = None,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Construct from seconds since Unix Epoch with optional timezone `<'Pddt'>`.
 */
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 875, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_seconds)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 875, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("fromseconds", 0, 2, 6, 1); __PYX_ERR(0, 875, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tz);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 875, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 875, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 875, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 875, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fromseconds") < 0)) __PYX_ERR(0, 875, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_seconds = values[1];
    __pyx_v_tz = values[2];
    __pyx_v_size = values[3];
    __pyx_v_unit = ((PyObject*)values[4]);
    __pyx_v_name = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fromseconds", 0, 2, 6, __pyx_nargs); __PYX_ERR(0, 875, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fromseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 1, "unit", 1))) __PYX_ERR(0, 881, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_16fromseconds(__pyx_self, __pyx_v_cls, __pyx_v_seconds, __pyx_v_tz, __pyx_v_size, __pyx_v_unit, __pyx_v_name);

  /* "cytimes/pddt.py":875
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromseconds(
 *         cls,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_16fromseconds(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_seconds, PyObject *__pyx_v_tz, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name) {
  PyArrayObject *__pyx_v_arr = 0;
  Py_ssize_t __pyx_v_arr_size;
  double __pyx_v_sec;
  PY_LONG_LONG __pyx_v_val;
  PyObject *__pyx_v_err = NULL;
  npy_int64 *__pyx_v_arr_ptr;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_item = NULL;
  Py_UCS4 __pyx_v_kind;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  double __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  unsigned int __pyx_t_16;
  int __pyx_t_17;
  char const *__pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  struct __pyx_opt_args_7cytimes_4pddt__pddt_fr_us __pyx_t_25;
  npy_intp __pyx_t_26[1];
  PyObject *(*__pyx_t_27)(PyObject *);
  PyObject *__pyx_t_28 = NULL;
  char const *__pyx_t_29;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_30;
  char __pyx_t_31;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fromseconds", 0);
  __Pyx_INCREF(__pyx_v_seconds);

  /* "cytimes/pddt.py":912
 * 
 *         # Single value
 *         if isinstance(seconds, (int, float, str, bytes)):             # <<<<<<<<<<<<<<
 *             # . convert to microseconds
 *             arr_size = _parse_arr_size(size)
 */
  __pyx_t_2 = PyInt_Check(__pyx_v_seconds); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyFloat_Check(__pyx_v_seconds); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyUnicode_Check(__pyx_v_seconds); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyBytes_Check(__pyx_v_seconds); 
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":914
 *         if isinstance(seconds, (int, float, str, bytes)):
 *             # . convert to microseconds
 *             arr_size = _parse_arr_size(size)             # <<<<<<<<<<<<<<
 *             try:
 *                 sec = float(seconds)
 */
    __pyx_t_3 = __pyx_f_7cytimes_4pddt__parse_arr_size(__pyx_v_size); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-2L))) __PYX_ERR(0, 914, __pyx_L1_error)
    __pyx_v_arr_size = __pyx_t_3;

    /* "cytimes/pddt.py":915
 *             # . convert to microseconds
 *             arr_size = _parse_arr_size(size)
 *             try:             # <<<<<<<<<<<<<<
 *                 sec = float(seconds)
 *             except Exception as err:
 */
    {
      __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:*/ {

        /* "cytimes/pddt.py":916
 *             arr_size = _parse_arr_size(size)
 *             try:
 *                 sec = float(seconds)             # <<<<<<<<<<<<<<
 *             except Exception as err:
 *                 raise errors.InvalidTypeError(
 */
        __pyx_t_7 = __Pyx_PyObject_AsDouble(__pyx_v_seconds); if (unlikely(__pyx_t_7 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 916, __pyx_L8_error)
        __pyx_v_sec = __pyx_t_7;

        /* "cytimes/pddt.py":915
 *             # . convert to microseconds
 *             arr_size = _parse_arr_size(size)
 *             try:             # <<<<<<<<<<<<<<
 *                 sec = float(seconds)
 *             except Exception as err:
 */
      }
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L13_try_end;
      __pyx_L8_error:;

      /* "cytimes/pddt.py":917
 *             try:
 *                 sec = float(seconds)
 *             except Exception as err:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidTypeError(
 *                     "cannot covnert '%s' to float "
 */
      __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
      if (__pyx_t_8) {
        __Pyx_AddTraceback("cytimes.pddt.Pddt.fromseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0) __PYX_ERR(0, 917, __pyx_L10_except_error)
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_10);
        __pyx_v_err = __pyx_t_10;
        /*try:*/ {

          /* "cytimes/pddt.py":918
 *                 sec = float(seconds)
 *             except Exception as err:
 *                 raise errors.InvalidTypeError(             # <<<<<<<<<<<<<<
 *                     "cannot covnert '%s' to float "
 *                     "to represent the seconds value." % seconds
 */
          __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_errors); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 918, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_InvalidTypeError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 918, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

          /* "cytimes/pddt.py":920
 *                 raise errors.InvalidTypeError(
 *                     "cannot covnert '%s' to float "
 *                     "to represent the seconds value." % seconds             # <<<<<<<<<<<<<<
 *                 ) from err
 *             val = int(sec * utils.US_SECOND)
 */
          __pyx_t_13 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_cannot_covnert_s_to_float_to_rep, __pyx_v_seconds); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 920, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_15 = NULL;
          __pyx_t_16 = 0;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_14))) {
            __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
            if (likely(__pyx_t_15)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
              __Pyx_INCREF(__pyx_t_15);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_14, function);
              __pyx_t_16 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_13};
            __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 918, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          }

          /* "cytimes/pddt.py":921
 *                     "cannot covnert '%s' to float "
 *                     "to represent the seconds value." % seconds
 *                 ) from err             # <<<<<<<<<<<<<<
 *             val = int(sec * utils.US_SECOND)
 *             # . new instance
 */
          __Pyx_Raise(__pyx_t_12, 0, 0, __pyx_v_err);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __PYX_ERR(0, 918, __pyx_L19_error)
        }

        /* "cytimes/pddt.py":917
 *             try:
 *                 sec = float(seconds)
 *             except Exception as err:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidTypeError(
 *                     "cannot covnert '%s' to float "
 */
        /*finally:*/ {
          __pyx_L19_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_22);
            __Pyx_XGOTREF(__pyx_t_23);
            __Pyx_XGOTREF(__pyx_t_24);
            __pyx_t_8 = __pyx_lineno; __pyx_t_17 = __pyx_clineno; __pyx_t_18 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
            }
            if (PY_MAJOR_VERSION >= 3) {
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_XGIVEREF(__pyx_t_24);
              __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24);
            }
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ErrRestore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
            __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0;
            __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_17; __pyx_filename = __pyx_t_18;
            goto __pyx_L10_except_error;
          }
        }
      }
      goto __pyx_L10_except_error;

      /* "cytimes/pddt.py":915
 *             # . convert to microseconds
 *             arr_size = _parse_arr_size(size)
 *             try:             # <<<<<<<<<<<<<<
 *                 sec = float(seconds)
 *             except Exception as err:
 */
      __pyx_L10_except_error:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      goto __pyx_L1_error;
      __pyx_L13_try_end:;
    }

    /* "cytimes/pddt.py":922
 *                     "to represent the seconds value." % seconds
 *                 ) from err
 *             val = int(sec * utils.US_SECOND)             # <<<<<<<<<<<<<<
 *             # . new instance
 *             return _pddt_fr_us(val, arr_size, tz, unit, name)
 */
    __pyx_v_val = ((PY_LONG_LONG)(__pyx_v_sec * __pyx_v_7cytimes_5utils_US_SECOND));

    /* "cytimes/pddt.py":924
 *             val = int(sec * utils.US_SECOND)
 *             # . new instance
 *             return _pddt_fr_us(val, arr_size, tz, unit, name)             # <<<<<<<<<<<<<<
 * 
 *         # <'list'/'tuple'>
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_25.__pyx_n = 3;
    __pyx_t_25.tz = __pyx_v_tz;
    __pyx_t_25.unit = __pyx_v_unit;
    __pyx_t_25.name = __pyx_v_name;
    __pyx_t_11 = __pyx_f_7cytimes_4pddt__pddt_fr_us(__pyx_v_val, __pyx_v_arr_size, &__pyx_t_25); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_r = __pyx_t_11;
    __pyx_t_11 = 0;
    goto __pyx_L0;

    /* "cytimes/pddt.py":912
 * 
 *         # Single value
 *         if isinstance(seconds, (int, float, str, bytes)):             # <<<<<<<<<<<<<<
 *             # . convert to microseconds
 *             arr_size = _parse_arr_size(size)
 */
  }

  /* "cytimes/pddt.py":927
 * 
 *         # <'list'/'tuple'>
 *         if isinstance(seconds, (list, tuple)):             # <<<<<<<<<<<<<<
 *             # . convert to ndarray[datetime64]
 *             arr_size = len(seconds)
 */
  __pyx_t_2 = PyList_Check(__pyx_v_seconds); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L26_bool_binop_done;
  }
  __pyx_t_2 = PyTuple_Check(__pyx_v_seconds); 
  __pyx_t_1 = __pyx_t_2;
  __pyx_L26_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":929
 *         if isinstance(seconds, (list, tuple)):
 *             # . convert to ndarray[datetime64]
 *             arr_size = len(seconds)             # <<<<<<<<<<<<<<
 *             arr = np.PyArray_EMPTY(1, [arr_size], np.NPY_TYPES.NPY_INT64, 0)
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 */
    __pyx_t_3 = PyObject_Length(__pyx_v_seconds); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 929, __pyx_L1_error)
    __pyx_v_arr_size = __pyx_t_3;

    /* "cytimes/pddt.py":930
 *             # . convert to ndarray[datetime64]
 *             arr_size = len(seconds)
 *             arr = np.PyArray_EMPTY(1, [arr_size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 *             i: cython.Py_ssize_t = 0
 */
    __pyx_t_26[0] = __pyx_v_arr_size;
    __pyx_t_11 = PyArray_EMPTY(1, __pyx_t_26, NPY_INT64, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 930, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 930, __pyx_L1_error)
    __pyx_v_arr = ((PyArrayObject *)__pyx_t_11);
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":931
 *             arr_size = len(seconds)
 *             arr = np.PyArray_EMPTY(1, [arr_size], np.NPY_TYPES.NPY_INT64, 0)
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))             # <<<<<<<<<<<<<<
 *             i: cython.Py_ssize_t = 0
 *             for item in seconds:
 */
    __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

    /* "cytimes/pddt.py":932
 *             arr = np.PyArray_EMPTY(1, [arr_size], np.NPY_TYPES.NPY_INT64, 0)
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 *             i: cython.Py_ssize_t = 0             # <<<<<<<<<<<<<<
 *             for item in seconds:
 *                 try:
 */
    __pyx_v_i = 0;

    /* "cytimes/pddt.py":933
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 *             i: cython.Py_ssize_t = 0
 *             for item in seconds:             # <<<<<<<<<<<<<<
 *                 try:
 *                     sec = float(item)
 */
    if (likely(PyList_CheckExact(__pyx_v_seconds)) || PyTuple_CheckExact(__pyx_v_seconds)) {
      __pyx_t_11 = __pyx_v_seconds; __Pyx_INCREF(__pyx_t_11);
      __pyx_t_3 = 0;
      __pyx_t_27 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_v_seconds); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 933, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_27 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 933, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_27)) {
        if (likely(PyList_CheckExact(__pyx_t_11))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 933, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_3); __Pyx_INCREF(__pyx_t_10); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 933, __pyx_L1_error)
          #else
          __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 933, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 933, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_3); __Pyx_INCREF(__pyx_t_10); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 933, __pyx_L1_error)
          #else
          __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 933, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        }
      } else {
        __pyx_t_10 = __pyx_t_27(__pyx_t_11);
        if (unlikely(!__pyx_t_10)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 933, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "cytimes/pddt.py":934
 *             i: cython.Py_ssize_t = 0
 *             for item in seconds:
 *                 try:             # <<<<<<<<<<<<<<
 *                     sec = float(item)
 *                 except Exception as err:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_4);
        /*try:*/ {

          /* "cytimes/pddt.py":935
 *             for item in seconds:
 *                 try:
 *                     sec = float(item)             # <<<<<<<<<<<<<<
 *                 except Exception as err:
 *                     raise errors.InvalidTypeError(
 */
          __pyx_t_7 = __Pyx_PyObject_AsDouble(__pyx_v_item); if (unlikely(__pyx_t_7 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 935, __pyx_L30_error)
          __pyx_v_sec = __pyx_t_7;

          /* "cytimes/pddt.py":934
 *             i: cython.Py_ssize_t = 0
 *             for item in seconds:
 *                 try:             # <<<<<<<<<<<<<<
 *                     sec = float(item)
 *                 except Exception as err:
 */
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L37_try_end;
        __pyx_L30_error:;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "cytimes/pddt.py":936
 *                 try:
 *                     sec = float(item)
 *                 except Exception as err:             # <<<<<<<<<<<<<<
 *                     raise errors.InvalidTypeError(
 *                         "cannot covnert '%s' to float "
 */
        __pyx_t_17 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
        if (__pyx_t_17) {
          __Pyx_AddTraceback("cytimes.pddt.Pddt.fromseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_9, &__pyx_t_12) < 0) __PYX_ERR(0, 936, __pyx_L32_except_error)
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_9);
          __pyx_v_err = __pyx_t_9;
          /*try:*/ {

            /* "cytimes/pddt.py":937
 *                     sec = float(item)
 *                 except Exception as err:
 *                     raise errors.InvalidTypeError(             # <<<<<<<<<<<<<<
 *                         "cannot covnert '%s' to float "
 *                         "to represent the seconds value." % item
 */
            __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_errors); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 937, __pyx_L43_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_InvalidTypeError); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 937, __pyx_L43_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

            /* "cytimes/pddt.py":939
 *                     raise errors.InvalidTypeError(
 *                         "cannot covnert '%s' to float "
 *                         "to represent the seconds value." % item             # <<<<<<<<<<<<<<
 *                     ) from err
 *                 val = int(sec * utils.US_SECOND)
 */
            __pyx_t_13 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_cannot_covnert_s_to_float_to_rep, __pyx_v_item); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 939, __pyx_L43_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_28 = NULL;
            __pyx_t_16 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_15))) {
              __pyx_t_28 = PyMethod_GET_SELF(__pyx_t_15);
              if (likely(__pyx_t_28)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
                __Pyx_INCREF(__pyx_t_28);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_15, function);
                __pyx_t_16 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_28, __pyx_t_13};
              __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
              __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 937, __pyx_L43_error)
              __Pyx_GOTREF(__pyx_t_14);
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            }

            /* "cytimes/pddt.py":940
 *                         "cannot covnert '%s' to float "
 *                         "to represent the seconds value." % item
 *                     ) from err             # <<<<<<<<<<<<<<
 *                 val = int(sec * utils.US_SECOND)
 *                 arr_ptr[i] = val
 */
            __Pyx_Raise(__pyx_t_14, 0, 0, __pyx_v_err);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __PYX_ERR(0, 937, __pyx_L43_error)
          }

          /* "cytimes/pddt.py":936
 *                 try:
 *                     sec = float(item)
 *                 except Exception as err:             # <<<<<<<<<<<<<<
 *                     raise errors.InvalidTypeError(
 *                         "cannot covnert '%s' to float "
 */
          /*finally:*/ {
            __pyx_L43_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0;
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
              if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
              if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22) < 0)) __Pyx_ErrFetch(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22);
              __Pyx_XGOTREF(__pyx_t_24);
              __Pyx_XGOTREF(__pyx_t_23);
              __Pyx_XGOTREF(__pyx_t_22);
              __Pyx_XGOTREF(__pyx_t_21);
              __Pyx_XGOTREF(__pyx_t_20);
              __Pyx_XGOTREF(__pyx_t_19);
              __pyx_t_17 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_29 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
              }
              if (PY_MAJOR_VERSION >= 3) {
                __Pyx_XGIVEREF(__pyx_t_21);
                __Pyx_XGIVEREF(__pyx_t_20);
                __Pyx_XGIVEREF(__pyx_t_19);
                __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19);
              }
              __Pyx_XGIVEREF(__pyx_t_24);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_ErrRestore(__pyx_t_24, __pyx_t_23, __pyx_t_22);
              __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0;
              __pyx_lineno = __pyx_t_17; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_29;
              goto __pyx_L32_except_error;
            }
          }
        }
        goto __pyx_L32_except_error;

        /* "cytimes/pddt.py":934
 *             i: cython.Py_ssize_t = 0
 *             for item in seconds:
 *                 try:             # <<<<<<<<<<<<<<
 *                     sec = float(item)
 *                 except Exception as err:
 */
        __pyx_L32_except_error:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4);
        goto __pyx_L1_error;
        __pyx_L37_try_end:;
      }

      /* "cytimes/pddt.py":941
 *                         "to represent the seconds value." % item
 *                     ) from err
 *                 val = int(sec * utils.US_SECOND)             # <<<<<<<<<<<<<<
 *                 arr_ptr[i] = val
 *                 i += 1
 */
      __pyx_v_val = ((PY_LONG_LONG)(__pyx_v_sec * __pyx_v_7cytimes_5utils_US_SECOND));

      /* "cytimes/pddt.py":942
 *                     ) from err
 *                 val = int(sec * utils.US_SECOND)
 *                 arr_ptr[i] = val             # <<<<<<<<<<<<<<
 *                 i += 1
 *             arr = arr.astype("datetime64[us]")
 */
      (__pyx_v_arr_ptr[__pyx_v_i]) = __pyx_v_val;

      /* "cytimes/pddt.py":943
 *                 val = int(sec * utils.US_SECOND)
 *                 arr_ptr[i] = val
 *                 i += 1             # <<<<<<<<<<<<<<
 *             arr = arr.astype("datetime64[us]")
 *             # . new instance
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "cytimes/pddt.py":933
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 *             i: cython.Py_ssize_t = 0
 *             for item in seconds:             # <<<<<<<<<<<<<<
 *                 try:
 *                     sec = float(item)
 */
    }
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "cytimes/pddt.py":944
 *                 arr_ptr[i] = val
 *                 i += 1
 *             arr = arr.astype("datetime64[us]")             # <<<<<<<<<<<<<<
 *             # . new instance
 *             return pddt_new_simple(arr, tz, unit, name)
 */
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_9 = NULL;
    __pyx_t_16 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
        __pyx_t_16 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_kp_u_datetime64_us};
      __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 944, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 944, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_11));
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":946
 *             arr = arr.astype("datetime64[us]")
 *             # . new instance
 *             return pddt_new_simple(arr, tz, unit, name)             # <<<<<<<<<<<<<<
 * 
 *         # <'pandas.Series'>
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_30.__pyx_n = 3;
    __pyx_t_30.tz = __pyx_v_tz;
    __pyx_t_30.unit = __pyx_v_unit;
    __pyx_t_30.name = __pyx_v_name;
    __pyx_t_11 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_30); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 946, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_r = __pyx_t_11;
    __pyx_t_11 = 0;
    goto __pyx_L0;

    /* "cytimes/pddt.py":927
 * 
 *         # <'list'/'tuple'>
 *         if isinstance(seconds, (list, tuple)):             # <<<<<<<<<<<<<<
 *             # . convert to ndarray[datetime64]
 *             arr_size = len(seconds)
 */
  }

  /* "cytimes/pddt.py":949
 * 
 *         # <'pandas.Series'>
 *         if isinstance(seconds, (Series, Index)):             # <<<<<<<<<<<<<<
 *             seconds = seconds.values
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_Series); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_Index); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_seconds, __pyx_t_11); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L51_bool_binop_done;
  }
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_seconds, __pyx_t_12); 
  __pyx_t_1 = __pyx_t_2;
  __pyx_L51_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":950
 *         # <'pandas.Series'>
 *         if isinstance(seconds, (Series, Index)):
 *             seconds = seconds.values             # <<<<<<<<<<<<<<
 * 
 *         # <'numpy.ndarray'>
 */
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_seconds, __pyx_n_s_values); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 950, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF_SET(__pyx_v_seconds, __pyx_t_11);
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":949
 * 
 *         # <'pandas.Series'>
 *         if isinstance(seconds, (Series, Index)):             # <<<<<<<<<<<<<<
 *             seconds = seconds.values
 * 
 */
  }

  /* "cytimes/pddt.py":953
 * 
 *         # <'numpy.ndarray'>
 *         if isinstance(seconds, np.ndarray):             # <<<<<<<<<<<<<<
 *             # . validate array
 *             arr = seconds
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_seconds, __pyx_ptype_5numpy_ndarray); 
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":955
 *         if isinstance(seconds, np.ndarray):
 *             # . validate array
 *             arr = seconds             # <<<<<<<<<<<<<<
 *             if arr.ndim != 1:
 *                 raise errors.InvalidTypeError(
 */
    if (!(likely(((__pyx_v_seconds) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_seconds, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 955, __pyx_L1_error)
    __pyx_t_11 = __pyx_v_seconds;
    __Pyx_INCREF(__pyx_t_11);
    __pyx_v_arr = ((PyArrayObject *)__pyx_t_11);
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":956
 *             # . validate array
 *             arr = seconds
 *             if arr.ndim != 1:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidTypeError(
 *                     "must be an 1-dimensional ndarray, instead of %d-dim." % arr.ndim
 */
    __pyx_t_1 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr) != 1);
    if (unlikely(__pyx_t_1)) {

      /* "cytimes/pddt.py":957
 *             arr = seconds
 *             if arr.ndim != 1:
 *                 raise errors.InvalidTypeError(             # <<<<<<<<<<<<<<
 *                     "must be an 1-dimensional ndarray, instead of %d-dim." % arr.ndim
 *                 )
 */
      __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_errors); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_InvalidTypeError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "cytimes/pddt.py":958
 *             if arr.ndim != 1:
 *                 raise errors.InvalidTypeError(
 *                     "must be an 1-dimensional ndarray, instead of %d-dim." % arr.ndim             # <<<<<<<<<<<<<<
 *                 )
 *             # . convert to ndarray[datetime64]
 */
      __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 958, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_10 = PyUnicode_Format(__pyx_kp_u_must_be_an_1_dimensional_ndarray, __pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 958, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = NULL;
      __pyx_t_16 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_16 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_10};
        __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 957, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_Raise(__pyx_t_11, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __PYX_ERR(0, 957, __pyx_L1_error)

      /* "cytimes/pddt.py":956
 *             # . validate array
 *             arr = seconds
 *             if arr.ndim != 1:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidTypeError(
 *                     "must be an 1-dimensional ndarray, instead of %d-dim." % arr.ndim
 */
    }

    /* "cytimes/pddt.py":961
 *                 )
 *             # . convert to ndarray[datetime64]
 *             kind: cython.Py_UCS4 = arr.descr.kind             # <<<<<<<<<<<<<<
 *             if kind == "f":  # float64
 *                 arr = utils.arr_assure_float64(arr)
 */
    __pyx_t_11 = ((PyObject *)__pyx_f_5numpy_7ndarray_5descr_descr(__pyx_v_arr)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 961, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_31 = ((PyArray_Descr *)__pyx_t_11)->kind;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_v_kind = __pyx_t_31;

    /* "cytimes/pddt.py":962
 *             # . convert to ndarray[datetime64]
 *             kind: cython.Py_UCS4 = arr.descr.kind
 *             if kind == "f":  # float64             # <<<<<<<<<<<<<<
 *                 arr = utils.arr_assure_float64(arr)
 *                 arr = utils.arr_assure_int64(arr * utils.US_SECOND)
 */
    __pyx_t_1 = (__pyx_v_kind == 0x66);
    if (__pyx_t_1) {

      /* "cytimes/pddt.py":963
 *             kind: cython.Py_UCS4 = arr.descr.kind
 *             if kind == "f":  # float64
 *                 arr = utils.arr_assure_float64(arr)             # <<<<<<<<<<<<<<
 *                 arr = utils.arr_assure_int64(arr * utils.US_SECOND)
 *             else:
 */
      __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_float64(__pyx_v_arr)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 963, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_11));
      __pyx_t_11 = 0;

      /* "cytimes/pddt.py":964
 *             if kind == "f":  # float64
 *                 arr = utils.arr_assure_float64(arr)
 *                 arr = utils.arr_assure_int64(arr * utils.US_SECOND)             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = utils.arr_assure_int64_like(arr)
 */
      __pyx_t_11 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_7cytimes_5utils_US_SECOND); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 964, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_9 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 964, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 964, __pyx_L1_error)
      __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64(((PyArrayObject *)__pyx_t_9))); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 964, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_11));
      __pyx_t_11 = 0;

      /* "cytimes/pddt.py":962
 *             # . convert to ndarray[datetime64]
 *             kind: cython.Py_UCS4 = arr.descr.kind
 *             if kind == "f":  # float64             # <<<<<<<<<<<<<<
 *                 arr = utils.arr_assure_float64(arr)
 *                 arr = utils.arr_assure_int64(arr * utils.US_SECOND)
 */
      goto __pyx_L55;
    }

    /* "cytimes/pddt.py":966
 *                 arr = utils.arr_assure_int64(arr * utils.US_SECOND)
 *             else:
 *                 arr = utils.arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 *                 arr = utils.arr_mul(arr, utils.US_SECOND)
 *             arr = arr.astype("datetime64[us]")
 */
    /*else*/ {
      __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 966, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_11));
      __pyx_t_11 = 0;

      /* "cytimes/pddt.py":967
 *             else:
 *                 arr = utils.arr_assure_int64_like(arr)
 *                 arr = utils.arr_mul(arr, utils.US_SECOND)             # <<<<<<<<<<<<<<
 *             arr = arr.astype("datetime64[us]")
 *             # . new instance
 */
      __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_arr, __pyx_v_7cytimes_5utils_US_SECOND, NULL)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 967, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_11));
      __pyx_t_11 = 0;
    }
    __pyx_L55:;

    /* "cytimes/pddt.py":968
 *                 arr = utils.arr_assure_int64_like(arr)
 *                 arr = utils.arr_mul(arr, utils.US_SECOND)
 *             arr = arr.astype("datetime64[us]")             # <<<<<<<<<<<<<<
 *             # . new instance
 *             return pddt_new_simple(arr, tz, unit, name)
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 968, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = NULL;
    __pyx_t_16 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_16 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_kp_u_datetime64_us};
      __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 968, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 968, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_11));
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":970
 *             arr = arr.astype("datetime64[us]")
 *             # . new instance
 *             return pddt_new_simple(arr, tz, unit, name)             # <<<<<<<<<<<<<<
 * 
 *         # Invalid
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_30.__pyx_n = 3;
    __pyx_t_30.tz = __pyx_v_tz;
    __pyx_t_30.unit = __pyx_v_unit;
    __pyx_t_30.name = __pyx_v_name;
    __pyx_t_11 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_30); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_r = __pyx_t_11;
    __pyx_t_11 = 0;
    goto __pyx_L0;

    /* "cytimes/pddt.py":953
 * 
 *         # <'numpy.ndarray'>
 *         if isinstance(seconds, np.ndarray):             # <<<<<<<<<<<<<<
 *             # . validate array
 *             arr = seconds
 */
  }

  /* "cytimes/pddt.py":973
 * 
 *         # Invalid
 *         raise errors.InvalidTypeError(             # <<<<<<<<<<<<<<
 *             "unsupported type %s for argument 'seconds'." % type(seconds)
 *         )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_errors); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_InvalidTypeError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "cytimes/pddt.py":974
 *         # Invalid
 *         raise errors.InvalidTypeError(
 *             "unsupported type %s for argument 'seconds'." % type(seconds)             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_9 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unsupported_type_s_for_argument_2, ((PyObject *)Py_TYPE(__pyx_v_seconds))); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_12 = NULL;
  __pyx_t_16 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
      __pyx_t_16 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_9};
    __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __PYX_ERR(0, 973, __pyx_L1_error)

  /* "cytimes/pddt.py":875
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromseconds(
 *         cls,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_28);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fromseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_seconds);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":977
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromicroseconds(
 *         cls,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_19fromicroseconds(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_18fromicroseconds, "Construct from microseconds since Unix Epoch with optional timezone `<'Pddt'>`.\n\n        :param us `<'int/Array-like'>`: The microseconds to construct with.\n            - `<'int'>` An integer value representing the microseconds since Unix Epoch.\n            - `<'Array-like'>` An array-like object containing the microseconds.\n\n        :param tz `<'str/tzinfo/None'>`: The timezone of the index, defaults to `None`.\n            - `<'datetime.tzinfo'>` A subclass of `datetime.tzinfo`.\n            - `<'str'>` Timezone name supported by the 'Zoneinfo' module, or `'local'` for local timezone.\n            - `<'None'>` Timezone-naive.\n\n        :param size `<'int/str/bytes/object'>`: The size of the index to generate, defaults to `1`.\n            - This argument is `ignored` if 'us' is an array-like object.\n            - `<'int/str/bytes'>` Representing an integer for the number of elements in the index.\n            - `<'object'>` Any object that implements `__len__()`, where its length represents the size of the index.\n\n        :param unit `<'str/None'>`: Set the datetime unit of the index, defaults to `None`.\n            Supported datetime units: 's', 'ms', 'us', 'ns'.\n\n        :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_19fromicroseconds = {"fromicroseconds", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_19fromicroseconds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_18fromicroseconds};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_19fromicroseconds(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_us = 0;
  PyObject *__pyx_v_tz = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fromicroseconds (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_us,&__pyx_n_s_tz,&__pyx_n_s_size,&__pyx_n_s_unit,&__pyx_n_s_name,0};

    /* "cytimes/pddt.py":981
 *         cls,
 *         us: int | object,
 *         tz: datetime.tzinfo | str | None = None,             # <<<<<<<<<<<<<<
 *         size: object = 1,
 *         unit: str = None,
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1)));

    /* "cytimes/pddt.py":983
 *         tz: datetime.tzinfo | str | None = None,
 *         size: object = 1,
 *         unit: str = None,             # <<<<<<<<<<<<<<
 *         name: Hashable | None = None,
 *     ) -> Self:
 */
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));

    /* "cytimes/pddt.py":984
 *         size: object = 1,
 *         unit: str = None,
 *         name: Hashable | None = None,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Construct from microseconds since Unix Epoch with optional timezone `<'Pddt'>`.
 */
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 977, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_us)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 977, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("fromicroseconds", 0, 2, 6, 1); __PYX_ERR(0, 977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tz);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 977, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 977, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fromicroseconds") < 0)) __PYX_ERR(0, 977, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_us = values[1];
    __pyx_v_tz = values[2];
    __pyx_v_size = values[3];
    __pyx_v_unit = ((PyObject*)values[4]);
    __pyx_v_name = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fromicroseconds", 0, 2, 6, __pyx_nargs); __PYX_ERR(0, 977, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fromicroseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 1, "unit", 1))) __PYX_ERR(0, 983, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_18fromicroseconds(__pyx_self, __pyx_v_cls, __pyx_v_us, __pyx_v_tz, __pyx_v_size, __pyx_v_unit, __pyx_v_name);

  /* "cytimes/pddt.py":977
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromicroseconds(
 *         cls,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_18fromicroseconds(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_us, PyObject *__pyx_v_tz, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name) {
  PyArrayObject *__pyx_v_arr = 0;
  Py_ssize_t __pyx_v_arr_size;
  PY_LONG_LONG __pyx_v_val;
  PyObject *__pyx_v_err = NULL;
  npy_int64 *__pyx_v_arr_ptr;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PY_LONG_LONG __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  unsigned int __pyx_t_16;
  int __pyx_t_17;
  char const *__pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  struct __pyx_opt_args_7cytimes_4pddt__pddt_fr_us __pyx_t_25;
  npy_intp __pyx_t_26[1];
  PyObject *(*__pyx_t_27)(PyObject *);
  PyObject *__pyx_t_28 = NULL;
  char const *__pyx_t_29;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_30;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fromicroseconds", 0);
  __Pyx_INCREF(__pyx_v_us);

  /* "cytimes/pddt.py":1013
 * 
 *         # Single value
 *         if isinstance(us, (int, float, str, bytes)):             # <<<<<<<<<<<<<<
 *             # . convert to microseconds
 *             arr_size = _parse_arr_size(size)
 */
  __pyx_t_2 = PyInt_Check(__pyx_v_us); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyFloat_Check(__pyx_v_us); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyUnicode_Check(__pyx_v_us); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyBytes_Check(__pyx_v_us); 
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1015
 *         if isinstance(us, (int, float, str, bytes)):
 *             # . convert to microseconds
 *             arr_size = _parse_arr_size(size)             # <<<<<<<<<<<<<<
 *             try:
 *                 val = int(us)
 */
    __pyx_t_3 = __pyx_f_7cytimes_4pddt__parse_arr_size(__pyx_v_size); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-2L))) __PYX_ERR(0, 1015, __pyx_L1_error)
    __pyx_v_arr_size = __pyx_t_3;

    /* "cytimes/pddt.py":1016
 *             # . convert to microseconds
 *             arr_size = _parse_arr_size(size)
 *             try:             # <<<<<<<<<<<<<<
 *                 val = int(us)
 *             except Exception as err:
 */
    {
      __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:*/ {

        /* "cytimes/pddt.py":1017
 *             arr_size = _parse_arr_size(size)
 *             try:
 *                 val = int(us)             # <<<<<<<<<<<<<<
 *             except Exception as err:
 *                 raise errors.InvalidTypeError(
 */
        __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_v_us); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1017, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_7); if (unlikely((__pyx_t_8 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 1017, __pyx_L8_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_val = __pyx_t_8;

        /* "cytimes/pddt.py":1016
 *             # . convert to microseconds
 *             arr_size = _parse_arr_size(size)
 *             try:             # <<<<<<<<<<<<<<
 *                 val = int(us)
 *             except Exception as err:
 */
      }
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L13_try_end;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cytimes/pddt.py":1018
 *             try:
 *                 val = int(us)
 *             except Exception as err:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidTypeError(
 *                     "cannot covnert '%s' to an integer "
 */
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
      if (__pyx_t_9) {
        __Pyx_AddTraceback("cytimes.pddt.Pddt.fromicroseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_10, &__pyx_t_11) < 0) __PYX_ERR(0, 1018, __pyx_L10_except_error)
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_10);
        __pyx_v_err = __pyx_t_10;
        /*try:*/ {

          /* "cytimes/pddt.py":1019
 *                 val = int(us)
 *             except Exception as err:
 *                 raise errors.InvalidTypeError(             # <<<<<<<<<<<<<<
 *                     "cannot covnert '%s' to an integer "
 *                     "to represent the microseconds value." % us
 */
          __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_errors); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1019, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_InvalidTypeError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1019, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

          /* "cytimes/pddt.py":1021
 *                 raise errors.InvalidTypeError(
 *                     "cannot covnert '%s' to an integer "
 *                     "to represent the microseconds value." % us             # <<<<<<<<<<<<<<
 *                 ) from err
 *             # . new instance
 */
          __pyx_t_13 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_cannot_covnert_s_to_an_integer_t, __pyx_v_us); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1021, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_15 = NULL;
          __pyx_t_16 = 0;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_14))) {
            __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
            if (likely(__pyx_t_15)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
              __Pyx_INCREF(__pyx_t_15);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_14, function);
              __pyx_t_16 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_13};
            __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1019, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          }

          /* "cytimes/pddt.py":1022
 *                     "cannot covnert '%s' to an integer "
 *                     "to represent the microseconds value." % us
 *                 ) from err             # <<<<<<<<<<<<<<
 *             # . new instance
 *             return _pddt_fr_us(val, arr_size, tz, unit, name)
 */
          __Pyx_Raise(__pyx_t_12, 0, 0, __pyx_v_err);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __PYX_ERR(0, 1019, __pyx_L19_error)
        }

        /* "cytimes/pddt.py":1018
 *             try:
 *                 val = int(us)
 *             except Exception as err:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidTypeError(
 *                     "cannot covnert '%s' to an integer "
 */
        /*finally:*/ {
          __pyx_L19_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_22);
            __Pyx_XGOTREF(__pyx_t_23);
            __Pyx_XGOTREF(__pyx_t_24);
            __pyx_t_9 = __pyx_lineno; __pyx_t_17 = __pyx_clineno; __pyx_t_18 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
            }
            if (PY_MAJOR_VERSION >= 3) {
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_XGIVEREF(__pyx_t_24);
              __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24);
            }
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ErrRestore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
            __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0;
            __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_17; __pyx_filename = __pyx_t_18;
            goto __pyx_L10_except_error;
          }
        }
      }
      goto __pyx_L10_except_error;

      /* "cytimes/pddt.py":1016
 *             # . convert to microseconds
 *             arr_size = _parse_arr_size(size)
 *             try:             # <<<<<<<<<<<<<<
 *                 val = int(us)
 *             except Exception as err:
 */
      __pyx_L10_except_error:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      goto __pyx_L1_error;
      __pyx_L13_try_end:;
    }

    /* "cytimes/pddt.py":1024
 *                 ) from err
 *             # . new instance
 *             return _pddt_fr_us(val, arr_size, tz, unit, name)             # <<<<<<<<<<<<<<
 * 
 *         # <'list'/'tuple'>
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_25.__pyx_n = 3;
    __pyx_t_25.tz = __pyx_v_tz;
    __pyx_t_25.unit = __pyx_v_unit;
    __pyx_t_25.name = __pyx_v_name;
    __pyx_t_11 = __pyx_f_7cytimes_4pddt__pddt_fr_us(__pyx_v_val, __pyx_v_arr_size, &__pyx_t_25); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1024, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_r = __pyx_t_11;
    __pyx_t_11 = 0;
    goto __pyx_L0;

    /* "cytimes/pddt.py":1013
 * 
 *         # Single value
 *         if isinstance(us, (int, float, str, bytes)):             # <<<<<<<<<<<<<<
 *             # . convert to microseconds
 *             arr_size = _parse_arr_size(size)
 */
  }

  /* "cytimes/pddt.py":1027
 * 
 *         # <'list'/'tuple'>
 *         if isinstance(us, (list, tuple)):             # <<<<<<<<<<<<<<
 *             # . convert to ndarray[datetime64]
 *             arr_size = len(us)
 */
  __pyx_t_2 = PyList_Check(__pyx_v_us); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L26_bool_binop_done;
  }
  __pyx_t_2 = PyTuple_Check(__pyx_v_us); 
  __pyx_t_1 = __pyx_t_2;
  __pyx_L26_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1029
 *         if isinstance(us, (list, tuple)):
 *             # . convert to ndarray[datetime64]
 *             arr_size = len(us)             # <<<<<<<<<<<<<<
 *             arr = np.PyArray_EMPTY(1, [arr_size], np.NPY_TYPES.NPY_INT64, 0)
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 */
    __pyx_t_3 = PyObject_Length(__pyx_v_us); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1029, __pyx_L1_error)
    __pyx_v_arr_size = __pyx_t_3;

    /* "cytimes/pddt.py":1030
 *             # . convert to ndarray[datetime64]
 *             arr_size = len(us)
 *             arr = np.PyArray_EMPTY(1, [arr_size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 *             i: cython.Py_ssize_t = 0
 */
    __pyx_t_26[0] = __pyx_v_arr_size;
    __pyx_t_11 = PyArray_EMPTY(1, __pyx_t_26, NPY_INT64, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1030, __pyx_L1_error)
    __pyx_v_arr = ((PyArrayObject *)__pyx_t_11);
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":1031
 *             arr_size = len(us)
 *             arr = np.PyArray_EMPTY(1, [arr_size], np.NPY_TYPES.NPY_INT64, 0)
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))             # <<<<<<<<<<<<<<
 *             i: cython.Py_ssize_t = 0
 *             for item in us:
 */
    __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

    /* "cytimes/pddt.py":1032
 *             arr = np.PyArray_EMPTY(1, [arr_size], np.NPY_TYPES.NPY_INT64, 0)
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 *             i: cython.Py_ssize_t = 0             # <<<<<<<<<<<<<<
 *             for item in us:
 *                 try:
 */
    __pyx_v_i = 0;

    /* "cytimes/pddt.py":1033
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 *             i: cython.Py_ssize_t = 0
 *             for item in us:             # <<<<<<<<<<<<<<
 *                 try:
 *                     val = int(item)
 */
    if (likely(PyList_CheckExact(__pyx_v_us)) || PyTuple_CheckExact(__pyx_v_us)) {
      __pyx_t_11 = __pyx_v_us; __Pyx_INCREF(__pyx_t_11);
      __pyx_t_3 = 0;
      __pyx_t_27 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_v_us); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1033, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_27 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 1033, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_27)) {
        if (likely(PyList_CheckExact(__pyx_t_11))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1033, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_3); __Pyx_INCREF(__pyx_t_10); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1033, __pyx_L1_error)
          #else
          __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1033, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1033, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_3); __Pyx_INCREF(__pyx_t_10); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1033, __pyx_L1_error)
          #else
          __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1033, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        }
      } else {
        __pyx_t_10 = __pyx_t_27(__pyx_t_11);
        if (unlikely(!__pyx_t_10)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1033, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "cytimes/pddt.py":1034
 *             i: cython.Py_ssize_t = 0
 *             for item in us:
 *                 try:             # <<<<<<<<<<<<<<
 *                     val = int(item)
 *                 except Exception as err:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_4);
        /*try:*/ {

          /* "cytimes/pddt.py":1035
 *             for item in us:
 *                 try:
 *                     val = int(item)             # <<<<<<<<<<<<<<
 *                 except Exception as err:
 *                     raise errors.InvalidTypeError(
 */
          __pyx_t_10 = __Pyx_PyNumber_Int(__pyx_v_item); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1035, __pyx_L30_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_8 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_10); if (unlikely((__pyx_t_8 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 1035, __pyx_L30_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_v_val = __pyx_t_8;

          /* "cytimes/pddt.py":1034
 *             i: cython.Py_ssize_t = 0
 *             for item in us:
 *                 try:             # <<<<<<<<<<<<<<
 *                     val = int(item)
 *                 except Exception as err:
 */
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L37_try_end;
        __pyx_L30_error:;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "cytimes/pddt.py":1036
 *                 try:
 *                     val = int(item)
 *                 except Exception as err:             # <<<<<<<<<<<<<<
 *                     raise errors.InvalidTypeError(
 *                         "cannot covnert '%s' to an integer "
 */
        __pyx_t_17 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
        if (__pyx_t_17) {
          __Pyx_AddTraceback("cytimes.pddt.Pddt.fromicroseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_7, &__pyx_t_12) < 0) __PYX_ERR(0, 1036, __pyx_L32_except_error)
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_7);
          __pyx_v_err = __pyx_t_7;
          /*try:*/ {

            /* "cytimes/pddt.py":1037
 *                     val = int(item)
 *                 except Exception as err:
 *                     raise errors.InvalidTypeError(             # <<<<<<<<<<<<<<
 *                         "cannot covnert '%s' to an integer "
 *                         "to represent the microseconds value." % item
 */
            __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_errors); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1037, __pyx_L43_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_InvalidTypeError); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1037, __pyx_L43_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

            /* "cytimes/pddt.py":1039
 *                     raise errors.InvalidTypeError(
 *                         "cannot covnert '%s' to an integer "
 *                         "to represent the microseconds value." % item             # <<<<<<<<<<<<<<
 *                     ) from err
 *                 arr_ptr[i] = val
 */
            __pyx_t_13 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_cannot_covnert_s_to_an_integer_t, __pyx_v_item); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1039, __pyx_L43_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_28 = NULL;
            __pyx_t_16 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_15))) {
              __pyx_t_28 = PyMethod_GET_SELF(__pyx_t_15);
              if (likely(__pyx_t_28)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
                __Pyx_INCREF(__pyx_t_28);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_15, function);
                __pyx_t_16 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_28, __pyx_t_13};
              __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
              __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1037, __pyx_L43_error)
              __Pyx_GOTREF(__pyx_t_14);
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            }

            /* "cytimes/pddt.py":1040
 *                         "cannot covnert '%s' to an integer "
 *                         "to represent the microseconds value." % item
 *                     ) from err             # <<<<<<<<<<<<<<
 *                 arr_ptr[i] = val
 *                 i += 1
 */
            __Pyx_Raise(__pyx_t_14, 0, 0, __pyx_v_err);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __PYX_ERR(0, 1037, __pyx_L43_error)
          }

          /* "cytimes/pddt.py":1036
 *                 try:
 *                     val = int(item)
 *                 except Exception as err:             # <<<<<<<<<<<<<<
 *                     raise errors.InvalidTypeError(
 *                         "cannot covnert '%s' to an integer "
 */
          /*finally:*/ {
            __pyx_L43_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0;
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
              if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
              if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22) < 0)) __Pyx_ErrFetch(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22);
              __Pyx_XGOTREF(__pyx_t_24);
              __Pyx_XGOTREF(__pyx_t_23);
              __Pyx_XGOTREF(__pyx_t_22);
              __Pyx_XGOTREF(__pyx_t_21);
              __Pyx_XGOTREF(__pyx_t_20);
              __Pyx_XGOTREF(__pyx_t_19);
              __pyx_t_17 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_29 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
              }
              if (PY_MAJOR_VERSION >= 3) {
                __Pyx_XGIVEREF(__pyx_t_21);
                __Pyx_XGIVEREF(__pyx_t_20);
                __Pyx_XGIVEREF(__pyx_t_19);
                __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19);
              }
              __Pyx_XGIVEREF(__pyx_t_24);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_ErrRestore(__pyx_t_24, __pyx_t_23, __pyx_t_22);
              __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0;
              __pyx_lineno = __pyx_t_17; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_29;
              goto __pyx_L32_except_error;
            }
          }
        }
        goto __pyx_L32_except_error;

        /* "cytimes/pddt.py":1034
 *             i: cython.Py_ssize_t = 0
 *             for item in us:
 *                 try:             # <<<<<<<<<<<<<<
 *                     val = int(item)
 *                 except Exception as err:
 */
        __pyx_L32_except_error:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4);
        goto __pyx_L1_error;
        __pyx_L37_try_end:;
      }

      /* "cytimes/pddt.py":1041
 *                         "to represent the microseconds value." % item
 *                     ) from err
 *                 arr_ptr[i] = val             # <<<<<<<<<<<<<<
 *                 i += 1
 *             arr = arr.astype("datetime64[us]")
 */
      (__pyx_v_arr_ptr[__pyx_v_i]) = __pyx_v_val;

      /* "cytimes/pddt.py":1042
 *                     ) from err
 *                 arr_ptr[i] = val
 *                 i += 1             # <<<<<<<<<<<<<<
 *             arr = arr.astype("datetime64[us]")
 *             # . new instance
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "cytimes/pddt.py":1033
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 *             i: cython.Py_ssize_t = 0
 *             for item in us:             # <<<<<<<<<<<<<<
 *                 try:
 *                     val = int(item)
 */
    }
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "cytimes/pddt.py":1043
 *                 arr_ptr[i] = val
 *                 i += 1
 *             arr = arr.astype("datetime64[us]")             # <<<<<<<<<<<<<<
 *             # . new instance
 *             return pddt_new_simple(arr, tz, unit, name)
 */
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1043, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_7 = NULL;
    __pyx_t_16 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
        __pyx_t_16 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_u_datetime64_us};
      __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1043, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1043, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_11));
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":1045
 *             arr = arr.astype("datetime64[us]")
 *             # . new instance
 *             return pddt_new_simple(arr, tz, unit, name)             # <<<<<<<<<<<<<<
 * 
 *         # <'pandas.Series'>
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_30.__pyx_n = 3;
    __pyx_t_30.tz = __pyx_v_tz;
    __pyx_t_30.unit = __pyx_v_unit;
    __pyx_t_30.name = __pyx_v_name;
    __pyx_t_11 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_30); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_r = __pyx_t_11;
    __pyx_t_11 = 0;
    goto __pyx_L0;

    /* "cytimes/pddt.py":1027
 * 
 *         # <'list'/'tuple'>
 *         if isinstance(us, (list, tuple)):             # <<<<<<<<<<<<<<
 *             # . convert to ndarray[datetime64]
 *             arr_size = len(us)
 */
  }

  /* "cytimes/pddt.py":1048
 * 
 *         # <'pandas.Series'>
 *         if isinstance(us, (Series, Index)):             # <<<<<<<<<<<<<<
 *             us = us.values
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_Series); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_Index); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_us, __pyx_t_11); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L51_bool_binop_done;
  }
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_us, __pyx_t_12); 
  __pyx_t_1 = __pyx_t_2;
  __pyx_L51_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1049
 *         # <'pandas.Series'>
 *         if isinstance(us, (Series, Index)):
 *             us = us.values             # <<<<<<<<<<<<<<
 * 
 *         # <'numpy.ndarray'>
 */
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_us, __pyx_n_s_values); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF_SET(__pyx_v_us, __pyx_t_11);
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":1048
 * 
 *         # <'pandas.Series'>
 *         if isinstance(us, (Series, Index)):             # <<<<<<<<<<<<<<
 *             us = us.values
 * 
 */
  }

  /* "cytimes/pddt.py":1052
 * 
 *         # <'numpy.ndarray'>
 *         if isinstance(us, np.ndarray):             # <<<<<<<<<<<<<<
 *             # . validate array
 *             arr = us
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_us, __pyx_ptype_5numpy_ndarray); 
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1054
 *         if isinstance(us, np.ndarray):
 *             # . validate array
 *             arr = us             # <<<<<<<<<<<<<<
 *             if arr.ndim != 1:
 *                 raise errors.InvalidTypeError(
 */
    if (!(likely(((__pyx_v_us) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_us, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1054, __pyx_L1_error)
    __pyx_t_11 = __pyx_v_us;
    __Pyx_INCREF(__pyx_t_11);
    __pyx_v_arr = ((PyArrayObject *)__pyx_t_11);
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":1055
 *             # . validate array
 *             arr = us
 *             if arr.ndim != 1:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidTypeError(
 *                     "must be an 1-dimensional ndarray, instead of %d-dim." % arr.ndim
 */
    __pyx_t_1 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr) != 1);
    if (unlikely(__pyx_t_1)) {

      /* "cytimes/pddt.py":1056
 *             arr = us
 *             if arr.ndim != 1:
 *                 raise errors.InvalidTypeError(             # <<<<<<<<<<<<<<
 *                     "must be an 1-dimensional ndarray, instead of %d-dim." % arr.ndim
 *                 )
 */
      __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_errors); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1056, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_InvalidTypeError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1056, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "cytimes/pddt.py":1057
 *             if arr.ndim != 1:
 *                 raise errors.InvalidTypeError(
 *                     "must be an 1-dimensional ndarray, instead of %d-dim." % arr.ndim             # <<<<<<<<<<<<<<
 *                 )
 *             # . convert to ndarray[datetime64]
 */
      __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1057, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_10 = PyUnicode_Format(__pyx_kp_u_must_be_an_1_dimensional_ndarray, __pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1057, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = NULL;
      __pyx_t_16 = 0;
      #if CYTHON_UNPACK_METHODS
      if (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_16 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_10};
        __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1056, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_Raise(__pyx_t_11, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __PYX_ERR(0, 1056, __pyx_L1_error)

      /* "cytimes/pddt.py":1055
 *             # . validate array
 *             arr = us
 *             if arr.ndim != 1:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidTypeError(
 *                     "must be an 1-dimensional ndarray, instead of %d-dim." % arr.ndim
 */
    }

    /* "cytimes/pddt.py":1060
 *                 )
 *             # . convert to ndarray[datetime64]
 *             arr = utils.arr_assure_int64_like(arr)             # <<<<<<<<<<<<<<
 *             arr = arr.astype("datetime64[us]")
 *             # . new instance
 */
    __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_assure_int64_like(__pyx_v_arr)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1060, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_11));
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":1061
 *             # . convert to ndarray[datetime64]
 *             arr = utils.arr_assure_int64_like(arr)
 *             arr = arr.astype("datetime64[us]")             # <<<<<<<<<<<<<<
 *             # . new instance
 *             return pddt_new_simple(arr, tz, unit, name)
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_10 = NULL;
    __pyx_t_16 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_16 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_kp_u_datetime64_us};
      __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1061, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1061, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_11));
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":1063
 *             arr = arr.astype("datetime64[us]")
 *             # . new instance
 *             return pddt_new_simple(arr, tz, unit, name)             # <<<<<<<<<<<<<<
 * 
 *         # Invalid
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_30.__pyx_n = 3;
    __pyx_t_30.tz = __pyx_v_tz;
    __pyx_t_30.unit = __pyx_v_unit;
    __pyx_t_30.name = __pyx_v_name;
    __pyx_t_11 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_30); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1063, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_r = __pyx_t_11;
    __pyx_t_11 = 0;
    goto __pyx_L0;

    /* "cytimes/pddt.py":1052
 * 
 *         # <'numpy.ndarray'>
 *         if isinstance(us, np.ndarray):             # <<<<<<<<<<<<<<
 *             # . validate array
 *             arr = us
 */
  }

  /* "cytimes/pddt.py":1066
 * 
 *         # Invalid
 *         raise errors.InvalidTypeError(             # <<<<<<<<<<<<<<
 *             "unsupported type %s for argument 'us'." % type(us)
 *         )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_errors); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_InvalidTypeError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":1067
 *         # Invalid
 *         raise errors.InvalidTypeError(
 *             "unsupported type %s for argument 'us'." % type(us)             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_7 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unsupported_type_s_for_argument_3, ((PyObject *)Py_TYPE(__pyx_v_us))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_12 = NULL;
  __pyx_t_16 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
      __pyx_t_16 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_7};
    __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1066, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __PYX_ERR(0, 1066, __pyx_L1_error)

  /* "cytimes/pddt.py":977
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromicroseconds(
 *         cls,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_28);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fromicroseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_us);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1070
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromtimestamp(
 *         cls,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_21fromtimestamp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_20fromtimestamp, "Construct from POSIX timestamps with optional timezone `<'Pddt'>`.\n\n        :param ts `<'int/float/Array-like'>`: The POSIX timestamps to construct with.\n            - `<'int/float'>` A numeric value representing the timestamp.\n            - `<'Array-like'>` An array-like object containing the timestamps.\n\n        :param tz `<'str/tzinfo/None'>`: The timezone of the index, defaults to `None`.\n            - `<'datetime.tzinfo'>` A subclass of `datetime.tzinfo`.\n            - `<'str'>` Timezone name supported by the 'Zoneinfo' module, or `'local'` for local timezone.\n            - `<'None'>` Timezone-naive.\n\n        :param size `<'int/str/bytes/object'>`: The size of the index to generate, defaults to `1`.\n            - This argument is `ignored` if 'us' is an array-like object.\n            - `<'int/str/bytes'>` Representing an integer for the number of elements in the index.\n            - `<'object'>` Any object that implements `__len__()`, where its length represents the size of the index.\n\n        :param unit `<'str/None'>`: Set the datetime unit of the index, defaults to `None`.\n            Supported datetime units: 's', 'ms', 'us', 'ns'.\n\n        :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_21fromtimestamp = {"fromtimestamp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_21fromtimestamp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_20fromtimestamp};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_21fromtimestamp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_ts = 0;
  PyObject *__pyx_v_tz = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fromtimestamp (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_ts,&__pyx_n_s_tz,&__pyx_n_s_size,&__pyx_n_s_unit,&__pyx_n_s_name,0};

    /* "cytimes/pddt.py":1074
 *         cls,
 *         ts: int | float | object,
 *         tz: datetime.tzinfo | str | None = None,             # <<<<<<<<<<<<<<
 *         size: object = 1,
 *         unit: str = None,
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1)));

    /* "cytimes/pddt.py":1076
 *         tz: datetime.tzinfo | str | None = None,
 *         size: object = 1,
 *         unit: str = None,             # <<<<<<<<<<<<<<
 *         name: Hashable | None = None,
 *     ) -> Self:
 */
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));

    /* "cytimes/pddt.py":1077
 *         size: object = 1,
 *         unit: str = None,
 *         name: Hashable | None = None,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Construct from POSIX timestamps with optional timezone `<'Pddt'>`.
 */
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1070, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ts)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1070, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("fromtimestamp", 0, 2, 6, 1); __PYX_ERR(0, 1070, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tz);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1070, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1070, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1070, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1070, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fromtimestamp") < 0)) __PYX_ERR(0, 1070, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_ts = values[1];
    __pyx_v_tz = values[2];
    __pyx_v_size = values[3];
    __pyx_v_unit = ((PyObject*)values[4]);
    __pyx_v_name = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fromtimestamp", 0, 2, 6, __pyx_nargs); __PYX_ERR(0, 1070, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fromtimestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 1, "unit", 1))) __PYX_ERR(0, 1076, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_20fromtimestamp(__pyx_self, __pyx_v_cls, __pyx_v_ts, __pyx_v_tz, __pyx_v_size, __pyx_v_unit, __pyx_v_name);

  /* "cytimes/pddt.py":1070
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromtimestamp(
 *         cls,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_20fromtimestamp(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_ts, PyObject *__pyx_v_tz, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name) {
  PyArrayObject *__pyx_v_arr = 0;
  Py_ssize_t __pyx_v_arr_size;
  double __pyx_v_sec;
  PyObject *__pyx_v_err = NULL;
  PyDateTime_DateTime *__pyx_v_dt = NULL;
  npy_int64 *__pyx_v_arr_ptr;
  Py_ssize_t __pyx_v_i;
  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 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  double __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  unsigned int __pyx_t_16;
  int __pyx_t_17;
  char const *__pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt_fr_ts __pyx_t_25;
  struct __pyx_opt_args_7cytimes_4pddt__pddt_fr_dt __pyx_t_26;
  npy_intp __pyx_t_27[1];
  PyObject *(*__pyx_t_28)(PyObject *);
  PyObject *__pyx_t_29 = NULL;
  char const *__pyx_t_30;
  PY_LONG_LONG __pyx_t_31;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_us __pyx_t_32;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_33;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fromtimestamp", 0);
  __Pyx_INCREF(__pyx_v_tz);

  /* "cytimes/pddt.py":1104
 *         arr_size: cython.Py_ssize_t
 *         sec: cython.double
 *         tz = utils.tz_parse(tz)             # <<<<<<<<<<<<<<
 * 
 *         # Single value
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_tz_parse(__pyx_v_tz); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":1107
 * 
 *         # Single value
 *         if isinstance(ts, (int, float, str, bytes)):             # <<<<<<<<<<<<<<
 *             # . convert to datetime
 *             arr_size = _parse_arr_size(size)
 */
  __pyx_t_3 = PyInt_Check(__pyx_v_ts); 
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = PyFloat_Check(__pyx_v_ts); 
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = PyUnicode_Check(__pyx_v_ts); 
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = PyBytes_Check(__pyx_v_ts); 
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":1109
 *         if isinstance(ts, (int, float, str, bytes)):
 *             # . convert to datetime
 *             arr_size = _parse_arr_size(size)             # <<<<<<<<<<<<<<
 *             try:
 *                 sec = float(ts)
 */
    __pyx_t_4 = __pyx_f_7cytimes_4pddt__parse_arr_size(__pyx_v_size); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-2L))) __PYX_ERR(0, 1109, __pyx_L1_error)
    __pyx_v_arr_size = __pyx_t_4;

    /* "cytimes/pddt.py":1110
 *             # . convert to datetime
 *             arr_size = _parse_arr_size(size)
 *             try:             # <<<<<<<<<<<<<<
 *                 sec = float(ts)
 *             except Exception as err:
 */
    {
      __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:*/ {

        /* "cytimes/pddt.py":1111
 *             arr_size = _parse_arr_size(size)
 *             try:
 *                 sec = float(ts)             # <<<<<<<<<<<<<<
 *             except Exception as err:
 *                 raise errors.InvalidTypeError(
 */
        __pyx_t_8 = __Pyx_PyObject_AsDouble(__pyx_v_ts); if (unlikely(__pyx_t_8 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1111, __pyx_L8_error)
        __pyx_v_sec = __pyx_t_8;

        /* "cytimes/pddt.py":1110
 *             # . convert to datetime
 *             arr_size = _parse_arr_size(size)
 *             try:             # <<<<<<<<<<<<<<
 *                 sec = float(ts)
 *             except Exception as err:
 */
      }
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L13_try_end;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cytimes/pddt.py":1112
 *             try:
 *                 sec = float(ts)
 *             except Exception as err:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidTypeError(
 *                     "cannot convert '%s' to float "
 */
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
      if (__pyx_t_9) {
        __Pyx_AddTraceback("cytimes.pddt.Pddt.fromtimestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_10, &__pyx_t_11) < 0) __PYX_ERR(0, 1112, __pyx_L10_except_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_10);
        __pyx_v_err = __pyx_t_10;
        /*try:*/ {

          /* "cytimes/pddt.py":1113
 *                 sec = float(ts)
 *             except Exception as err:
 *                 raise errors.InvalidTypeError(             # <<<<<<<<<<<<<<
 *                     "cannot convert '%s' to float "
 *                     "to represent the timestamp value." % ts
 */
          __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_errors); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1113, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_InvalidTypeError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1113, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

          /* "cytimes/pddt.py":1115
 *                 raise errors.InvalidTypeError(
 *                     "cannot convert '%s' to float "
 *                     "to represent the timestamp value." % ts             # <<<<<<<<<<<<<<
 *                 ) from err
 *             dt = utils.dt_fr_ts(sec, tz)
 */
          __pyx_t_13 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_cannot_convert_s_to_float_to_rep, __pyx_v_ts); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1115, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_15 = NULL;
          __pyx_t_16 = 0;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_14))) {
            __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
            if (likely(__pyx_t_15)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
              __Pyx_INCREF(__pyx_t_15);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_14, function);
              __pyx_t_16 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_13};
            __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1113, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          }

          /* "cytimes/pddt.py":1116
 *                     "cannot convert '%s' to float "
 *                     "to represent the timestamp value." % ts
 *                 ) from err             # <<<<<<<<<<<<<<
 *             dt = utils.dt_fr_ts(sec, tz)
 *             # . new instance
 */
          __Pyx_Raise(__pyx_t_12, 0, 0, __pyx_v_err);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __PYX_ERR(0, 1113, __pyx_L19_error)
        }

        /* "cytimes/pddt.py":1112
 *             try:
 *                 sec = float(ts)
 *             except Exception as err:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidTypeError(
 *                     "cannot convert '%s' to float "
 */
        /*finally:*/ {
          __pyx_L19_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_22);
            __Pyx_XGOTREF(__pyx_t_23);
            __Pyx_XGOTREF(__pyx_t_24);
            __pyx_t_9 = __pyx_lineno; __pyx_t_17 = __pyx_clineno; __pyx_t_18 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
            }
            if (PY_MAJOR_VERSION >= 3) {
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_XGIVEREF(__pyx_t_24);
              __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24);
            }
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ErrRestore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
            __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0;
            __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_17; __pyx_filename = __pyx_t_18;
            goto __pyx_L10_except_error;
          }
        }
      }
      goto __pyx_L10_except_error;

      /* "cytimes/pddt.py":1110
 *             # . convert to datetime
 *             arr_size = _parse_arr_size(size)
 *             try:             # <<<<<<<<<<<<<<
 *                 sec = float(ts)
 *             except Exception as err:
 */
      __pyx_L10_except_error:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L13_try_end:;
    }

    /* "cytimes/pddt.py":1117
 *                     "to represent the timestamp value." % ts
 *                 ) from err
 *             dt = utils.dt_fr_ts(sec, tz)             # <<<<<<<<<<<<<<
 *             # . new instance
 *             return _pddt_fr_dt(dt, arr_size, unit, name)
 */
    __pyx_t_25.__pyx_n = 1;
    __pyx_t_25.tz = __pyx_v_tz;
    __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_ts(__pyx_v_sec, &__pyx_t_25)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_v_dt = ((PyDateTime_DateTime *)__pyx_t_11);
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":1119
 *             dt = utils.dt_fr_ts(sec, tz)
 *             # . new instance
 *             return _pddt_fr_dt(dt, arr_size, unit, name)             # <<<<<<<<<<<<<<
 * 
 *         # Array-like
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_26.__pyx_n = 2;
    __pyx_t_26.unit = __pyx_v_unit;
    __pyx_t_26.name = __pyx_v_name;
    __pyx_t_11 = __pyx_f_7cytimes_4pddt__pddt_fr_dt(__pyx_v_dt, __pyx_v_arr_size, &__pyx_t_26); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_r = __pyx_t_11;
    __pyx_t_11 = 0;
    goto __pyx_L0;

    /* "cytimes/pddt.py":1107
 * 
 *         # Single value
 *         if isinstance(ts, (int, float, str, bytes)):             # <<<<<<<<<<<<<<
 *             # . convert to datetime
 *             arr_size = _parse_arr_size(size)
 */
  }

  /* "cytimes/pddt.py":1122
 * 
 *         # Array-like
 *         if isinstance(ts, (list, tuple, Series, Index, np.ndarray)):             # <<<<<<<<<<<<<<
 *             # . convert to ndarray[datetime64]
 *             arr_size = len(ts)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_Series); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_Index); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_3 = PyList_Check(__pyx_v_ts); 
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L26_bool_binop_done;
  }
  __pyx_t_3 = PyTuple_Check(__pyx_v_ts); 
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L26_bool_binop_done;
  }
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_ts, __pyx_t_11); 
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L26_bool_binop_done;
  }
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_ts, __pyx_t_10); 
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L26_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_ts, __pyx_ptype_5numpy_ndarray); 
  __pyx_t_2 = __pyx_t_3;
  __pyx_L26_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":1124
 *         if isinstance(ts, (list, tuple, Series, Index, np.ndarray)):
 *             # . convert to ndarray[datetime64]
 *             arr_size = len(ts)             # <<<<<<<<<<<<<<
 *             arr = np.PyArray_EMPTY(1, [arr_size], np.NPY_TYPES.NPY_INT64, 0)
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 */
    __pyx_t_4 = PyObject_Length(__pyx_v_ts); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1124, __pyx_L1_error)
    __pyx_v_arr_size = __pyx_t_4;

    /* "cytimes/pddt.py":1125
 *             # . convert to ndarray[datetime64]
 *             arr_size = len(ts)
 *             arr = np.PyArray_EMPTY(1, [arr_size], np.NPY_TYPES.NPY_INT64, 0)             # <<<<<<<<<<<<<<
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 *             i: cython.Py_ssize_t = 0
 */
    __pyx_t_27[0] = __pyx_v_arr_size;
    __pyx_t_11 = PyArray_EMPTY(1, __pyx_t_27, NPY_INT64, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1125, __pyx_L1_error)
    __pyx_v_arr = ((PyArrayObject *)__pyx_t_11);
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":1126
 *             arr_size = len(ts)
 *             arr = np.PyArray_EMPTY(1, [arr_size], np.NPY_TYPES.NPY_INT64, 0)
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))             # <<<<<<<<<<<<<<
 *             i: cython.Py_ssize_t = 0
 *             for item in ts:
 */
    __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

    /* "cytimes/pddt.py":1127
 *             arr = np.PyArray_EMPTY(1, [arr_size], np.NPY_TYPES.NPY_INT64, 0)
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 *             i: cython.Py_ssize_t = 0             # <<<<<<<<<<<<<<
 *             for item in ts:
 *                 try:
 */
    __pyx_v_i = 0;

    /* "cytimes/pddt.py":1128
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 *             i: cython.Py_ssize_t = 0
 *             for item in ts:             # <<<<<<<<<<<<<<
 *                 try:
 *                     sec = float(item)
 */
    if (likely(PyList_CheckExact(__pyx_v_ts)) || PyTuple_CheckExact(__pyx_v_ts)) {
      __pyx_t_11 = __pyx_v_ts; __Pyx_INCREF(__pyx_t_11);
      __pyx_t_4 = 0;
      __pyx_t_28 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_v_ts); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1128, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_28 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 1128, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_28)) {
        if (likely(PyList_CheckExact(__pyx_t_11))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1128, __pyx_L1_error)
            #endif
            if (__pyx_t_4 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 1128, __pyx_L1_error)
          #else
          __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1128, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1128, __pyx_L1_error)
            #endif
            if (__pyx_t_4 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 1128, __pyx_L1_error)
          #else
          __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1128, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        }
      } else {
        __pyx_t_10 = __pyx_t_28(__pyx_t_11);
        if (unlikely(!__pyx_t_10)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1128, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "cytimes/pddt.py":1129
 *             i: cython.Py_ssize_t = 0
 *             for item in ts:
 *                 try:             # <<<<<<<<<<<<<<
 *                     sec = float(item)
 *                 except Exception as err:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_5);
        /*try:*/ {

          /* "cytimes/pddt.py":1130
 *             for item in ts:
 *                 try:
 *                     sec = float(item)             # <<<<<<<<<<<<<<
 *                 except Exception as err:
 *                     raise errors.InvalidTypeError(
 */
          __pyx_t_8 = __Pyx_PyObject_AsDouble(__pyx_v_item); if (unlikely(__pyx_t_8 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1130, __pyx_L33_error)
          __pyx_v_sec = __pyx_t_8;

          /* "cytimes/pddt.py":1129
 *             i: cython.Py_ssize_t = 0
 *             for item in ts:
 *                 try:             # <<<<<<<<<<<<<<
 *                     sec = float(item)
 *                 except Exception as err:
 */
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L40_try_end;
        __pyx_L33_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;

        /* "cytimes/pddt.py":1131
 *                 try:
 *                     sec = float(item)
 *                 except Exception as err:             # <<<<<<<<<<<<<<
 *                     raise errors.InvalidTypeError(
 *                         "cannot convert '%s' to float "
 */
        __pyx_t_17 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
        if (__pyx_t_17) {
          __Pyx_AddTraceback("cytimes.pddt.Pddt.fromtimestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_1, &__pyx_t_12) < 0) __PYX_ERR(0, 1131, __pyx_L35_except_error)
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_1);
          __pyx_v_err = __pyx_t_1;
          /*try:*/ {

            /* "cytimes/pddt.py":1132
 *                     sec = float(item)
 *                 except Exception as err:
 *                     raise errors.InvalidTypeError(             # <<<<<<<<<<<<<<
 *                         "cannot convert '%s' to float "
 *                         "to represent the timestamp value." % item
 */
            __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_errors); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1132, __pyx_L46_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_InvalidTypeError); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1132, __pyx_L46_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

            /* "cytimes/pddt.py":1134
 *                     raise errors.InvalidTypeError(
 *                         "cannot convert '%s' to float "
 *                         "to represent the timestamp value." % item             # <<<<<<<<<<<<<<
 *                     ) from err
 *                 dt = utils.dt_fr_ts(sec, tz)
 */
            __pyx_t_13 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_cannot_convert_s_to_float_to_rep, __pyx_v_item); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1134, __pyx_L46_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_29 = NULL;
            __pyx_t_16 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_15))) {
              __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_15);
              if (likely(__pyx_t_29)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
                __Pyx_INCREF(__pyx_t_29);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_15, function);
                __pyx_t_16 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_29, __pyx_t_13};
              __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
              __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1132, __pyx_L46_error)
              __Pyx_GOTREF(__pyx_t_14);
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            }

            /* "cytimes/pddt.py":1135
 *                         "cannot convert '%s' to float "
 *                         "to represent the timestamp value." % item
 *                     ) from err             # <<<<<<<<<<<<<<
 *                 dt = utils.dt_fr_ts(sec, tz)
 *                 arr_ptr[i] = utils.dt_to_us(dt, False)
 */
            __Pyx_Raise(__pyx_t_14, 0, 0, __pyx_v_err);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __PYX_ERR(0, 1132, __pyx_L46_error)
          }

          /* "cytimes/pddt.py":1131
 *                 try:
 *                     sec = float(item)
 *                 except Exception as err:             # <<<<<<<<<<<<<<
 *                     raise errors.InvalidTypeError(
 *                         "cannot convert '%s' to float "
 */
          /*finally:*/ {
            __pyx_L46_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0;
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
              if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
              if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22) < 0)) __Pyx_ErrFetch(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22);
              __Pyx_XGOTREF(__pyx_t_24);
              __Pyx_XGOTREF(__pyx_t_23);
              __Pyx_XGOTREF(__pyx_t_22);
              __Pyx_XGOTREF(__pyx_t_21);
              __Pyx_XGOTREF(__pyx_t_20);
              __Pyx_XGOTREF(__pyx_t_19);
              __pyx_t_17 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_30 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
              }
              if (PY_MAJOR_VERSION >= 3) {
                __Pyx_XGIVEREF(__pyx_t_21);
                __Pyx_XGIVEREF(__pyx_t_20);
                __Pyx_XGIVEREF(__pyx_t_19);
                __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19);
              }
              __Pyx_XGIVEREF(__pyx_t_24);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_ErrRestore(__pyx_t_24, __pyx_t_23, __pyx_t_22);
              __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0;
              __pyx_lineno = __pyx_t_17; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_30;
              goto __pyx_L35_except_error;
            }
          }
        }
        goto __pyx_L35_except_error;

        /* "cytimes/pddt.py":1129
 *             i: cython.Py_ssize_t = 0
 *             for item in ts:
 *                 try:             # <<<<<<<<<<<<<<
 *                     sec = float(item)
 *                 except Exception as err:
 */
        __pyx_L35_except_error:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
        goto __pyx_L1_error;
        __pyx_L40_try_end:;
      }

      /* "cytimes/pddt.py":1136
 *                         "to represent the timestamp value." % item
 *                     ) from err
 *                 dt = utils.dt_fr_ts(sec, tz)             # <<<<<<<<<<<<<<
 *                 arr_ptr[i] = utils.dt_to_us(dt, False)
 *                 i += 1
 */
      __pyx_t_25.__pyx_n = 1;
      __pyx_t_25.tz = __pyx_v_tz;
      __pyx_t_12 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_ts(__pyx_v_sec, &__pyx_t_25)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_XDECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_12));
      __pyx_t_12 = 0;

      /* "cytimes/pddt.py":1137
 *                     ) from err
 *                 dt = utils.dt_fr_ts(sec, tz)
 *                 arr_ptr[i] = utils.dt_to_us(dt, False)             # <<<<<<<<<<<<<<
 *                 i += 1
 *             arr = arr.astype("datetime64[us]")
 */
      __pyx_t_32.__pyx_n = 1;
      __pyx_t_32.utc = 0;
      __pyx_t_31 = __pyx_f_7cytimes_5utils_dt_to_us(__pyx_v_dt, &__pyx_t_32); if (unlikely(__pyx_t_31 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 1137, __pyx_L1_error)
      (__pyx_v_arr_ptr[__pyx_v_i]) = __pyx_t_31;

      /* "cytimes/pddt.py":1138
 *                 dt = utils.dt_fr_ts(sec, tz)
 *                 arr_ptr[i] = utils.dt_to_us(dt, False)
 *                 i += 1             # <<<<<<<<<<<<<<
 *             arr = arr.astype("datetime64[us]")
 *             # . new instance
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "cytimes/pddt.py":1128
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 *             i: cython.Py_ssize_t = 0
 *             for item in ts:             # <<<<<<<<<<<<<<
 *                 try:
 *                     sec = float(item)
 */
    }
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "cytimes/pddt.py":1139
 *                 arr_ptr[i] = utils.dt_to_us(dt, False)
 *                 i += 1
 *             arr = arr.astype("datetime64[us]")             # <<<<<<<<<<<<<<
 *             # . new instance
 *             return pddt_new_simple(arr, tz, unit, name)
 */
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_1 = NULL;
    __pyx_t_16 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
        __pyx_t_16 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_u_datetime64_us};
      __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1139, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1139, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_11));
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":1141
 *             arr = arr.astype("datetime64[us]")
 *             # . new instance
 *             return pddt_new_simple(arr, tz, unit, name)             # <<<<<<<<<<<<<<
 * 
 *         # Invalid
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_33.__pyx_n = 3;
    __pyx_t_33.tz = __pyx_v_tz;
    __pyx_t_33.unit = __pyx_v_unit;
    __pyx_t_33.name = __pyx_v_name;
    __pyx_t_11 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_33); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1141, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_r = __pyx_t_11;
    __pyx_t_11 = 0;
    goto __pyx_L0;

    /* "cytimes/pddt.py":1122
 * 
 *         # Array-like
 *         if isinstance(ts, (list, tuple, Series, Index, np.ndarray)):             # <<<<<<<<<<<<<<
 *             # . convert to ndarray[datetime64]
 *             arr_size = len(ts)
 */
  }

  /* "cytimes/pddt.py":1144
 * 
 *         # Invalid
 *         raise errors.InvalidTypeError(             # <<<<<<<<<<<<<<
 *             "unsupported type %s for argument 'ts'." % type(ts)
 *         )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_errors); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_InvalidTypeError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "cytimes/pddt.py":1145
 *         # Invalid
 *         raise errors.InvalidTypeError(
 *             "unsupported type %s for argument 'ts'." % type(ts)             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_12 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unsupported_type_s_for_argument_4, ((PyObject *)Py_TYPE(__pyx_v_ts))); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = NULL;
  __pyx_t_16 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_16 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_12};
    __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __PYX_ERR(0, 1144, __pyx_L1_error)

  /* "cytimes/pddt.py":1070
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromtimestamp(
 *         cls,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_29);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fromtimestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XDECREF((PyObject *)__pyx_v_dt);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1148
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def utcfromtimestamp(
 *         cls,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_23utcfromtimestamp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_22utcfromtimestamp, "Construct from POSIX timestamps with UTC timezone `<'Pddt'>`.\n\n        :param ts `<'int/float/Array-like'>`: The POSIX timestamps to construct with.\n            - `<'int/float'>` A numeric value representing the timestamp.\n            - `<'Array-like'>` An array-like object containing the timestamps.\n\n        :param size `<'int/str/bytes/object'>`: The size of the index to generate, defaults to `1`.\n            - This argument is `ignored` if 'us' is an array-like object.\n            - `<'int/str/bytes'>` Representing an integer for the number of elements in the index.\n            - `<'object'>` Any object that implements `__len__()`, where its length represents the size of the index.\n\n        :param unit `<'str/None'>`: Set the datetime unit of the index, defaults to `None`.\n            Supported datetime units: 's', 'ms', 'us', 'ns'.\n\n        :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_23utcfromtimestamp = {"utcfromtimestamp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_23utcfromtimestamp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_22utcfromtimestamp};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_23utcfromtimestamp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_ts = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("utcfromtimestamp (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_ts,&__pyx_n_s_size,&__pyx_n_s_unit,&__pyx_n_s_name,0};
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1)));

    /* "cytimes/pddt.py":1153
 *         ts: int | float | object,
 *         size: object = 1,
 *         unit: str = None,             # <<<<<<<<<<<<<<
 *         name: Hashable | None = None,
 *     ) -> Self:
 */
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));

    /* "cytimes/pddt.py":1154
 *         size: object = 1,
 *         unit: str = None,
 *         name: Hashable | None = None,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Construct from POSIX timestamps with UTC timezone `<'Pddt'>`.
 */
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1148, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ts)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1148, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("utcfromtimestamp", 0, 2, 5, 1); __PYX_ERR(0, 1148, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1148, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1148, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1148, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "utcfromtimestamp") < 0)) __PYX_ERR(0, 1148, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_ts = values[1];
    __pyx_v_size = values[2];
    __pyx_v_unit = ((PyObject*)values[3]);
    __pyx_v_name = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("utcfromtimestamp", 0, 2, 5, __pyx_nargs); __PYX_ERR(0, 1148, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.utcfromtimestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 1, "unit", 1))) __PYX_ERR(0, 1153, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_22utcfromtimestamp(__pyx_self, __pyx_v_cls, __pyx_v_ts, __pyx_v_size, __pyx_v_unit, __pyx_v_name);

  /* "cytimes/pddt.py":1148
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def utcfromtimestamp(
 *         cls,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_22utcfromtimestamp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_ts, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("utcfromtimestamp", 1);

  /* "cytimes/pddt.py":1172
 *         :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.
 *         """
 *         return cls.fromtimestamp(ts, utils.UTC, size, unit, name)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_fromtimestamp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[6] = {__pyx_t_3, __pyx_v_ts, ((PyObject *)__pyx_v_7cytimes_5utils_UTC), __pyx_v_size, __pyx_v_unit, __pyx_v_name};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 5+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __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;

  /* "cytimes/pddt.py":1148
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def utcfromtimestamp(
 *         cls,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.utcfromtimestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1174
 *         return cls.fromtimestamp(ts, utils.UTC, size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromisoformat(
 *         cls,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_25fromisoformat(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_24fromisoformat, "Construct from ISO format strings `<'Pddt'>`.\n\n        :param dtstr `<'str/Array-like'>`: The ISO format datetime string(s) to construct with.\n            - `<'str'>` A ISO format datetime string.\n            - `<'Array-like'>` An array-like object containing the datetime strings.\n\n        :param size `<'int/str/bytes/object'>`: The size of the index to generate, defaults to `1`.\n            - This argument is `ignored` if 'us' is an array-like object.\n            - `<'int/str/bytes'>` Representing an integer for the number of elements in the index.\n            - `<'object'>` Any object that implements `__len__()`, where its length represents the size of the index.\n\n        :param unit `<'str/None'>`: Set the datetime unit of the index, defaults to `None`.\n            Supported datetime units: 's', 'ms', 'us', 'ns'.\n\n        :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_25fromisoformat = {"fromisoformat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_25fromisoformat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_24fromisoformat};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_25fromisoformat(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_dtstr = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fromisoformat (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_dtstr,&__pyx_n_s_size,&__pyx_n_s_unit,&__pyx_n_s_name,0};
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1)));

    /* "cytimes/pddt.py":1179
 *         dtstr: str | object,
 *         size: object = 1,
 *         unit: str = None,             # <<<<<<<<<<<<<<
 *         name: Hashable | None = None,
 *     ) -> Self:
 */
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));

    /* "cytimes/pddt.py":1180
 *         size: object = 1,
 *         unit: str = None,
 *         name: Hashable | None = None,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Construct from ISO format strings `<'Pddt'>`.
 */
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1174, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dtstr)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1174, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("fromisoformat", 0, 2, 5, 1); __PYX_ERR(0, 1174, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1174, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1174, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1174, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fromisoformat") < 0)) __PYX_ERR(0, 1174, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_dtstr = values[1];
    __pyx_v_size = values[2];
    __pyx_v_unit = ((PyObject*)values[3]);
    __pyx_v_name = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fromisoformat", 0, 2, 5, __pyx_nargs); __PYX_ERR(0, 1174, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fromisoformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 1, "unit", 1))) __PYX_ERR(0, 1179, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_24fromisoformat(__pyx_self, __pyx_v_cls, __pyx_v_dtstr, __pyx_v_size, __pyx_v_unit, __pyx_v_name);

  /* "cytimes/pddt.py":1174
 *         return cls.fromtimestamp(ts, utils.UTC, size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromisoformat(
 *         cls,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_24fromisoformat(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_dtstr, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name) {
  Py_ssize_t __pyx_v_arr_size;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  struct __pyx_opt_args_7cytimes_4pddt__pddt_fr_dt __pyx_t_5;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fromisoformat", 1);

  /* "cytimes/pddt.py":1199
 *         """
 *         # <'str'>
 *         if isinstance(dtstr, str):             # <<<<<<<<<<<<<<
 *             arr_size = _parse_arr_size(size)
 *             return _pddt_fr_dt(_parse_dtobj(dtstr), arr_size, unit, name)
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_dtstr); 
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1200
 *         # <'str'>
 *         if isinstance(dtstr, str):
 *             arr_size = _parse_arr_size(size)             # <<<<<<<<<<<<<<
 *             return _pddt_fr_dt(_parse_dtobj(dtstr), arr_size, unit, name)
 * 
 */
    __pyx_t_2 = __pyx_f_7cytimes_4pddt__parse_arr_size(__pyx_v_size); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-2L))) __PYX_ERR(0, 1200, __pyx_L1_error)
    __pyx_v_arr_size = __pyx_t_2;

    /* "cytimes/pddt.py":1201
 *         if isinstance(dtstr, str):
 *             arr_size = _parse_arr_size(size)
 *             return _pddt_fr_dt(_parse_dtobj(dtstr), arr_size, unit, name)             # <<<<<<<<<<<<<<
 * 
 *         # Other types
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_4pddt__parse_dtobj(__pyx_v_dtstr, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5.__pyx_n = 2;
    __pyx_t_5.unit = __pyx_v_unit;
    __pyx_t_5.name = __pyx_v_name;
    __pyx_t_4 = __pyx_f_7cytimes_4pddt__pddt_fr_dt(((PyDateTime_DateTime *)__pyx_t_3), __pyx_v_arr_size, &__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1201, __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;

    /* "cytimes/pddt.py":1199
 *         """
 *         # <'str'>
 *         if isinstance(dtstr, str):             # <<<<<<<<<<<<<<
 *             arr_size = _parse_arr_size(size)
 *             return _pddt_fr_dt(_parse_dtobj(dtstr), arr_size, unit, name)
 */
  }

  /* "cytimes/pddt.py":1204
 * 
 *         # Other types
 *         return pddt_new_simple(dtstr, None, unit, name)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6.__pyx_n = 3;
  __pyx_t_6.tz = Py_None;
  __pyx_t_6.unit = __pyx_v_unit;
  __pyx_t_6.name = __pyx_v_name;
  __pyx_t_4 = __pyx_f_7cytimes_4pddt_pddt_new_simple(__pyx_v_dtstr, &__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":1174
 *         return cls.fromtimestamp(ts, utils.UTC, size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromisoformat(
 *         cls,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fromisoformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1206
 *         return pddt_new_simple(dtstr, None, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromisocalendar(
 *         cls,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_27fromisocalendar(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_26fromisocalendar, "Construct from ISO calendar values `<'Pddt'>`.\n\n        :param iso `<'dict/list/tuple/DataFrame'>`: The ISO calendar values to construct with.\n        :param year `<'int/None'>`: The ISO year, defaults to `None`.\n        :param week `<'int/None'>`: The ISO week number (1-53), defaults to `None`.\n        :param weekday `<'int'>`: The ISO weekday (1=Mon...7=Sun), defaults to `None`.\n        :param tz `<'str/tzinfo/None'>`: The timezone of the index, defaults to `None`.\n            - `<'datetime.tzinfo'>` A subclass of `datetime.tzinfo`.\n            - `<'str'>` Timezone name supported by the 'Zoneinfo' module, or `'local'` for local timezone.\n            - `<'None'>` Timezone-naive.\n\n        :param size `<'int/str/bytes/object'>`: The size of the index to generate, defaults to `1`.\n            - This argument is `ignored` if 'us' is an array-like object.\n            - `<'int/str/bytes'>` Representing an integer for the number of elements in the index.\n            - `<'object'>` Any object that implements `__len__()`, where its length represents the size of the index.\n\n        :param unit `<'str/None'>`: Set the datetime unit of the index, defaults to `None`.\n            Supported datetime units: 's', 'ms', 'us', 'ns'.\n\n        :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_27fromisocalendar = {"fromisocalendar", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_27fromisocalendar, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_26fromisocalendar};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_27fromisocalendar(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_iso = 0;
  PyObject *__pyx_v_year = 0;
  PyObject *__pyx_v_week = 0;
  PyObject *__pyx_v_weekday = 0;
  PyObject *__pyx_v_tz = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fromisocalendar (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_iso,&__pyx_n_s_year,&__pyx_n_s_week,&__pyx_n_s_weekday,&__pyx_n_s_tz,&__pyx_n_s_size,&__pyx_n_s_unit,&__pyx_n_s_name,0};

    /* "cytimes/pddt.py":1210
 *         cls,
 *         iso: object,
 *         year: int | None = None,             # <<<<<<<<<<<<<<
 *         week: int | None = None,
 *         weekday: int | None = None,
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "cytimes/pddt.py":1211
 *         iso: object,
 *         year: int | None = None,
 *         week: int | None = None,             # <<<<<<<<<<<<<<
 *         weekday: int | None = None,
 *         tz: datetime.tzinfo | str | None = None,
 */
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "cytimes/pddt.py":1212
 *         year: int | None = None,
 *         week: int | None = None,
 *         weekday: int | None = None,             # <<<<<<<<<<<<<<
 *         tz: datetime.tzinfo | str | None = None,
 *         size: object = 1,
 */
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "cytimes/pddt.py":1213
 *         week: int | None = None,
 *         weekday: int | None = None,
 *         tz: datetime.tzinfo | str | None = None,             # <<<<<<<<<<<<<<
 *         size: object = 1,
 *         unit: str = None,
 */
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1)));

    /* "cytimes/pddt.py":1215
 *         tz: datetime.tzinfo | str | None = None,
 *         size: object = 1,
 *         unit: str = None,             # <<<<<<<<<<<<<<
 *         name: Hashable | None = None,
 *     ) -> Self:
 */
    values[7] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));

    /* "cytimes/pddt.py":1216
 *         size: object = 1,
 *         unit: str = None,
 *         name: Hashable | None = None,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Construct from ISO calendar values `<'Pddt'>`.
 */
    values[8] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1206, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iso)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1206, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("fromisocalendar", 0, 2, 9, 1); __PYX_ERR(0, 1206, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_year);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1206, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_week);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1206, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_weekday);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1206, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tz);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1206, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
          if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1206, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit);
          if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1206, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[8] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1206, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fromisocalendar") < 0)) __PYX_ERR(0, 1206, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_iso = values[1];
    __pyx_v_year = values[2];
    __pyx_v_week = values[3];
    __pyx_v_weekday = values[4];
    __pyx_v_tz = values[5];
    __pyx_v_size = values[6];
    __pyx_v_unit = ((PyObject*)values[7]);
    __pyx_v_name = values[8];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fromisocalendar", 0, 2, 9, __pyx_nargs); __PYX_ERR(0, 1206, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fromisocalendar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 1, "unit", 1))) __PYX_ERR(0, 1215, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_26fromisocalendar(__pyx_self, __pyx_v_cls, __pyx_v_iso, __pyx_v_year, __pyx_v_week, __pyx_v_weekday, __pyx_v_tz, __pyx_v_size, __pyx_v_unit, __pyx_v_name);

  /* "cytimes/pddt.py":1206
 *         return pddt_new_simple(dtstr, None, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromisocalendar(
 *         cls,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1240
 *         """
 * 
 *         def _parse_dict(item: dict) -> object:             # <<<<<<<<<<<<<<
 *             yy = item.get("year", year)
 *             ww = item.get("week", week)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_15fromisocalendar_1_parse_dict(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_15fromisocalendar_1_parse_dict = {"_parse_dict", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_15fromisocalendar_1_parse_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_15fromisocalendar_1_parse_dict(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_item = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_parse_dict (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_item,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_item)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1240, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_dict") < 0)) __PYX_ERR(0, 1240, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_item = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_parse_dict", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1240, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fromisocalendar._parse_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyDict_Type), 0, "item", 1))) __PYX_ERR(0, 1240, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_15fromisocalendar__parse_dict(__pyx_self, __pyx_v_item);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_15fromisocalendar__parse_dict(PyObject *__pyx_self, PyObject *__pyx_v_item) {
  struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar *__pyx_cur_scope;
  struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar *__pyx_outer_scope;
  PyObject *__pyx_v_yy = NULL;
  PyObject *__pyx_v_ww = NULL;
  PyObject *__pyx_v_dd = NULL;
  __pyx_t_7cytimes_5utils_ymd __pyx_v__ymd;
  PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  unsigned int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_23;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_parse_dict", 1);
  __pyx_outer_scope = (struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cytimes/pddt.py":1241
 * 
 *         def _parse_dict(item: dict) -> object:
 *             yy = item.get("year", year)             # <<<<<<<<<<<<<<
 *             ww = item.get("week", week)
 *             dd = item.get("weekday", item.get("day", weekday))
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_year)) { __Pyx_RaiseClosureNameError("year"); __PYX_ERR(0, 1241, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_item, __pyx_n_u_year, __pyx_cur_scope->__pyx_v_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_yy = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":1242
 *         def _parse_dict(item: dict) -> object:
 *             yy = item.get("year", year)
 *             ww = item.get("week", week)             # <<<<<<<<<<<<<<
 *             dd = item.get("weekday", item.get("day", weekday))
 *             try:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_week)) { __Pyx_RaiseClosureNameError("week"); __PYX_ERR(0, 1242, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_item, __pyx_n_u_week, __pyx_cur_scope->__pyx_v_week); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ww = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":1243
 *             yy = item.get("year", year)
 *             ww = item.get("week", week)
 *             dd = item.get("weekday", item.get("day", weekday))             # <<<<<<<<<<<<<<
 *             try:
 *                 _ymd = utils.ymd_fr_isocalendar(yy, ww, dd)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_weekday)) { __Pyx_RaiseClosureNameError("weekday"); __PYX_ERR(0, 1243, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_item, __pyx_n_u_day, __pyx_cur_scope->__pyx_v_weekday); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_item, __pyx_n_u_weekday, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dd = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":1244
 *             ww = item.get("week", week)
 *             dd = item.get("weekday", item.get("day", weekday))
 *             try:             # <<<<<<<<<<<<<<
 *                 _ymd = utils.ymd_fr_isocalendar(yy, ww, dd)
 *             except Exception as err:
 */
  {
    __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:*/ {

      /* "cytimes/pddt.py":1245
 *             dd = item.get("weekday", item.get("day", weekday))
 *             try:
 *                 _ymd = utils.ymd_fr_isocalendar(yy, ww, dd)             # <<<<<<<<<<<<<<
 *             except Exception as err:
 *                 raise errors.InvalidArgumentError(
 */
      __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_yy); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1245, __pyx_L3_error)
      __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_ww); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1245, __pyx_L3_error)
      __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_dd); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1245, __pyx_L3_error)
      __pyx_t_9 = __pyx_f_7cytimes_5utils_ymd_fr_isocalendar(__pyx_t_6, __pyx_t_7, __pyx_t_8); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1245, __pyx_L3_error)
      __pyx_v__ymd = __pyx_t_9;

      /* "cytimes/pddt.py":1244
 *             ww = item.get("week", week)
 *             dd = item.get("weekday", item.get("day", weekday))
 *             try:             # <<<<<<<<<<<<<<
 *                 _ymd = utils.ymd_fr_isocalendar(yy, ww, dd)
 *             except Exception as err:
 */
    }
    __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_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cytimes/pddt.py":1246
 *             try:
 *                 _ymd = utils.ymd_fr_isocalendar(yy, ww, dd)
 *             except Exception as err:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidArgumentError(
 *                     "cannot unpack '%s' to iso calendar "
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("cytimes.pddt.Pddt.fromisocalendar._parse_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_10) < 0) __PYX_ERR(0, 1246, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_v_err = __pyx_t_1;
      /*try:*/ {

        /* "cytimes/pddt.py":1247
 *                 _ymd = utils.ymd_fr_isocalendar(yy, ww, dd)
 *             except Exception as err:
 *                 raise errors.InvalidArgumentError(             # <<<<<<<<<<<<<<
 *                     "cannot unpack '%s' to iso calendar "
 *                     "values (year, week, day)." % item
 */
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_errors); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1247, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1247, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "cytimes/pddt.py":1249
 *                 raise errors.InvalidArgumentError(
 *                     "cannot unpack '%s' to iso calendar "
 *                     "values (year, week, day)." % item             # <<<<<<<<<<<<<<
 *                 ) from err
 *             return datetime.datetime_new(
 */
        __pyx_t_12 = PyUnicode_Format(__pyx_kp_u_cannot_unpack_s_to_iso_calendar, __pyx_v_item); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1249, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_14 = NULL;
        __pyx_t_15 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
            __pyx_t_15 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_12};
          __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15);
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1247, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }

        /* "cytimes/pddt.py":1250
 *                     "cannot unpack '%s' to iso calendar "
 *                     "values (year, week, day)." % item
 *                 ) from err             # <<<<<<<<<<<<<<
 *             return datetime.datetime_new(
 *                 _ymd.year, _ymd.month, _ymd.day, 0, 0, 0, 0, tz, 0
 */
        __Pyx_Raise(__pyx_t_11, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __PYX_ERR(0, 1247, __pyx_L14_error)
      }

      /* "cytimes/pddt.py":1246
 *             try:
 *                 _ymd = utils.ymd_fr_isocalendar(yy, ww, dd)
 *             except Exception as err:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidArgumentError(
 *                     "cannot unpack '%s' to iso calendar "
 */
      /*finally:*/ {
        __pyx_L14_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_8 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/pddt.py":1244
 *             ww = item.get("week", week)
 *             dd = item.get("weekday", item.get("day", weekday))
 *             try:             # <<<<<<<<<<<<<<
 *                 _ymd = utils.ymd_fr_isocalendar(yy, ww, dd)
 *             except Exception as err:
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "cytimes/pddt.py":1251
 *                     "values (year, week, day)." % item
 *                 ) from err
 *             return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *                 _ymd.year, _ymd.month, _ymd.day, 0, 0, 0, 0, tz, 0
 *             )
 */
  __Pyx_XDECREF(__pyx_r);

  /* "cytimes/pddt.py":1252
 *                 ) from err
 *             return datetime.datetime_new(
 *                 _ymd.year, _ymd.month, _ymd.day, 0, 0, 0, 0, tz, 0             # <<<<<<<<<<<<<<
 *             )
 * 
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_tz)) { __Pyx_RaiseClosureNameError("tz"); __PYX_ERR(0, 1252, __pyx_L1_error) }
  __pyx_t_10 = __pyx_cur_scope->__pyx_v_tz;
  __Pyx_INCREF(__pyx_t_10);

  /* "cytimes/pddt.py":1251
 *                     "values (year, week, day)." % item
 *                 ) from err
 *             return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *                 _ymd.year, _ymd.month, _ymd.day, 0, 0, 0, 0, tz, 0
 *             )
 */
  __pyx_t_23.__pyx_n = 1;
  __pyx_t_23.fold = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_v__ymd.year, __pyx_v__ymd.month, __pyx_v__ymd.day, 0, 0, 0, 0, __pyx_t_10, &__pyx_t_23)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":1240
 *         """
 * 
 *         def _parse_dict(item: dict) -> object:             # <<<<<<<<<<<<<<
 *             yy = item.get("year", year)
 *             ww = item.get("week", week)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fromisocalendar._parse_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_yy);
  __Pyx_XDECREF(__pyx_v_ww);
  __Pyx_XDECREF(__pyx_v_dd);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1255
 *             )
 * 
 *         def _parse_sequence(item: object) -> object:             # <<<<<<<<<<<<<<
 *             try:
 *                 if len(item) != 3:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_15fromisocalendar_3_parse_sequence(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_15fromisocalendar_3_parse_sequence = {"_parse_sequence", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_15fromisocalendar_3_parse_sequence, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_15fromisocalendar_3_parse_sequence(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_item = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_parse_sequence (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_item,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_item)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1255, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse_sequence") < 0)) __PYX_ERR(0, 1255, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_item = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_parse_sequence", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1255, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fromisocalendar._parse_sequence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_15fromisocalendar_2_parse_sequence(__pyx_self, __pyx_v_item);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_15fromisocalendar_2_parse_sequence(PyObject *__pyx_self, PyObject *__pyx_v_item) {
  struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar *__pyx_cur_scope;
  struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar *__pyx_outer_scope;
  __pyx_t_7cytimes_5utils_ymd __pyx_v__ymd;
  PyObject *__pyx_v_err = 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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  __pyx_t_7cytimes_5utils_ymd __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  unsigned int __pyx_t_17;
  char const *__pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_25;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_parse_sequence", 1);
  __pyx_outer_scope = (struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cytimes/pddt.py":1256
 * 
 *         def _parse_sequence(item: object) -> object:
 *             try:             # <<<<<<<<<<<<<<
 *                 if len(item) != 3:
 *                     raise ValueError("sequence must have 3 items.")
 */
  {
    __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:*/ {

      /* "cytimes/pddt.py":1257
 *         def _parse_sequence(item: object) -> object:
 *             try:
 *                 if len(item) != 3:             # <<<<<<<<<<<<<<
 *                     raise ValueError("sequence must have 3 items.")
 *                 _ymd = utils.ymd_fr_isocalendar(item[0], item[1], item[2])
 */
      __pyx_t_4 = PyObject_Length(__pyx_v_item); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1257, __pyx_L3_error)
      __pyx_t_5 = (__pyx_t_4 != 3);
      if (unlikely(__pyx_t_5)) {

        /* "cytimes/pddt.py":1258
 *             try:
 *                 if len(item) != 3:
 *                     raise ValueError("sequence must have 3 items.")             # <<<<<<<<<<<<<<
 *                 _ymd = utils.ymd_fr_isocalendar(item[0], item[1], item[2])
 *             except Exception as err:
 */
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1258, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_Raise(__pyx_t_6, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __PYX_ERR(0, 1258, __pyx_L3_error)

        /* "cytimes/pddt.py":1257
 *         def _parse_sequence(item: object) -> object:
 *             try:
 *                 if len(item) != 3:             # <<<<<<<<<<<<<<
 *                     raise ValueError("sequence must have 3 items.")
 *                 _ymd = utils.ymd_fr_isocalendar(item[0], item[1], item[2])
 */
      }

      /* "cytimes/pddt.py":1259
 *                 if len(item) != 3:
 *                     raise ValueError("sequence must have 3 items.")
 *                 _ymd = utils.ymd_fr_isocalendar(item[0], item[1], item[2])             # <<<<<<<<<<<<<<
 *             except Exception as err:
 *                 raise errors.InvalidArgumentError(
 */
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_item, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1259, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1259, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_item, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1259, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1259, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_item, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1259, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1259, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_10 = __pyx_f_7cytimes_5utils_ymd_fr_isocalendar(__pyx_t_7, __pyx_t_8, __pyx_t_9); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1259, __pyx_L3_error)
      __pyx_v__ymd = __pyx_t_10;

      /* "cytimes/pddt.py":1256
 * 
 *         def _parse_sequence(item: object) -> object:
 *             try:             # <<<<<<<<<<<<<<
 *                 if len(item) != 3:
 *                     raise ValueError("sequence must have 3 items.")
 */
    }
    __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_6); __pyx_t_6 = 0;

    /* "cytimes/pddt.py":1260
 *                     raise ValueError("sequence must have 3 items.")
 *                 _ymd = utils.ymd_fr_isocalendar(item[0], item[1], item[2])
 *             except Exception as err:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidArgumentError(
 *                     "cannot unpack '%s' to iso calendar "
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_9) {
      __Pyx_AddTraceback("cytimes.pddt.Pddt.fromisocalendar._parse_sequence", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_11, &__pyx_t_12) < 0) __PYX_ERR(0, 1260, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_11);
      __pyx_v_err = __pyx_t_11;
      /*try:*/ {

        /* "cytimes/pddt.py":1261
 *                 _ymd = utils.ymd_fr_isocalendar(item[0], item[1], item[2])
 *             except Exception as err:
 *                 raise errors.InvalidArgumentError(             # <<<<<<<<<<<<<<
 *                     "cannot unpack '%s' to iso calendar "
 *                     "values (year, week, day)." % item
 */
        __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_errors); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1261, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1261, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

        /* "cytimes/pddt.py":1263
 *                 raise errors.InvalidArgumentError(
 *                     "cannot unpack '%s' to iso calendar "
 *                     "values (year, week, day)." % item             # <<<<<<<<<<<<<<
 *                 ) from err
 *             return datetime.datetime_new(
 */
        __pyx_t_14 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_cannot_unpack_s_to_iso_calendar, __pyx_v_item); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1263, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_16 = NULL;
        __pyx_t_17 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_15))) {
          __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_15);
          if (likely(__pyx_t_16)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
            __Pyx_INCREF(__pyx_t_16);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_15, function);
            __pyx_t_17 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_t_14};
          __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_17, 1+__pyx_t_17);
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1261, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        }

        /* "cytimes/pddt.py":1264
 *                     "cannot unpack '%s' to iso calendar "
 *                     "values (year, week, day)." % item
 *                 ) from err             # <<<<<<<<<<<<<<
 *             return datetime.datetime_new(
 *                 _ymd.year, _ymd.month, _ymd.day, 0, 0, 0, 0, tz, 0
 */
        __Pyx_Raise(__pyx_t_13, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __PYX_ERR(0, 1261, __pyx_L15_error)
      }

      /* "cytimes/pddt.py":1260
 *                     raise ValueError("sequence must have 3 items.")
 *                 _ymd = utils.ymd_fr_isocalendar(item[0], item[1], item[2])
 *             except Exception as err:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidArgumentError(
 *                     "cannot unpack '%s' to iso calendar "
 */
      /*finally:*/ {
        __pyx_L15_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __Pyx_XGOTREF(__pyx_t_23);
          __Pyx_XGOTREF(__pyx_t_24);
          __pyx_t_9 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_18 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_XGIVEREF(__pyx_t_23);
            __Pyx_XGIVEREF(__pyx_t_24);
            __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24);
          }
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_ErrRestore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0;
          __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_18;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/pddt.py":1256
 * 
 *         def _parse_sequence(item: object) -> object:
 *             try:             # <<<<<<<<<<<<<<
 *                 if len(item) != 3:
 *                     raise ValueError("sequence must have 3 items.")
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "cytimes/pddt.py":1265
 *                     "values (year, week, day)." % item
 *                 ) from err
 *             return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *                 _ymd.year, _ymd.month, _ymd.day, 0, 0, 0, 0, tz, 0
 *             )
 */
  __Pyx_XDECREF(__pyx_r);

  /* "cytimes/pddt.py":1266
 *                 ) from err
 *             return datetime.datetime_new(
 *                 _ymd.year, _ymd.month, _ymd.day, 0, 0, 0, 0, tz, 0             # <<<<<<<<<<<<<<
 *             )
 * 
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_tz)) { __Pyx_RaiseClosureNameError("tz"); __PYX_ERR(0, 1266, __pyx_L1_error) }
  __pyx_t_12 = __pyx_cur_scope->__pyx_v_tz;
  __Pyx_INCREF(__pyx_t_12);

  /* "cytimes/pddt.py":1265
 *                     "values (year, week, day)." % item
 *                 ) from err
 *             return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *                 _ymd.year, _ymd.month, _ymd.day, 0, 0, 0, 0, tz, 0
 *             )
 */
  __pyx_t_25.__pyx_n = 1;
  __pyx_t_25.fold = 0;
  __pyx_t_11 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_v__ymd.year, __pyx_v__ymd.month, __pyx_v__ymd.day, 0, 0, 0, 0, __pyx_t_12, &__pyx_t_25)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_r = __pyx_t_11;
  __pyx_t_11 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":1255
 *             )
 * 
 *         def _parse_sequence(item: object) -> object:             # <<<<<<<<<<<<<<
 *             try:
 *                 if len(item) != 3:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fromisocalendar._parse_sequence", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1206
 *         return pddt_new_simple(dtstr, None, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromisocalendar(
 *         cls,
 */

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_26fromisocalendar(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_iso, PyObject *__pyx_v_year, PyObject *__pyx_v_week, PyObject *__pyx_v_weekday, PyObject *__pyx_v_tz, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name) {
  struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar *__pyx_cur_scope;
  PyObject *__pyx_v__parse_dict = 0;
  PyObject *__pyx_v__parse_sequence = 0;
  PyObject *__pyx_v_dts = 0;
  PyObject *__pyx_v_item = NULL;
  Py_ssize_t __pyx_v_arr_size;
  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;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  unsigned int __pyx_t_11;
  struct __pyx_opt_args_7cytimes_4pddt__pddt_fr_dt __pyx_t_12;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fromisocalendar", 0);
  __pyx_cur_scope = (struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar *)__pyx_tp_new_7cytimes_4pddt___pyx_scope_struct__fromisocalendar(__pyx_ptype_7cytimes_4pddt___pyx_scope_struct__fromisocalendar, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1206, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_year = __pyx_v_year;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_year);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_year);
  __pyx_cur_scope->__pyx_v_week = __pyx_v_week;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_week);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_week);
  __pyx_cur_scope->__pyx_v_weekday = __pyx_v_weekday;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_weekday);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_weekday);
  __pyx_cur_scope->__pyx_v_tz = __pyx_v_tz;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tz);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_tz);

  /* "cytimes/pddt.py":1240
 *         """
 * 
 *         def _parse_dict(item: dict) -> object:             # <<<<<<<<<<<<<<
 *             yy = item.get("year", year)
 *             ww = item.get("week", week)
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_item, __pyx_n_s_dict) < 0) __PYX_ERR(0, 1240, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_return, __pyx_n_s_object) < 0) __PYX_ERR(0, 1240, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_15fromisocalendar_1_parse_dict, 0, __pyx_n_s_Pddt_fromisocalendar_locals__par, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v__parse_dict = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":1255
 *             )
 * 
 *         def _parse_sequence(item: object) -> object:             # <<<<<<<<<<<<<<
 *             try:
 *                 if len(item) != 3:
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_item, __pyx_n_s_object) < 0) __PYX_ERR(0, 1255, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_object) < 0) __PYX_ERR(0, 1255, __pyx_L1_error)
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_15fromisocalendar_3_parse_sequence, 0, __pyx_n_s_Pddt_fromisocalendar_locals__par_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_1, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v__parse_sequence = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":1270
 * 
 *         # Validate
 *         tz = utils.tz_parse(tz)             # <<<<<<<<<<<<<<
 *         dts: list = []
 * 
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_tz;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_7cytimes_5utils_tz_parse(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_tz);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_tz, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":1271
 *         # Validate
 *         tz = utils.tz_parse(tz)
 *         dts: list = []             # <<<<<<<<<<<<<<
 * 
 *         # <'ditc'>
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_dts = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":1274
 * 
 *         # <'ditc'>
 *         if isinstance(iso, dict):             # <<<<<<<<<<<<<<
 *             dts.append(_parse_dict(iso))
 * 
 */
  __pyx_t_3 = PyDict_Check(__pyx_v_iso); 
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":1275
 *         # <'ditc'>
 *         if isinstance(iso, dict):
 *             dts.append(_parse_dict(iso))             # <<<<<<<<<<<<<<
 * 
 *         # <'list'/'tuple'>
 */
    if (!(likely(PyDict_CheckExact(__pyx_v_iso))||((__pyx_v_iso) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_v_iso))) __PYX_ERR(0, 1275, __pyx_L1_error)
    __pyx_t_2 = __pyx_pf_7cytimes_4pddt_4Pddt_15fromisocalendar__parse_dict(__pyx_v__parse_dict, ((PyObject*)__pyx_v_iso)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_dts, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1275, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cytimes/pddt.py":1274
 * 
 *         # <'ditc'>
 *         if isinstance(iso, dict):             # <<<<<<<<<<<<<<
 *             dts.append(_parse_dict(iso))
 * 
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":1278
 * 
 *         # <'list'/'tuple'>
 *         elif isinstance(iso, (list, tuple)):             # <<<<<<<<<<<<<<
 *             for item in iso:
 *                 if isinstance(item, dict):
 */
  __pyx_t_5 = PyList_Check(__pyx_v_iso); 
  if (!__pyx_t_5) {
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = PyTuple_Check(__pyx_v_iso); 
  __pyx_t_3 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":1279
 *         # <'list'/'tuple'>
 *         elif isinstance(iso, (list, tuple)):
 *             for item in iso:             # <<<<<<<<<<<<<<
 *                 if isinstance(item, dict):
 *                     dts.append(_parse_dict(item))
 */
    if (likely(PyList_CheckExact(__pyx_v_iso)) || PyTuple_CheckExact(__pyx_v_iso)) {
      __pyx_t_2 = __pyx_v_iso; __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_iso); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1279, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1279, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1279, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) 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, 1279, __pyx_L1_error)
          #else
          __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1279, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1279, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) 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, 1279, __pyx_L1_error)
          #else
          __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1279, __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, 1279, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "cytimes/pddt.py":1280
 *         elif isinstance(iso, (list, tuple)):
 *             for item in iso:
 *                 if isinstance(item, dict):             # <<<<<<<<<<<<<<
 *                     dts.append(_parse_dict(item))
 *                 elif isinstance(item, (list, tuple)):
 */
      __pyx_t_3 = PyDict_Check(__pyx_v_item); 
      if (__pyx_t_3) {

        /* "cytimes/pddt.py":1281
 *             for item in iso:
 *                 if isinstance(item, dict):
 *                     dts.append(_parse_dict(item))             # <<<<<<<<<<<<<<
 *                 elif isinstance(item, (list, tuple)):
 *                     dts.append(_parse_sequence(item))
 */
        if (!(likely(PyDict_CheckExact(__pyx_v_item))||((__pyx_v_item) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_v_item))) __PYX_ERR(0, 1281, __pyx_L1_error)
        __pyx_t_1 = __pyx_pf_7cytimes_4pddt_4Pddt_15fromisocalendar__parse_dict(__pyx_v__parse_dict, ((PyObject*)__pyx_v_item)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1281, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_dts, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1281, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "cytimes/pddt.py":1280
 *         elif isinstance(iso, (list, tuple)):
 *             for item in iso:
 *                 if isinstance(item, dict):             # <<<<<<<<<<<<<<
 *                     dts.append(_parse_dict(item))
 *                 elif isinstance(item, (list, tuple)):
 */
        goto __pyx_L8;
      }

      /* "cytimes/pddt.py":1282
 *                 if isinstance(item, dict):
 *                     dts.append(_parse_dict(item))
 *                 elif isinstance(item, (list, tuple)):             # <<<<<<<<<<<<<<
 *                     dts.append(_parse_sequence(item))
 *                 elif isinstance(item, int):
 */
      __pyx_t_5 = PyList_Check(__pyx_v_item); 
      if (!__pyx_t_5) {
      } else {
        __pyx_t_3 = __pyx_t_5;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_5 = PyTuple_Check(__pyx_v_item); 
      __pyx_t_3 = __pyx_t_5;
      __pyx_L9_bool_binop_done:;
      if (__pyx_t_3) {

        /* "cytimes/pddt.py":1283
 *                     dts.append(_parse_dict(item))
 *                 elif isinstance(item, (list, tuple)):
 *                     dts.append(_parse_sequence(item))             # <<<<<<<<<<<<<<
 *                 elif isinstance(item, int):
 *                     dts.append(_parse_sequence(iso))
 */
        __pyx_t_1 = __pyx_pf_7cytimes_4pddt_4Pddt_15fromisocalendar_2_parse_sequence(__pyx_v__parse_sequence, __pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1283, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_dts, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1283, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "cytimes/pddt.py":1282
 *                 if isinstance(item, dict):
 *                     dts.append(_parse_dict(item))
 *                 elif isinstance(item, (list, tuple)):             # <<<<<<<<<<<<<<
 *                     dts.append(_parse_sequence(item))
 *                 elif isinstance(item, int):
 */
        goto __pyx_L8;
      }

      /* "cytimes/pddt.py":1284
 *                 elif isinstance(item, (list, tuple)):
 *                     dts.append(_parse_sequence(item))
 *                 elif isinstance(item, int):             # <<<<<<<<<<<<<<
 *                     dts.append(_parse_sequence(iso))
 *                     break
 */
      __pyx_t_3 = PyInt_Check(__pyx_v_item); 
      if (likely(__pyx_t_3)) {

        /* "cytimes/pddt.py":1285
 *                     dts.append(_parse_sequence(item))
 *                 elif isinstance(item, int):
 *                     dts.append(_parse_sequence(iso))             # <<<<<<<<<<<<<<
 *                     break
 *                 else:
 */
        __pyx_t_1 = __pyx_pf_7cytimes_4pddt_4Pddt_15fromisocalendar_2_parse_sequence(__pyx_v__parse_sequence, __pyx_v_iso); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1285, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_dts, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1285, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "cytimes/pddt.py":1286
 *                 elif isinstance(item, int):
 *                     dts.append(_parse_sequence(iso))
 *                     break             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise errors.InvalidTypeError(
 */
        goto __pyx_L7_break;

        /* "cytimes/pddt.py":1284
 *                 elif isinstance(item, (list, tuple)):
 *                     dts.append(_parse_sequence(item))
 *                 elif isinstance(item, int):             # <<<<<<<<<<<<<<
 *                     dts.append(_parse_sequence(iso))
 *                     break
 */
      }

      /* "cytimes/pddt.py":1288
 *                     break
 *                 else:
 *                     raise errors.InvalidTypeError(             # <<<<<<<<<<<<<<
 *                         "unsupported type %s for argument 'iso'." % type(item)
 *                     )
 */
      /*else*/ {
        __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_errors); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1288, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_InvalidTypeError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1288, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cytimes/pddt.py":1289
 *                 else:
 *                     raise errors.InvalidTypeError(
 *                         "unsupported type %s for argument 'iso'." % type(item)             # <<<<<<<<<<<<<<
 *                     )
 * 
 */
        __pyx_t_8 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unsupported_type_s_for_argument_5, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1289, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_10 = NULL;
        __pyx_t_11 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(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_11 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_8};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1288, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 1288, __pyx_L1_error)
      }
      __pyx_L8:;

      /* "cytimes/pddt.py":1279
 *         # <'list'/'tuple'>
 *         elif isinstance(iso, (list, tuple)):
 *             for item in iso:             # <<<<<<<<<<<<<<
 *                 if isinstance(item, dict):
 *                     dts.append(_parse_dict(item))
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L11_for_end;
    __pyx_L7_break:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L11_for_end;
    __pyx_L11_for_end:;

    /* "cytimes/pddt.py":1278
 * 
 *         # <'list'/'tuple'>
 *         elif isinstance(iso, (list, tuple)):             # <<<<<<<<<<<<<<
 *             for item in iso:
 *                 if isinstance(item, dict):
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":1293
 * 
 *         # <'DataFrame'>
 *         elif isinstance(iso, DataFrame):             # <<<<<<<<<<<<<<
 *             for item in iso.itertuples(index=False):
 *                 dts.append(_parse_sequence(item))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_iso, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1293, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":1294
 *         # <'DataFrame'>
 *         elif isinstance(iso, DataFrame):
 *             for item in iso.itertuples(index=False):             # <<<<<<<<<<<<<<
 *                 dts.append(_parse_sequence(item))
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_iso, __pyx_n_s_itertuples); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_index, Py_False) < 0) __PYX_ERR(0, 1294, __pyx_L1_error)
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
      __pyx_t_1 = __pyx_t_9; __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1294, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1294, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1294, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1294, __pyx_L1_error)
          #else
          __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1294, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1294, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1294, __pyx_L1_error)
          #else
          __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1294, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        }
      } else {
        __pyx_t_9 = __pyx_t_7(__pyx_t_1);
        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, 1294, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_9);
      __pyx_t_9 = 0;

      /* "cytimes/pddt.py":1295
 *         elif isinstance(iso, DataFrame):
 *             for item in iso.itertuples(index=False):
 *                 dts.append(_parse_sequence(item))             # <<<<<<<<<<<<<<
 * 
 *         # Y/M/D values
 */
      __pyx_t_9 = __pyx_pf_7cytimes_4pddt_4Pddt_15fromisocalendar_2_parse_sequence(__pyx_v__parse_sequence, __pyx_v_item); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1295, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_dts, __pyx_t_9); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1295, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "cytimes/pddt.py":1294
 *         # <'DataFrame'>
 *         elif isinstance(iso, DataFrame):
 *             for item in iso.itertuples(index=False):             # <<<<<<<<<<<<<<
 *                 dts.append(_parse_sequence(item))
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/pddt.py":1293
 * 
 *         # <'DataFrame'>
 *         elif isinstance(iso, DataFrame):             # <<<<<<<<<<<<<<
 *             for item in iso.itertuples(index=False):
 *                 dts.append(_parse_sequence(item))
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":1298
 * 
 *         # Y/M/D values
 *         elif year is not None and week is not None and weekday is not None:             # <<<<<<<<<<<<<<
 *             dts.append(_parse_sequence([year, week, weekday]))
 * 
 */
  __pyx_t_5 = (__pyx_cur_scope->__pyx_v_year != Py_None);
  if (__pyx_t_5) {
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_5 = (__pyx_cur_scope->__pyx_v_week != Py_None);
  if (__pyx_t_5) {
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_5 = (__pyx_cur_scope->__pyx_v_weekday != Py_None);
  __pyx_t_3 = __pyx_t_5;
  __pyx_L15_bool_binop_done:;
  if (likely(__pyx_t_3)) {

    /* "cytimes/pddt.py":1299
 *         # Y/M/D values
 *         elif year is not None and week is not None and weekday is not None:
 *             dts.append(_parse_sequence([year, week, weekday]))             # <<<<<<<<<<<<<<
 * 
 *         # Invalid
 */
    __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_year);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_year);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_year)) __PYX_ERR(0, 1299, __pyx_L1_error);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_week);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_week);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_week)) __PYX_ERR(0, 1299, __pyx_L1_error);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_weekday);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_weekday);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_cur_scope->__pyx_v_weekday)) __PYX_ERR(0, 1299, __pyx_L1_error);
    __pyx_t_9 = __pyx_pf_7cytimes_4pddt_4Pddt_15fromisocalendar_2_parse_sequence(__pyx_v__parse_sequence, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_dts, __pyx_t_9); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1299, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cytimes/pddt.py":1298
 * 
 *         # Y/M/D values
 *         elif year is not None and week is not None and weekday is not None:             # <<<<<<<<<<<<<<
 *             dts.append(_parse_sequence([year, week, weekday]))
 * 
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":1303
 *         # Invalid
 *         else:
 *             raise errors.InvalidTypeError(             # <<<<<<<<<<<<<<
 *                 "unsupported type %s for argument 'iso'." % type(iso)
 *             )
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_errors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_InvalidTypeError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/pddt.py":1304
 *         else:
 *             raise errors.InvalidTypeError(
 *                 "unsupported type %s for argument 'iso'." % type(iso)             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unsupported_type_s_for_argument_5, ((PyObject *)Py_TYPE(__pyx_v_iso))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = NULL;
    __pyx_t_11 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_11 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_1};
      __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1303, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_Raise(__pyx_t_9, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __PYX_ERR(0, 1303, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "cytimes/pddt.py":1308
 * 
 *         # Create Pddt
 *         if len(dts) == 1:             # <<<<<<<<<<<<<<
 *             arr_size = _parse_arr_size(size)
 *             return _pddt_fr_dt(dts[0], arr_size, unit, name)
 */
  __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_dts); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1308, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_6 == 1);
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":1309
 *         # Create Pddt
 *         if len(dts) == 1:
 *             arr_size = _parse_arr_size(size)             # <<<<<<<<<<<<<<
 *             return _pddt_fr_dt(dts[0], arr_size, unit, name)
 *         else:
 */
    __pyx_t_6 = __pyx_f_7cytimes_4pddt__parse_arr_size(__pyx_v_size); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-2L))) __PYX_ERR(0, 1309, __pyx_L1_error)
    __pyx_v_arr_size = __pyx_t_6;

    /* "cytimes/pddt.py":1310
 *         if len(dts) == 1:
 *             arr_size = _parse_arr_size(size)
 *             return _pddt_fr_dt(dts[0], arr_size, unit, name)             # <<<<<<<<<<<<<<
 *         else:
 *             return pddt_new_simple(dts, None, unit, name)
 */
    __Pyx_XDECREF(__pyx_r);
    if (!(likely(((PyList_GET_ITEM(__pyx_v_dts, 0)) == Py_None) || likely(__Pyx_TypeTest(PyList_GET_ITEM(__pyx_v_dts, 0), __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(0, 1310, __pyx_L1_error)
    __pyx_t_9 = PyList_GET_ITEM(__pyx_v_dts, 0);
    __Pyx_INCREF(__pyx_t_9);
    __pyx_t_12.__pyx_n = 2;
    __pyx_t_12.unit = __pyx_v_unit;
    __pyx_t_12.name = __pyx_v_name;
    __pyx_t_2 = __pyx_f_7cytimes_4pddt__pddt_fr_dt(((PyDateTime_DateTime *)__pyx_t_9), __pyx_v_arr_size, &__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/pddt.py":1308
 * 
 *         # Create Pddt
 *         if len(dts) == 1:             # <<<<<<<<<<<<<<
 *             arr_size = _parse_arr_size(size)
 *             return _pddt_fr_dt(dts[0], arr_size, unit, name)
 */
  }

  /* "cytimes/pddt.py":1312
 *             return _pddt_fr_dt(dts[0], arr_size, unit, name)
 *         else:
 *             return pddt_new_simple(dts, None, unit, name)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_13.__pyx_n = 3;
    __pyx_t_13.tz = Py_None;
    __pyx_t_13.unit = __pyx_v_unit;
    __pyx_t_13.name = __pyx_v_name;
    __pyx_t_2 = __pyx_f_7cytimes_4pddt_pddt_new_simple(__pyx_v_dts, &__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "cytimes/pddt.py":1206
 *         return pddt_new_simple(dtstr, None, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromisocalendar(
 *         cls,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fromisocalendar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__parse_dict);
  __Pyx_XDECREF(__pyx_v__parse_sequence);
  __Pyx_XDECREF(__pyx_v_dts);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1314
 *             return pddt_new_simple(dts, None, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromdate(
 *         cls,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_29fromdate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_28fromdate, "Construct from instances of date (all time fields set to 0) `<'Pddt'>`.\n\n        :param date `<'date/Array-like'>`: The date-like object(s) to construct with.\n            - `<'datetime.date'>` An instance of `datetime.date`.\n            - `<'Array-like'>` An array-like object containing the date-like objects.\n\n        :param tz `<'str/tzinfo/None'>`: The timezone of the index, defaults to `None`.\n            - `<'datetime.tzinfo'>` A subclass of `datetime.tzinfo`.\n            - `<'str'>` Timezone name supported by the 'Zoneinfo' module, or `'local'` for local timezone.\n            - `<'None'>` Timezone-naive.\n\n        :param size `<'int/str/bytes/object'>`: The size of the index to generate, defaults to `1`.\n            - This argument is `ignored` if 'us' is an array-like object.\n            - `<'int/str/bytes'>` Representing an integer for the number of elements in the index.\n            - `<'object'>` Any object that implements `__len__()`, where its length represents the size of the index.\n\n        :param unit `<'str/None'>`: Set the datetime unit of the index, defaults to `None`.\n            Supported datetime units: 's', 'ms', 'us', 'ns'.\n\n        :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_29fromdate = {"fromdate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_29fromdate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_28fromdate};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_29fromdate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_date = 0;
  PyObject *__pyx_v_tz = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fromdate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_date,&__pyx_n_s_tz,&__pyx_n_s_size,&__pyx_n_s_unit,&__pyx_n_s_name,0};

    /* "cytimes/pddt.py":1318
 *         cls,
 *         date: datetime.date | object,
 *         tz: datetime.tzinfo | str | None = None,             # <<<<<<<<<<<<<<
 *         size: object = 1,
 *         unit: str = None,
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1)));

    /* "cytimes/pddt.py":1320
 *         tz: datetime.tzinfo | str | None = None,
 *         size: object = 1,
 *         unit: str = None,             # <<<<<<<<<<<<<<
 *         name: Hashable | None = None,
 *     ) -> Self:
 */
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));

    /* "cytimes/pddt.py":1321
 *         size: object = 1,
 *         unit: str = None,
 *         name: Hashable | None = None,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Construct from instances of date (all time fields set to 0) `<'Pddt'>`.
 */
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1314, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_date)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1314, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("fromdate", 0, 2, 6, 1); __PYX_ERR(0, 1314, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tz);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1314, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1314, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1314, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1314, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fromdate") < 0)) __PYX_ERR(0, 1314, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_date = values[1];
    __pyx_v_tz = values[2];
    __pyx_v_size = values[3];
    __pyx_v_unit = ((PyObject*)values[4]);
    __pyx_v_name = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fromdate", 0, 2, 6, __pyx_nargs); __PYX_ERR(0, 1314, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fromdate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 1, "unit", 1))) __PYX_ERR(0, 1320, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_28fromdate(__pyx_self, __pyx_v_cls, __pyx_v_date, __pyx_v_tz, __pyx_v_size, __pyx_v_unit, __pyx_v_name);

  /* "cytimes/pddt.py":1314
 *             return pddt_new_simple(dts, None, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromdate(
 *         cls,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_28fromdate(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_date, PyObject *__pyx_v_tz, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name) {
  Py_ssize_t __pyx_v_arr_size;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt_fr_date __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  struct __pyx_opt_args_7cytimes_4pddt__pddt_fr_dt __pyx_t_6;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fromdate", 0);
  __Pyx_INCREF(__pyx_v_tz);

  /* "cytimes/pddt.py":1347
 * 
 *         # <'date'>
 *         if utils.is_date(date):             # <<<<<<<<<<<<<<
 *             arr_size, tz = _parse_arr_size(size), utils.tz_parse(tz)
 *             return _pddt_fr_dt(utils.dt_fr_date(date, tz), arr_size, unit, name)
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_is_date(__pyx_v_date); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1347, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1348
 *         # <'date'>
 *         if utils.is_date(date):
 *             arr_size, tz = _parse_arr_size(size), utils.tz_parse(tz)             # <<<<<<<<<<<<<<
 *             return _pddt_fr_dt(utils.dt_fr_date(date, tz), arr_size, unit, name)
 * 
 */
    __pyx_t_2 = __pyx_f_7cytimes_4pddt__parse_arr_size(__pyx_v_size); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-2L))) __PYX_ERR(0, 1348, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_7cytimes_5utils_tz_parse(__pyx_v_tz); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1348, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_arr_size = __pyx_t_2;
    __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1349
 *         if utils.is_date(date):
 *             arr_size, tz = _parse_arr_size(size), utils.tz_parse(tz)
 *             return _pddt_fr_dt(utils.dt_fr_date(date, tz), arr_size, unit, name)             # <<<<<<<<<<<<<<
 * 
 *         # Other types
 */
    __Pyx_XDECREF(__pyx_r);
    if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_7cpython_8datetime_date))))) __PYX_ERR(0, 1349, __pyx_L1_error)
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.tz = __pyx_v_tz;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_fr_date(((PyDateTime_Date *)__pyx_v_date), &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6.__pyx_n = 2;
    __pyx_t_6.unit = __pyx_v_unit;
    __pyx_t_6.name = __pyx_v_name;
    __pyx_t_5 = __pyx_f_7cytimes_4pddt__pddt_fr_dt(((PyDateTime_DateTime *)__pyx_t_3), __pyx_v_arr_size, &__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1349, __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;

    /* "cytimes/pddt.py":1347
 * 
 *         # <'date'>
 *         if utils.is_date(date):             # <<<<<<<<<<<<<<
 *             arr_size, tz = _parse_arr_size(size), utils.tz_parse(tz)
 *             return _pddt_fr_dt(utils.dt_fr_date(date, tz), arr_size, unit, name)
 */
  }

  /* "cytimes/pddt.py":1352
 * 
 *         # Other types
 *         return pddt_new_simple(date, tz, unit, name)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7.__pyx_n = 3;
  __pyx_t_7.tz = __pyx_v_tz;
  __pyx_t_7.unit = __pyx_v_unit;
  __pyx_t_7.name = __pyx_v_name;
  __pyx_t_5 = __pyx_f_7cytimes_4pddt_pddt_new_simple(__pyx_v_date, &__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":1314
 *             return pddt_new_simple(dts, None, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromdate(
 *         cls,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fromdate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1354
 *         return pddt_new_simple(date, tz, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromdatetime(
 *         cls,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_31fromdatetime(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_30fromdatetime, "Construct from instances of datetime `<'Pddt'>`.\n\n        :param dt `<'datetime/Array-like'>`: The datetime-like object(s) to construct with.\n            - `<'datetime.datetime'>` An instance of `datetime.datetime`.\n            - `<'Array-like'>` An array-like object containing the datetime-like objects.\n\n        :param size `<'int/str/bytes/object'>`: The size of the index to generate, defaults to `1`.\n            - This argument is `ignored` if 'us' is an array-like object.\n            - `<'int/str/bytes'>` Representing an integer for the number of elements in the index.\n            - `<'object'>` Any object that implements `__len__()`, where its length represents the size of the index.\n\n        :param unit `<'str/None'>`: Set the datetime unit of the index, defaults to `None`.\n            Supported datetime units: 's', 'ms', 'us', 'ns'.\n\n        :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_31fromdatetime = {"fromdatetime", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_31fromdatetime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_30fromdatetime};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_31fromdatetime(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_dt = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fromdatetime (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_dt,&__pyx_n_s_size,&__pyx_n_s_unit,&__pyx_n_s_name,0};
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1)));

    /* "cytimes/pddt.py":1359
 *         dt: datetime.datetime | object,
 *         size: object = 1,
 *         unit: str = None,             # <<<<<<<<<<<<<<
 *         name: Hashable | None = None,
 *     ) -> Self:
 */
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));

    /* "cytimes/pddt.py":1360
 *         size: object = 1,
 *         unit: str = None,
 *         name: Hashable | None = None,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Construct from instances of datetime `<'Pddt'>`.
 */
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1354, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dt)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1354, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("fromdatetime", 0, 2, 5, 1); __PYX_ERR(0, 1354, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1354, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1354, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1354, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fromdatetime") < 0)) __PYX_ERR(0, 1354, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_dt = values[1];
    __pyx_v_size = values[2];
    __pyx_v_unit = ((PyObject*)values[3]);
    __pyx_v_name = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fromdatetime", 0, 2, 5, __pyx_nargs); __PYX_ERR(0, 1354, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fromdatetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 1, "unit", 1))) __PYX_ERR(0, 1359, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_30fromdatetime(__pyx_self, __pyx_v_cls, __pyx_v_dt, __pyx_v_size, __pyx_v_unit, __pyx_v_name);

  /* "cytimes/pddt.py":1354
 *         return pddt_new_simple(date, tz, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromdatetime(
 *         cls,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_30fromdatetime(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_dt, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name) {
  Py_ssize_t __pyx_v_arr_size;
  PyObject *__pyx_v_dts = NULL;
  CYTHON_UNUSED Py_ssize_t __pyx_7genexpr__pyx_v__;
  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;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_9;
  struct __pyx_opt_args_7cytimes_4pddt__pddt_fr_dt __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fromdatetime", 1);

  /* "cytimes/pddt.py":1379
 *         """
 *         # <'str'/'Timestamp'/'datetime64'>
 *         if isinstance(dt, (str, Timestamp, np.datetime64)):             # <<<<<<<<<<<<<<
 *             arr_size = _parse_arr_size(size)
 *             dts = [dt for _ in range(arr_size)]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_datetime64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = PyUnicode_Check(__pyx_v_dt); 
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = PyObject_IsInstance(__pyx_v_dt, __pyx_t_1); 
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = PyObject_IsInstance(__pyx_v_dt, __pyx_t_3); 
  __pyx_t_4 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "cytimes/pddt.py":1380
 *         # <'str'/'Timestamp'/'datetime64'>
 *         if isinstance(dt, (str, Timestamp, np.datetime64)):
 *             arr_size = _parse_arr_size(size)             # <<<<<<<<<<<<<<
 *             dts = [dt for _ in range(arr_size)]
 *             return pddt_new_simple(dts, None, unit, name)
 */
    __pyx_t_6 = __pyx_f_7cytimes_4pddt__parse_arr_size(__pyx_v_size); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-2L))) __PYX_ERR(0, 1380, __pyx_L1_error)
    __pyx_v_arr_size = __pyx_t_6;

    /* "cytimes/pddt.py":1381
 *         if isinstance(dt, (str, Timestamp, np.datetime64)):
 *             arr_size = _parse_arr_size(size)
 *             dts = [dt for _ in range(arr_size)]             # <<<<<<<<<<<<<<
 *             return pddt_new_simple(dts, None, unit, name)
 * 
 */
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1381, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __pyx_v_arr_size;
      __pyx_t_7 = __pyx_t_6;
      for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
        __pyx_7genexpr__pyx_v__ = __pyx_t_8;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_dt))) __PYX_ERR(0, 1381, __pyx_L1_error)
      }
    } /* exit inner scope */
    __pyx_v_dts = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":1382
 *             arr_size = _parse_arr_size(size)
 *             dts = [dt for _ in range(arr_size)]
 *             return pddt_new_simple(dts, None, unit, name)             # <<<<<<<<<<<<<<
 * 
 *         # <'datetime'>
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_9.__pyx_n = 3;
    __pyx_t_9.tz = Py_None;
    __pyx_t_9.unit = __pyx_v_unit;
    __pyx_t_9.name = __pyx_v_name;
    __pyx_t_1 = __pyx_f_7cytimes_4pddt_pddt_new_simple(__pyx_v_dts, &__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/pddt.py":1379
 *         """
 *         # <'str'/'Timestamp'/'datetime64'>
 *         if isinstance(dt, (str, Timestamp, np.datetime64)):             # <<<<<<<<<<<<<<
 *             arr_size = _parse_arr_size(size)
 *             dts = [dt for _ in range(arr_size)]
 */
  }

  /* "cytimes/pddt.py":1385
 * 
 *         # <'datetime'>
 *         if utils.is_dt(dt):             # <<<<<<<<<<<<<<
 *             arr_size = _parse_arr_size(size)
 *             return _pddt_fr_dt(dt, arr_size, unit, name)
 */
  __pyx_t_4 = __pyx_f_7cytimes_5utils_is_dt(__pyx_v_dt); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1385, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "cytimes/pddt.py":1386
 *         # <'datetime'>
 *         if utils.is_dt(dt):
 *             arr_size = _parse_arr_size(size)             # <<<<<<<<<<<<<<
 *             return _pddt_fr_dt(dt, arr_size, unit, name)
 * 
 */
    __pyx_t_6 = __pyx_f_7cytimes_4pddt__parse_arr_size(__pyx_v_size); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-2L))) __PYX_ERR(0, 1386, __pyx_L1_error)
    __pyx_v_arr_size = __pyx_t_6;

    /* "cytimes/pddt.py":1387
 *         if utils.is_dt(dt):
 *             arr_size = _parse_arr_size(size)
 *             return _pddt_fr_dt(dt, arr_size, unit, name)             # <<<<<<<<<<<<<<
 * 
 *         # Other types
 */
    __Pyx_XDECREF(__pyx_r);
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(0, 1387, __pyx_L1_error)
    __pyx_t_10.__pyx_n = 2;
    __pyx_t_10.unit = __pyx_v_unit;
    __pyx_t_10.name = __pyx_v_name;
    __pyx_t_1 = __pyx_f_7cytimes_4pddt__pddt_fr_dt(((PyDateTime_DateTime *)__pyx_v_dt), __pyx_v_arr_size, &__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1387, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/pddt.py":1385
 * 
 *         # <'datetime'>
 *         if utils.is_dt(dt):             # <<<<<<<<<<<<<<
 *             arr_size = _parse_arr_size(size)
 *             return _pddt_fr_dt(dt, arr_size, unit, name)
 */
  }

  /* "cytimes/pddt.py":1390
 * 
 *         # Other types
 *         return pddt_new_simple(dt, None, unit, name)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9.__pyx_n = 3;
  __pyx_t_9.tz = Py_None;
  __pyx_t_9.unit = __pyx_v_unit;
  __pyx_t_9.name = __pyx_v_name;
  __pyx_t_1 = __pyx_f_7cytimes_4pddt_pddt_new_simple(__pyx_v_dt, &__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":1354
 *         return pddt_new_simple(date, tz, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromdatetime(
 *         cls,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fromdatetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dts);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1392
 *         return pddt_new_simple(dt, None, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromdatetime64(
 *         cls,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_33fromdatetime64(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_32fromdatetime64, "Construct from instances of datetime64 `<'Pddt'>`.\n\n        :param dt64 `<'datetime64/Array-like'>`: The datetime-like object(s) to construct with.\n            - `<'np..datetime64'>` An instance of `np.datetime64`.\n            - `<'Array-like'>` An array-like object containing the datetime-like objects.\n\n        :param tz `<'str/tzinfo/None'>`: The timezone of the index, defaults to `None`.\n            - `<'datetime.tzinfo'>` A subclass of `datetime.tzinfo`.\n            - `<'str'>` Timezone name supported by the 'Zoneinfo' module, or `'local'` for local timezone.\n            - `<'None'>` Timezone-naive.\n\n        :param size `<'int/str/bytes/object'>`: The size of the index to generate, defaults to `1`.\n            - This argument is `ignored` if 'us' is an array-like object.\n            - `<'int/str/bytes'>` Representing an integer for the number of elements in the index.\n            - `<'object'>` Any object that implements `__len__()`, where its length represents the size of the index.\n\n        :param unit `<'str/None'>`: Set the datetime unit of the index, defaults to `None`.\n            Supported datetime units: 's', 'ms', 'us', 'ns'.\n\n        :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_33fromdatetime64 = {"fromdatetime64", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_33fromdatetime64, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_32fromdatetime64};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_33fromdatetime64(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_dt64 = 0;
  PyObject *__pyx_v_tz = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fromdatetime64 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_dt64,&__pyx_n_s_tz,&__pyx_n_s_size,&__pyx_n_s_unit,&__pyx_n_s_name,0};

    /* "cytimes/pddt.py":1396
 *         cls,
 *         dt64: np.datetime64 | object,
 *         tz: datetime.tzinfo | str | None = None,             # <<<<<<<<<<<<<<
 *         size: object = 1,
 *         unit: str = None,
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1)));

    /* "cytimes/pddt.py":1398
 *         tz: datetime.tzinfo | str | None = None,
 *         size: object = 1,
 *         unit: str = None,             # <<<<<<<<<<<<<<
 *         name: Hashable | None = None,
 *     ) -> Self:
 */
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));

    /* "cytimes/pddt.py":1399
 *         size: object = 1,
 *         unit: str = None,
 *         name: Hashable | None = None,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Construct from instances of datetime64 `<'Pddt'>`.
 */
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1392, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dt64)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1392, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("fromdatetime64", 0, 2, 6, 1); __PYX_ERR(0, 1392, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tz);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1392, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1392, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1392, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1392, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fromdatetime64") < 0)) __PYX_ERR(0, 1392, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_dt64 = values[1];
    __pyx_v_tz = values[2];
    __pyx_v_size = values[3];
    __pyx_v_unit = ((PyObject*)values[4]);
    __pyx_v_name = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fromdatetime64", 0, 2, 6, __pyx_nargs); __PYX_ERR(0, 1392, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fromdatetime64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 1, "unit", 1))) __PYX_ERR(0, 1398, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_32fromdatetime64(__pyx_self, __pyx_v_cls, __pyx_v_dt64, __pyx_v_tz, __pyx_v_size, __pyx_v_unit, __pyx_v_name);

  /* "cytimes/pddt.py":1392
 *         return pddt_new_simple(dt, None, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromdatetime64(
 *         cls,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_32fromdatetime64(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_dt64, PyObject *__pyx_v_tz, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name) {
  Py_ssize_t __pyx_v_arr_size;
  PyObject *__pyx_v_dts = NULL;
  CYTHON_UNUSED Py_ssize_t __pyx_8genexpr1__pyx_v__;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fromdatetime64", 1);

  /* "cytimes/pddt.py":1423
 *         """
 *         # <'datetime64'>
 *         if utils.is_dt64(dt64):             # <<<<<<<<<<<<<<
 *             arr_size = _parse_arr_size(size)
 *             dts = [dt64 for _ in range(arr_size)]
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64(__pyx_v_dt64); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1423, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1424
 *         # <'datetime64'>
 *         if utils.is_dt64(dt64):
 *             arr_size = _parse_arr_size(size)             # <<<<<<<<<<<<<<
 *             dts = [dt64 for _ in range(arr_size)]
 *             return pddt_new_simple(dts, tz, unit, name)
 */
    __pyx_t_2 = __pyx_f_7cytimes_4pddt__parse_arr_size(__pyx_v_size); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-2L))) __PYX_ERR(0, 1424, __pyx_L1_error)
    __pyx_v_arr_size = __pyx_t_2;

    /* "cytimes/pddt.py":1425
 *         if utils.is_dt64(dt64):
 *             arr_size = _parse_arr_size(size)
 *             dts = [dt64 for _ in range(arr_size)]             # <<<<<<<<<<<<<<
 *             return pddt_new_simple(dts, tz, unit, name)
 * 
 */
    { /* enter inner scope */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1425, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __pyx_v_arr_size;
      __pyx_t_4 = __pyx_t_2;
      for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
        __pyx_8genexpr1__pyx_v__ = __pyx_t_5;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_v_dt64))) __PYX_ERR(0, 1425, __pyx_L1_error)
      }
    } /* exit inner scope */
    __pyx_v_dts = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1426
 *             arr_size = _parse_arr_size(size)
 *             dts = [dt64 for _ in range(arr_size)]
 *             return pddt_new_simple(dts, tz, unit, name)             # <<<<<<<<<<<<<<
 * 
 *         # Other types
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6.__pyx_n = 3;
    __pyx_t_6.tz = __pyx_v_tz;
    __pyx_t_6.unit = __pyx_v_unit;
    __pyx_t_6.name = __pyx_v_name;
    __pyx_t_3 = __pyx_f_7cytimes_4pddt_pddt_new_simple(__pyx_v_dts, &__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1426, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cytimes/pddt.py":1423
 *         """
 *         # <'datetime64'>
 *         if utils.is_dt64(dt64):             # <<<<<<<<<<<<<<
 *             arr_size = _parse_arr_size(size)
 *             dts = [dt64 for _ in range(arr_size)]
 */
  }

  /* "cytimes/pddt.py":1429
 * 
 *         # Other types
 *         return pddt_new_simple(dt64, tz, unit, name)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6.__pyx_n = 3;
  __pyx_t_6.tz = __pyx_v_tz;
  __pyx_t_6.unit = __pyx_v_unit;
  __pyx_t_6.name = __pyx_v_name;
  __pyx_t_3 = __pyx_f_7cytimes_4pddt_pddt_new_simple(__pyx_v_dt64, &__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":1392
 *         return pddt_new_simple(dt, None, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromdatetime64(
 *         cls,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fromdatetime64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dts);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1431
 *         return pddt_new_simple(dt64, tz, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def strptime(
 *         cls,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_35strptime(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_34strptime, "Construct from datetime strings according to the given format `<'Pddt'>`.\n\n        :param dtstr `<'str/Array-like'>`: The datetime string(s) to construct with.\n            - `<'str'>` A datetime string.\n            - `<'Array-like'>` An array-like object containing the datetime strings.\n\n        :param fmt `<'str'>`: The format used to parse the datetime strings.\n\n        :param size `<'int/str/bytes/object'>`: The size of the index to generate, defaults to `1`.\n            - This argument is `ignored` if 'us' is an array-like object.\n            - `<'int/str/bytes'>` Representing an integer for the number of elements in the index.\n            - `<'object'>` Any object that implements `__len__()`, where its length represents the size of the index.\n\n        :param unit `<'str/None'>`: Set the datetime unit of the index, defaults to `None`.\n            Supported datetime units: 's', 'ms', 'us', 'ns'.\n\n        :param name `<'Hashable/None'>`: The name assigned to the index, defaults to `None`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_35strptime = {"strptime", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_35strptime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_34strptime};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_35strptime(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_dtstr = 0;
  PyObject *__pyx_v_fmt = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("strptime (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_dtstr,&__pyx_n_s_fmt,&__pyx_n_s_size,&__pyx_n_s_unit,&__pyx_n_s_name,0};
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1)));

    /* "cytimes/pddt.py":1437
 *         fmt: str,
 *         size: object = 1,
 *         unit: str = None,             # <<<<<<<<<<<<<<
 *         name: Hashable | None = None,
 *     ) -> Self:
 */
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));

    /* "cytimes/pddt.py":1438
 *         size: object = 1,
 *         unit: str = None,
 *         name: Hashable | None = None,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Construct from datetime strings according to the given format `<'Pddt'>`.
 */
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1431, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dtstr)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1431, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("strptime", 0, 3, 6, 1); __PYX_ERR(0, 1431, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fmt)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1431, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("strptime", 0, 3, 6, 2); __PYX_ERR(0, 1431, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_size);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1431, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1431, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1431, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "strptime") < 0)) __PYX_ERR(0, 1431, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_dtstr = values[1];
    __pyx_v_fmt = ((PyObject*)values[2]);
    __pyx_v_size = values[3];
    __pyx_v_unit = ((PyObject*)values[4]);
    __pyx_v_name = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("strptime", 0, 3, 6, __pyx_nargs); __PYX_ERR(0, 1431, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.strptime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fmt), (&PyUnicode_Type), 0, "fmt", 1))) __PYX_ERR(0, 1435, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 1, "unit", 1))) __PYX_ERR(0, 1437, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_34strptime(__pyx_self, __pyx_v_cls, __pyx_v_dtstr, __pyx_v_fmt, __pyx_v_size, __pyx_v_unit, __pyx_v_name);

  /* "cytimes/pddt.py":1431
 *         return pddt_new_simple(dt64, tz, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def strptime(
 *         cls,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_34strptime(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_dtstr, PyObject *__pyx_v_fmt, PyObject *__pyx_v_size, PyObject *__pyx_v_unit, PyObject *__pyx_v_name) {
  Py_ssize_t __pyx_v_arr_size;
  PyObject *__pyx_v_dt = NULL;
  PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_v_dts = 0;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  unsigned int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  struct __pyx_opt_args_7cytimes_4pddt__pddt_fr_dt __pyx_t_22;
  int __pyx_t_23;
  PyObject *(*__pyx_t_24)(PyObject *);
  int __pyx_t_25;
  PyObject *__pyx_t_26 = NULL;
  char const *__pyx_t_27;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_28;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("strptime", 1);

  /* "cytimes/pddt.py":1459
 *         """
 *         # <'str'>
 *         if isinstance(dtstr, str):             # <<<<<<<<<<<<<<
 *             arr_size = _parse_arr_size(size)
 *             try:
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_dtstr); 
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1460
 *         # <'str'>
 *         if isinstance(dtstr, str):
 *             arr_size = _parse_arr_size(size)             # <<<<<<<<<<<<<<
 *             try:
 *                 dt = datetime.datetime.strptime(dtstr, fmt)
 */
    __pyx_t_2 = __pyx_f_7cytimes_4pddt__parse_arr_size(__pyx_v_size); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-2L))) __PYX_ERR(0, 1460, __pyx_L1_error)
    __pyx_v_arr_size = __pyx_t_2;

    /* "cytimes/pddt.py":1461
 *         if isinstance(dtstr, str):
 *             arr_size = _parse_arr_size(size)
 *             try:             # <<<<<<<<<<<<<<
 *                 dt = datetime.datetime.strptime(dtstr, fmt)
 *             except Exception as err:
 */
    {
      __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:*/ {

        /* "cytimes/pddt.py":1462
 *             arr_size = _parse_arr_size(size)
 *             try:
 *                 dt = datetime.datetime.strptime(dtstr, fmt)             # <<<<<<<<<<<<<<
 *             except Exception as err:
 *                 raise errors.InvalidArgumentError(err) from err
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7cpython_8datetime_datetime), __pyx_n_s_strptime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1462, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = NULL;
        __pyx_t_9 = 0;
        #if CYTHON_UNPACK_METHODS
        if (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_9 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_dtstr, __pyx_v_fmt};
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9);
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1462, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __pyx_v_dt = __pyx_t_6;
        __pyx_t_6 = 0;

        /* "cytimes/pddt.py":1461
 *         if isinstance(dtstr, str):
 *             arr_size = _parse_arr_size(size)
 *             try:             # <<<<<<<<<<<<<<
 *                 dt = datetime.datetime.strptime(dtstr, fmt)
 *             except Exception as err:
 */
      }
      __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_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cytimes/pddt.py":1463
 *             try:
 *                 dt = datetime.datetime.strptime(dtstr, fmt)
 *             except Exception as err:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidArgumentError(err) from err
 *             return _pddt_fr_dt(dt, arr_size, unit, name)
 */
      __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
      if (__pyx_t_10) {
        __Pyx_AddTraceback("cytimes.pddt.Pddt.strptime", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 1463, __pyx_L6_except_error)
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_7);
        __pyx_v_err = __pyx_t_7;
        /*try:*/ {

          /* "cytimes/pddt.py":1464
 *                 dt = datetime.datetime.strptime(dtstr, fmt)
 *             except Exception as err:
 *                 raise errors.InvalidArgumentError(err) from err             # <<<<<<<<<<<<<<
 *             return _pddt_fr_dt(dt, arr_size, unit, name)
 * 
 */
          __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_errors); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1464, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1464, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = NULL;
          __pyx_t_9 = 0;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_13))) {
            __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
            if (likely(__pyx_t_12)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
              __Pyx_INCREF(__pyx_t_12);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_13, function);
              __pyx_t_9 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_err};
            __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1464, __pyx_L15_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          }
          __Pyx_Raise(__pyx_t_11, 0, 0, __pyx_v_err);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __PYX_ERR(0, 1464, __pyx_L15_error)
        }

        /* "cytimes/pddt.py":1463
 *             try:
 *                 dt = datetime.datetime.strptime(dtstr, fmt)
 *             except Exception as err:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidArgumentError(err) from err
 *             return _pddt_fr_dt(dt, arr_size, unit, name)
 */
        /*finally:*/ {
          __pyx_L15_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_21);
            __pyx_t_10 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
            }
            if (PY_MAJOR_VERSION >= 3) {
              __Pyx_XGIVEREF(__pyx_t_19);
              __Pyx_XGIVEREF(__pyx_t_20);
              __Pyx_XGIVEREF(__pyx_t_21);
              __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
            }
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
            __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
            __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
            goto __pyx_L6_except_error;
          }
        }
      }
      goto __pyx_L6_except_error;

      /* "cytimes/pddt.py":1461
 *         if isinstance(dtstr, str):
 *             arr_size = _parse_arr_size(size)
 *             try:             # <<<<<<<<<<<<<<
 *                 dt = datetime.datetime.strptime(dtstr, fmt)
 *             except Exception as err:
 */
      __pyx_L6_except_error:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L1_error;
      __pyx_L9_try_end:;
    }

    /* "cytimes/pddt.py":1465
 *             except Exception as err:
 *                 raise errors.InvalidArgumentError(err) from err
 *             return _pddt_fr_dt(dt, arr_size, unit, name)             # <<<<<<<<<<<<<<
 * 
 *         # Array-like
 */
    __Pyx_XDECREF(__pyx_r);
    if (!(likely(((__pyx_v_dt) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dt, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(0, 1465, __pyx_L1_error)
    __pyx_t_22.__pyx_n = 2;
    __pyx_t_22.unit = __pyx_v_unit;
    __pyx_t_22.name = __pyx_v_name;
    __pyx_t_8 = __pyx_f_7cytimes_4pddt__pddt_fr_dt(((PyDateTime_DateTime *)__pyx_v_dt), __pyx_v_arr_size, &__pyx_t_22); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;

    /* "cytimes/pddt.py":1459
 *         """
 *         # <'str'>
 *         if isinstance(dtstr, str):             # <<<<<<<<<<<<<<
 *             arr_size = _parse_arr_size(size)
 *             try:
 */
  }

  /* "cytimes/pddt.py":1468
 * 
 *         # Array-like
 *         if isinstance(dtstr, (list, tuple, Series, Index, np.ndarray)):             # <<<<<<<<<<<<<<
 *             dts: list = []
 *             for item in dtstr:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Series); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_23 = PyList_Check(__pyx_v_dtstr); 
  if (!__pyx_t_23) {
  } else {
    __pyx_t_1 = __pyx_t_23;
    goto __pyx_L22_bool_binop_done;
  }
  __pyx_t_23 = PyTuple_Check(__pyx_v_dtstr); 
  if (!__pyx_t_23) {
  } else {
    __pyx_t_1 = __pyx_t_23;
    goto __pyx_L22_bool_binop_done;
  }
  __pyx_t_23 = PyObject_IsInstance(__pyx_v_dtstr, __pyx_t_8); 
  if (!__pyx_t_23) {
  } else {
    __pyx_t_1 = __pyx_t_23;
    goto __pyx_L22_bool_binop_done;
  }
  __pyx_t_23 = PyObject_IsInstance(__pyx_v_dtstr, __pyx_t_7); 
  if (!__pyx_t_23) {
  } else {
    __pyx_t_1 = __pyx_t_23;
    goto __pyx_L22_bool_binop_done;
  }
  __pyx_t_23 = __Pyx_TypeCheck(__pyx_v_dtstr, __pyx_ptype_5numpy_ndarray); 
  __pyx_t_1 = __pyx_t_23;
  __pyx_L22_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1469
 *         # Array-like
 *         if isinstance(dtstr, (list, tuple, Series, Index, np.ndarray)):
 *             dts: list = []             # <<<<<<<<<<<<<<
 *             for item in dtstr:
 *                 try:
 */
    __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_v_dts = ((PyObject*)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "cytimes/pddt.py":1470
 *         if isinstance(dtstr, (list, tuple, Series, Index, np.ndarray)):
 *             dts: list = []
 *             for item in dtstr:             # <<<<<<<<<<<<<<
 *                 try:
 *                     dts.append(datetime.datetime.strptime(item, fmt))
 */
    if (likely(PyList_CheckExact(__pyx_v_dtstr)) || PyTuple_CheckExact(__pyx_v_dtstr)) {
      __pyx_t_8 = __pyx_v_dtstr; __Pyx_INCREF(__pyx_t_8);
      __pyx_t_2 = 0;
      __pyx_t_24 = NULL;
    } else {
      __pyx_t_2 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_dtstr); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1470, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_24 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 1470, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_24)) {
        if (likely(PyList_CheckExact(__pyx_t_8))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1470, __pyx_L1_error)
            #endif
            if (__pyx_t_2 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1470, __pyx_L1_error)
          #else
          __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1470, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1470, __pyx_L1_error)
            #endif
            if (__pyx_t_2 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1470, __pyx_L1_error)
          #else
          __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1470, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_24(__pyx_t_8);
        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, 1470, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cytimes/pddt.py":1471
 *             dts: list = []
 *             for item in dtstr:
 *                 try:             # <<<<<<<<<<<<<<
 *                     dts.append(datetime.datetime.strptime(item, fmt))
 *                 except Exception as err:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_3);
        /*try:*/ {

          /* "cytimes/pddt.py":1472
 *             for item in dtstr:
 *                 try:
 *                     dts.append(datetime.datetime.strptime(item, fmt))             # <<<<<<<<<<<<<<
 *                 except Exception as err:
 *                     raise errors.InvalidArgumentError(err) from err
 */
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7cpython_8datetime_datetime), __pyx_n_s_strptime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1472, __pyx_L29_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_11 = NULL;
          __pyx_t_9 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_6, function);
              __pyx_t_9 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_v_item, __pyx_v_fmt};
            __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9);
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1472, __pyx_L29_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          }
          __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_dts, __pyx_t_7); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 1472, __pyx_L29_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "cytimes/pddt.py":1471
 *             dts: list = []
 *             for item in dtstr:
 *                 try:             # <<<<<<<<<<<<<<
 *                     dts.append(datetime.datetime.strptime(item, fmt))
 *                 except Exception as err:
 */
        }
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L36_try_end;
        __pyx_L29_error:;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "cytimes/pddt.py":1473
 *                 try:
 *                     dts.append(datetime.datetime.strptime(item, fmt))
 *                 except Exception as err:             # <<<<<<<<<<<<<<
 *                     raise errors.InvalidArgumentError(err) from err
 *             return pddt_new_simple(dts, None, unit, name)
 */
        __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
        if (__pyx_t_14) {
          __Pyx_AddTraceback("cytimes.pddt.Pddt.strptime", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_11) < 0) __PYX_ERR(0, 1473, __pyx_L31_except_error)
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_6);
          __pyx_v_err = __pyx_t_6;
          /*try:*/ {

            /* "cytimes/pddt.py":1474
 *                     dts.append(datetime.datetime.strptime(item, fmt))
 *                 except Exception as err:
 *                     raise errors.InvalidArgumentError(err) from err             # <<<<<<<<<<<<<<
 *             return pddt_new_simple(dts, None, unit, name)
 * 
 */
            __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_errors); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1474, __pyx_L42_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_26 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1474, __pyx_L42_error)
            __Pyx_GOTREF(__pyx_t_26);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_12 = NULL;
            __pyx_t_9 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_26))) {
              __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_26);
              if (likely(__pyx_t_12)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_26);
                __Pyx_INCREF(__pyx_t_12);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_26, function);
                __pyx_t_9 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_err};
              __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_26, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1474, __pyx_L42_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
            }
            __Pyx_Raise(__pyx_t_13, 0, 0, __pyx_v_err);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __PYX_ERR(0, 1474, __pyx_L42_error)
          }

          /* "cytimes/pddt.py":1473
 *                 try:
 *                     dts.append(datetime.datetime.strptime(item, fmt))
 *                 except Exception as err:             # <<<<<<<<<<<<<<
 *                     raise errors.InvalidArgumentError(err) from err
 *             return pddt_new_simple(dts, None, unit, name)
 */
          /*finally:*/ {
            __pyx_L42_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0;
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
              if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
              if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
              __Pyx_XGOTREF(__pyx_t_21);
              __Pyx_XGOTREF(__pyx_t_20);
              __Pyx_XGOTREF(__pyx_t_19);
              __Pyx_XGOTREF(__pyx_t_18);
              __Pyx_XGOTREF(__pyx_t_17);
              __Pyx_XGOTREF(__pyx_t_16);
              __pyx_t_14 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_27 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
              }
              if (PY_MAJOR_VERSION >= 3) {
                __Pyx_XGIVEREF(__pyx_t_18);
                __Pyx_XGIVEREF(__pyx_t_17);
                __Pyx_XGIVEREF(__pyx_t_16);
                __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_17, __pyx_t_16);
              }
              __Pyx_XGIVEREF(__pyx_t_21);
              __Pyx_XGIVEREF(__pyx_t_20);
              __Pyx_XGIVEREF(__pyx_t_19);
              __Pyx_ErrRestore(__pyx_t_21, __pyx_t_20, __pyx_t_19);
              __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0;
              __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_27;
              goto __pyx_L31_except_error;
            }
          }
        }
        goto __pyx_L31_except_error;

        /* "cytimes/pddt.py":1471
 *             dts: list = []
 *             for item in dtstr:
 *                 try:             # <<<<<<<<<<<<<<
 *                     dts.append(datetime.datetime.strptime(item, fmt))
 *                 except Exception as err:
 */
        __pyx_L31_except_error:;
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
        goto __pyx_L1_error;
        __pyx_L36_try_end:;
      }

      /* "cytimes/pddt.py":1470
 *         if isinstance(dtstr, (list, tuple, Series, Index, np.ndarray)):
 *             dts: list = []
 *             for item in dtstr:             # <<<<<<<<<<<<<<
 *                 try:
 *                     dts.append(datetime.datetime.strptime(item, fmt))
 */
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cytimes/pddt.py":1475
 *                 except Exception as err:
 *                     raise errors.InvalidArgumentError(err) from err
 *             return pddt_new_simple(dts, None, unit, name)             # <<<<<<<<<<<<<<
 * 
 *         # Invalid
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_28.__pyx_n = 3;
    __pyx_t_28.tz = Py_None;
    __pyx_t_28.unit = __pyx_v_unit;
    __pyx_t_28.name = __pyx_v_name;
    __pyx_t_8 = __pyx_f_7cytimes_4pddt_pddt_new_simple(__pyx_v_dts, &__pyx_t_28); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1475, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;

    /* "cytimes/pddt.py":1468
 * 
 *         # Array-like
 *         if isinstance(dtstr, (list, tuple, Series, Index, np.ndarray)):             # <<<<<<<<<<<<<<
 *             dts: list = []
 *             for item in dtstr:
 */
  }

  /* "cytimes/pddt.py":1478
 * 
 *         # Invalid
 *         raise errors.InvalidTypeError(             # <<<<<<<<<<<<<<
 *             "unsupported type %s for argument 'dtstr'." % type(dtstr)
 *         )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_errors); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_InvalidTypeError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cytimes/pddt.py":1479
 *         # Invalid
 *         raise errors.InvalidTypeError(
 *             "unsupported type %s for argument 'dtstr'." % type(dtstr)             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unsupported_type_s_for_argument_6, ((PyObject *)Py_TYPE(__pyx_v_dtstr))); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_7 = NULL;
  __pyx_t_9 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_9 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_11};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1478, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __PYX_ERR(0, 1478, __pyx_L1_error)

  /* "cytimes/pddt.py":1431
 *         return pddt_new_simple(dt64, tz, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def strptime(
 *         cls,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_26);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.strptime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dt);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XDECREF(__pyx_v_dts);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1483
 * 
 *     # Convertor ----------------------------------------------------------------------------
 *     def ctime(self) -> Index[str]:             # <<<<<<<<<<<<<<
 *         """Convert to index of strings in C time format `<'Index[str]'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_37ctime(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_36ctime, "Convert to index of strings in C time format `<'Index[str]'>`.\n\n        - ctime format: 'Tue Oct 10 08:19:05 2024'\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_37ctime = {"ctime", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_37ctime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_36ctime};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_37ctime(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ctime (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1483, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ctime") < 0)) __PYX_ERR(0, 1483, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ctime", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1483, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.ctime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_36ctime(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_36ctime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ctime", 1);

  /* "cytimes/pddt.py":1488
 *         - ctime format: 'Tue Oct 10 08:19:05 2024'
 *         """
 *         return self.strftime("%a %b %d %H:%M:%S %Y")             # <<<<<<<<<<<<<<
 * 
 *     def isoformat(self, sep: str = "T") -> Index[str]:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_strftime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_a_b_d_H_M_S_Y};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1488, __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;

  /* "cytimes/pddt.py":1483
 * 
 *     # Convertor ----------------------------------------------------------------------------
 *     def ctime(self) -> Index[str]:             # <<<<<<<<<<<<<<
 *         """Convert to index of strings in C time format `<'Index[str]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.ctime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1490
 *         return self.strftime("%a %b %d %H:%M:%S %Y")
 * 
 *     def isoformat(self, sep: str = "T") -> Index[str]:             # <<<<<<<<<<<<<<
 *         """Convert to index of strings in ISO format `<'Index[str]'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_39isoformat(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_38isoformat, "Convert to index of strings in ISO format `<'Index[str]'>`.\n\n        :param sep `<'str'>`: The separator between date and time components, defaults to `'T'`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_39isoformat = {"isoformat", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_39isoformat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_38isoformat};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_39isoformat(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_sep = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isoformat (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_sep,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)((PyObject*)__pyx_n_u_T)));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1490, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sep);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1490, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isoformat") < 0)) __PYX_ERR(0, 1490, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_sep = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("isoformat", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1490, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.isoformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sep), (&PyUnicode_Type), 0, "sep", 1))) __PYX_ERR(0, 1490, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_38isoformat(__pyx_self, __pyx_v_self, __pyx_v_sep);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_38isoformat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_sep) {
  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_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isoformat", 1);

  /* "cytimes/pddt.py":1495
 *         :param sep `<'str'>`: The separator between date and time components, defaults to `'T'`.
 *         """
 *         return self.strftime(f"%Y-%m-%d{sep}%H:%M:%S.%f%z")             # <<<<<<<<<<<<<<
 * 
 *     def timedf(self) -> DataFrame:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_strftime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 0;
  __pyx_t_5 = 127;
  __Pyx_INCREF(__pyx_kp_u_Y_m_d);
  __pyx_t_4 += 8;
  __Pyx_GIVEREF(__pyx_kp_u_Y_m_d);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Y_m_d);
  __Pyx_INCREF(__pyx_v_sep);
  __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_sep) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_sep) : __pyx_t_5;
  __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_sep);
  __Pyx_GIVEREF(__pyx_v_sep);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_sep);
  __Pyx_INCREF(__pyx_kp_u_H_M_S_f_z);
  __pyx_t_4 += 13;
  __Pyx_GIVEREF(__pyx_kp_u_H_M_S_f_z);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_H_M_S_f_z);
  __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1495, __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;

  /* "cytimes/pddt.py":1490
 *         return self.strftime("%a %b %d %H:%M:%S %Y")
 * 
 *     def isoformat(self, sep: str = "T") -> Index[str]:             # <<<<<<<<<<<<<<
 *         """Convert to index of strings in ISO format `<'Index[str]'>`.
 * 
 */

  /* 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("cytimes.pddt.Pddt.isoformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1497
 *         return self.strftime(f"%Y-%m-%d{sep}%H:%M:%S.%f%z")
 * 
 *     def timedf(self) -> DataFrame:             # <<<<<<<<<<<<<<
 *         """Convert to DataFrame of time components `<'DataFrame'>`."""
 *         arr: np.ndarray = self.values_naive
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_41timedf(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_40timedf, "Convert to DataFrame of time components `<'DataFrame'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_41timedf = {"timedf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_41timedf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_40timedf};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_41timedf(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("timedf (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1497, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "timedf") < 0)) __PYX_ERR(0, 1497, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("timedf", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1497, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.timedf", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_40timedf(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_40timedf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyArrayObject *__pyx_v_arr = 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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("timedf", 1);

  /* "cytimes/pddt.py":1499
 *     def timedf(self) -> DataFrame:
 *         """Convert to DataFrame of time components `<'DataFrame'>`."""
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 *         return DataFrame(
 *             {
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1499, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":1500
 *         """Convert to DataFrame of time components `<'DataFrame'>`."""
 *         arr: np.ndarray = self.values_naive
 *         return DataFrame(             # <<<<<<<<<<<<<<
 *             {
 *                 "tm_year": utils.dt64arr_year(arr),
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cytimes/pddt.py":1502
 *         return DataFrame(
 *             {
 *                 "tm_year": utils.dt64arr_year(arr),             # <<<<<<<<<<<<<<
 *                 "tm_mon": utils.dt64arr_month(arr),
 *                 "tm_mday": utils.dt64arr_day(arr),
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_year(__pyx_v_arr, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_tm_year, __pyx_t_4) < 0) __PYX_ERR(0, 1502, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/pddt.py":1503
 *             {
 *                 "tm_year": utils.dt64arr_year(arr),
 *                 "tm_mon": utils.dt64arr_month(arr),             # <<<<<<<<<<<<<<
 *                 "tm_mday": utils.dt64arr_day(arr),
 *                 "tm_hour": utils.dt64arr_hour(arr),
 */
  __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_month(__pyx_v_arr, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_tm_mon, __pyx_t_4) < 0) __PYX_ERR(0, 1502, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/pddt.py":1504
 *                 "tm_year": utils.dt64arr_year(arr),
 *                 "tm_mon": utils.dt64arr_month(arr),
 *                 "tm_mday": utils.dt64arr_day(arr),             # <<<<<<<<<<<<<<
 *                 "tm_hour": utils.dt64arr_hour(arr),
 *                 "tm_min": utils.dt64arr_minute(arr),
 */
  __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_day(__pyx_v_arr, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_tm_mday, __pyx_t_4) < 0) __PYX_ERR(0, 1502, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/pddt.py":1505
 *                 "tm_mon": utils.dt64arr_month(arr),
 *                 "tm_mday": utils.dt64arr_day(arr),
 *                 "tm_hour": utils.dt64arr_hour(arr),             # <<<<<<<<<<<<<<
 *                 "tm_min": utils.dt64arr_minute(arr),
 *                 "tm_sec": utils.dt64arr_second(arr),
 */
  __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_hour(__pyx_v_arr, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_tm_hour, __pyx_t_4) < 0) __PYX_ERR(0, 1502, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/pddt.py":1506
 *                 "tm_mday": utils.dt64arr_day(arr),
 *                 "tm_hour": utils.dt64arr_hour(arr),
 *                 "tm_min": utils.dt64arr_minute(arr),             # <<<<<<<<<<<<<<
 *                 "tm_sec": utils.dt64arr_second(arr),
 *                 "tm_wday": utils.dt64arr_weekday(arr),
 */
  __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_minute(__pyx_v_arr, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_tm_min, __pyx_t_4) < 0) __PYX_ERR(0, 1502, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/pddt.py":1507
 *                 "tm_hour": utils.dt64arr_hour(arr),
 *                 "tm_min": utils.dt64arr_minute(arr),
 *                 "tm_sec": utils.dt64arr_second(arr),             # <<<<<<<<<<<<<<
 *                 "tm_wday": utils.dt64arr_weekday(arr),
 *                 "tm_yday": utils.dt64arr_days_of_year(arr),
 */
  __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_second(__pyx_v_arr, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_tm_sec, __pyx_t_4) < 0) __PYX_ERR(0, 1502, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/pddt.py":1508
 *                 "tm_min": utils.dt64arr_minute(arr),
 *                 "tm_sec": utils.dt64arr_second(arr),
 *                 "tm_wday": utils.dt64arr_weekday(arr),             # <<<<<<<<<<<<<<
 *                 "tm_yday": utils.dt64arr_days_of_year(arr),
 *             },
 */
  __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_weekday(__pyx_v_arr, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_tm_wday, __pyx_t_4) < 0) __PYX_ERR(0, 1502, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/pddt.py":1509
 *                 "tm_sec": utils.dt64arr_second(arr),
 *                 "tm_wday": utils.dt64arr_weekday(arr),
 *                 "tm_yday": utils.dt64arr_days_of_year(arr),             # <<<<<<<<<<<<<<
 *             },
 *         )
 */
  __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_of_year(__pyx_v_arr, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_tm_yday, __pyx_t_4) < 0) __PYX_ERR(0, 1502, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __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, 1500, __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;

  /* "cytimes/pddt.py":1497
 *         return self.strftime(f"%Y-%m-%d{sep}%H:%M:%S.%f%z")
 * 
 *     def timedf(self) -> DataFrame:             # <<<<<<<<<<<<<<
 *         """Convert to DataFrame of time components `<'DataFrame'>`."""
 *         arr: np.ndarray = self.values_naive
 */

  /* 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("cytimes.pddt.Pddt.timedf", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1513
 *         )
 * 
 *     def utctimedf(self) -> DataFrame:             # <<<<<<<<<<<<<<
 *         """Convert to DataFrame of time components representing the UTC time `<'DataFrame'>`."""
 *         my_tz = self.tzinfo
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_43utctimedf(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_42utctimedf, "Convert to DataFrame of time components representing the UTC time `<'DataFrame'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_43utctimedf = {"utctimedf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_43utctimedf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_42utctimedf};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_43utctimedf(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("utctimedf (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1513, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "utctimedf") < 0)) __PYX_ERR(0, 1513, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("utctimedf", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1513, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.utctimedf", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_42utctimedf(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_42utctimedf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_my_tz = 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;
  unsigned int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("utctimedf", 1);

  /* "cytimes/pddt.py":1515
 *     def utctimedf(self) -> DataFrame:
 *         """Convert to DataFrame of time components representing the UTC time `<'DataFrame'>`."""
 *         my_tz = self.tzinfo             # <<<<<<<<<<<<<<
 *         if my_tz is None or my_tz is utils.UTC:
 *             return self.timedf()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_my_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":1516
 *         """Convert to DataFrame of time components representing the UTC time `<'DataFrame'>`."""
 *         my_tz = self.tzinfo
 *         if my_tz is None or my_tz is utils.UTC:             # <<<<<<<<<<<<<<
 *             return self.timedf()
 *         return self.tz_convert(utils.UTC).timedf()
 */
  __pyx_t_3 = (__pyx_v_my_tz == Py_None);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_my_tz == ((PyObject *)__pyx_v_7cytimes_5utils_UTC));
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":1517
 *         my_tz = self.tzinfo
 *         if my_tz is None or my_tz is utils.UTC:
 *             return self.timedf()             # <<<<<<<<<<<<<<
 *         return self.tz_convert(utils.UTC).timedf()
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_timedf); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1517, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/pddt.py":1516
 *         """Convert to DataFrame of time components representing the UTC time `<'DataFrame'>`."""
 *         my_tz = self.tzinfo
 *         if my_tz is None or my_tz is utils.UTC:             # <<<<<<<<<<<<<<
 *             return self.timedf()
 *         return self.tz_convert(utils.UTC).timedf()
 */
  }

  /* "cytimes/pddt.py":1518
 *         if my_tz is None or my_tz is utils.UTC:
 *             return self.timedf()
 *         return self.tz_convert(utils.UTC).timedf()             # <<<<<<<<<<<<<<
 * 
 *     def toordinal(self) -> Index[np.int64]:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tz_convert); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, ((PyObject *)__pyx_v_7cytimes_5utils_UTC)};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_timedf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":1513
 *         )
 * 
 *     def utctimedf(self) -> DataFrame:             # <<<<<<<<<<<<<<
 *         """Convert to DataFrame of time components representing the UTC time `<'DataFrame'>`."""
 *         my_tz = self.tzinfo
 */

  /* 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("cytimes.pddt.Pddt.utctimedf", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_my_tz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1520
 *         return self.tz_convert(utils.UTC).timedf()
 * 
 *     def toordinal(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Convert to index of proleptic Gregorian ordinal days `<'Index[int64]'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_45toordinal(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_44toordinal, "Convert to index of proleptic Gregorian ordinal days `<'Index[int64]'>`.\n\n        - Day 1 (ordinal=1) is `0001-01-01`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_45toordinal = {"toordinal", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_45toordinal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_44toordinal};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_45toordinal(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("toordinal (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1520, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toordinal") < 0)) __PYX_ERR(0, 1520, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("toordinal", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1520, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.toordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_44toordinal(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_44toordinal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("toordinal", 1);

  /* "cytimes/pddt.py":1525
 *         - Day 1 (ordinal=1) is `0001-01-01`.
 *         """
 *         return Index(utils.dt64arr_to_ordinal(self.values), name="ordinal")             # <<<<<<<<<<<<<<
 * 
 *     def seconds(self, utc: cython.bint = False) -> Index[np.float64]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1525, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_to_ordinal(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 1525, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_ordinal) < 0) __PYX_ERR(0, 1525, __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(0, 1525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":1520
 *         return self.tz_convert(utils.UTC).timedf()
 * 
 *     def toordinal(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Convert to index of proleptic Gregorian ordinal days `<'Index[int64]'>`.
 * 
 */

  /* 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("cytimes.pddt.Pddt.toordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1527
 *         return Index(utils.dt64arr_to_ordinal(self.values), name="ordinal")
 * 
 *     def seconds(self, utc: cython.bint = False) -> Index[np.float64]:             # <<<<<<<<<<<<<<
 *         """Convert to index of seconds since Unix Epoch `<'Index[float64]'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_47seconds(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_46seconds, "Convert to index of seconds since Unix Epoch `<'Index[float64]'>`.\n\n        Unlike 'timesamp()', this method does `NOT` take local\n        timezone into consideration at conversion.\n\n        :param utc `<'bool'>`: Whether to subtract the UTC offset from the result, defaults to `False`.\n            Only applicable when instance is timezone-aware; otherwise ignored.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_47seconds = {"seconds", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_47seconds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_46seconds};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_47seconds(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_utc;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("seconds (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_utc,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1527, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_utc);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1527, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "seconds") < 0)) __PYX_ERR(0, 1527, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    if (values[1]) {
      __pyx_v_utc = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_utc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1527, __pyx_L3_error)
    } else {
      __pyx_v_utc = ((int)((int)0));
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("seconds", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1527, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_46seconds(__pyx_self, __pyx_v_self, __pyx_v_utc);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_46seconds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_utc) {
  PyObject *__pyx_v_my_tz = NULL;
  PyObject *__pyx_v_arr = 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;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("seconds", 1);

  /* "cytimes/pddt.py":1536
 *             Only applicable when instance is timezone-aware; otherwise ignored.
 *         """
 *         my_tz = self.tzinfo             # <<<<<<<<<<<<<<
 *         if my_tz is None:
 *             arr = self.values
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_my_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":1537
 *         """
 *         my_tz = self.tzinfo
 *         if my_tz is None:             # <<<<<<<<<<<<<<
 *             arr = self.values
 *         elif not utc:
 */
  __pyx_t_2 = (__pyx_v_my_tz == Py_None);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":1538
 *         my_tz = self.tzinfo
 *         if my_tz is None:
 *             arr = self.values             # <<<<<<<<<<<<<<
 *         elif not utc:
 *             arr = self.values_naive
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_arr = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":1537
 *         """
 *         my_tz = self.tzinfo
 *         if my_tz is None:             # <<<<<<<<<<<<<<
 *             arr = self.values
 *         elif not utc:
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":1539
 *         if my_tz is None:
 *             arr = self.values
 *         elif not utc:             # <<<<<<<<<<<<<<
 *             arr = self.values_naive
 *         else:
 */
  __pyx_t_2 = (!__pyx_v_utc);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":1540
 *             arr = self.values
 *         elif not utc:
 *             arr = self.values_naive             # <<<<<<<<<<<<<<
 *         else:
 *             arr = self.tz_convert(utils.UTC).values_naive
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1540, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_arr = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":1539
 *         if my_tz is None:
 *             arr = self.values
 *         elif not utc:             # <<<<<<<<<<<<<<
 *             arr = self.values_naive
 *         else:
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":1542
 *             arr = self.values_naive
 *         else:
 *             arr = self.tz_convert(utils.UTC).values_naive             # <<<<<<<<<<<<<<
 *         return Index(utils.dt64arr_to_ts(arr), name="seconds")
 * 
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tz_convert); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_7cytimes_5utils_UTC)};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1542, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_arr = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "cytimes/pddt.py":1543
 *         else:
 *             arr = self.tz_convert(utils.UTC).values_naive
 *         return Index(utils.dt64arr_to_ts(arr), name="seconds")             # <<<<<<<<<<<<<<
 * 
 *     def microseconds(self, utc: cython.bint = False) -> Index[np.int64]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1543, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_to_ts(((PyArrayObject *)__pyx_v_arr), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 1543, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_n_u_seconds) < 0) __PYX_ERR(0, 1543, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":1527
 *         return Index(utils.dt64arr_to_ordinal(self.values), name="ordinal")
 * 
 *     def seconds(self, utc: cython.bint = False) -> Index[np.float64]:             # <<<<<<<<<<<<<<
 *         """Convert to index of seconds since Unix Epoch `<'Index[float64]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_my_tz);
  __Pyx_XDECREF(__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1545
 *         return Index(utils.dt64arr_to_ts(arr), name="seconds")
 * 
 *     def microseconds(self, utc: cython.bint = False) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Convert to index of microseconds since Unix Epoch `<'Index[int64]'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_49microseconds(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_48microseconds, "Convert to index of microseconds since Unix Epoch `<'Index[int64]'>`.\n\n        Unlike 'timesamp()', this method does `NOT` take local\n        timezone into consideration at conversion.\n\n        :param utc `<'bool'>`: Whether to subtract the UTC offset from the result, defaults to `False`.\n            Only applicable when instance is timezone-aware; otherwise ignored.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_49microseconds = {"microseconds", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_49microseconds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_48microseconds};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_49microseconds(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_utc;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("microseconds (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_utc,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1545, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_utc);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1545, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "microseconds") < 0)) __PYX_ERR(0, 1545, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    if (values[1]) {
      __pyx_v_utc = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_utc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1545, __pyx_L3_error)
    } else {
      __pyx_v_utc = ((int)((int)0));
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("microseconds", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1545, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.microseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_48microseconds(__pyx_self, __pyx_v_self, __pyx_v_utc);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_48microseconds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_utc) {
  PyObject *__pyx_v_my_tz = NULL;
  PyObject *__pyx_v_arr = 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;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("microseconds", 1);

  /* "cytimes/pddt.py":1554
 *             Only applicable when instance is timezone-aware; otherwise ignored.
 *         """
 *         my_tz = self.tzinfo             # <<<<<<<<<<<<<<
 *         if my_tz is None:
 *             arr = self.values
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_my_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":1555
 *         """
 *         my_tz = self.tzinfo
 *         if my_tz is None:             # <<<<<<<<<<<<<<
 *             arr = self.values
 *         elif not utc:
 */
  __pyx_t_2 = (__pyx_v_my_tz == Py_None);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":1556
 *         my_tz = self.tzinfo
 *         if my_tz is None:
 *             arr = self.values             # <<<<<<<<<<<<<<
 *         elif not utc:
 *             arr = self.values_naive
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1556, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_arr = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":1555
 *         """
 *         my_tz = self.tzinfo
 *         if my_tz is None:             # <<<<<<<<<<<<<<
 *             arr = self.values
 *         elif not utc:
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":1557
 *         if my_tz is None:
 *             arr = self.values
 *         elif not utc:             # <<<<<<<<<<<<<<
 *             arr = self.values_naive
 *         else:
 */
  __pyx_t_2 = (!__pyx_v_utc);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":1558
 *             arr = self.values
 *         elif not utc:
 *             arr = self.values_naive             # <<<<<<<<<<<<<<
 *         else:
 *             arr = self.tz_convert(utils.UTC).values_naive
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_arr = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":1557
 *         if my_tz is None:
 *             arr = self.values
 *         elif not utc:             # <<<<<<<<<<<<<<
 *             arr = self.values_naive
 *         else:
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":1560
 *             arr = self.values_naive
 *         else:
 *             arr = self.tz_convert(utils.UTC).values_naive             # <<<<<<<<<<<<<<
 *         return Index(utils.dt64arr_as_int64_us(arr), name="microseconds")
 * 
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tz_convert); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1560, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_7cytimes_5utils_UTC)};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1560, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1560, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_arr = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "cytimes/pddt.py":1561
 *         else:
 *             arr = self.tz_convert(utils.UTC).values_naive
 *         return Index(utils.dt64arr_as_int64_us(arr), name="microseconds")             # <<<<<<<<<<<<<<
 * 
 *     def timestamp(self) -> Index[np.float64]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1561, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_us(((PyArrayObject *)__pyx_v_arr), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 1561, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_n_u_microseconds) < 0) __PYX_ERR(0, 1561, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":1545
 *         return Index(utils.dt64arr_to_ts(arr), name="seconds")
 * 
 *     def microseconds(self, utc: cython.bint = False) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Convert to index of microseconds since Unix Epoch `<'Index[int64]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.microseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_my_tz);
  __Pyx_XDECREF(__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1563
 *         return Index(utils.dt64arr_as_int64_us(arr), name="microseconds")
 * 
 *     def timestamp(self) -> Index[np.float64]:             # <<<<<<<<<<<<<<
 *         """Convert to index of POSIX timestamps `<'Index[float64]'>`."""
 *         # fmt: off
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_51timestamp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_50timestamp, "Convert to index of POSIX timestamps `<'Index[float64]'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_51timestamp = {"timestamp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_51timestamp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_50timestamp};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_51timestamp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("timestamp (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1563, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "timestamp") < 0)) __PYX_ERR(0, 1563, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("timestamp", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1563, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_50timestamp(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_50timestamp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_arr = 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;
  struct __pyx_opt_args_7cytimes_5utils_tz_local __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("timestamp", 1);

  /* "cytimes/pddt.py":1566
 *         """Convert to index of POSIX timestamps `<'Index[float64]'>`."""
 *         # fmt: off
 *         if self.tzinfo is None:             # <<<<<<<<<<<<<<
 *             arr = self.tz_localize(utils.tz_local(None), "infer", "shift_forward").values
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":1567
 *         # fmt: off
 *         if self.tzinfo is None:
 *             arr = self.tz_localize(utils.tz_local(None), "infer", "shift_forward").values             # <<<<<<<<<<<<<<
 *         else:
 *             arr = self.values
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tz_localize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1567, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.dt = ((PyDateTime_DateTime *)Py_None);
    __pyx_t_4 = __pyx_f_7cytimes_5utils_tz_local(&__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1567, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_4, __pyx_n_u_infer, __pyx_n_u_shift_forward};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1567, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1567, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_arr = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1566
 *         """Convert to index of POSIX timestamps `<'Index[float64]'>`."""
 *         # fmt: off
 *         if self.tzinfo is None:             # <<<<<<<<<<<<<<
 *             arr = self.tz_localize(utils.tz_local(None), "infer", "shift_forward").values
 *         else:
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":1569
 *             arr = self.tz_localize(utils.tz_local(None), "infer", "shift_forward").values
 *         else:
 *             arr = self.values             # <<<<<<<<<<<<<<
 *         # fmt: on
 *         return Index(utils.dt64arr_to_ts(arr), name="timestamp")
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_arr = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "cytimes/pddt.py":1571
 *             arr = self.values
 *         # fmt: on
 *         return Index(utils.dt64arr_to_ts(arr), name="timestamp")             # <<<<<<<<<<<<<<
 * 
 *     def datetime(self) -> np.ndarray[datetime.datetime]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1571, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_to_ts(((PyArrayObject *)__pyx_v_arr), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 1571, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_n_u_timestamp) < 0) __PYX_ERR(0, 1571, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":1563
 *         return Index(utils.dt64arr_as_int64_us(arr), name="microseconds")
 * 
 *     def timestamp(self) -> Index[np.float64]:             # <<<<<<<<<<<<<<
 *         """Convert to index of POSIX timestamps `<'Index[float64]'>`."""
 *         # fmt: off
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1573
 *         return Index(utils.dt64arr_to_ts(arr), name="timestamp")
 * 
 *     def datetime(self) -> np.ndarray[datetime.datetime]:             # <<<<<<<<<<<<<<
 *         """Convert to array of datetime.datetime `<'ndarray[datetime]'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_53datetime(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_52datetime, "Convert to array of datetime.datetime `<'ndarray[datetime]'>`.\n\n        #### Alias of `to_pydatetime()`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_53datetime = {"datetime", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_53datetime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_52datetime};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_53datetime(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("datetime (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1573, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "datetime") < 0)) __PYX_ERR(0, 1573, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("datetime", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1573, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_52datetime(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_52datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("datetime", 1);

  /* "cytimes/pddt.py":1578
 *         #### Alias of `to_pydatetime()`.
 *         """
 *         return DatetimeIndex.to_pydatetime(self)             # <<<<<<<<<<<<<<
 * 
 *     def date(self) -> np.ndarray[datetime.date]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DatetimeIndex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_to_pydatetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1578, __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;

  /* "cytimes/pddt.py":1573
 *         return Index(utils.dt64arr_to_ts(arr), name="timestamp")
 * 
 *     def datetime(self) -> np.ndarray[datetime.datetime]:             # <<<<<<<<<<<<<<
 *         """Convert to array of datetime.datetime `<'ndarray[datetime]'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1580
 *         return DatetimeIndex.to_pydatetime(self)
 * 
 *     def date(self) -> np.ndarray[datetime.date]:             # <<<<<<<<<<<<<<
 *         """Convert to array of datetime.date `<'ndarray[date]'>`."""
 *         return super(Pddt, self).date
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_55date(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_54date, "Convert to array of datetime.date `<'ndarray[date]'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_55date = {"date", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_55date, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_54date};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_55date(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("date (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1580, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "date") < 0)) __PYX_ERR(0, 1580, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("date", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1580, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.date", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_54date(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_54date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date", 1);

  /* "cytimes/pddt.py":1582
 *     def date(self) -> np.ndarray[datetime.date]:
 *         """Convert to array of datetime.date `<'ndarray[date]'>`."""
 *         return super(Pddt, self).date             # <<<<<<<<<<<<<<
 * 
 *     def time(self) -> np.ndarray[datetime.time]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Pddt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1582, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self)) __PYX_ERR(0, 1582, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_date); 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_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":1580
 *         return DatetimeIndex.to_pydatetime(self)
 * 
 *     def date(self) -> np.ndarray[datetime.date]:             # <<<<<<<<<<<<<<
 *         """Convert to array of datetime.date `<'ndarray[date]'>`."""
 *         return super(Pddt, self).date
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.date", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1584
 *         return super(Pddt, self).date
 * 
 *     def time(self) -> np.ndarray[datetime.time]:             # <<<<<<<<<<<<<<
 *         """Convert to array of datetime.time (`WITHOUT` timezone) `<'ndarray[time]'>`."""
 *         return super(Pddt, self).time
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_57time(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_56time, "Convert to array of datetime.time (`WITHOUT` timezone) `<'ndarray[time]'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_57time = {"time", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_57time, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_56time};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_57time(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("time (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1584, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "time") < 0)) __PYX_ERR(0, 1584, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("time", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1584, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_56time(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_56time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time", 1);

  /* "cytimes/pddt.py":1586
 *     def time(self) -> np.ndarray[datetime.time]:
 *         """Convert to array of datetime.time (`WITHOUT` timezone) `<'ndarray[time]'>`."""
 *         return super(Pddt, self).time             # <<<<<<<<<<<<<<
 * 
 *     def timetz(self) -> np.ndarray[datetime.time]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Pddt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1586, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self)) __PYX_ERR(0, 1586, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1586, __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;

  /* "cytimes/pddt.py":1584
 *         return super(Pddt, self).date
 * 
 *     def time(self) -> np.ndarray[datetime.time]:             # <<<<<<<<<<<<<<
 *         """Convert to array of datetime.time (`WITHOUT` timezone) `<'ndarray[time]'>`."""
 *         return super(Pddt, self).time
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1588
 *         return super(Pddt, self).time
 * 
 *     def timetz(self) -> np.ndarray[datetime.time]:             # <<<<<<<<<<<<<<
 *         """Convert to array of datetime.time (`WITH` timezone) `<'ndarray[time]'>`."""
 *         return super(Pddt, self).timetz
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_59timetz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_58timetz, "Convert to array of datetime.time (`WITH` timezone) `<'ndarray[time]'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_59timetz = {"timetz", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_59timetz, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_58timetz};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_59timetz(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("timetz (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1588, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "timetz") < 0)) __PYX_ERR(0, 1588, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("timetz", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1588, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.timetz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_58timetz(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_58timetz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("timetz", 1);

  /* "cytimes/pddt.py":1590
 *     def timetz(self) -> np.ndarray[datetime.time]:
 *         """Convert to array of datetime.time (`WITH` timezone) `<'ndarray[time]'>`."""
 *         return super(Pddt, self).timetz             # <<<<<<<<<<<<<<
 * 
 *     # Manipulator --------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Pddt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1590, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self)) __PYX_ERR(0, 1590, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_timetz); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1590, __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;

  /* "cytimes/pddt.py":1588
 *         return super(Pddt, self).time
 * 
 *     def timetz(self) -> np.ndarray[datetime.time]:             # <<<<<<<<<<<<<<
 *         """Convert to array of datetime.time (`WITH` timezone) `<'ndarray[time]'>`."""
 *         return super(Pddt, self).timetz
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.timetz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1593
 * 
 *     # Manipulator --------------------------------------------------------------------------
 *     def replace(             # <<<<<<<<<<<<<<
 *         self,
 *         year: cython.int = -1,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_61replace(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_60replace, "Replace the specified datetime fields with new values `<'Pddt'>`.\n\n        #### Fields set to `-1` means retaining the original values.\n\n        :param year `<'int'>`: Year value, defaults to `-1`.\n        :param month `<'int'>`: Yonth value (1-12), defaults to `-1`.\n        :param day `<'int'>`: Day value (1-31), automacially clamped to the maximum days in the month, defaults to `-1`.\n        :param hour `<'int'>`: Hour value (0-23), defaults to `-1`.\n        :param minute `<'int'>`: Minute value (0-59), defaults to `-1`.\n        :param second `<'int'>`: Second value (0-59), defaults to `-1`.\n        :param microsecond `<'int'>`: Microsecond value (0-999999), defaults to `-1`.\n        :param tz `<'tzinfo/str/None'>`: The timezone, defaults to `-1`.\n            - `<'int'>` Retains the original timezone.\n            - `<'datetime.tzinfo'>` A subclass of `datetime.tzinfo`.\n            - `<'str'>` Timezone name supported by the 'Zoneinfo' module, or `'local'` for local timezone.\n            - `<'None'>` Timezone-naive.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_61replace = {"replace", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_61replace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_60replace};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_61replace(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_year;
  int __pyx_v_month;
  int __pyx_v_day;
  int __pyx_v_hour;
  int __pyx_v_minute;
  int __pyx_v_second;
  int __pyx_v_microsecond;
  int __pyx_v_nanosecond;
  PyObject *__pyx_v_tzinfo = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("replace (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_year,&__pyx_n_s_month,&__pyx_n_s_day,&__pyx_n_s_hour,&__pyx_n_s_minute,&__pyx_n_s_second,&__pyx_n_s_microsecond,&__pyx_n_s_nanosecond,&__pyx_n_s_tzinfo,0};
    values[9] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_neg_1)));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1593, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_year);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1593, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_month);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1593, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_day);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1593, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hour);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1593, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_minute);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1593, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_second);
          if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1593, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_microsecond);
          if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1593, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nanosecond);
          if (value) { values[8] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1593, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tzinfo);
          if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1593, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "replace") < 0)) __PYX_ERR(0, 1593, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    if (values[1]) {
      __pyx_v_year = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_year == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1595, __pyx_L3_error)
    } else {
      __pyx_v_year = ((int)((int)-1));
    }
    if (values[2]) {
      __pyx_v_month = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_month == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1596, __pyx_L3_error)
    } else {
      __pyx_v_month = ((int)((int)-1));
    }
    if (values[3]) {
      __pyx_v_day = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_day == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1597, __pyx_L3_error)
    } else {
      __pyx_v_day = ((int)((int)-1));
    }
    if (values[4]) {
      __pyx_v_hour = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_hour == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1598, __pyx_L3_error)
    } else {
      __pyx_v_hour = ((int)((int)-1));
    }
    if (values[5]) {
      __pyx_v_minute = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_minute == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1599, __pyx_L3_error)
    } else {
      __pyx_v_minute = ((int)((int)-1));
    }
    if (values[6]) {
      __pyx_v_second = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_second == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1600, __pyx_L3_error)
    } else {
      __pyx_v_second = ((int)((int)-1));
    }
    if (values[7]) {
      __pyx_v_microsecond = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_microsecond == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1601, __pyx_L3_error)
    } else {
      __pyx_v_microsecond = ((int)((int)-1));
    }
    if (values[8]) {
      __pyx_v_nanosecond = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_nanosecond == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1602, __pyx_L3_error)
    } else {
      __pyx_v_nanosecond = ((int)((int)-1));
    }
    __pyx_v_tzinfo = values[9];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("replace", 0, 1, 10, __pyx_nargs); __PYX_ERR(0, 1593, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_60replace(__pyx_self, __pyx_v_self, __pyx_v_year, __pyx_v_month, __pyx_v_day, __pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_nanosecond, __pyx_v_tzinfo);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_60replace(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_year, int __pyx_v_month, int __pyx_v_day, int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, int __pyx_v_nanosecond, PyObject *__pyx_v_tzinfo) {
  PyObject *__pyx_v_my_tz = NULL;
  PyObject *__pyx_v_pt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("replace", 0);
  __Pyx_INCREF(__pyx_v_tzinfo);

  /* "cytimes/pddt.py":1623
 *         """
 *         # Access my_tzinfo
 *         my_tz = self.tzinfo             # <<<<<<<<<<<<<<
 *         pt = self if my_tz is None else self.tz_localize(None)  # timezone-naive
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_my_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":1624
 *         # Access my_tzinfo
 *         my_tz = self.tzinfo
 *         pt = self if my_tz is None else self.tz_localize(None)  # timezone-naive             # <<<<<<<<<<<<<<
 * 
 *         # Replace datetime
 */
  __pyx_t_2 = (__pyx_v_my_tz == Py_None);
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_v_self);
    __pyx_t_1 = __pyx_v_self;
  } else {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tz_localize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, Py_None};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1624, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_pt = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":1627
 * 
 *         # Replace datetime
 *         pt = pt.to_datetime(             # <<<<<<<<<<<<<<
 *             year, month, day, hour, minute, second, microsecond, nanosecond
 *         )
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt, __pyx_n_s_to_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cytimes/pddt.py":1628
 *         # Replace datetime
 *         pt = pt.to_datetime(
 *             year, month, day, hour, minute, second, microsecond, nanosecond             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_month); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_hour); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_minute); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_second); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_microsecond); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_nanosecond); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_13)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_13);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[9] = {__pyx_t_13, __pyx_t_4, __pyx_t_5, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 8+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 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;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1627, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF_SET(__pyx_v_pt, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":1633
 *         # Replace timezone
 *         # . timezone-naive
 *         if my_tz is None:             # <<<<<<<<<<<<<<
 *             if isinstance(tzinfo, int):
 *                 return pt  # exit: keep naive
 */
  __pyx_t_2 = (__pyx_v_my_tz == Py_None);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":1634
 *         # . timezone-naive
 *         if my_tz is None:
 *             if isinstance(tzinfo, int):             # <<<<<<<<<<<<<<
 *                 return pt  # exit: keep naive
 *             tzinfo = utils.tz_parse(tzinfo)
 */
    __pyx_t_2 = PyInt_Check(__pyx_v_tzinfo); 
    if (__pyx_t_2) {

      /* "cytimes/pddt.py":1635
 *         if my_tz is None:
 *             if isinstance(tzinfo, int):
 *                 return pt  # exit: keep naive             # <<<<<<<<<<<<<<
 *             tzinfo = utils.tz_parse(tzinfo)
 *             if tzinfo is None:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_pt);
      __pyx_r = __pyx_v_pt;
      goto __pyx_L0;

      /* "cytimes/pddt.py":1634
 *         # . timezone-naive
 *         if my_tz is None:
 *             if isinstance(tzinfo, int):             # <<<<<<<<<<<<<<
 *                 return pt  # exit: keep naive
 *             tzinfo = utils.tz_parse(tzinfo)
 */
    }

    /* "cytimes/pddt.py":1636
 *             if isinstance(tzinfo, int):
 *                 return pt  # exit: keep naive
 *             tzinfo = utils.tz_parse(tzinfo)             # <<<<<<<<<<<<<<
 *             if tzinfo is None:
 *                 return pt  # exit: keep naive
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils_tz_parse(__pyx_v_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_tzinfo, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":1637
 *                 return pt  # exit: keep naive
 *             tzinfo = utils.tz_parse(tzinfo)
 *             if tzinfo is None:             # <<<<<<<<<<<<<<
 *                 return pt  # exit: keep naive
 *         # . timezone-aware
 */
    __pyx_t_2 = (__pyx_v_tzinfo == Py_None);
    if (__pyx_t_2) {

      /* "cytimes/pddt.py":1638
 *             tzinfo = utils.tz_parse(tzinfo)
 *             if tzinfo is None:
 *                 return pt  # exit: keep naive             # <<<<<<<<<<<<<<
 *         # . timezone-aware
 *         else:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_pt);
      __pyx_r = __pyx_v_pt;
      goto __pyx_L0;

      /* "cytimes/pddt.py":1637
 *                 return pt  # exit: keep naive
 *             tzinfo = utils.tz_parse(tzinfo)
 *             if tzinfo is None:             # <<<<<<<<<<<<<<
 *                 return pt  # exit: keep naive
 *         # . timezone-aware
 */
    }

    /* "cytimes/pddt.py":1633
 *         # Replace timezone
 *         # . timezone-naive
 *         if my_tz is None:             # <<<<<<<<<<<<<<
 *             if isinstance(tzinfo, int):
 *                 return pt  # exit: keep naive
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":1641
 *         # . timezone-aware
 *         else:
 *             if isinstance(tzinfo, int):             # <<<<<<<<<<<<<<
 *                 return pt.tz_localize(
 *                     my_tz, "infer", "shift_forward"
 */
  /*else*/ {
    __pyx_t_2 = PyInt_Check(__pyx_v_tzinfo); 
    if (__pyx_t_2) {

      /* "cytimes/pddt.py":1642
 *         else:
 *             if isinstance(tzinfo, int):
 *                 return pt.tz_localize(             # <<<<<<<<<<<<<<
 *                     my_tz, "infer", "shift_forward"
 *                 )  # exit: keep mytz
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt, __pyx_n_s_tz_localize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1642, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "cytimes/pddt.py":1643
 *             if isinstance(tzinfo, int):
 *                 return pt.tz_localize(
 *                     my_tz, "infer", "shift_forward"             # <<<<<<<<<<<<<<
 *                 )  # exit: keep mytz
 *             tzinfo = utils.tz_parse(tzinfo)
 */
      __pyx_t_12 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[4] = {__pyx_t_12, __pyx_v_my_tz, __pyx_n_u_infer, __pyx_n_u_shift_forward};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1642, __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;

      /* "cytimes/pddt.py":1641
 *         # . timezone-aware
 *         else:
 *             if isinstance(tzinfo, int):             # <<<<<<<<<<<<<<
 *                 return pt.tz_localize(
 *                     my_tz, "infer", "shift_forward"
 */
    }

    /* "cytimes/pddt.py":1645
 *                     my_tz, "infer", "shift_forward"
 *                 )  # exit: keep mytz
 *             tzinfo = utils.tz_parse(tzinfo)             # <<<<<<<<<<<<<<
 *             if tzinfo is None:
 *                 return pt  # exit: keep naive
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils_tz_parse(__pyx_v_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_tzinfo, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":1646
 *                 )  # exit: keep mytz
 *             tzinfo = utils.tz_parse(tzinfo)
 *             if tzinfo is None:             # <<<<<<<<<<<<<<
 *                 return pt  # exit: keep naive
 *         # . localize to new timezone
 */
    __pyx_t_2 = (__pyx_v_tzinfo == Py_None);
    if (__pyx_t_2) {

      /* "cytimes/pddt.py":1647
 *             tzinfo = utils.tz_parse(tzinfo)
 *             if tzinfo is None:
 *                 return pt  # exit: keep naive             # <<<<<<<<<<<<<<
 *         # . localize to new timezone
 *         return pt.tz_localize(tzinfo, "infer", "shift_forward")
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_pt);
      __pyx_r = __pyx_v_pt;
      goto __pyx_L0;

      /* "cytimes/pddt.py":1646
 *                 )  # exit: keep mytz
 *             tzinfo = utils.tz_parse(tzinfo)
 *             if tzinfo is None:             # <<<<<<<<<<<<<<
 *                 return pt  # exit: keep naive
 *         # . localize to new timezone
 */
    }
  }
  __pyx_L3:;

  /* "cytimes/pddt.py":1649
 *                 return pt  # exit: keep naive
 *         # . localize to new timezone
 *         return pt.tz_localize(tzinfo, "infer", "shift_forward")             # <<<<<<<<<<<<<<
 * 
 *     # . year
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt, __pyx_n_s_tz_localize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_12 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_12, __pyx_v_tzinfo, __pyx_n_u_infer, __pyx_n_u_shift_forward};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1649, __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;

  /* "cytimes/pddt.py":1593
 * 
 *     # Manipulator --------------------------------------------------------------------------
 *     def replace(             # <<<<<<<<<<<<<<
 *         self,
 *         year: cython.int = -1,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_my_tz);
  __Pyx_XDECREF(__pyx_v_pt);
  __Pyx_XDECREF(__pyx_v_tzinfo);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1652
 * 
 *     # . year
 *     def to_curr_year(             # <<<<<<<<<<<<<<
 *         self,
 *         month: int | str | None = None,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_63to_curr_year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_62to_curr_year, "Adjust the date to the specified month and day in the current year `<'Pddt'>`.\n\n        :param month `<'int/str/None'>`: Month value, defaults to `None`.\n            - `<'int'>` Month number (1=Jan...12=Dec).\n            - `<'str'>` Month name (case-insensitive), e.g., 'Jan', 'februar', '\344\270\211\346\234\210'.\n            - `<'None'>` Retains the original months.\n\n        :param day `<'int'>`: Day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_curr_year(\"Feb\", 31)  # The last day of February in the current year\n        >>> pt.to_curr_year(11)         # The same day of November in the current year\n        >>> pt.to_curr_year(day=1)      # The first day of the current month\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_63to_curr_year = {"to_curr_year", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_63to_curr_year, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_62to_curr_year};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_63to_curr_year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_month = 0;
  int __pyx_v_day;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_curr_year (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_month,&__pyx_n_s_day,0};

    /* "cytimes/pddt.py":1654
 *     def to_curr_year(
 *         self,
 *         month: int | str | None = None,             # <<<<<<<<<<<<<<
 *         day: cython.int = -1,
 *     ) -> Self:
 */
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1652, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_month);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1652, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_day);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1652, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_curr_year") < 0)) __PYX_ERR(0, 1652, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_month = values[1];
    if (values[2]) {
      __pyx_v_day = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_day == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1655, __pyx_L3_error)
    } else {
      __pyx_v_day = ((int)((int)-1));
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_curr_year", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 1652, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_curr_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_62to_curr_year(__pyx_self, __pyx_v_self, __pyx_v_month, __pyx_v_day);

  /* "cytimes/pddt.py":1652
 * 
 *     # . year
 *     def to_curr_year(             # <<<<<<<<<<<<<<
 *         self,
 *         month: int | str | None = None,
 */

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_62to_curr_year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_month, int __pyx_v_day) {
  int __pyx_v_mm;
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_my_unit = 0;
  PyArrayObject *__pyx_v_delta = 0;
  PyArrayObject *__pyx_v_times = NULL;
  PyArrayObject *__pyx_v_datesY = NULL;
  PyArrayObject *__pyx_v_datesM = NULL;
  PyArrayObject *__pyx_v_datesD = NULL;
  int __pyx_v_my_unit_ns;
  PyArrayObject *__pyx_v_dates = NULL;
  PyObject *__pyx_v_dtype = 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;
  unsigned int __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_times __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_10;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_11;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_month __pyx_t_12;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_day __pyx_t_13;
  struct __pyx_opt_args_7cytimes_5utils_arr_add_arr __pyx_t_14;
  int __pyx_t_15;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_16;
  int __pyx_t_17;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 __pyx_t_18;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_curr_year", 1);

  /* "cytimes/pddt.py":1674
 *         """
 *         # No month adjustment
 *         mm: cython.int = _parse_month(month, True)             # <<<<<<<<<<<<<<
 *         if mm == -1:
 *             return self.to_curr_month(day)
 */
  __pyx_t_1 = __pyx_f_7cytimes_4pddt__parse_month(__pyx_v_month, 1); if (unlikely(__pyx_t_1 == ((int)-2))) __PYX_ERR(0, 1674, __pyx_L1_error)
  __pyx_v_mm = __pyx_t_1;

  /* "cytimes/pddt.py":1675
 *         # No month adjustment
 *         mm: cython.int = _parse_month(month, True)
 *         if mm == -1:             # <<<<<<<<<<<<<<
 *             return self.to_curr_month(day)
 * 
 */
  __pyx_t_2 = (__pyx_v_mm == -1L);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":1676
 *         mm: cython.int = _parse_month(month, True)
 *         if mm == -1:
 *             return self.to_curr_month(day)             # <<<<<<<<<<<<<<
 * 
 *         # Access datetime array & info
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_curr_month); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1676, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1676, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1676, __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;

    /* "cytimes/pddt.py":1675
 *         # No month adjustment
 *         mm: cython.int = _parse_month(month, True)
 *         if mm == -1:             # <<<<<<<<<<<<<<
 *             return self.to_curr_month(day)
 * 
 */
  }

  /* "cytimes/pddt.py":1679
 * 
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 *         delta: np.ndarray
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1679, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":1680
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 *         delta: np.ndarray
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_3))) __PYX_ERR(0, 1680, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":1684
 * 
 *         # Seperate times
 *         times = utils.dt64arr_times(arr, my_unit)  # int64[my_unit]             # <<<<<<<<<<<<<<
 * 
 *         # Adjust dates
 */
  __pyx_t_8.__pyx_n = 1;
  __pyx_t_8.arr_unit = __pyx_v_my_unit;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_times(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_times = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":1687
 * 
 *         # Adjust dates
 *         datesY = utils.dt64arr_as_int64_Y(arr, my_unit)             # <<<<<<<<<<<<<<
 *         datesM = utils.dt64arr_as_int64_M(datesY, "Y", mm - 1)
 *         # . add back original day
 */
  __pyx_t_9.__pyx_n = 1;
  __pyx_t_9.arr_unit = __pyx_v_my_unit;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_datesY = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":1688
 *         # Adjust dates
 *         datesY = utils.dt64arr_as_int64_Y(arr, my_unit)
 *         datesM = utils.dt64arr_as_int64_M(datesY, "Y", mm - 1)             # <<<<<<<<<<<<<<
 *         # . add back original day
 *         if day < 1:
 */
  __pyx_t_10.__pyx_n = 2;
  __pyx_t_10.arr_unit = __pyx_n_u_Y;
  __pyx_t_10.offset = (__pyx_v_mm - 1);
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_datesY, &__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_datesM = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":1690
 *         datesM = utils.dt64arr_as_int64_M(datesY, "Y", mm - 1)
 *         # . add back original day
 *         if day < 1:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 */
  __pyx_t_2 = (__pyx_v_day < 1);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":1691
 *         # . add back original day
 *         if day < 1:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))
 */
    __pyx_t_11.__pyx_n = 1;
    __pyx_t_11.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1692
 *         if day < 1:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")             # <<<<<<<<<<<<<<
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 */
    __pyx_t_12.__pyx_n = 1;
    __pyx_t_12.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_in_month(__pyx_v_datesM, &__pyx_t_12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1693
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 *         # . first day
 */
    __pyx_t_13.__pyx_n = 1;
    __pyx_t_13.arr_unit = __pyx_v_my_unit;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_day(__pyx_v_arr, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_min_arr(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3), NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":1694
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]             # <<<<<<<<<<<<<<
 *         # . first day
 *         elif day == 1:
 */
    __pyx_t_14.__pyx_n = 1;
    __pyx_t_14.offset = -1LL;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesD, __pyx_v_delta, &__pyx_t_14)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":1690
 *         datesM = utils.dt64arr_as_int64_M(datesY, "Y", mm - 1)
 *         # . add back original day
 *         if day < 1:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 */
    goto __pyx_L4;
  }

  /* "cytimes/pddt.py":1696
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 *         # . first day
 *         elif day == 1:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 */
  __pyx_t_2 = (__pyx_v_day == 1);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":1697
 *         # . first day
 *         elif day == 1:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *         # . days before 29
 *         elif day < 29:
 */
    __pyx_t_11.__pyx_n = 1;
    __pyx_t_11.arr_unit = __pyx_n_u_M;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_11)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":1696
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 *         # . first day
 *         elif day == 1:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 */
    goto __pyx_L4;
  }

  /* "cytimes/pddt.py":1699
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 *         elif day < 29:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 */
  __pyx_t_2 = (__pyx_v_day < 29);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":1700
 *         # . days before 29
 *         elif day < 29:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]             # <<<<<<<<<<<<<<
 *         # . days before 31
 *         elif day < 31:
 */
    __pyx_t_11.__pyx_n = 2;
    __pyx_t_11.arr_unit = __pyx_n_u_M;
    __pyx_t_11.offset = (__pyx_v_day - 1);
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_11)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1700, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":1699
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 *         elif day < 29:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 */
    goto __pyx_L4;
  }

  /* "cytimes/pddt.py":1702
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 *         elif day < 31:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 */
  __pyx_t_2 = (__pyx_v_day < 31);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":1703
 *         # . days before 31
 *         elif day < 31:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min(delta, day)
 */
    __pyx_t_11.__pyx_n = 1;
    __pyx_t_11.arr_unit = __pyx_n_u_M;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_11)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":1704
 *         elif day < 31:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")             # <<<<<<<<<<<<<<
 *             delta = utils.arr_min(delta, day)
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 */
    __pyx_t_12.__pyx_n = 1;
    __pyx_t_12.arr_unit = __pyx_n_u_M;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_in_month(__pyx_v_datesM, &__pyx_t_12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1704, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":1705
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min(delta, day)             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 *         # . last day
 */
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_min(__pyx_v_delta, __pyx_v_day, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1705, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":1706
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min(delta, day)
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]             # <<<<<<<<<<<<<<
 *         # . last day
 *         else:
 */
    __pyx_t_14.__pyx_n = 1;
    __pyx_t_14.offset = -1LL;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesD, __pyx_v_delta, &__pyx_t_14)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":1702
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 *         elif day < 31:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 */
    goto __pyx_L4;
  }

  /* "cytimes/pddt.py":1709
 *         # . last day
 *         else:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 */
  /*else*/ {
    __pyx_t_11.__pyx_n = 1;
    __pyx_t_11.arr_unit = __pyx_n_u_M;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_11)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":1710
 *         else:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 * 
 */
    __pyx_t_12.__pyx_n = 1;
    __pyx_t_12.arr_unit = __pyx_n_u_M;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_in_month(__pyx_v_datesM, &__pyx_t_12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1710, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":1711
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]             # <<<<<<<<<<<<<<
 * 
 *         # Combine dates & times
 */
    __pyx_t_14.__pyx_n = 1;
    __pyx_t_14.offset = -1LL;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesD, __pyx_v_delta, &__pyx_t_14)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;
  }
  __pyx_L4:;

  /* "cytimes/pddt.py":1714
 * 
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"             # <<<<<<<<<<<<<<
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 */
  __pyx_v_my_unit_ns = (PyUnicode_READ_CHAR(__pyx_v_my_unit, 0) == 0x6E);

  /* "cytimes/pddt.py":1715
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
  if (__pyx_v_my_unit_ns) {
  } else {
    __pyx_t_2 = __pyx_v_my_unit_ns;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_16.__pyx_n = 1;
  __pyx_t_16.arr_unit = __pyx_n_u_D;
  __pyx_t_15 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_datesD, &__pyx_t_16); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1715, __pyx_L1_error)
  __pyx_t_17 = (!__pyx_t_15);
  __pyx_t_2 = __pyx_t_17;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":1716
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]             # <<<<<<<<<<<<<<
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"
 */
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_datesD, __pyx_v_7cytimes_5utils_US_DAY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":1717
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[us]"
 *         else:
 */
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_times, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1717, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":1718
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 */
    __Pyx_INCREF(__pyx_kp_u_datetime64_us);
    __pyx_v_dtype = __pyx_kp_u_datetime64_us;

    /* "cytimes/pddt.py":1715
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
    goto __pyx_L5;
  }

  /* "cytimes/pddt.py":1720
 *             dtype = "datetime64[us]"
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 */
  /*else*/ {
    __pyx_t_18.__pyx_n = 1;
    __pyx_t_18.arr_unit = __pyx_n_u_D;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_datesD, __pyx_v_my_unit, &__pyx_t_18)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":1721
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit             # <<<<<<<<<<<<<<
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 */
    __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_my_unit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_dtype = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
  }
  __pyx_L5:;

  /* "cytimes/pddt.py":1722
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_dates, __pyx_v_times, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_dtype};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1722, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
  __pyx_t_4 = 0;

  /* "cytimes/pddt.py":1723
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)             # <<<<<<<<<<<<<<
 * 
 *     def to_prev_year(
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_19.__pyx_n = 3;
  __pyx_t_19.tz = __pyx_t_4;
  __pyx_t_19.unit = ((PyObject*)Py_None);
  __pyx_t_19.name = __pyx_t_5;
  __pyx_t_3 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_19); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":1652
 * 
 *     # . year
 *     def to_curr_year(             # <<<<<<<<<<<<<<
 *         self,
 *         month: int | str | None = 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_6);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_curr_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_delta);
  __Pyx_XDECREF((PyObject *)__pyx_v_times);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesY);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesM);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesD);
  __Pyx_XDECREF((PyObject *)__pyx_v_dates);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1725
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_prev_year(             # <<<<<<<<<<<<<<
 *         self,
 *         month: int | str | None = None,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_65to_prev_year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_64to_prev_year, "Adjust the date to the specified month and day in the previous year `<'Pddt'>`.\n\n        :param month `<'int/str/None'>`: Month value, defaults to `None`.\n            - `<'int'>` Month number (1=Jan...12=Dec).\n            - `<'str'>` Month name (case-insensitive), e.g., 'Jan', 'februar', '\344\270\211\346\234\210'.\n            - `<'None'>` Retains the original months.\n\n        :param day `<'int'>`: Day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_prev_year(\"Feb\", 31)  # The last day of February in the previous year\n        >>> pt.to_prev_year(11)         # The same day of November in the previous year\n        >>> pt.to_prev_year(day=1)      # The first day of the current month in the previous year\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_65to_prev_year = {"to_prev_year", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_65to_prev_year, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_64to_prev_year};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_65to_prev_year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_month = 0;
  int __pyx_v_day;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_prev_year (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_month,&__pyx_n_s_day,0};

    /* "cytimes/pddt.py":1727
 *     def to_prev_year(
 *         self,
 *         month: int | str | None = None,             # <<<<<<<<<<<<<<
 *         day: cython.int = -1,
 *     ) -> Self:
 */
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1725, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_month);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1725, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_day);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1725, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_prev_year") < 0)) __PYX_ERR(0, 1725, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_month = values[1];
    if (values[2]) {
      __pyx_v_day = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_day == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1728, __pyx_L3_error)
    } else {
      __pyx_v_day = ((int)((int)-1));
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_prev_year", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 1725, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_prev_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_64to_prev_year(__pyx_self, __pyx_v_self, __pyx_v_month, __pyx_v_day);

  /* "cytimes/pddt.py":1725
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_prev_year(             # <<<<<<<<<<<<<<
 *         self,
 *         month: int | str | None = None,
 */

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_64to_prev_year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_month, int __pyx_v_day) {
  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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_prev_year", 1);

  /* "cytimes/pddt.py":1746
 *         >>> pt.to_prev_year(day=1)      # The first day of the current month in the previous year
 *         """
 *         return self.to_year(-1, month, day)             # <<<<<<<<<<<<<<
 * 
 *     def to_next_year(
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_year); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_int_neg_1, __pyx_v_month, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
    __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, 1746, __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;

  /* "cytimes/pddt.py":1725
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_prev_year(             # <<<<<<<<<<<<<<
 *         self,
 *         month: int | str | None = None,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_prev_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1748
 *         return self.to_year(-1, month, day)
 * 
 *     def to_next_year(             # <<<<<<<<<<<<<<
 *         self,
 *         month: int | str | None = None,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_67to_next_year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_66to_next_year, "Adjust the date to the specified month and day in the next year `<'Pddt'>`.\n\n        :param month `<'int/str/None'>`: Month value, defaults to `None`.\n            - `<'int'>` Month number (1=Jan...12=Dec).\n            - `<'str'>` Month name (case-insensitive), e.g., 'Jan', 'februar', '\344\270\211\346\234\210'.\n            - `<'None'>` Retains the original months.\n\n        :param day `<'int'>`: Day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_next_year(\"Feb\", 31)  # The last day of February in the next year\n        >>> pt.to_next_year(11)         # The same day of November in the next year\n        >>> pt.to_next_year(day=1)      # The first day of the current month in the next year\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_67to_next_year = {"to_next_year", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_67to_next_year, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_66to_next_year};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_67to_next_year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_month = 0;
  int __pyx_v_day;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_next_year (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_month,&__pyx_n_s_day,0};

    /* "cytimes/pddt.py":1750
 *     def to_next_year(
 *         self,
 *         month: int | str | None = None,             # <<<<<<<<<<<<<<
 *         day: cython.int = -1,
 *     ) -> Self:
 */
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1748, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_month);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1748, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_day);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1748, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_next_year") < 0)) __PYX_ERR(0, 1748, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_month = values[1];
    if (values[2]) {
      __pyx_v_day = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_day == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1751, __pyx_L3_error)
    } else {
      __pyx_v_day = ((int)((int)-1));
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_next_year", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 1748, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_next_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_66to_next_year(__pyx_self, __pyx_v_self, __pyx_v_month, __pyx_v_day);

  /* "cytimes/pddt.py":1748
 *         return self.to_year(-1, month, day)
 * 
 *     def to_next_year(             # <<<<<<<<<<<<<<
 *         self,
 *         month: int | str | None = None,
 */

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_66to_next_year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_month, int __pyx_v_day) {
  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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_next_year", 1);

  /* "cytimes/pddt.py":1769
 *         >>> pt.to_next_year(day=1)      # The first day of the current month in the next year
 *         """
 *         return self.to_year(1, month, day)             # <<<<<<<<<<<<<<
 * 
 *     def to_year(
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_year); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_int_1, __pyx_v_month, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
    __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, 1769, __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;

  /* "cytimes/pddt.py":1748
 *         return self.to_year(-1, month, day)
 * 
 *     def to_next_year(             # <<<<<<<<<<<<<<
 *         self,
 *         month: int | str | None = None,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_next_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1771
 *         return self.to_year(1, month, day)
 * 
 *     def to_year(             # <<<<<<<<<<<<<<
 *         self,
 *         offset: cython.int,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_69to_year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_68to_year, "Adjust the date to the specified month and day in the year (+/-) offset `<'Pddt'>`.\n\n        :param offset `<'int'>`: The year offset (+/-).\n\n        :param month `<'int/str/None'>`: Month value, defaults to `None`.\n            - `<'int'>` Month number (1=Jan...12=Dec).\n            - `<'str'>` Month name (case-insensitive), e.g., 'Jan', 'februar', '\344\270\211\346\234\210'.\n            - `<'None'>` Retains the original months.\n\n        :param day `<'int'>`: Day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_year(-2, \"Feb\", 31)  # The last day of February, two years ago\n        >>> pt.to_year(2, 11)          # The same day of November, two years later\n        >>> pt.to_year(2, day=1)       # The first day of the current month, two years later\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_69to_year = {"to_year", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_69to_year, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_68to_year};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_69to_year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_offset;
  PyObject *__pyx_v_month = 0;
  int __pyx_v_day;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_year (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_offset,&__pyx_n_s_month,&__pyx_n_s_day,0};

    /* "cytimes/pddt.py":1774
 *         self,
 *         offset: cython.int,
 *         month: int | str | None = None,             # <<<<<<<<<<<<<<
 *         day: cython.int = -1,
 *     ) -> Self:
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1771, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1771, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("to_year", 0, 2, 4, 1); __PYX_ERR(0, 1771, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_month);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1771, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_day);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1771, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_year") < 0)) __PYX_ERR(0, 1771, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_offset = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1773, __pyx_L3_error)
    __pyx_v_month = values[2];
    if (values[3]) {
      __pyx_v_day = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_day == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1775, __pyx_L3_error)
    } else {
      __pyx_v_day = ((int)((int)-1));
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_year", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1771, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_68to_year(__pyx_self, __pyx_v_self, __pyx_v_offset, __pyx_v_month, __pyx_v_day);

  /* "cytimes/pddt.py":1771
 *         return self.to_year(1, month, day)
 * 
 *     def to_year(             # <<<<<<<<<<<<<<
 *         self,
 *         offset: cython.int,
 */

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_68to_year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_offset, PyObject *__pyx_v_month, int __pyx_v_day) {
  int __pyx_v_mm;
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_my_unit = 0;
  PyArrayObject *__pyx_v_delta = 0;
  PyArrayObject *__pyx_v_times = NULL;
  PyArrayObject *__pyx_v_datesY = NULL;
  PyArrayObject *__pyx_v_datesM = NULL;
  PyArrayObject *__pyx_v_datesD = NULL;
  int __pyx_v_my_unit_ns;
  PyArrayObject *__pyx_v_dates = NULL;
  PyObject *__pyx_v_dtype = 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;
  unsigned int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_times __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_10;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_month __pyx_t_11;
  struct __pyx_opt_args_7cytimes_5utils_arr_add_arr __pyx_t_12;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_13;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_month __pyx_t_14;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_day __pyx_t_15;
  int __pyx_t_16;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_17;
  int __pyx_t_18;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 __pyx_t_19;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_year", 1);

  /* "cytimes/pddt.py":1796
 *         """
 *         # No offset
 *         if offset == 0:             # <<<<<<<<<<<<<<
 *             return self.to_curr_year(month, day)
 *         mm: cython.int = _parse_month(month, True)
 */
  __pyx_t_1 = (__pyx_v_offset == 0);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1797
 *         # No offset
 *         if offset == 0:
 *             return self.to_curr_year(month, day)             # <<<<<<<<<<<<<<
 *         mm: cython.int = _parse_month(month, True)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_curr_year); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1797, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1797, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_month, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1797, __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;

    /* "cytimes/pddt.py":1796
 *         """
 *         # No offset
 *         if offset == 0:             # <<<<<<<<<<<<<<
 *             return self.to_curr_year(month, day)
 *         mm: cython.int = _parse_month(month, True)
 */
  }

  /* "cytimes/pddt.py":1798
 *         if offset == 0:
 *             return self.to_curr_year(month, day)
 *         mm: cython.int = _parse_month(month, True)             # <<<<<<<<<<<<<<
 * 
 *         # Access datetime array & info
 */
  __pyx_t_7 = __pyx_f_7cytimes_4pddt__parse_month(__pyx_v_month, 1); if (unlikely(__pyx_t_7 == ((int)-2))) __PYX_ERR(0, 1798, __pyx_L1_error)
  __pyx_v_mm = __pyx_t_7;

  /* "cytimes/pddt.py":1801
 * 
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 *         delta: np.ndarray
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1801, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1801, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":1802
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 *         delta: np.ndarray
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 1802, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":1806
 * 
 *         # Seperate times
 *         times = utils.dt64arr_times(arr, my_unit)  # int64[my_unit]             # <<<<<<<<<<<<<<
 * 
 *         # Adjust dates
 */
  __pyx_t_8.__pyx_n = 1;
  __pyx_t_8.arr_unit = __pyx_v_my_unit;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_times(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_times = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":1809
 * 
 *         # Adjust dates
 *         datesY = utils.dt64arr_as_int64_Y(arr, my_unit, offset)  # int64[Y]+off             # <<<<<<<<<<<<<<
 *         datesM = utils.dt64arr_as_int64_M(datesY, "Y")  # int64[M]
 *         if mm == -1:
 */
  __pyx_t_9.__pyx_n = 2;
  __pyx_t_9.arr_unit = __pyx_v_my_unit;
  __pyx_t_9.offset = __pyx_v_offset;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_datesY = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":1810
 *         # Adjust dates
 *         datesY = utils.dt64arr_as_int64_Y(arr, my_unit, offset)  # int64[Y]+off
 *         datesM = utils.dt64arr_as_int64_M(datesY, "Y")  # int64[M]             # <<<<<<<<<<<<<<
 *         if mm == -1:
 *             delta = utils.dt64arr_month(arr, my_unit)
 */
  __pyx_t_10.__pyx_n = 1;
  __pyx_t_10.arr_unit = __pyx_n_u_Y;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_datesY, &__pyx_t_10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_datesM = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":1811
 *         datesY = utils.dt64arr_as_int64_Y(arr, my_unit, offset)  # int64[Y]+off
 *         datesM = utils.dt64arr_as_int64_M(datesY, "Y")  # int64[M]
 *         if mm == -1:             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_month(arr, my_unit)
 *             datesM = utils.arr_add_arr(datesM, delta, -1)  # int64[M]
 */
  __pyx_t_1 = (__pyx_v_mm == -1L);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1812
 *         datesM = utils.dt64arr_as_int64_M(datesY, "Y")  # int64[M]
 *         if mm == -1:
 *             delta = utils.dt64arr_month(arr, my_unit)             # <<<<<<<<<<<<<<
 *             datesM = utils.arr_add_arr(datesM, delta, -1)  # int64[M]
 *         else:
 */
    __pyx_t_11.__pyx_n = 1;
    __pyx_t_11.arr_unit = __pyx_v_my_unit;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_month(__pyx_v_arr, &__pyx_t_11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":1813
 *         if mm == -1:
 *             delta = utils.dt64arr_month(arr, my_unit)
 *             datesM = utils.arr_add_arr(datesM, delta, -1)  # int64[M]             # <<<<<<<<<<<<<<
 *         else:
 *             datesM = utils.arr_add(datesM, mm - 1)  # int64[M]
 */
    __pyx_t_12.__pyx_n = 1;
    __pyx_t_12.offset = -1LL;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesM, __pyx_v_delta, &__pyx_t_12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_datesM, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":1811
 *         datesY = utils.dt64arr_as_int64_Y(arr, my_unit, offset)  # int64[Y]+off
 *         datesM = utils.dt64arr_as_int64_M(datesY, "Y")  # int64[M]
 *         if mm == -1:             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_month(arr, my_unit)
 *             datesM = utils.arr_add_arr(datesM, delta, -1)  # int64[M]
 */
    goto __pyx_L4;
  }

  /* "cytimes/pddt.py":1815
 *             datesM = utils.arr_add_arr(datesM, delta, -1)  # int64[M]
 *         else:
 *             datesM = utils.arr_add(datesM, mm - 1)  # int64[M]             # <<<<<<<<<<<<<<
 *         # . add back original day
 *         if day < 1:
 */
  /*else*/ {
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_datesM, (__pyx_v_mm - 1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1815, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_datesM, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;
  }
  __pyx_L4:;

  /* "cytimes/pddt.py":1817
 *             datesM = utils.arr_add(datesM, mm - 1)  # int64[M]
 *         # . add back original day
 *         if day < 1:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 */
  __pyx_t_1 = (__pyx_v_day < 1);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1818
 *         # . add back original day
 *         if day < 1:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))
 */
    __pyx_t_13.__pyx_n = 1;
    __pyx_t_13.arr_unit = __pyx_n_u_M;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1818, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":1819
 *         if day < 1:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")             # <<<<<<<<<<<<<<
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 */
    __pyx_t_14.__pyx_n = 1;
    __pyx_t_14.arr_unit = __pyx_n_u_M;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_in_month(__pyx_v_datesM, &__pyx_t_14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":1820
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 *         # . first day
 */
    __pyx_t_15.__pyx_n = 1;
    __pyx_t_15.arr_unit = __pyx_v_my_unit;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_day(__pyx_v_arr, &__pyx_t_15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1820, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_min_arr(__pyx_v_delta, ((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1820, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1821
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]             # <<<<<<<<<<<<<<
 *         # . first day
 *         elif day == 1:
 */
    __pyx_t_12.__pyx_n = 1;
    __pyx_t_12.offset = -1LL;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesD, __pyx_v_delta, &__pyx_t_12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1817
 *             datesM = utils.arr_add(datesM, mm - 1)  # int64[M]
 *         # . add back original day
 *         if day < 1:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 */
    goto __pyx_L5;
  }

  /* "cytimes/pddt.py":1823
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 *         # . first day
 *         elif day == 1:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 */
  __pyx_t_1 = (__pyx_v_day == 1);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1824
 *         # . first day
 *         elif day == 1:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *         # . days before 29
 *         elif day < 29:
 */
    __pyx_t_13.__pyx_n = 1;
    __pyx_t_13.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1823
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 *         # . first day
 *         elif day == 1:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 */
    goto __pyx_L5;
  }

  /* "cytimes/pddt.py":1826
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 *         elif day < 29:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 */
  __pyx_t_1 = (__pyx_v_day < 29);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1827
 *         # . days before 29
 *         elif day < 29:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]             # <<<<<<<<<<<<<<
 *         # . days before 31
 *         elif day < 31:
 */
    __pyx_t_13.__pyx_n = 2;
    __pyx_t_13.arr_unit = __pyx_n_u_M;
    __pyx_t_13.offset = (__pyx_v_day - 1);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1826
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 *         elif day < 29:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 */
    goto __pyx_L5;
  }

  /* "cytimes/pddt.py":1829
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 *         elif day < 31:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 */
  __pyx_t_1 = (__pyx_v_day < 31);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1830
 *         # . days before 31
 *         elif day < 31:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min(delta, day)
 */
    __pyx_t_13.__pyx_n = 1;
    __pyx_t_13.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1831
 *         elif day < 31:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")             # <<<<<<<<<<<<<<
 *             delta = utils.arr_min(delta, day)
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 */
    __pyx_t_14.__pyx_n = 1;
    __pyx_t_14.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_in_month(__pyx_v_datesM, &__pyx_t_14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1831, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1832
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min(delta, day)             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 *         # . last day
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_min(__pyx_v_delta, __pyx_v_day, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1832, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1833
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min(delta, day)
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]             # <<<<<<<<<<<<<<
 *         # . last day
 *         else:
 */
    __pyx_t_12.__pyx_n = 1;
    __pyx_t_12.offset = -1LL;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesD, __pyx_v_delta, &__pyx_t_12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1829
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 *         elif day < 31:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 */
    goto __pyx_L5;
  }

  /* "cytimes/pddt.py":1836
 *         # . last day
 *         else:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 */
  /*else*/ {
    __pyx_t_13.__pyx_n = 1;
    __pyx_t_13.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1836, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1837
 *         else:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 * 
 */
    __pyx_t_14.__pyx_n = 1;
    __pyx_t_14.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_in_month(__pyx_v_datesM, &__pyx_t_14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1838
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]             # <<<<<<<<<<<<<<
 * 
 *         # Combine dates & times
 */
    __pyx_t_12.__pyx_n = 1;
    __pyx_t_12.offset = -1LL;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesD, __pyx_v_delta, &__pyx_t_12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;
  }
  __pyx_L5:;

  /* "cytimes/pddt.py":1841
 * 
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"             # <<<<<<<<<<<<<<
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 */
  __pyx_v_my_unit_ns = (PyUnicode_READ_CHAR(__pyx_v_my_unit, 0) == 0x6E);

  /* "cytimes/pddt.py":1842
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
  if (__pyx_v_my_unit_ns) {
  } else {
    __pyx_t_1 = __pyx_v_my_unit_ns;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_17.__pyx_n = 1;
  __pyx_t_17.arr_unit = __pyx_n_u_D;
  __pyx_t_16 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_datesD, &__pyx_t_17); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 1842, __pyx_L1_error)
  __pyx_t_18 = (!__pyx_t_16);
  __pyx_t_1 = __pyx_t_18;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1843
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]             # <<<<<<<<<<<<<<
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_datesD, __pyx_v_7cytimes_5utils_US_DAY, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1844
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[us]"
 *         else:
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_times, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1844, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1845
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 */
    __Pyx_INCREF(__pyx_kp_u_datetime64_us);
    __pyx_v_dtype = __pyx_kp_u_datetime64_us;

    /* "cytimes/pddt.py":1842
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
    goto __pyx_L6;
  }

  /* "cytimes/pddt.py":1847
 *             dtype = "datetime64[us]"
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 */
  /*else*/ {
    __pyx_t_19.__pyx_n = 1;
    __pyx_t_19.arr_unit = __pyx_n_u_D;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_datesD, __pyx_v_my_unit, &__pyx_t_19)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1847, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1848
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit             # <<<<<<<<<<<<<<
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 */
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_my_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_dtype = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L6:;

  /* "cytimes/pddt.py":1849
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_dates, __pyx_v_times, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_dtype};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1849, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1849, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":1850
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)             # <<<<<<<<<<<<<<
 * 
 *     # . quarter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_20.__pyx_n = 3;
  __pyx_t_20.tz = __pyx_t_3;
  __pyx_t_20.unit = ((PyObject*)Py_None);
  __pyx_t_20.name = __pyx_t_4;
  __pyx_t_2 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_20); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":1771
 *         return self.to_year(1, month, day)
 * 
 *     def to_year(             # <<<<<<<<<<<<<<
 *         self,
 *         offset: cython.int,
 */

  /* 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("cytimes.pddt.Pddt.to_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_delta);
  __Pyx_XDECREF((PyObject *)__pyx_v_times);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesY);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesM);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesD);
  __Pyx_XDECREF((PyObject *)__pyx_v_dates);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1853
 * 
 *     # . quarter
 *     def to_curr_quarter(self, month: cython.int = -1, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified month and day in the current quarter. `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_71to_curr_quarter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_70to_curr_quarter, "Adjust the date to the specified month and day in the current quarter. `<'Pddt'>`.\n\n        :param month `<'int'>`: Month (1-3) of the quarter, defaults to `-1`.\n            If `-1`, retains the original months of the quarter.\n\n        :param day `<'int'>`: Day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_curr_quarter(1, 31)  # The last day of the first quarter month in the current quarter\n        >>> pt.to_curr_quarter(2)      # The same day of the second quarter month in the current quarter\n        >>> pt.to_curr_quarter(day=1)  # The first day of the current quarter month in the current quarter\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_71to_curr_quarter = {"to_curr_quarter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_71to_curr_quarter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_70to_curr_quarter};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_71to_curr_quarter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_month;
  int __pyx_v_day;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_curr_quarter (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_month,&__pyx_n_s_day,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1853, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_month);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1853, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_day);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1853, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_curr_quarter") < 0)) __PYX_ERR(0, 1853, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    if (values[1]) {
      __pyx_v_month = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_month == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1853, __pyx_L3_error)
    } else {
      __pyx_v_month = ((int)((int)-1));
    }
    if (values[2]) {
      __pyx_v_day = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_day == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1853, __pyx_L3_error)
    } else {
      __pyx_v_day = ((int)((int)-1));
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_curr_quarter", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 1853, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_curr_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_70to_curr_quarter(__pyx_self, __pyx_v_self, __pyx_v_month, __pyx_v_day);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_70to_curr_quarter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_month, int __pyx_v_day) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_my_unit = 0;
  PyArrayObject *__pyx_v_times = NULL;
  PyArrayObject *__pyx_v_datesQ = NULL;
  PyArrayObject *__pyx_v_datesM = NULL;
  PyArrayObject *__pyx_v_datesD = NULL;
  PyArrayObject *__pyx_v_delta = NULL;
  int __pyx_v_my_unit_ns;
  PyArrayObject *__pyx_v_dates = NULL;
  PyObject *__pyx_v_dtype = 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;
  unsigned int __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_times __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Q __pyx_t_8;
  long __pyx_t_9;
  int __pyx_t_10;
  long __pyx_t_11;
  struct __pyx_opt_args_7cytimes_5utils_arr_mul __pyx_t_12;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_13;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_month __pyx_t_14;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_day __pyx_t_15;
  struct __pyx_opt_args_7cytimes_5utils_arr_add_arr __pyx_t_16;
  int __pyx_t_17;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_18;
  int __pyx_t_19;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 __pyx_t_20;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_curr_quarter", 1);

  /* "cytimes/pddt.py":1869
 *         """
 *         # No month adjustment
 *         if month < 1:             # <<<<<<<<<<<<<<
 *             return self.to_curr_month(day)
 * 
 */
  __pyx_t_1 = (__pyx_v_month < 1);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1870
 *         # No month adjustment
 *         if month < 1:
 *             return self.to_curr_month(day)             # <<<<<<<<<<<<<<
 * 
 *         # Access datetime array & info
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_curr_month); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1870, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1870, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1870, __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;

    /* "cytimes/pddt.py":1869
 *         """
 *         # No month adjustment
 *         if month < 1:             # <<<<<<<<<<<<<<
 *             return self.to_curr_month(day)
 * 
 */
  }

  /* "cytimes/pddt.py":1873
 * 
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1873, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":1874
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 * 
 *         # Seperate times
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 1874, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":1877
 * 
 *         # Seperate times
 *         times = utils.dt64arr_times(arr, my_unit)  # int64[my_unit]             # <<<<<<<<<<<<<<
 * 
 *         # Adjust dates
 */
  __pyx_t_7.__pyx_n = 1;
  __pyx_t_7.arr_unit = __pyx_v_my_unit;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_times(__pyx_v_arr, &__pyx_t_7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_times = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":1880
 * 
 *         # Adjust dates
 *         datesQ = utils.dt64arr_as_int64_Q(arr, my_unit)  # int64[Q]             # <<<<<<<<<<<<<<
 *         datesM = utils.arr_mul(datesQ, 3, min(month, 3) - 1)  # int64[M]+Moff
 *         # . add back original day
 */
  __pyx_t_8.__pyx_n = 1;
  __pyx_t_8.arr_unit = __pyx_v_my_unit;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Q(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_datesQ = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":1881
 *         # Adjust dates
 *         datesQ = utils.dt64arr_as_int64_Q(arr, my_unit)  # int64[Q]
 *         datesM = utils.arr_mul(datesQ, 3, min(month, 3) - 1)  # int64[M]+Moff             # <<<<<<<<<<<<<<
 *         # . add back original day
 *         if day < 1:
 */
  __pyx_t_9 = 3;
  __pyx_t_10 = __pyx_v_month;
  __pyx_t_1 = (__pyx_t_9 < __pyx_t_10);
  if (__pyx_t_1) {
    __pyx_t_11 = __pyx_t_9;
  } else {
    __pyx_t_11 = __pyx_t_10;
  }
  __pyx_t_12.__pyx_n = 1;
  __pyx_t_12.offset = (__pyx_t_11 - 1);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_datesQ, 3, &__pyx_t_12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_datesM = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":1883
 *         datesM = utils.arr_mul(datesQ, 3, min(month, 3) - 1)  # int64[M]+Moff
 *         # . add back original day
 *         if day < 1:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 */
  __pyx_t_1 = (__pyx_v_day < 1);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1884
 *         # . add back original day
 *         if day < 1:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))
 */
    __pyx_t_13.__pyx_n = 1;
    __pyx_t_13.arr_unit = __pyx_n_u_M;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1884, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":1885
 *         if day < 1:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")             # <<<<<<<<<<<<<<
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 */
    __pyx_t_14.__pyx_n = 1;
    __pyx_t_14.arr_unit = __pyx_n_u_M;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_in_month(__pyx_v_datesM, &__pyx_t_14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1885, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":1886
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 *         # . first day
 */
    __pyx_t_15.__pyx_n = 1;
    __pyx_t_15.arr_unit = __pyx_v_my_unit;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_day(__pyx_v_arr, &__pyx_t_15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_min_arr(__pyx_v_delta, ((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1887
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]             # <<<<<<<<<<<<<<
 *         # . first day
 *         elif day == 1:
 */
    __pyx_t_16.__pyx_n = 1;
    __pyx_t_16.offset = -1LL;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesD, __pyx_v_delta, &__pyx_t_16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1887, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1883
 *         datesM = utils.arr_mul(datesQ, 3, min(month, 3) - 1)  # int64[M]+Moff
 *         # . add back original day
 *         if day < 1:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 */
    goto __pyx_L4;
  }

  /* "cytimes/pddt.py":1889
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 *         # . first day
 *         elif day == 1:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 */
  __pyx_t_1 = (__pyx_v_day == 1);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1890
 *         # . first day
 *         elif day == 1:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *         # . days before 29
 *         elif day < 29:
 */
    __pyx_t_13.__pyx_n = 1;
    __pyx_t_13.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1889
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 *         # . first day
 *         elif day == 1:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 */
    goto __pyx_L4;
  }

  /* "cytimes/pddt.py":1892
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 *         elif day < 29:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 */
  __pyx_t_1 = (__pyx_v_day < 29);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1893
 *         # . days before 29
 *         elif day < 29:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]             # <<<<<<<<<<<<<<
 *         # . days before 31
 *         elif day < 31:
 */
    __pyx_t_13.__pyx_n = 2;
    __pyx_t_13.arr_unit = __pyx_n_u_M;
    __pyx_t_13.offset = (__pyx_v_day - 1);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1892
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 *         elif day < 29:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 */
    goto __pyx_L4;
  }

  /* "cytimes/pddt.py":1895
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 *         elif day < 31:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 */
  __pyx_t_1 = (__pyx_v_day < 31);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1896
 *         # . days before 31
 *         elif day < 31:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min(delta, day)
 */
    __pyx_t_13.__pyx_n = 1;
    __pyx_t_13.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1896, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1897
 *         elif day < 31:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")             # <<<<<<<<<<<<<<
 *             delta = utils.arr_min(delta, day)
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 */
    __pyx_t_14.__pyx_n = 1;
    __pyx_t_14.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_in_month(__pyx_v_datesM, &__pyx_t_14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1897, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1898
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min(delta, day)             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 *         # . last day
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_min(__pyx_v_delta, __pyx_v_day, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1898, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1899
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min(delta, day)
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]             # <<<<<<<<<<<<<<
 *         # . last day
 *         else:
 */
    __pyx_t_16.__pyx_n = 1;
    __pyx_t_16.offset = -1LL;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesD, __pyx_v_delta, &__pyx_t_16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1895
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 *         elif day < 31:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 */
    goto __pyx_L4;
  }

  /* "cytimes/pddt.py":1902
 *         # . last day
 *         else:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 */
  /*else*/ {
    __pyx_t_13.__pyx_n = 1;
    __pyx_t_13.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1903
 *         else:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 * 
 */
    __pyx_t_14.__pyx_n = 1;
    __pyx_t_14.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_in_month(__pyx_v_datesM, &__pyx_t_14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1904
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]             # <<<<<<<<<<<<<<
 * 
 *         # Combine dates & times
 */
    __pyx_t_16.__pyx_n = 1;
    __pyx_t_16.offset = -1LL;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesD, __pyx_v_delta, &__pyx_t_16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1904, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;
  }
  __pyx_L4:;

  /* "cytimes/pddt.py":1907
 * 
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"             # <<<<<<<<<<<<<<
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 */
  __pyx_v_my_unit_ns = (PyUnicode_READ_CHAR(__pyx_v_my_unit, 0) == 0x6E);

  /* "cytimes/pddt.py":1908
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
  if (__pyx_v_my_unit_ns) {
  } else {
    __pyx_t_1 = __pyx_v_my_unit_ns;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_18.__pyx_n = 1;
  __pyx_t_18.arr_unit = __pyx_n_u_D;
  __pyx_t_17 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_datesD, &__pyx_t_18); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 1908, __pyx_L1_error)
  __pyx_t_19 = (!__pyx_t_17);
  __pyx_t_1 = __pyx_t_19;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1909
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]             # <<<<<<<<<<<<<<
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_datesD, __pyx_v_7cytimes_5utils_US_DAY, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1909, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1910
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[us]"
 *         else:
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_times, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1910, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1911
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 */
    __Pyx_INCREF(__pyx_kp_u_datetime64_us);
    __pyx_v_dtype = __pyx_kp_u_datetime64_us;

    /* "cytimes/pddt.py":1908
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
    goto __pyx_L5;
  }

  /* "cytimes/pddt.py":1913
 *             dtype = "datetime64[us]"
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 */
  /*else*/ {
    __pyx_t_20.__pyx_n = 1;
    __pyx_t_20.arr_unit = __pyx_n_u_D;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_datesD, __pyx_v_my_unit, &__pyx_t_20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1913, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1914
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit             # <<<<<<<<<<<<<<
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 */
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_my_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1914, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_dtype = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L5:;

  /* "cytimes/pddt.py":1915
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_dates, __pyx_v_times, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_dtype};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1915, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1915, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":1916
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)             # <<<<<<<<<<<<<<
 * 
 *     def to_prev_quarter(self, month: cython.int = -1, day: cython.int = -1) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_21.__pyx_n = 3;
  __pyx_t_21.tz = __pyx_t_3;
  __pyx_t_21.unit = ((PyObject*)Py_None);
  __pyx_t_21.name = __pyx_t_4;
  __pyx_t_2 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_21); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":1853
 * 
 *     # . quarter
 *     def to_curr_quarter(self, month: cython.int = -1, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified month and day in the current quarter. `<'Pddt'>`.
 * 
 */

  /* 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("cytimes.pddt.Pddt.to_curr_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_times);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesQ);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesM);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesD);
  __Pyx_XDECREF((PyObject *)__pyx_v_delta);
  __Pyx_XDECREF((PyObject *)__pyx_v_dates);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1918
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_prev_quarter(self, month: cython.int = -1, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified month and day in the previous quarter. `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_73to_prev_quarter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_72to_prev_quarter, "Adjust the date to the specified month and day in the previous quarter. `<'Pddt'>`.\n\n        :param month `<'int'>`: Month (1-3) of the quarter, defaults to `-1`.\n            If `-1`, retains the original months of the quarter.\n\n        :param day `<'int'>`: Day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_prev_quarter(1, 31)  # The last day of the first quarter month in the previous quarter\n        >>> pt.to_prev_quarter(2)      # The same day of the second quarter month in the previous quarter\n        >>> pt.to_prev_quarter(day=1)  # The first day of the current quarter month in the previous quarter\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_73to_prev_quarter = {"to_prev_quarter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_73to_prev_quarter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_72to_prev_quarter};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_73to_prev_quarter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_month;
  int __pyx_v_day;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_prev_quarter (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_month,&__pyx_n_s_day,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1918, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_month);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1918, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_day);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1918, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_prev_quarter") < 0)) __PYX_ERR(0, 1918, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    if (values[1]) {
      __pyx_v_month = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_month == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1918, __pyx_L3_error)
    } else {
      __pyx_v_month = ((int)((int)-1));
    }
    if (values[2]) {
      __pyx_v_day = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_day == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1918, __pyx_L3_error)
    } else {
      __pyx_v_day = ((int)((int)-1));
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_prev_quarter", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 1918, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_prev_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_72to_prev_quarter(__pyx_self, __pyx_v_self, __pyx_v_month, __pyx_v_day);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_72to_prev_quarter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_month, int __pyx_v_day) {
  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;
  unsigned int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_prev_quarter", 1);

  /* "cytimes/pddt.py":1933
 *         >>> pt.to_prev_quarter(day=1)  # The first day of the current quarter month in the previous quarter
 *         """
 *         return self.to_quarter(-1, month, day)             # <<<<<<<<<<<<<<
 * 
 *     def to_next_quarter(self, month: cython.int = -1, day: cython.int = -1) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_quarter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_month); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_int_neg_1, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1933, __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;

  /* "cytimes/pddt.py":1918
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_prev_quarter(self, month: cython.int = -1, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified month and day in the previous quarter. `<'Pddt'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_prev_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1935
 *         return self.to_quarter(-1, month, day)
 * 
 *     def to_next_quarter(self, month: cython.int = -1, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified month and day in the next quarter. `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_75to_next_quarter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_74to_next_quarter, "Adjust the date to the specified month and day in the next quarter. `<'Pddt'>`.\n\n        :param month `<'int'>`: Month (1-3) of the quarter, defaults to `-1`.\n            If `-1`, retains the original months of the quarter.\n\n        :param day `<'int'>`: Day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_next_quarter(1, 31)  # The last day of the first quarter month in the next quarter\n        >>> pt.to_next_quarter(2)      # The same day of the second quarter month in the next quarter\n        >>> pt.to_next_quarter(day=1)  # The first day of the current quarter month in the next quarter\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_75to_next_quarter = {"to_next_quarter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_75to_next_quarter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_74to_next_quarter};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_75to_next_quarter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_month;
  int __pyx_v_day;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_next_quarter (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_month,&__pyx_n_s_day,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1935, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_month);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1935, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_day);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1935, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_next_quarter") < 0)) __PYX_ERR(0, 1935, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    if (values[1]) {
      __pyx_v_month = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_month == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1935, __pyx_L3_error)
    } else {
      __pyx_v_month = ((int)((int)-1));
    }
    if (values[2]) {
      __pyx_v_day = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_day == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1935, __pyx_L3_error)
    } else {
      __pyx_v_day = ((int)((int)-1));
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_next_quarter", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 1935, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_next_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_74to_next_quarter(__pyx_self, __pyx_v_self, __pyx_v_month, __pyx_v_day);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_74to_next_quarter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_month, int __pyx_v_day) {
  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;
  unsigned int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_next_quarter", 1);

  /* "cytimes/pddt.py":1950
 *         >>> pt.to_next_quarter(day=1)  # The first day of the current quarter month in the next quarter
 *         """
 *         return self.to_quarter(1, month, day)             # <<<<<<<<<<<<<<
 * 
 *     def to_quarter(
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_quarter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_month); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_int_1, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1950, __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;

  /* "cytimes/pddt.py":1935
 *         return self.to_quarter(-1, month, day)
 * 
 *     def to_next_quarter(self, month: cython.int = -1, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified month and day in the next quarter. `<'Pddt'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_next_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":1952
 *         return self.to_quarter(1, month, day)
 * 
 *     def to_quarter(             # <<<<<<<<<<<<<<
 *         self,
 *         offset: cython.int,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_77to_quarter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_76to_quarter, "Adjust the date to the specified month and day in the quarter (+/-) 'offset'. `<'Pddt'>`.\n\n        :param offset `<'int'>`: The quarter offset (+/-).\n\n        :param month `<'int'>`: Month (1-3) of the quarter, defaults to `-1`.\n            If `-1`, retains the original months of the quarter.\n\n        :param day `<'int'>`: Day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_quarter(-2, 1, 31)  # The last day of the first quarter month, two quarters ago\n        >>> pt.to_quarter(2, 2)       # The same day of the second quarter month, two quarters later\n        >>> pt.to_quarter(2, day=1)   # The first day of the current quarter month, two quarters later\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_77to_quarter = {"to_quarter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_77to_quarter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_76to_quarter};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_77to_quarter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_offset;
  int __pyx_v_month;
  int __pyx_v_day;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_quarter (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_offset,&__pyx_n_s_month,&__pyx_n_s_day,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1952, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1952, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("to_quarter", 0, 2, 4, 1); __PYX_ERR(0, 1952, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_month);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1952, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_day);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1952, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_quarter") < 0)) __PYX_ERR(0, 1952, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_offset = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1954, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_month = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_month == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1955, __pyx_L3_error)
    } else {
      __pyx_v_month = ((int)((int)-1));
    }
    if (values[3]) {
      __pyx_v_day = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_day == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1956, __pyx_L3_error)
    } else {
      __pyx_v_day = ((int)((int)-1));
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_quarter", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1952, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_76to_quarter(__pyx_self, __pyx_v_self, __pyx_v_offset, __pyx_v_month, __pyx_v_day);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_76to_quarter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_offset, int __pyx_v_month, int __pyx_v_day) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_my_unit = 0;
  PyArrayObject *__pyx_v_times = NULL;
  PyArrayObject *__pyx_v_datesM = NULL;
  PyArrayObject *__pyx_v_datesQ = NULL;
  PyArrayObject *__pyx_v_datesD = NULL;
  PyArrayObject *__pyx_v_delta = NULL;
  int __pyx_v_my_unit_ns;
  PyArrayObject *__pyx_v_dates = NULL;
  PyObject *__pyx_v_dtype = 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;
  unsigned int __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_times __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Q __pyx_t_10;
  long __pyx_t_11;
  int __pyx_t_12;
  long __pyx_t_13;
  struct __pyx_opt_args_7cytimes_5utils_arr_mul __pyx_t_14;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_15;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_month __pyx_t_16;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_day __pyx_t_17;
  struct __pyx_opt_args_7cytimes_5utils_arr_add_arr __pyx_t_18;
  int __pyx_t_19;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_20;
  int __pyx_t_21;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 __pyx_t_22;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_23;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_quarter", 1);

  /* "cytimes/pddt.py":1975
 *         """
 *         # No offset
 *         if offset == 0:             # <<<<<<<<<<<<<<
 *             return self.to_curr_quarter(month, day)
 * 
 */
  __pyx_t_1 = (__pyx_v_offset == 0);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1976
 *         # No offset
 *         if offset == 0:
 *             return self.to_curr_quarter(month, day)             # <<<<<<<<<<<<<<
 * 
 *         # Access datetime array & info
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_curr_quarter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1976, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_month); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1976, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1976, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1976, __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;

    /* "cytimes/pddt.py":1975
 *         """
 *         # No offset
 *         if offset == 0:             # <<<<<<<<<<<<<<
 *             return self.to_curr_quarter(month, day)
 * 
 */
  }

  /* "cytimes/pddt.py":1979
 * 
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1979, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":1980
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 * 
 *         # Seperate times
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 1980, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":1983
 * 
 *         # Seperate times
 *         times = utils.dt64arr_times(arr, my_unit)  # int64[my_unit]             # <<<<<<<<<<<<<<
 * 
 *         # Adjust dates
 */
  __pyx_t_8.__pyx_n = 1;
  __pyx_t_8.arr_unit = __pyx_v_my_unit;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_times(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_times = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":1986
 * 
 *         # Adjust dates
 *         if month < 1:             # <<<<<<<<<<<<<<
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit, offset * 3)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_month < 1);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1987
 *         # Adjust dates
 *         if month < 1:
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit, offset * 3)             # <<<<<<<<<<<<<<
 *         else:
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit)
 */
    __pyx_t_9.__pyx_n = 2;
    __pyx_t_9.arr_unit = __pyx_v_my_unit;
    __pyx_t_9.offset = (__pyx_v_offset * 3);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_arr, &__pyx_t_9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_datesM = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":1986
 * 
 *         # Adjust dates
 *         if month < 1:             # <<<<<<<<<<<<<<
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit, offset * 3)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "cytimes/pddt.py":1989
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit, offset * 3)
 *         else:
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit)             # <<<<<<<<<<<<<<
 *             datesM = utils.arr_mul(datesQ, 3, offset * 3 + min(month, 3) - 1)
 *         # . add back original day
 */
  /*else*/ {
    __pyx_t_10.__pyx_n = 1;
    __pyx_t_10.arr_unit = __pyx_v_my_unit;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Q(__pyx_v_arr, &__pyx_t_10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_datesQ = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":1990
 *         else:
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit)
 *             datesM = utils.arr_mul(datesQ, 3, offset * 3 + min(month, 3) - 1)             # <<<<<<<<<<<<<<
 *         # . add back original day
 *         if day < 1:
 */
    __pyx_t_11 = 3;
    __pyx_t_12 = __pyx_v_month;
    __pyx_t_1 = (__pyx_t_11 < __pyx_t_12);
    if (__pyx_t_1) {
      __pyx_t_13 = __pyx_t_11;
    } else {
      __pyx_t_13 = __pyx_t_12;
    }
    __pyx_t_14.__pyx_n = 1;
    __pyx_t_14.offset = (((__pyx_v_offset * 3) + __pyx_t_13) - 1);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_datesQ, 3, &__pyx_t_14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1990, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_datesM = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L4:;

  /* "cytimes/pddt.py":1992
 *             datesM = utils.arr_mul(datesQ, 3, offset * 3 + min(month, 3) - 1)
 *         # . add back original day
 *         if day < 1:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 */
  __pyx_t_1 = (__pyx_v_day < 1);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1993
 *         # . add back original day
 *         if day < 1:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))
 */
    __pyx_t_15.__pyx_n = 1;
    __pyx_t_15.arr_unit = __pyx_n_u_M;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1993, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":1994
 *         if day < 1:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")             # <<<<<<<<<<<<<<
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 */
    __pyx_t_16.__pyx_n = 1;
    __pyx_t_16.arr_unit = __pyx_n_u_M;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_in_month(__pyx_v_datesM, &__pyx_t_16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1994, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":1995
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 *         # . first day
 */
    __pyx_t_17.__pyx_n = 1;
    __pyx_t_17.arr_unit = __pyx_v_my_unit;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_day(__pyx_v_arr, &__pyx_t_17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1995, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_min_arr(__pyx_v_delta, ((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1995, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1996
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]             # <<<<<<<<<<<<<<
 *         # . first day
 *         elif day == 1:
 */
    __pyx_t_18.__pyx_n = 1;
    __pyx_t_18.offset = -1LL;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesD, __pyx_v_delta, &__pyx_t_18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1992
 *             datesM = utils.arr_mul(datesQ, 3, offset * 3 + min(month, 3) - 1)
 *         # . add back original day
 *         if day < 1:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 */
    goto __pyx_L5;
  }

  /* "cytimes/pddt.py":1998
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 *         # . first day
 *         elif day == 1:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 */
  __pyx_t_1 = (__pyx_v_day == 1);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":1999
 *         # . first day
 *         elif day == 1:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *         # . days before 29
 *         elif day < 29:
 */
    __pyx_t_15.__pyx_n = 1;
    __pyx_t_15.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1999, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":1998
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 *         # . first day
 *         elif day == 1:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 */
    goto __pyx_L5;
  }

  /* "cytimes/pddt.py":2001
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 *         elif day < 29:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 */
  __pyx_t_1 = (__pyx_v_day < 29);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2002
 *         # . days before 29
 *         elif day < 29:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]             # <<<<<<<<<<<<<<
 *         # . days before 31
 *         elif day < 31:
 */
    __pyx_t_15.__pyx_n = 2;
    __pyx_t_15.arr_unit = __pyx_n_u_M;
    __pyx_t_15.offset = (__pyx_v_day - 1);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2002, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2001
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 *         elif day < 29:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 */
    goto __pyx_L5;
  }

  /* "cytimes/pddt.py":2004
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 *         elif day < 31:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 */
  __pyx_t_1 = (__pyx_v_day < 31);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2005
 *         # . days before 31
 *         elif day < 31:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min(delta, day)
 */
    __pyx_t_15.__pyx_n = 1;
    __pyx_t_15.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2006
 *         elif day < 31:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")             # <<<<<<<<<<<<<<
 *             delta = utils.arr_min(delta, day)
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 */
    __pyx_t_16.__pyx_n = 1;
    __pyx_t_16.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_in_month(__pyx_v_datesM, &__pyx_t_16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2007
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min(delta, day)             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 *         # . last day
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_min(__pyx_v_delta, __pyx_v_day, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2007, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2008
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min(delta, day)
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]             # <<<<<<<<<<<<<<
 *         # . last day
 *         else:
 */
    __pyx_t_18.__pyx_n = 1;
    __pyx_t_18.offset = -1LL;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesD, __pyx_v_delta, &__pyx_t_18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2008, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2004
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 *         elif day < 31:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 */
    goto __pyx_L5;
  }

  /* "cytimes/pddt.py":2011
 *         # . last day
 *         else:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 */
  /*else*/ {
    __pyx_t_15.__pyx_n = 1;
    __pyx_t_15.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2011, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2012
 *         else:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 * 
 */
    __pyx_t_16.__pyx_n = 1;
    __pyx_t_16.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_in_month(__pyx_v_datesM, &__pyx_t_16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2012, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2013
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]             # <<<<<<<<<<<<<<
 * 
 *         # Combine dates & times
 */
    __pyx_t_18.__pyx_n = 1;
    __pyx_t_18.offset = -1LL;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesD, __pyx_v_delta, &__pyx_t_18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2013, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;
  }
  __pyx_L5:;

  /* "cytimes/pddt.py":2016
 * 
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"             # <<<<<<<<<<<<<<
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 */
  __pyx_v_my_unit_ns = (PyUnicode_READ_CHAR(__pyx_v_my_unit, 0) == 0x6E);

  /* "cytimes/pddt.py":2017
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
  if (__pyx_v_my_unit_ns) {
  } else {
    __pyx_t_1 = __pyx_v_my_unit_ns;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_20.__pyx_n = 1;
  __pyx_t_20.arr_unit = __pyx_n_u_D;
  __pyx_t_19 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_datesD, &__pyx_t_20); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(0, 2017, __pyx_L1_error)
  __pyx_t_21 = (!__pyx_t_19);
  __pyx_t_1 = __pyx_t_21;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2018
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]             # <<<<<<<<<<<<<<
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_datesD, __pyx_v_7cytimes_5utils_US_DAY, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2018, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2019
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[us]"
 *         else:
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_times, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2019, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2020
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 */
    __Pyx_INCREF(__pyx_kp_u_datetime64_us);
    __pyx_v_dtype = __pyx_kp_u_datetime64_us;

    /* "cytimes/pddt.py":2017
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
    goto __pyx_L6;
  }

  /* "cytimes/pddt.py":2022
 *             dtype = "datetime64[us]"
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 */
  /*else*/ {
    __pyx_t_22.__pyx_n = 1;
    __pyx_t_22.arr_unit = __pyx_n_u_D;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_datesD, __pyx_v_my_unit, &__pyx_t_22)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2022, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2023
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit             # <<<<<<<<<<<<<<
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 */
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_my_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2023, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_dtype = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L6:;

  /* "cytimes/pddt.py":2024
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_dates, __pyx_v_times, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_dtype};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2024, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2024, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2025
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)             # <<<<<<<<<<<<<<
 * 
 *     # . month
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_23.__pyx_n = 3;
  __pyx_t_23.tz = __pyx_t_3;
  __pyx_t_23.unit = ((PyObject*)Py_None);
  __pyx_t_23.name = __pyx_t_5;
  __pyx_t_2 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_23); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":1952
 *         return self.to_quarter(1, month, day)
 * 
 *     def to_quarter(             # <<<<<<<<<<<<<<
 *         self,
 *         offset: cython.int,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_times);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesM);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesQ);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesD);
  __Pyx_XDECREF((PyObject *)__pyx_v_delta);
  __Pyx_XDECREF((PyObject *)__pyx_v_dates);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2028
 * 
 *     # . month
 *     def to_curr_month(self, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified day of the current month `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_79to_curr_month(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_78to_curr_month, "Adjust the date to the specified day of the current month `<'Pddt'>`.\n\n        :param day `<'int'>`: The day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_curr_month(31)  # The last day of the current month\n        >>> pt.to_curr_month(1)   # The first day of the current month\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_79to_curr_month = {"to_curr_month", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_79to_curr_month, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_78to_curr_month};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_79to_curr_month(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_day;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_curr_month (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_day,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2028, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_day);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2028, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_curr_month") < 0)) __PYX_ERR(0, 2028, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    if (values[1]) {
      __pyx_v_day = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_day == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2028, __pyx_L3_error)
    } else {
      __pyx_v_day = ((int)((int)-1));
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_curr_month", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2028, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_curr_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_78to_curr_month(__pyx_self, __pyx_v_self, __pyx_v_day);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_78to_curr_month(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_day) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_my_unit = 0;
  PyArrayObject *__pyx_v_delta = 0;
  PyArrayObject *__pyx_v_times = NULL;
  PyArrayObject *__pyx_v_datesM = NULL;
  PyArrayObject *__pyx_v_datesD = NULL;
  int __pyx_v_my_unit_ns;
  PyArrayObject *__pyx_v_dates = NULL;
  PyObject *__pyx_v_dtype = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_times __pyx_t_3;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_4;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_5;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_month __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils_arr_add_arr __pyx_t_7;
  int __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_9;
  int __pyx_t_10;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  unsigned int __pyx_t_14;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_curr_month", 1);

  /* "cytimes/pddt.py":2040
 *         """
 *         # No adjustment
 *         if day < 1:             # <<<<<<<<<<<<<<
 *             return self  # exit
 * 
 */
  __pyx_t_1 = (__pyx_v_day < 1);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2041
 *         # No adjustment
 *         if day < 1:
 *             return self  # exit             # <<<<<<<<<<<<<<
 * 
 *         # Access datetime array & info
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":2040
 *         """
 *         # No adjustment
 *         if day < 1:             # <<<<<<<<<<<<<<
 *             return self  # exit
 * 
 */
  }

  /* "cytimes/pddt.py":2044
 * 
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 *         delta: np.ndarray
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2044, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2045
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 *         delta: np.ndarray
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2045, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 2045, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2049
 * 
 *         # Seperate times
 *         times = utils.dt64arr_times(arr, my_unit)  # int64[my_unit]             # <<<<<<<<<<<<<<
 * 
 *         # Adjust dates
 */
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.arr_unit = __pyx_v_my_unit;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_times(__pyx_v_arr, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_times = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2052
 * 
 *         # Adjust dates
 *         datesM = utils.dt64arr_as_int64_M(arr, my_unit)  # int64[M]             # <<<<<<<<<<<<<<
 *         # . first day
 *         if day == 1:
 */
  __pyx_t_4.__pyx_n = 1;
  __pyx_t_4.arr_unit = __pyx_v_my_unit;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_arr, &__pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_datesM = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2054
 *         datesM = utils.dt64arr_as_int64_M(arr, my_unit)  # int64[M]
 *         # . first day
 *         if day == 1:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 */
  __pyx_t_1 = (__pyx_v_day == 1);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2055
 *         # . first day
 *         if day == 1:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *         # . days before 29
 *         elif day < 29:
 */
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.arr_unit = __pyx_n_u_M;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2055, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2054
 *         datesM = utils.dt64arr_as_int64_M(arr, my_unit)  # int64[M]
 *         # . first day
 *         if day == 1:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 */
    goto __pyx_L4;
  }

  /* "cytimes/pddt.py":2057
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 *         elif day < 29:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 */
  __pyx_t_1 = (__pyx_v_day < 29);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2058
 *         # . days before 29
 *         elif day < 29:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]             # <<<<<<<<<<<<<<
 *         # . days before 31
 *         elif day < 31:
 */
    __pyx_t_5.__pyx_n = 2;
    __pyx_t_5.arr_unit = __pyx_n_u_M;
    __pyx_t_5.offset = (__pyx_v_day - 1);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2058, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2057
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 *         elif day < 29:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 */
    goto __pyx_L4;
  }

  /* "cytimes/pddt.py":2060
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 *         elif day < 31:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 */
  __pyx_t_1 = (__pyx_v_day < 31);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2061
 *         # . days before 31
 *         elif day < 31:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min(delta, day)
 */
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.arr_unit = __pyx_n_u_M;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2062
 *         elif day < 31:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")             # <<<<<<<<<<<<<<
 *             delta = utils.arr_min(delta, day)
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.arr_unit = __pyx_n_u_M;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_in_month(__pyx_v_datesM, &__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2062, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2063
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min(delta, day)             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 *         # . last day
 */
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_min(__pyx_v_delta, __pyx_v_day, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2063, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2064
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min(delta, day)
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]             # <<<<<<<<<<<<<<
 *         # . last day
 *         else:
 */
    __pyx_t_7.__pyx_n = 1;
    __pyx_t_7.offset = -1LL;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesD, __pyx_v_delta, &__pyx_t_7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2060
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 *         elif day < 31:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 */
    goto __pyx_L4;
  }

  /* "cytimes/pddt.py":2067
 *         # . last day
 *         else:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 */
  /*else*/ {
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.arr_unit = __pyx_n_u_M;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2067, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2068
 *         else:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.arr_unit = __pyx_n_u_M;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_in_month(__pyx_v_datesM, &__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2068, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2069
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]             # <<<<<<<<<<<<<<
 * 
 *         # Combine dates & times
 */
    __pyx_t_7.__pyx_n = 1;
    __pyx_t_7.offset = -1LL;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesD, __pyx_v_delta, &__pyx_t_7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2069, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;
  }
  __pyx_L4:;

  /* "cytimes/pddt.py":2072
 * 
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"             # <<<<<<<<<<<<<<
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 */
  __pyx_v_my_unit_ns = (PyUnicode_READ_CHAR(__pyx_v_my_unit, 0) == 0x6E);

  /* "cytimes/pddt.py":2073
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
  if (__pyx_v_my_unit_ns) {
  } else {
    __pyx_t_1 = __pyx_v_my_unit_ns;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_9.__pyx_n = 1;
  __pyx_t_9.arr_unit = __pyx_n_u_D;
  __pyx_t_8 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_datesD, &__pyx_t_9); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 2073, __pyx_L1_error)
  __pyx_t_10 = (!__pyx_t_8);
  __pyx_t_1 = __pyx_t_10;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2074
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]             # <<<<<<<<<<<<<<
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"
 */
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_datesD, __pyx_v_7cytimes_5utils_US_DAY, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2074, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2075
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[us]"
 *         else:
 */
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_times, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2075, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2076
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 */
    __Pyx_INCREF(__pyx_kp_u_datetime64_us);
    __pyx_v_dtype = __pyx_kp_u_datetime64_us;

    /* "cytimes/pddt.py":2073
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
    goto __pyx_L5;
  }

  /* "cytimes/pddt.py":2078
 *             dtype = "datetime64[us]"
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 */
  /*else*/ {
    __pyx_t_11.__pyx_n = 1;
    __pyx_t_11.arr_unit = __pyx_n_u_D;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_datesD, __pyx_v_my_unit, &__pyx_t_11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2078, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2079
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit             # <<<<<<<<<<<<<<
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 */
    __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_my_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2079, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_dtype = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L5:;

  /* "cytimes/pddt.py":2080
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 */
  __pyx_t_12 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_dates, __pyx_v_times, NULL)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_astype); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = NULL;
  __pyx_t_14 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_13))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_13, function);
      __pyx_t_14 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_dtype};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2080, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2080, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2081
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)             # <<<<<<<<<<<<<<
 * 
 *     def to_prev_month(self, day: cython.int = -1) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_15.__pyx_n = 3;
  __pyx_t_15.tz = __pyx_t_2;
  __pyx_t_15.unit = ((PyObject*)Py_None);
  __pyx_t_15.name = __pyx_t_13;
  __pyx_t_12 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_15); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_r = __pyx_t_12;
  __pyx_t_12 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":2028
 * 
 *     # . month
 *     def to_curr_month(self, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified day of the current month `<'Pddt'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_curr_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_delta);
  __Pyx_XDECREF((PyObject *)__pyx_v_times);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesM);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesD);
  __Pyx_XDECREF((PyObject *)__pyx_v_dates);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2083
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_prev_month(self, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified day of the previous month `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_81to_prev_month(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_80to_prev_month, "Adjust the date to the specified day of the previous month `<'Pddt'>`.\n\n        :param day `<'int'>`: The day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_prev_month(31)  # The last day of the previous month\n        >>> pt.to_prev_month(1)   # The first day of the previous month\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_81to_prev_month = {"to_prev_month", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_81to_prev_month, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_80to_prev_month};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_81to_prev_month(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_day;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_prev_month (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_day,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2083, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_day);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2083, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_prev_month") < 0)) __PYX_ERR(0, 2083, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    if (values[1]) {
      __pyx_v_day = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_day == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2083, __pyx_L3_error)
    } else {
      __pyx_v_day = ((int)((int)-1));
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_prev_month", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2083, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_prev_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_80to_prev_month(__pyx_self, __pyx_v_self, __pyx_v_day);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_80to_prev_month(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_day) {
  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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_prev_month", 1);

  /* "cytimes/pddt.py":2094
 *         >>> pt.to_prev_month(1)   # The first day of the previous month
 *         """
 *         return self.to_month(-1, day)             # <<<<<<<<<<<<<<
 * 
 *     def to_next_month(self, day: cython.int = -1) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_month); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_int_neg_1, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __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, 2094, __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;

  /* "cytimes/pddt.py":2083
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_prev_month(self, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified day of the previous month `<'Pddt'>`.
 * 
 */

  /* 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("cytimes.pddt.Pddt.to_prev_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2096
 *         return self.to_month(-1, day)
 * 
 *     def to_next_month(self, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified day of the next month `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_83to_next_month(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_82to_next_month, "Adjust the date to the specified day of the next month `<'Pddt'>`.\n\n        :param day `<'int'>`: The day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_next_month(31)  # The last day of the next month\n        >>> pt.to_next_month(1)   # The first day of the next month\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_83to_next_month = {"to_next_month", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_83to_next_month, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_82to_next_month};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_83to_next_month(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_day;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_next_month (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_day,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2096, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_day);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2096, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_next_month") < 0)) __PYX_ERR(0, 2096, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    if (values[1]) {
      __pyx_v_day = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_day == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2096, __pyx_L3_error)
    } else {
      __pyx_v_day = ((int)((int)-1));
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_next_month", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2096, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_next_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_82to_next_month(__pyx_self, __pyx_v_self, __pyx_v_day);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_82to_next_month(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_day) {
  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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_next_month", 1);

  /* "cytimes/pddt.py":2107
 *         >>> pt.to_next_month(1)   # The first day of the next month
 *         """
 *         return self.to_month(1, day)             # <<<<<<<<<<<<<<
 * 
 *     def to_month(self, offset: cython.int, day: cython.int = -1) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_month); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_int_1, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __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, 2107, __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;

  /* "cytimes/pddt.py":2096
 *         return self.to_month(-1, day)
 * 
 *     def to_next_month(self, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified day of the next month `<'Pddt'>`.
 * 
 */

  /* 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("cytimes.pddt.Pddt.to_next_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2109
 *         return self.to_month(1, day)
 * 
 *     def to_month(self, offset: cython.int, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified day of the month (+/-) offest `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_85to_month(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_84to_month, "Adjust the date to the specified day of the month (+/-) offest `<'Pddt'>`.\n\n        :param offset `<'int'>`: The month offset (+/-).\n        :param day `<'int'>`: The day value (1-31), defaults to `-1`.\n            If `-1`, retains the original days. The final day\n            values are clamped to the maximum days in the month.\n\n        ### Example:\n        >>> pt.to_month(-2, 31)  # The last day of the month, two months ago\n        >>> pt.to_month(2, 1)    # The first day of the month, two months later\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_85to_month = {"to_month", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_85to_month, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_84to_month};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_85to_month(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_offset;
  int __pyx_v_day;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_month (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_offset,&__pyx_n_s_day,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2109, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2109, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("to_month", 0, 2, 3, 1); __PYX_ERR(0, 2109, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_day);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2109, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_month") < 0)) __PYX_ERR(0, 2109, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_offset = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2109, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_day = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_day == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2109, __pyx_L3_error)
    } else {
      __pyx_v_day = ((int)((int)-1));
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_month", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 2109, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_84to_month(__pyx_self, __pyx_v_self, __pyx_v_offset, __pyx_v_day);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_84to_month(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_offset, int __pyx_v_day) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_my_unit = 0;
  PyArrayObject *__pyx_v_delta = 0;
  PyArrayObject *__pyx_v_times = NULL;
  PyArrayObject *__pyx_v_datesM = NULL;
  PyArrayObject *__pyx_v_datesD = NULL;
  int __pyx_v_my_unit_ns;
  PyArrayObject *__pyx_v_dates = NULL;
  PyObject *__pyx_v_dtype = 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;
  unsigned int __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_times __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_month __pyx_t_10;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_day __pyx_t_11;
  struct __pyx_opt_args_7cytimes_5utils_arr_add_arr __pyx_t_12;
  int __pyx_t_13;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_14;
  int __pyx_t_15;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 __pyx_t_16;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_month", 1);

  /* "cytimes/pddt.py":2122
 *         """
 *         # No offset
 *         if offset == 0:             # <<<<<<<<<<<<<<
 *             return self.to_curr_month(day)
 * 
 */
  __pyx_t_1 = (__pyx_v_offset == 0);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2123
 *         # No offset
 *         if offset == 0:
 *             return self.to_curr_month(day)             # <<<<<<<<<<<<<<
 * 
 *         # Access datetime array & info
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_curr_month); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2123, __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;

    /* "cytimes/pddt.py":2122
 *         """
 *         # No offset
 *         if offset == 0:             # <<<<<<<<<<<<<<
 *             return self.to_curr_month(day)
 * 
 */
  }

  /* "cytimes/pddt.py":2126
 * 
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 *         delta: np.ndarray
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2126, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2127
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 *         delta: np.ndarray
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 2127, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2131
 * 
 *         # Seperate times
 *         times = utils.dt64arr_times(arr, my_unit)  # int64[my_unit]             # <<<<<<<<<<<<<<
 * 
 *         # Adjust dates
 */
  __pyx_t_7.__pyx_n = 1;
  __pyx_t_7.arr_unit = __pyx_v_my_unit;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_times(__pyx_v_arr, &__pyx_t_7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_times = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2134
 * 
 *         # Adjust dates
 *         datesM = utils.dt64arr_as_int64_M(arr, my_unit, offset)  # int64[M]+off             # <<<<<<<<<<<<<<
 *         # . add back original day
 *         if day < 1:
 */
  __pyx_t_8.__pyx_n = 2;
  __pyx_t_8.arr_unit = __pyx_v_my_unit;
  __pyx_t_8.offset = __pyx_v_offset;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_datesM = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2136
 *         datesM = utils.dt64arr_as_int64_M(arr, my_unit, offset)  # int64[M]+off
 *         # . add back original day
 *         if day < 1:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 */
  __pyx_t_1 = (__pyx_v_day < 1);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2137
 *         # . add back original day
 *         if day < 1:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))
 */
    __pyx_t_9.__pyx_n = 1;
    __pyx_t_9.arr_unit = __pyx_n_u_M;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2138
 *         if day < 1:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")             # <<<<<<<<<<<<<<
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 */
    __pyx_t_10.__pyx_n = 1;
    __pyx_t_10.arr_unit = __pyx_n_u_M;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_in_month(__pyx_v_datesM, &__pyx_t_10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2139
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 *         # . first day
 */
    __pyx_t_11.__pyx_n = 1;
    __pyx_t_11.arr_unit = __pyx_v_my_unit;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_day(__pyx_v_arr, &__pyx_t_11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_min_arr(__pyx_v_delta, ((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2140
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]             # <<<<<<<<<<<<<<
 *         # . first day
 *         elif day == 1:
 */
    __pyx_t_12.__pyx_n = 1;
    __pyx_t_12.offset = -1LL;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesD, __pyx_v_delta, &__pyx_t_12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2136
 *         datesM = utils.dt64arr_as_int64_M(arr, my_unit, offset)  # int64[M]+off
 *         # . add back original day
 *         if day < 1:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 */
    goto __pyx_L4;
  }

  /* "cytimes/pddt.py":2142
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 *         # . first day
 *         elif day == 1:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 */
  __pyx_t_1 = (__pyx_v_day == 1);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2143
 *         # . first day
 *         elif day == 1:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *         # . days before 29
 *         elif day < 29:
 */
    __pyx_t_9.__pyx_n = 1;
    __pyx_t_9.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2143, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2142
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 *         # . first day
 *         elif day == 1:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 */
    goto __pyx_L4;
  }

  /* "cytimes/pddt.py":2145
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 *         elif day < 29:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 */
  __pyx_t_1 = (__pyx_v_day < 29);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2146
 *         # . days before 29
 *         elif day < 29:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]             # <<<<<<<<<<<<<<
 *         # . days before 31
 *         elif day < 31:
 */
    __pyx_t_9.__pyx_n = 2;
    __pyx_t_9.arr_unit = __pyx_n_u_M;
    __pyx_t_9.offset = (__pyx_v_day - 1);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2145
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         # . days before 29
 *         elif day < 29:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 */
    goto __pyx_L4;
  }

  /* "cytimes/pddt.py":2148
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 *         elif day < 31:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 */
  __pyx_t_1 = (__pyx_v_day < 31);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2149
 *         # . days before 31
 *         elif day < 31:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min(delta, day)
 */
    __pyx_t_9.__pyx_n = 1;
    __pyx_t_9.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2150
 *         elif day < 31:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")             # <<<<<<<<<<<<<<
 *             delta = utils.arr_min(delta, day)
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 */
    __pyx_t_10.__pyx_n = 1;
    __pyx_t_10.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_in_month(__pyx_v_datesM, &__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2151
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min(delta, day)             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 *         # . last day
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_min(__pyx_v_delta, __pyx_v_day, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2152
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             delta = utils.arr_min(delta, day)
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]             # <<<<<<<<<<<<<<
 *         # . last day
 *         else:
 */
    __pyx_t_12.__pyx_n = 1;
    __pyx_t_12.offset = -1LL;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesD, __pyx_v_delta, &__pyx_t_12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2148
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", day - 1)  # int64[D]
 *         # . days before 31
 *         elif day < 31:             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 */
    goto __pyx_L4;
  }

  /* "cytimes/pddt.py":2155
 *         # . last day
 *         else:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 */
  /*else*/ {
    __pyx_t_9.__pyx_n = 1;
    __pyx_t_9.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2156
 *         else:
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 * 
 */
    __pyx_t_10.__pyx_n = 1;
    __pyx_t_10.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_in_month(__pyx_v_datesM, &__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2157
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_days_in_month(datesM, "M")
 *             datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]             # <<<<<<<<<<<<<<
 * 
 *         # Combine dates & times
 */
    __pyx_t_12.__pyx_n = 1;
    __pyx_t_12.offset = -1LL;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesD, __pyx_v_delta, &__pyx_t_12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;
  }
  __pyx_L4:;

  /* "cytimes/pddt.py":2160
 * 
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"             # <<<<<<<<<<<<<<
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 */
  __pyx_v_my_unit_ns = (PyUnicode_READ_CHAR(__pyx_v_my_unit, 0) == 0x6E);

  /* "cytimes/pddt.py":2161
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
  if (__pyx_v_my_unit_ns) {
  } else {
    __pyx_t_1 = __pyx_v_my_unit_ns;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_14.__pyx_n = 1;
  __pyx_t_14.arr_unit = __pyx_n_u_D;
  __pyx_t_13 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_datesD, &__pyx_t_14); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 2161, __pyx_L1_error)
  __pyx_t_15 = (!__pyx_t_13);
  __pyx_t_1 = __pyx_t_15;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2162
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]             # <<<<<<<<<<<<<<
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_datesD, __pyx_v_7cytimes_5utils_US_DAY, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2163
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[us]"
 *         else:
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_times, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2164
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 */
    __Pyx_INCREF(__pyx_kp_u_datetime64_us);
    __pyx_v_dtype = __pyx_kp_u_datetime64_us;

    /* "cytimes/pddt.py":2161
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
    goto __pyx_L5;
  }

  /* "cytimes/pddt.py":2166
 *             dtype = "datetime64[us]"
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 */
  /*else*/ {
    __pyx_t_16.__pyx_n = 1;
    __pyx_t_16.arr_unit = __pyx_n_u_D;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_datesD, __pyx_v_my_unit, &__pyx_t_16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2167
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit             # <<<<<<<<<<<<<<
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 */
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_my_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_dtype = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L5:;

  /* "cytimes/pddt.py":2168
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_dates, __pyx_v_times, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_dtype};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2168, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2169
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)             # <<<<<<<<<<<<<<
 * 
 *     # . weekday
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_17.__pyx_n = 3;
  __pyx_t_17.tz = __pyx_t_3;
  __pyx_t_17.unit = ((PyObject*)Py_None);
  __pyx_t_17.name = __pyx_t_4;
  __pyx_t_2 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":2109
 *         return self.to_month(1, day)
 * 
 *     def to_month(self, offset: cython.int, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified day of the month (+/-) offest `<'Pddt'>`.
 * 
 */

  /* 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("cytimes.pddt.Pddt.to_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_delta);
  __Pyx_XDECREF((PyObject *)__pyx_v_times);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesM);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesD);
  __Pyx_XDECREF((PyObject *)__pyx_v_dates);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2172
 * 
 *     # . weekday
 *     def to_monday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Monday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(0)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_87to_monday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_86to_monday, "Adjust the date to the Monday of the current week `<'Pddt'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_87to_monday = {"to_monday", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_87to_monday, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_86to_monday};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_87to_monday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_monday (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2172, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_monday") < 0)) __PYX_ERR(0, 2172, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_monday", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2172, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_monday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_86to_monday(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_86to_monday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_monday", 1);

  /* "cytimes/pddt.py":2174
 *     def to_monday(self) -> Self:
 *         """Adjust the date to the Monday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(0)             # <<<<<<<<<<<<<<
 * 
 *     def to_tuesday(self) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_curr_weekday); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_0};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2174, __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;

  /* "cytimes/pddt.py":2172
 * 
 *     # . weekday
 *     def to_monday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Monday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(0)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_monday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2176
 *         return self._to_curr_weekday(0)
 * 
 *     def to_tuesday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Tuesday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(1)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_89to_tuesday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_88to_tuesday, "Adjust the date to the Tuesday of the current week `<'Pddt'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_89to_tuesday = {"to_tuesday", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_89to_tuesday, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_88to_tuesday};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_89to_tuesday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_tuesday (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2176, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_tuesday") < 0)) __PYX_ERR(0, 2176, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_tuesday", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2176, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_tuesday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_88to_tuesday(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_88to_tuesday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_tuesday", 1);

  /* "cytimes/pddt.py":2178
 *     def to_tuesday(self) -> Self:
 *         """Adjust the date to the Tuesday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(1)             # <<<<<<<<<<<<<<
 * 
 *     def to_wednesday(self) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_curr_weekday); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_1};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2178, __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;

  /* "cytimes/pddt.py":2176
 *         return self._to_curr_weekday(0)
 * 
 *     def to_tuesday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Tuesday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(1)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_tuesday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2180
 *         return self._to_curr_weekday(1)
 * 
 *     def to_wednesday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Wednesday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(2)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_91to_wednesday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_90to_wednesday, "Adjust the date to the Wednesday of the current week `<'Pddt'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_91to_wednesday = {"to_wednesday", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_91to_wednesday, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_90to_wednesday};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_91to_wednesday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_wednesday (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2180, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_wednesday") < 0)) __PYX_ERR(0, 2180, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_wednesday", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2180, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_wednesday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_90to_wednesday(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_90to_wednesday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_wednesday", 1);

  /* "cytimes/pddt.py":2182
 *     def to_wednesday(self) -> Self:
 *         """Adjust the date to the Wednesday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(2)             # <<<<<<<<<<<<<<
 * 
 *     def to_thursday(self) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_curr_weekday); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2182, __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;

  /* "cytimes/pddt.py":2180
 *         return self._to_curr_weekday(1)
 * 
 *     def to_wednesday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Wednesday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(2)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_wednesday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2184
 *         return self._to_curr_weekday(2)
 * 
 *     def to_thursday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Thursday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(3)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_93to_thursday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_92to_thursday, "Adjust the date to the Thursday of the current week `<'Pddt'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_93to_thursday = {"to_thursday", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_93to_thursday, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_92to_thursday};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_93to_thursday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_thursday (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2184, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_thursday") < 0)) __PYX_ERR(0, 2184, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_thursday", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2184, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_thursday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_92to_thursday(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_92to_thursday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_thursday", 1);

  /* "cytimes/pddt.py":2186
 *     def to_thursday(self) -> Self:
 *         """Adjust the date to the Thursday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(3)             # <<<<<<<<<<<<<<
 * 
 *     def to_friday(self) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_curr_weekday); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2186, __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;

  /* "cytimes/pddt.py":2184
 *         return self._to_curr_weekday(2)
 * 
 *     def to_thursday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Thursday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(3)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_thursday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2188
 *         return self._to_curr_weekday(3)
 * 
 *     def to_friday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Friday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(4)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_95to_friday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_94to_friday, "Adjust the date to the Friday of the current week `<'Pddt'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_95to_friday = {"to_friday", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_95to_friday, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_94to_friday};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_95to_friday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_friday (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2188, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_friday") < 0)) __PYX_ERR(0, 2188, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_friday", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2188, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_friday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_94to_friday(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_94to_friday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_friday", 1);

  /* "cytimes/pddt.py":2190
 *     def to_friday(self) -> Self:
 *         """Adjust the date to the Friday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(4)             # <<<<<<<<<<<<<<
 * 
 *     def to_saturday(self) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_curr_weekday); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2190, __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;

  /* "cytimes/pddt.py":2188
 *         return self._to_curr_weekday(3)
 * 
 *     def to_friday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Friday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(4)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_friday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2192
 *         return self._to_curr_weekday(4)
 * 
 *     def to_saturday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Saturday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(5)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_97to_saturday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_96to_saturday, "Adjust the date to the Saturday of the current week `<'Pddt'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_97to_saturday = {"to_saturday", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_97to_saturday, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_96to_saturday};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_97to_saturday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_saturday (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2192, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_saturday") < 0)) __PYX_ERR(0, 2192, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_saturday", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2192, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_saturday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_96to_saturday(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_96to_saturday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_saturday", 1);

  /* "cytimes/pddt.py":2194
 *     def to_saturday(self) -> Self:
 *         """Adjust the date to the Saturday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(5)             # <<<<<<<<<<<<<<
 * 
 *     def to_sunday(self) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_curr_weekday); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2194, __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;

  /* "cytimes/pddt.py":2192
 *         return self._to_curr_weekday(4)
 * 
 *     def to_saturday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Saturday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(5)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_saturday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2196
 *         return self._to_curr_weekday(5)
 * 
 *     def to_sunday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Sunday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(6)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_99to_sunday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_98to_sunday, "Adjust the date to the Sunday of the current week `<'Pddt'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_99to_sunday = {"to_sunday", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_99to_sunday, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_98to_sunday};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_99to_sunday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_sunday (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2196, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_sunday") < 0)) __PYX_ERR(0, 2196, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_sunday", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2196, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_sunday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_98to_sunday(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_98to_sunday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_sunday", 1);

  /* "cytimes/pddt.py":2198
 *     def to_sunday(self) -> Self:
 *         """Adjust the date to the Sunday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(6)             # <<<<<<<<<<<<<<
 * 
 *     def to_curr_weekday(self, weekday: int | str | None = None) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_curr_weekday); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_6};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2198, __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;

  /* "cytimes/pddt.py":2196
 *         return self._to_curr_weekday(5)
 * 
 *     def to_sunday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Sunday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(6)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_sunday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2200
 *         return self._to_curr_weekday(6)
 * 
 *     def to_curr_weekday(self, weekday: int | str | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specific weekday of the current week `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_101to_curr_weekday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_100to_curr_weekday, "Adjust the date to the specific weekday of the current week `<'Pddt'>`.\n\n        :param weekday `<'int/str/None'>`: Weekday value, defaults to `None`.\n            - `<'int'>` Weekday number (0=Mon...6=Sun).\n            - `<'str'>` Weekday name (case-insensitive), e.g., 'Mon', 'dienstag', '\346\230\237\346\234\237\344\270\211'.\n            - `<'None'>` Retains the original weekdays.\n\n        ### Example:\n        >>> pt.to_curr_weekday(0)      # The Monday of the current week\n        >>> pt.to_curr_weekday(\"Tue\")  # The Tuesday of the current week\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_101to_curr_weekday = {"to_curr_weekday", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_101to_curr_weekday, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_100to_curr_weekday};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_101to_curr_weekday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_weekday = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_curr_weekday (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_weekday,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2200, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_weekday);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2200, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_curr_weekday") < 0)) __PYX_ERR(0, 2200, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_weekday = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_curr_weekday", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2200, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_curr_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_100to_curr_weekday(__pyx_self, __pyx_v_self, __pyx_v_weekday);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_100to_curr_weekday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_weekday) {
  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;
  unsigned int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_curr_weekday", 1);

  /* "cytimes/pddt.py":2212
 *         >>> pt.to_curr_weekday("Tue")  # The Tuesday of the current week
 *         """
 *         return self._to_curr_weekday(_parse_weekday(weekday, True))             # <<<<<<<<<<<<<<
 * 
 *     def to_prev_weekday(self, weekday: int | str | None = None) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_curr_weekday); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_f_7cytimes_4pddt__parse_weekday(__pyx_v_weekday, 1); if (unlikely(__pyx_t_3 == ((int)-2))) __PYX_ERR(0, 2212, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2212, __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;

  /* "cytimes/pddt.py":2200
 *         return self._to_curr_weekday(6)
 * 
 *     def to_curr_weekday(self, weekday: int | str | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specific weekday of the current week `<'Pddt'>`.
 * 
 */

  /* 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("cytimes.pddt.Pddt.to_curr_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2214
 *         return self._to_curr_weekday(_parse_weekday(weekday, True))
 * 
 *     def to_prev_weekday(self, weekday: int | str | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specific weekday of the previous week `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_103to_prev_weekday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_102to_prev_weekday, "Adjust the date to the specific weekday of the previous week `<'Pddt'>`.\n\n        :param weekday `<'int/str/None'>`: Weekday value, defaults to `None`.\n            - `<'int'>` Weekday number (0=Mon...6=Sun).\n            - `<'str'>` Weekday name (case-insensitive), e.g., 'Mon', 'dienstag', '\346\230\237\346\234\237\344\270\211'.\n            - `<'None'>` Retains the original weekdays.\n\n        ### Example:\n        >>> pt.to_prev_weekday(0)      # The Monday of the previous week\n        >>> pt.to_prev_weekday(\"Tue\")  # The Tuesday of the previous week\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_103to_prev_weekday = {"to_prev_weekday", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_103to_prev_weekday, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_102to_prev_weekday};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_103to_prev_weekday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_weekday = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_prev_weekday (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_weekday,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2214, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_weekday);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2214, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_prev_weekday") < 0)) __PYX_ERR(0, 2214, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_weekday = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_prev_weekday", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2214, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_prev_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_102to_prev_weekday(__pyx_self, __pyx_v_self, __pyx_v_weekday);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_102to_prev_weekday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_weekday) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_prev_weekday", 1);

  /* "cytimes/pddt.py":2226
 *         >>> pt.to_prev_weekday("Tue")  # The Tuesday of the previous week
 *         """
 *         return self.to_weekday(-1, weekday)             # <<<<<<<<<<<<<<
 * 
 *     def to_next_weekday(self, weekday: int | str | None = None) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_weekday); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_int_neg_1, __pyx_v_weekday};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2226, __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;

  /* "cytimes/pddt.py":2214
 *         return self._to_curr_weekday(_parse_weekday(weekday, True))
 * 
 *     def to_prev_weekday(self, weekday: int | str | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specific weekday of the previous week `<'Pddt'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_prev_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2228
 *         return self.to_weekday(-1, weekday)
 * 
 *     def to_next_weekday(self, weekday: int | str | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specific weekday of the next week `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_105to_next_weekday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_104to_next_weekday, "Adjust the date to the specific weekday of the next week `<'Pddt'>`.\n\n        :param weekday `<'int/str/None'>`: Weekday value, defaults to `None`.\n            - `<'int'>` Weekday number (0=Mon...6=Sun).\n            - `<'str'>` Weekday name (case-insensitive), e.g., 'Mon', 'dienstag', '\346\230\237\346\234\237\344\270\211'.\n            - `<'None'>` Retains the original weekdays.\n\n        ### Example:\n        >>> pt.to_next_weekday(0)      # The Monday of the next week\n        >>> pt.to_next_weekday(\"Tue\")  # The Tuesday of the next week\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_105to_next_weekday = {"to_next_weekday", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_105to_next_weekday, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_104to_next_weekday};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_105to_next_weekday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_weekday = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_next_weekday (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_weekday,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2228, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_weekday);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2228, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_next_weekday") < 0)) __PYX_ERR(0, 2228, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_weekday = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_next_weekday", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2228, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_next_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_104to_next_weekday(__pyx_self, __pyx_v_self, __pyx_v_weekday);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_104to_next_weekday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_weekday) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_next_weekday", 1);

  /* "cytimes/pddt.py":2240
 *         >>> pt.to_next_weekday("Tue")  # The Tuesday of the next week
 *         """
 *         return self.to_weekday(1, weekday)             # <<<<<<<<<<<<<<
 * 
 *     def to_weekday(self, offset: cython.int, weekday: int | str | None = None) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_weekday); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_int_1, __pyx_v_weekday};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2240, __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;

  /* "cytimes/pddt.py":2228
 *         return self.to_weekday(-1, weekday)
 * 
 *     def to_next_weekday(self, weekday: int | str | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specific weekday of the next week `<'Pddt'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_next_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2242
 *         return self.to_weekday(1, weekday)
 * 
 *     def to_weekday(self, offset: cython.int, weekday: int | str | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specific weekday of the week (+/-) offset `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_107to_weekday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_106to_weekday, "Adjust the date to the specific weekday of the week (+/-) offset `<'Pddt'>`.\n\n        :param offset `<'int'>`: The week offset (+/-).\n        :param weekday `<'int/str/None'>`: Weekday value, defaults to `None`.\n            - `<'int'>` Weekday number (0=Mon...6=Sun).\n            - `<'str'>` Weekday name (case-insensitive), e.g., 'Mon', 'dienstag', '\346\230\237\346\234\237\344\270\211'.\n            - `<'None'>` Retains the original weekdays.\n\n        ### Example:\n        >>> pt.to_weekday(-2, 0)     # The Monday of the week, two weeks ago\n        >>> pt.to_weekday(2, \"Tue\")  # The Tuesday of the week, two weeks later\n        >>> pt.to_weekday(2)         # The same weekday of the week, two weeks later\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_107to_weekday = {"to_weekday", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_107to_weekday, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_106to_weekday};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_107to_weekday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_offset;
  PyObject *__pyx_v_weekday = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_weekday (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_offset,&__pyx_n_s_weekday,0};
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2242, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2242, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("to_weekday", 0, 2, 3, 1); __PYX_ERR(0, 2242, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_weekday);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2242, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_weekday") < 0)) __PYX_ERR(0, 2242, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_offset = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2242, __pyx_L3_error)
    __pyx_v_weekday = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_weekday", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 2242, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_106to_weekday(__pyx_self, __pyx_v_self, __pyx_v_offset, __pyx_v_weekday);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_106to_weekday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_offset, PyObject *__pyx_v_weekday) {
  int __pyx_v_wkd;
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_my_unit = 0;
  PyArrayObject *__pyx_v_delta = 0;
  PyArrayObject *__pyx_v_times = NULL;
  PyArrayObject *__pyx_v_datesD = NULL;
  int __pyx_v_my_unit_ns;
  PyArrayObject *__pyx_v_dates = NULL;
  PyObject *__pyx_v_dtype = 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;
  unsigned int __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_times __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_weekday __pyx_t_10;
  int __pyx_t_11;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_12;
  int __pyx_t_13;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 __pyx_t_14;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_weekday", 1);

  /* "cytimes/pddt.py":2257
 *         """
 *         # No offset
 *         wkd: cython.int = _parse_weekday(weekday, True)             # <<<<<<<<<<<<<<
 *         if offset == 0:
 *             return self._to_curr_weekday(wkd)
 */
  __pyx_t_1 = __pyx_f_7cytimes_4pddt__parse_weekday(__pyx_v_weekday, 1); if (unlikely(__pyx_t_1 == ((int)-2))) __PYX_ERR(0, 2257, __pyx_L1_error)
  __pyx_v_wkd = __pyx_t_1;

  /* "cytimes/pddt.py":2258
 *         # No offset
 *         wkd: cython.int = _parse_weekday(weekday, True)
 *         if offset == 0:             # <<<<<<<<<<<<<<
 *             return self._to_curr_weekday(wkd)
 * 
 */
  __pyx_t_2 = (__pyx_v_offset == 0);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":2259
 *         wkd: cython.int = _parse_weekday(weekday, True)
 *         if offset == 0:
 *             return self._to_curr_weekday(wkd)             # <<<<<<<<<<<<<<
 * 
 *         # Access datetime array & info
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_curr_weekday); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_wkd); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2259, __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;

    /* "cytimes/pddt.py":2258
 *         # No offset
 *         wkd: cython.int = _parse_weekday(weekday, True)
 *         if offset == 0:             # <<<<<<<<<<<<<<
 *             return self._to_curr_weekday(wkd)
 * 
 */
  }

  /* "cytimes/pddt.py":2262
 * 
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 *         delta: np.ndarray
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2262, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2263
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 *         delta: np.ndarray
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_3))) __PYX_ERR(0, 2263, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2267
 * 
 *         # Seperate times
 *         times = utils.dt64arr_times(arr, my_unit)  # int64[my_unit]             # <<<<<<<<<<<<<<
 * 
 *         # Adjust dates
 */
  __pyx_t_8.__pyx_n = 1;
  __pyx_t_8.arr_unit = __pyx_v_my_unit;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_times(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_times = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2270
 * 
 *         # Adjust dates
 *         datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]             # <<<<<<<<<<<<<<
 *         if wkd == -1:
 *             datesD = utils.arr_add(datesD, offset * 7)  # int64[D]
 */
  __pyx_t_9.__pyx_n = 1;
  __pyx_t_9.arr_unit = __pyx_v_my_unit;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_datesD = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2271
 *         # Adjust dates
 *         datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *         if wkd == -1:             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_add(datesD, offset * 7)  # int64[D]
 *         else:
 */
  __pyx_t_2 = (__pyx_v_wkd == -1L);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":2272
 *         datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *         if wkd == -1:
 *             datesD = utils.arr_add(datesD, offset * 7)  # int64[D]             # <<<<<<<<<<<<<<
 *         else:
 *             delta = utils.dt64arr_weekday(datesD, "D", -(offset * 7 + wkd))
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_datesD, (__pyx_v_offset * 7))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2271
 *         # Adjust dates
 *         datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *         if wkd == -1:             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_add(datesD, offset * 7)  # int64[D]
 *         else:
 */
    goto __pyx_L4;
  }

  /* "cytimes/pddt.py":2274
 *             datesD = utils.arr_add(datesD, offset * 7)  # int64[D]
 *         else:
 *             delta = utils.dt64arr_weekday(datesD, "D", -(offset * 7 + wkd))             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]
 * 
 */
  /*else*/ {
    __pyx_t_10.__pyx_n = 2;
    __pyx_t_10.arr_unit = __pyx_n_u_D;
    __pyx_t_10.offset = (-((__pyx_v_offset * 7) + __pyx_v_wkd));
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_weekday(__pyx_v_datesD, &__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2275
 *         else:
 *             delta = utils.dt64arr_weekday(datesD, "D", -(offset * 7 + wkd))
 *             datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]             # <<<<<<<<<<<<<<
 * 
 *         # Combine dates & times
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_sub_arr(__pyx_v_datesD, __pyx_v_delta, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;
  }
  __pyx_L4:;

  /* "cytimes/pddt.py":2278
 * 
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"             # <<<<<<<<<<<<<<
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 */
  __pyx_v_my_unit_ns = (PyUnicode_READ_CHAR(__pyx_v_my_unit, 0) == 0x6E);

  /* "cytimes/pddt.py":2279
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
  if (__pyx_v_my_unit_ns) {
  } else {
    __pyx_t_2 = __pyx_v_my_unit_ns;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_12.__pyx_n = 1;
  __pyx_t_12.arr_unit = __pyx_n_u_D;
  __pyx_t_11 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_datesD, &__pyx_t_12); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 2279, __pyx_L1_error)
  __pyx_t_13 = (!__pyx_t_11);
  __pyx_t_2 = __pyx_t_13;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":2280
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]             # <<<<<<<<<<<<<<
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_datesD, __pyx_v_7cytimes_5utils_US_DAY, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2281
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[us]"
 *         else:
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_times, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2282
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 */
    __Pyx_INCREF(__pyx_kp_u_datetime64_us);
    __pyx_v_dtype = __pyx_kp_u_datetime64_us;

    /* "cytimes/pddt.py":2279
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
    goto __pyx_L5;
  }

  /* "cytimes/pddt.py":2284
 *             dtype = "datetime64[us]"
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 */
  /*else*/ {
    __pyx_t_14.__pyx_n = 1;
    __pyx_t_14.arr_unit = __pyx_n_u_D;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_datesD, __pyx_v_my_unit, &__pyx_t_14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2285
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit             # <<<<<<<<<<<<<<
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 */
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_my_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_dtype = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L5:;

  /* "cytimes/pddt.py":2286
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 */
  __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_dates, __pyx_v_times, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(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_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_dtype};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2286, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2287
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)             # <<<<<<<<<<<<<<
 * 
 *     def _to_curr_weekday(self, weekday: cython.int) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_15.__pyx_n = 3;
  __pyx_t_15.tz = __pyx_t_3;
  __pyx_t_15.unit = ((PyObject*)Py_None);
  __pyx_t_15.name = __pyx_t_5;
  __pyx_t_4 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_15); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":2242
 *         return self.to_weekday(1, weekday)
 * 
 *     def to_weekday(self, offset: cython.int, weekday: int | str | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specific weekday of the week (+/-) offset `<'Pddt'>`.
 * 
 */

  /* 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("cytimes.pddt.Pddt.to_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_delta);
  __Pyx_XDECREF((PyObject *)__pyx_v_times);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesD);
  __Pyx_XDECREF((PyObject *)__pyx_v_dates);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2289
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def _to_curr_weekday(self, weekday: cython.int) -> Self:             # <<<<<<<<<<<<<<
 *         """(internal) Adjust the date to the specific weekday of the current week `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_109_to_curr_weekday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_108_to_curr_weekday, "(internal) Adjust the date to the specific weekday of the current week `<'Pddt'>`.\n\n        :param weekday `<'int'>`: Weekday number (0=Mon...6=Sun).\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_109_to_curr_weekday = {"_to_curr_weekday", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_109_to_curr_weekday, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_108_to_curr_weekday};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_109_to_curr_weekday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_weekday;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_to_curr_weekday (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_weekday,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2289, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_weekday)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2289, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_to_curr_weekday", 1, 2, 2, 1); __PYX_ERR(0, 2289, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_to_curr_weekday") < 0)) __PYX_ERR(0, 2289, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_weekday = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_weekday == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2289, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_to_curr_weekday", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2289, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt._to_curr_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_108_to_curr_weekday(__pyx_self, __pyx_v_self, __pyx_v_weekday);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_108_to_curr_weekday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_weekday) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_my_unit = 0;
  PyArrayObject *__pyx_v_delta = 0;
  PyArrayObject *__pyx_v_times = NULL;
  PyArrayObject *__pyx_v_datesD = NULL;
  int __pyx_v_my_unit_ns;
  PyArrayObject *__pyx_v_dates = NULL;
  PyObject *__pyx_v_dtype = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_times __pyx_t_3;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_4;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_weekday __pyx_t_5;
  long __pyx_t_6;
  int __pyx_t_7;
  long __pyx_t_8;
  int __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_10;
  int __pyx_t_11;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  unsigned int __pyx_t_15;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_to_curr_weekday", 1);

  /* "cytimes/pddt.py":2295
 *         """
 *         # No adjustment
 *         if weekday < 0:             # <<<<<<<<<<<<<<
 *             return self
 * 
 */
  __pyx_t_1 = (__pyx_v_weekday < 0);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2296
 *         # No adjustment
 *         if weekday < 0:
 *             return self             # <<<<<<<<<<<<<<
 * 
 *         # Access datetime array & info
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":2295
 *         """
 *         # No adjustment
 *         if weekday < 0:             # <<<<<<<<<<<<<<
 *             return self
 * 
 */
  }

  /* "cytimes/pddt.py":2299
 * 
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 *         delta: np.ndarray
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2299, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2300
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 *         delta: np.ndarray
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 2300, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2304
 * 
 *         # Seperate times
 *         times = utils.dt64arr_times(arr, my_unit)  # int64[my_unit]             # <<<<<<<<<<<<<<
 * 
 *         # Adjust dates
 */
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.arr_unit = __pyx_v_my_unit;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_times(__pyx_v_arr, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_times = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2307
 * 
 *         # Adjust dates
 *         datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]             # <<<<<<<<<<<<<<
 *         if weekday == 0:
 *             delta = utils.dt64arr_weekday(datesD, "D")  # weekday
 */
  __pyx_t_4.__pyx_n = 1;
  __pyx_t_4.arr_unit = __pyx_v_my_unit;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_datesD = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2308
 *         # Adjust dates
 *         datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *         if weekday == 0:             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_weekday(datesD, "D")  # weekday
 *         else:
 */
  __pyx_t_1 = (__pyx_v_weekday == 0);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2309
 *         datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *         if weekday == 0:
 *             delta = utils.dt64arr_weekday(datesD, "D")  # weekday             # <<<<<<<<<<<<<<
 *         else:
 *             delta = utils.dt64arr_weekday(datesD, "D", -min(weekday, 6))  # weekday-off
 */
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.arr_unit = __pyx_n_u_D;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_weekday(__pyx_v_datesD, &__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2308
 *         # Adjust dates
 *         datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *         if weekday == 0:             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_weekday(datesD, "D")  # weekday
 *         else:
 */
    goto __pyx_L4;
  }

  /* "cytimes/pddt.py":2311
 *             delta = utils.dt64arr_weekday(datesD, "D")  # weekday
 *         else:
 *             delta = utils.dt64arr_weekday(datesD, "D", -min(weekday, 6))  # weekday-off             # <<<<<<<<<<<<<<
 *         datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]
 * 
 */
  /*else*/ {
    __pyx_t_6 = 6;
    __pyx_t_7 = __pyx_v_weekday;
    __pyx_t_1 = (__pyx_t_6 < __pyx_t_7);
    if (__pyx_t_1) {
      __pyx_t_8 = __pyx_t_6;
    } else {
      __pyx_t_8 = __pyx_t_7;
    }
    __pyx_t_5.__pyx_n = 2;
    __pyx_t_5.arr_unit = __pyx_n_u_D;
    __pyx_t_5.offset = (-__pyx_t_8);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_weekday(__pyx_v_datesD, &__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L4:;

  /* "cytimes/pddt.py":2312
 *         else:
 *             delta = utils.dt64arr_weekday(datesD, "D", -min(weekday, 6))  # weekday-off
 *         datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]             # <<<<<<<<<<<<<<
 * 
 *         # Combine dates & times
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_sub_arr(__pyx_v_datesD, __pyx_v_delta, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2315
 * 
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"             # <<<<<<<<<<<<<<
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 */
  __pyx_v_my_unit_ns = (PyUnicode_READ_CHAR(__pyx_v_my_unit, 0) == 0x6E);

  /* "cytimes/pddt.py":2316
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
  if (__pyx_v_my_unit_ns) {
  } else {
    __pyx_t_1 = __pyx_v_my_unit_ns;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_10.__pyx_n = 1;
  __pyx_t_10.arr_unit = __pyx_n_u_D;
  __pyx_t_9 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_datesD, &__pyx_t_10); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 2316, __pyx_L1_error)
  __pyx_t_11 = (!__pyx_t_9);
  __pyx_t_1 = __pyx_t_11;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2317
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]             # <<<<<<<<<<<<<<
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"
 */
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_datesD, __pyx_v_7cytimes_5utils_US_DAY, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2317, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2318
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[us]"
 *         else:
 */
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_times, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2319
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 */
    __Pyx_INCREF(__pyx_kp_u_datetime64_us);
    __pyx_v_dtype = __pyx_kp_u_datetime64_us;

    /* "cytimes/pddt.py":2316
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
    goto __pyx_L5;
  }

  /* "cytimes/pddt.py":2321
 *             dtype = "datetime64[us]"
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 */
  /*else*/ {
    __pyx_t_12.__pyx_n = 1;
    __pyx_t_12.arr_unit = __pyx_n_u_D;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_datesD, __pyx_v_my_unit, &__pyx_t_12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2322
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit             # <<<<<<<<<<<<<<
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 */
    __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_my_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2322, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_dtype = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L5:;

  /* "cytimes/pddt.py":2323
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 */
  __pyx_t_13 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_dates, __pyx_v_times, NULL)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_astype); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = NULL;
  __pyx_t_15 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_14))) {
    __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14);
    if (likely(__pyx_t_13)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
      __Pyx_INCREF(__pyx_t_13);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_14, function);
      __pyx_t_15 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_v_dtype};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15);
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2323, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2324
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)             # <<<<<<<<<<<<<<
 * 
 *     # . day
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_16.__pyx_n = 3;
  __pyx_t_16.tz = __pyx_t_2;
  __pyx_t_16.unit = ((PyObject*)Py_None);
  __pyx_t_16.name = __pyx_t_14;
  __pyx_t_13 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_16); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_r = __pyx_t_13;
  __pyx_t_13 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":2289
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def _to_curr_weekday(self, weekday: cython.int) -> Self:             # <<<<<<<<<<<<<<
 *         """(internal) Adjust the date to the specific weekday of the current week `<'Pddt'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("cytimes.pddt.Pddt._to_curr_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_delta);
  __Pyx_XDECREF((PyObject *)__pyx_v_times);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesD);
  __Pyx_XDECREF((PyObject *)__pyx_v_dates);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2327
 * 
 *     # . day
 *     def to_yesterday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to Yesterday `<'Pddt'>`."""
 *         return self.to_day(-1)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_111to_yesterday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_110to_yesterday, "Adjust the date to Yesterday `<'Pddt'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_111to_yesterday = {"to_yesterday", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_111to_yesterday, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_110to_yesterday};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_111to_yesterday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_yesterday (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2327, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_yesterday") < 0)) __PYX_ERR(0, 2327, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_yesterday", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2327, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_yesterday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_110to_yesterday(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_110to_yesterday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_yesterday", 1);

  /* "cytimes/pddt.py":2329
 *     def to_yesterday(self) -> Self:
 *         """Adjust the date to Yesterday `<'Pddt'>`."""
 *         return self.to_day(-1)             # <<<<<<<<<<<<<<
 * 
 *     def to_tomorrow(self) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_day); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_neg_1};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2329, __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;

  /* "cytimes/pddt.py":2327
 * 
 *     # . day
 *     def to_yesterday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to Yesterday `<'Pddt'>`."""
 *         return self.to_day(-1)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_yesterday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2331
 *         return self.to_day(-1)
 * 
 *     def to_tomorrow(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to Tomorrow `<'Pddt'>`."""
 *         return self.to_day(1)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_113to_tomorrow(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_112to_tomorrow, "Adjust the date to Tomorrow `<'Pddt'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_113to_tomorrow = {"to_tomorrow", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_113to_tomorrow, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_112to_tomorrow};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_113to_tomorrow(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_tomorrow (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2331, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_tomorrow") < 0)) __PYX_ERR(0, 2331, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_tomorrow", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2331, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_tomorrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_112to_tomorrow(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_112to_tomorrow(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_tomorrow", 1);

  /* "cytimes/pddt.py":2333
 *     def to_tomorrow(self) -> Self:
 *         """Adjust the date to Tomorrow `<'Pddt'>`."""
 *         return self.to_day(1)             # <<<<<<<<<<<<<<
 * 
 *     def to_day(self, offset: cython.int) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_day); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_1};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2333, __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;

  /* "cytimes/pddt.py":2331
 *         return self.to_day(-1)
 * 
 *     def to_tomorrow(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to Tomorrow `<'Pddt'>`."""
 *         return self.to_day(1)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_tomorrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2335
 *         return self.to_day(1)
 * 
 *     def to_day(self, offset: cython.int) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to day (+/-) offset `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_115to_day(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_114to_day, "Adjust the date to day (+/-) offset `<'Pddt'>`.\n\n        :param offset `<'int'>`: The day offset (+/-).\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_115to_day = {"to_day", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_115to_day, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_114to_day};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_115to_day(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_offset;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_day (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_offset,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2335, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2335, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("to_day", 1, 2, 2, 1); __PYX_ERR(0, 2335, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_day") < 0)) __PYX_ERR(0, 2335, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_offset = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2335, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_day", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2335, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_day", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_114to_day(__pyx_self, __pyx_v_self, __pyx_v_offset);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_114to_day(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_offset) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_my_unit = 0;
  PyArrayObject *__pyx_v_times = 0;
  PyArrayObject *__pyx_v_datesD = 0;
  int __pyx_v_my_unit_ns;
  PyArrayObject *__pyx_v_dates = NULL;
  PyObject *__pyx_v_dtype = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_times __pyx_t_3;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_4;
  int __pyx_t_5;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  unsigned int __pyx_t_11;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_day", 1);

  /* "cytimes/pddt.py":2341
 *         """
 *         # No offset
 *         if offset == 0:             # <<<<<<<<<<<<<<
 *             return self
 * 
 */
  __pyx_t_1 = (__pyx_v_offset == 0);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2342
 *         # No offset
 *         if offset == 0:
 *             return self             # <<<<<<<<<<<<<<
 * 
 *         # Access datetime array & info
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":2341
 *         """
 *         # No offset
 *         if offset == 0:             # <<<<<<<<<<<<<<
 *             return self
 * 
 */
  }

  /* "cytimes/pddt.py":2345
 * 
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2345, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2346
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 * 
 *         # Seperate times
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 2346, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2349
 * 
 *         # Seperate times
 *         times: np.ndarray = utils.dt64arr_times(arr, my_unit)  # int64[my_unit]             # <<<<<<<<<<<<<<
 * 
 *         # Adjust dates
 */
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.arr_unit = __pyx_v_my_unit;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_times(__pyx_v_arr, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_times = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2352
 * 
 *         # Adjust dates
 *         datesD: np.ndarray = utils.dt64arr_as_int64_D(arr, my_unit, offset)  # int64[D]             # <<<<<<<<<<<<<<
 * 
 *         # Combine dates & times
 */
  __pyx_t_4.__pyx_n = 2;
  __pyx_t_4.arr_unit = __pyx_v_my_unit;
  __pyx_t_4.offset = __pyx_v_offset;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_datesD = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2355
 * 
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"             # <<<<<<<<<<<<<<
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 */
  __pyx_v_my_unit_ns = (PyUnicode_READ_CHAR(__pyx_v_my_unit, 0) == 0x6E);

  /* "cytimes/pddt.py":2356
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
  if (__pyx_v_my_unit_ns) {
  } else {
    __pyx_t_1 = __pyx_v_my_unit_ns;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.arr_unit = __pyx_n_u_D;
  __pyx_t_5 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_datesD, &__pyx_t_6); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 2356, __pyx_L1_error)
  __pyx_t_7 = (!__pyx_t_5);
  __pyx_t_1 = __pyx_t_7;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2357
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]             # <<<<<<<<<<<<<<
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"
 */
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_datesD, __pyx_v_7cytimes_5utils_US_DAY, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2358
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[us]"
 *         else:
 */
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_times, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2358, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2359
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 */
    __Pyx_INCREF(__pyx_kp_u_datetime64_us);
    __pyx_v_dtype = __pyx_kp_u_datetime64_us;

    /* "cytimes/pddt.py":2356
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
    goto __pyx_L4;
  }

  /* "cytimes/pddt.py":2361
 *             dtype = "datetime64[us]"
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 */
  /*else*/ {
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.arr_unit = __pyx_n_u_D;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_datesD, __pyx_v_my_unit, &__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2362
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit             # <<<<<<<<<<<<<<
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 */
    __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_my_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_dtype = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L4:;

  /* "cytimes/pddt.py":2363
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 */
  __pyx_t_9 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_dates, __pyx_v_times, NULL)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_astype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_dtype};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2363, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2364
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)             # <<<<<<<<<<<<<<
 * 
 *     # . date&time
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_12.__pyx_n = 3;
  __pyx_t_12.tz = __pyx_t_2;
  __pyx_t_12.unit = ((PyObject*)Py_None);
  __pyx_t_12.name = __pyx_t_10;
  __pyx_t_9 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":2335
 *         return self.to_day(1)
 * 
 *     def to_day(self, offset: cython.int) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to day (+/-) offset `<'Pddt'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_day", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_times);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesD);
  __Pyx_XDECREF((PyObject *)__pyx_v_dates);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2367
 * 
 *     # . date&time
 *     def snap(self, freq: object = "S") -> Self:             # <<<<<<<<<<<<<<
 *         """Snap to nearest occurring frequency `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_117snap(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_116snap, "Snap to nearest occurring frequency `<'Pddt'>`.\n\n        Examples\n        --------\n        >>> idx = pd.DatetimeIndex(['2023-01-01', '2023-01-02',\n        ...                        '2023-02-01', '2023-02-02'])\n        >>> idx\n        DatetimeIndex(['2023-01-01', '2023-01-02', '2023-02-01', '2023-02-02'],\n        dtype='datetime64[ns]', freq=None)\n        >>> idx.snap('MS')\n        DatetimeIndex(['2023-01-01', '2023-01-01', '2023-02-01', '2023-02-01'],\n        dtype='datetime64[ns]', freq=None)\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_117snap = {"snap", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_117snap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_116snap};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_117snap(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_freq = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("snap (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_freq,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_n_u_S)));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2367, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_freq);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2367, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "snap") < 0)) __PYX_ERR(0, 2367, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_freq = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("snap", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2367, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.snap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_116snap(__pyx_self, __pyx_v_self, __pyx_v_freq);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_116snap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_freq) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("snap", 1);

  /* "cytimes/pddt.py":2381
 *         dtype='datetime64[ns]', freq=None)
 *         """
 *         return pddt_new_simple(DatetimeIndex.snap(self, freq))             # <<<<<<<<<<<<<<
 * 
 *     def to_datetime(
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DatetimeIndex); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_snap); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_freq};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_3 = __pyx_f_7cytimes_4pddt_pddt_new_simple(__pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":2367
 * 
 *     # . date&time
 *     def snap(self, freq: object = "S") -> Self:             # <<<<<<<<<<<<<<
 *         """Snap to nearest occurring frequency `<'Pddt'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.snap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2383
 *         return pddt_new_simple(DatetimeIndex.snap(self, freq))
 * 
 *     def to_datetime(             # <<<<<<<<<<<<<<
 *         self,
 *         year: cython.int = -1,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_119to_datetime(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_118to_datetime, "Adjust the date and time fields with new values `<'Pddt'>`.\n\n        #### Fields set to `-1` means retaining the original values.\n\n        :param year `<'int'>`: Year value, defaults to `-1`.\n        :param month `<'int'>`: Yonth value (1-12), defaults to `-1`.\n        :param day `<'int'>`: Day value (1-31), automacially clamped to the maximum days in the month, defaults to `-1`.\n        :param hour `<'int'>`: Hour value (0-23), defaults to `-1`.\n        :param minute `<'int'>`: Minute value (0-59), defaults to `-1`.\n        :param second `<'int'>`: Second value (0-59), defaults to `-1`.\n        :param microsecond `<'int'>`: Microsecond value (0-999999), defaults to `-1`.\n\n        ### Equivalent to:\n        >>> pt.replace(\n                year=year,\n                month=month,\n                day=day,\n                hour=hour,\n                minute=minute,\n                second=second,\n                microsecond=microsecond,\n            )\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_119to_datetime = {"to_datetime", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_119to_datetime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_118to_datetime};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_119to_datetime(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_year;
  int __pyx_v_month;
  int __pyx_v_day;
  int __pyx_v_hour;
  int __pyx_v_minute;
  int __pyx_v_second;
  int __pyx_v_microsecond;
  int __pyx_v_nanosecond;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_datetime (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_year,&__pyx_n_s_month,&__pyx_n_s_day,&__pyx_n_s_hour,&__pyx_n_s_minute,&__pyx_n_s_second,&__pyx_n_s_microsecond,&__pyx_n_s_nanosecond,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2383, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_year);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2383, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_month);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2383, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_day);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2383, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hour);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2383, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_minute);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2383, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_second);
          if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2383, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_microsecond);
          if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2383, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nanosecond);
          if (value) { values[8] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2383, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_datetime") < 0)) __PYX_ERR(0, 2383, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    if (values[1]) {
      __pyx_v_year = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_year == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2385, __pyx_L3_error)
    } else {
      __pyx_v_year = ((int)((int)-1));
    }
    if (values[2]) {
      __pyx_v_month = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_month == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2386, __pyx_L3_error)
    } else {
      __pyx_v_month = ((int)((int)-1));
    }
    if (values[3]) {
      __pyx_v_day = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_day == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2387, __pyx_L3_error)
    } else {
      __pyx_v_day = ((int)((int)-1));
    }
    if (values[4]) {
      __pyx_v_hour = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_hour == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2388, __pyx_L3_error)
    } else {
      __pyx_v_hour = ((int)((int)-1));
    }
    if (values[5]) {
      __pyx_v_minute = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_minute == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2389, __pyx_L3_error)
    } else {
      __pyx_v_minute = ((int)((int)-1));
    }
    if (values[6]) {
      __pyx_v_second = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_second == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2390, __pyx_L3_error)
    } else {
      __pyx_v_second = ((int)((int)-1));
    }
    if (values[7]) {
      __pyx_v_microsecond = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_microsecond == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2391, __pyx_L3_error)
    } else {
      __pyx_v_microsecond = ((int)((int)-1));
    }
    if (values[8]) {
      __pyx_v_nanosecond = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_nanosecond == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2392, __pyx_L3_error)
    } else {
      __pyx_v_nanosecond = ((int)((int)-1));
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_datetime", 0, 1, 9, __pyx_nargs); __PYX_ERR(0, 2383, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_118to_datetime(__pyx_self, __pyx_v_self, __pyx_v_year, __pyx_v_month, __pyx_v_day, __pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_nanosecond);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_118to_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_year, int __pyx_v_month, int __pyx_v_day, int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, int __pyx_v_nanosecond) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_my_unit = 0;
  Py_UCS4 __pyx_v_my_unit_ch;
  PyArrayObject *__pyx_v_delta = 0;
  PY_LONG_LONG __pyx_v_hh_fac;
  PY_LONG_LONG __pyx_v_mi_fac;
  PY_LONG_LONG __pyx_v_ss_fac;
  PY_LONG_LONG __pyx_v_us_fac;
  PY_LONG_LONG __pyx_v_months;
  PyArrayObject *__pyx_v_datesM = NULL;
  PyArrayObject *__pyx_v_datesY = NULL;
  PyArrayObject *__pyx_v_datesD = NULL;
  PyArrayObject *__pyx_v_times = 0;
  PyObject *__pyx_v_my_unit_adj = 0;
  PyObject *__pyx_v_dtype = NULL;
  PyArrayObject *__pyx_v_dates = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  unsigned int __pyx_t_11;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_12;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_13;
  long __pyx_t_14;
  int __pyx_t_15;
  long __pyx_t_16;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_month __pyx_t_17;
  struct __pyx_opt_args_7cytimes_5utils_arr_add_arr __pyx_t_18;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_19;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_month __pyx_t_20;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_day __pyx_t_21;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_22;
  Py_UCS4 __pyx_t_23;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_hour __pyx_t_24;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_minute __pyx_t_25;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_second __pyx_t_26;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_millisecond __pyx_t_27;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_microsecond __pyx_t_28;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_nanosecond __pyx_t_29;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 __pyx_t_30;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_31;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_datetime", 1);

  /* "cytimes/pddt.py":2419
 *         # Fast-path
 *         # fmt: off
 *         if year <= 0 and month <= 0 and day <= 0:             # <<<<<<<<<<<<<<
 *             return self.to_time(hour, minute, second, microsecond, nanosecond)
 *         if hour < 0 and minute < 0 and second < 0 and microsecond < 0 and nanosecond < 0:
 */
  __pyx_t_2 = (__pyx_v_year <= 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_month <= 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_day <= 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2420
 *         # fmt: off
 *         if year <= 0 and month <= 0 and day <= 0:
 *             return self.to_time(hour, minute, second, microsecond, nanosecond)             # <<<<<<<<<<<<<<
 *         if hour < 0 and minute < 0 and second < 0 and microsecond < 0 and nanosecond < 0:
 *             return self.to_date(year, month, day)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_hour); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_minute); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_second); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_microsecond); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nanosecond); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = NULL;
    __pyx_t_11 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_11 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[6] = {__pyx_t_10, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_11, 5+__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2420, __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;

    /* "cytimes/pddt.py":2419
 *         # Fast-path
 *         # fmt: off
 *         if year <= 0 and month <= 0 and day <= 0:             # <<<<<<<<<<<<<<
 *             return self.to_time(hour, minute, second, microsecond, nanosecond)
 *         if hour < 0 and minute < 0 and second < 0 and microsecond < 0 and nanosecond < 0:
 */
  }

  /* "cytimes/pddt.py":2421
 *         if year <= 0 and month <= 0 and day <= 0:
 *             return self.to_time(hour, minute, second, microsecond, nanosecond)
 *         if hour < 0 and minute < 0 and second < 0 and microsecond < 0 and nanosecond < 0:             # <<<<<<<<<<<<<<
 *             return self.to_date(year, month, day)
 *         # fmt: on
 */
  __pyx_t_2 = (__pyx_v_hour < 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_minute < 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_second < 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_microsecond < 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_nanosecond < 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2422
 *             return self.to_time(hour, minute, second, microsecond, nanosecond)
 *         if hour < 0 and minute < 0 and second < 0 and microsecond < 0 and nanosecond < 0:
 *             return self.to_date(year, month, day)             # <<<<<<<<<<<<<<
 *         # fmt: on
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_date); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_year); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_month); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = NULL;
    __pyx_t_11 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_11 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_9, __pyx_t_8, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_11, 3+__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2422, __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;

    /* "cytimes/pddt.py":2421
 *         if year <= 0 and month <= 0 and day <= 0:
 *             return self.to_time(hour, minute, second, microsecond, nanosecond)
 *         if hour < 0 and minute < 0 and second < 0 and microsecond < 0 and nanosecond < 0:             # <<<<<<<<<<<<<<
 *             return self.to_date(year, month, day)
 *         # fmt: on
 */
  }

  /* "cytimes/pddt.py":2426
 * 
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 *         my_unit_ch: cython.Py_UCS4 = str_read(my_unit, 0)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2426, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2427
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 *         my_unit_ch: cython.Py_UCS4 = str_read(my_unit, 0)
 *         delta: np.ndarray
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_3))) __PYX_ERR(0, 2427, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2428
 *         arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit
 *         my_unit_ch: cython.Py_UCS4 = str_read(my_unit, 0)             # <<<<<<<<<<<<<<
 *         delta: np.ndarray
 *         hh_fac: cython.longlong
 */
  __pyx_v_my_unit_ch = PyUnicode_READ_CHAR(__pyx_v_my_unit, 0);

  /* "cytimes/pddt.py":2437
 *         # Construct dates
 *         # . year
 *         if year > 0:             # <<<<<<<<<<<<<<
 *             months = (year - utils.EPOCH_YEAR) * 12  # year+off
 *             datesM = utils.arr_full_int64(months, arr.shape[0])  # int64[M]
 */
  __pyx_t_1 = (__pyx_v_year > 0);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2438
 *         # . year
 *         if year > 0:
 *             months = (year - utils.EPOCH_YEAR) * 12  # year+off             # <<<<<<<<<<<<<<
 *             datesM = utils.arr_full_int64(months, arr.shape[0])  # int64[M]
 *         else:
 */
    __pyx_v_months = ((__pyx_v_year - __pyx_v_7cytimes_5utils_EPOCH_YEAR) * 12);

    /* "cytimes/pddt.py":2439
 *         if year > 0:
 *             months = (year - utils.EPOCH_YEAR) * 12  # year+off
 *             datesM = utils.arr_full_int64(months, arr.shape[0])  # int64[M]             # <<<<<<<<<<<<<<
 *         else:
 *             datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_full_int64(__pyx_v_months, (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2439, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesM = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2437
 *         # Construct dates
 *         # . year
 *         if year > 0:             # <<<<<<<<<<<<<<
 *             months = (year - utils.EPOCH_YEAR) * 12  # year+off
 *             datesM = utils.arr_full_int64(months, arr.shape[0])  # int64[M]
 */
    goto __pyx_L13;
  }

  /* "cytimes/pddt.py":2441
 *             datesM = utils.arr_full_int64(months, arr.shape[0])  # int64[M]
 *         else:
 *             datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]             # <<<<<<<<<<<<<<
 *             datesM = utils.dt64arr_as_int64_M(datesY, "Y")  # int64[M]
 *         # . month
 */
  /*else*/ {
    __pyx_t_12.__pyx_n = 1;
    __pyx_t_12.arr_unit = __pyx_v_my_unit;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2441, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesY = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2442
 *         else:
 *             datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *             datesM = utils.dt64arr_as_int64_M(datesY, "Y")  # int64[M]             # <<<<<<<<<<<<<<
 *         # . month
 *         if month > 0:
 */
    __pyx_t_13.__pyx_n = 1;
    __pyx_t_13.arr_unit = __pyx_n_u_Y;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_datesY, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesM = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L13:;

  /* "cytimes/pddt.py":2444
 *             datesM = utils.dt64arr_as_int64_M(datesY, "Y")  # int64[M]
 *         # . month
 *         if month > 0:             # <<<<<<<<<<<<<<
 *             datesM = utils.arr_add(datesM, min(month, 12) - 1)  # int64[M]
 *         else:
 */
  __pyx_t_1 = (__pyx_v_month > 0);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2445
 *         # . month
 *         if month > 0:
 *             datesM = utils.arr_add(datesM, min(month, 12) - 1)  # int64[M]             # <<<<<<<<<<<<<<
 *         else:
 *             delta = utils.dt64arr_month(arr, my_unit)
 */
    __pyx_t_14 = 12;
    __pyx_t_15 = __pyx_v_month;
    __pyx_t_1 = (__pyx_t_14 < __pyx_t_15);
    if (__pyx_t_1) {
      __pyx_t_16 = __pyx_t_14;
    } else {
      __pyx_t_16 = __pyx_t_15;
    }
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_datesM, (__pyx_t_16 - 1))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_datesM, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2444
 *             datesM = utils.dt64arr_as_int64_M(datesY, "Y")  # int64[M]
 *         # . month
 *         if month > 0:             # <<<<<<<<<<<<<<
 *             datesM = utils.arr_add(datesM, min(month, 12) - 1)  # int64[M]
 *         else:
 */
    goto __pyx_L14;
  }

  /* "cytimes/pddt.py":2447
 *             datesM = utils.arr_add(datesM, min(month, 12) - 1)  # int64[M]
 *         else:
 *             delta = utils.dt64arr_month(arr, my_unit)             # <<<<<<<<<<<<<<
 *             datesM = utils.arr_add_arr(datesM, delta, -1)  # int64[M]
 *         # . day
 */
  /*else*/ {
    __pyx_t_17.__pyx_n = 1;
    __pyx_t_17.arr_unit = __pyx_v_my_unit;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_month(__pyx_v_arr, &__pyx_t_17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2447, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2448
 *         else:
 *             delta = utils.dt64arr_month(arr, my_unit)
 *             datesM = utils.arr_add_arr(datesM, delta, -1)  # int64[M]             # <<<<<<<<<<<<<<
 *         # . day
 *         datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 */
    __pyx_t_18.__pyx_n = 1;
    __pyx_t_18.offset = -1LL;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesM, __pyx_v_delta, &__pyx_t_18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_datesM, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;
  }
  __pyx_L14:;

  /* "cytimes/pddt.py":2450
 *             datesM = utils.arr_add_arr(datesM, delta, -1)  # int64[M]
 *         # . day
 *         datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *         delta = utils.dt64arr_days_in_month(datesM, "M")
 *         if day > 0:
 */
  __pyx_t_19.__pyx_n = 1;
  __pyx_t_19.arr_unit = __pyx_n_u_M;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_19)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_datesD = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2451
 *         # . day
 *         datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         delta = utils.dt64arr_days_in_month(datesM, "M")             # <<<<<<<<<<<<<<
 *         if day > 0:
 *             delta = utils.arr_min(delta, day)
 */
  __pyx_t_20.__pyx_n = 1;
  __pyx_t_20.arr_unit = __pyx_n_u_M;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_in_month(__pyx_v_datesM, &__pyx_t_20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_XDECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2452
 *         datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         delta = utils.dt64arr_days_in_month(datesM, "M")
 *         if day > 0:             # <<<<<<<<<<<<<<
 *             delta = utils.arr_min(delta, day)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_day > 0);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2453
 *         delta = utils.dt64arr_days_in_month(datesM, "M")
 *         if day > 0:
 *             delta = utils.arr_min(delta, day)             # <<<<<<<<<<<<<<
 *         else:
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_min(__pyx_v_delta, __pyx_v_day, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2453, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2452
 *         datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         delta = utils.dt64arr_days_in_month(datesM, "M")
 *         if day > 0:             # <<<<<<<<<<<<<<
 *             delta = utils.arr_min(delta, day)
 *         else:
 */
    goto __pyx_L15;
  }

  /* "cytimes/pddt.py":2455
 *             delta = utils.arr_min(delta, day)
 *         else:
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))             # <<<<<<<<<<<<<<
 *         datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 * 
 */
  /*else*/ {
    __pyx_t_21.__pyx_n = 1;
    __pyx_t_21.arr_unit = __pyx_v_my_unit;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_day(__pyx_v_arr, &__pyx_t_21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_min_arr(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3), NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;
  }
  __pyx_L15:;

  /* "cytimes/pddt.py":2456
 *         else:
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))
 *         datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]             # <<<<<<<<<<<<<<
 * 
 *         # Construct times
 */
  __pyx_t_18.__pyx_n = 1;
  __pyx_t_18.offset = -1LL;
  __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesD, __pyx_v_delta, &__pyx_t_18)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_4));
  __pyx_t_4 = 0;

  /* "cytimes/pddt.py":2459
 * 
 *         # Construct times
 *         times: np.ndarray = utils.arr_zero_int64(arr.shape[0])  # int64[my_unit]             # <<<<<<<<<<<<<<
 *         # . get conversion factors
 *         my_unit_adj: str = my_unit
 */
  __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_zero_int64((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_times = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cytimes/pddt.py":2461
 *         times: np.ndarray = utils.arr_zero_int64(arr.shape[0])  # int64[my_unit]
 *         # . get conversion factors
 *         my_unit_adj: str = my_unit             # <<<<<<<<<<<<<<
 *         if my_unit_ch == "n" and utils.is_dt64arr_ns_safe(datesD, "D"):
 *             hh_fac = utils.NS_HOUR
 */
  __Pyx_INCREF(__pyx_v_my_unit);
  __pyx_v_my_unit_adj = __pyx_v_my_unit;

  /* "cytimes/pddt.py":2462
 *         # . get conversion factors
 *         my_unit_adj: str = my_unit
 *         if my_unit_ch == "n" and utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             hh_fac = utils.NS_HOUR
 *             mi_fac = utils.NS_MINUTE
 */
  __pyx_t_2 = (__pyx_v_my_unit_ch == 0x6E);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L17_bool_binop_done;
  }
  __pyx_t_22.__pyx_n = 1;
  __pyx_t_22.arr_unit = __pyx_n_u_D;
  __pyx_t_2 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_datesD, &__pyx_t_22); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2462, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __pyx_L17_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2463
 *         my_unit_adj: str = my_unit
 *         if my_unit_ch == "n" and utils.is_dt64arr_ns_safe(datesD, "D"):
 *             hh_fac = utils.NS_HOUR             # <<<<<<<<<<<<<<
 *             mi_fac = utils.NS_MINUTE
 *             ss_fac = utils.NS_SECOND
 */
    __pyx_v_hh_fac = __pyx_v_7cytimes_5utils_NS_HOUR;

    /* "cytimes/pddt.py":2464
 *         if my_unit_ch == "n" and utils.is_dt64arr_ns_safe(datesD, "D"):
 *             hh_fac = utils.NS_HOUR
 *             mi_fac = utils.NS_MINUTE             # <<<<<<<<<<<<<<
 *             ss_fac = utils.NS_SECOND
 *             us_fac = utils.NS_MICROSECOND
 */
    __pyx_v_mi_fac = __pyx_v_7cytimes_5utils_NS_MINUTE;

    /* "cytimes/pddt.py":2465
 *             hh_fac = utils.NS_HOUR
 *             mi_fac = utils.NS_MINUTE
 *             ss_fac = utils.NS_SECOND             # <<<<<<<<<<<<<<
 *             us_fac = utils.NS_MICROSECOND
 *         elif my_unit_ch in ("n", "u"):
 */
    __pyx_v_ss_fac = __pyx_v_7cytimes_5utils_NS_SECOND;

    /* "cytimes/pddt.py":2466
 *             mi_fac = utils.NS_MINUTE
 *             ss_fac = utils.NS_SECOND
 *             us_fac = utils.NS_MICROSECOND             # <<<<<<<<<<<<<<
 *         elif my_unit_ch in ("n", "u"):
 *             hh_fac = utils.US_HOUR
 */
    __pyx_v_us_fac = __pyx_v_7cytimes_5utils_NS_MICROSECOND;

    /* "cytimes/pddt.py":2462
 *         # . get conversion factors
 *         my_unit_adj: str = my_unit
 *         if my_unit_ch == "n" and utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             hh_fac = utils.NS_HOUR
 *             mi_fac = utils.NS_MINUTE
 */
    goto __pyx_L16;
  }

  /* "cytimes/pddt.py":2467
 *             ss_fac = utils.NS_SECOND
 *             us_fac = utils.NS_MICROSECOND
 *         elif my_unit_ch in ("n", "u"):             # <<<<<<<<<<<<<<
 *             hh_fac = utils.US_HOUR
 *             mi_fac = utils.US_MINUTE
 */
  switch (__pyx_v_my_unit_ch) {
    case 0x6E:
    case 0x75:
    __pyx_t_1 = 1;
    break;
    default:
    __pyx_t_1 = 0;
    break;
  }
  __pyx_t_2 = __pyx_t_1;
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":2468
 *             us_fac = utils.NS_MICROSECOND
 *         elif my_unit_ch in ("n", "u"):
 *             hh_fac = utils.US_HOUR             # <<<<<<<<<<<<<<
 *             mi_fac = utils.US_MINUTE
 *             ss_fac = utils.US_SECOND
 */
    __pyx_v_hh_fac = __pyx_v_7cytimes_5utils_US_HOUR;

    /* "cytimes/pddt.py":2469
 *         elif my_unit_ch in ("n", "u"):
 *             hh_fac = utils.US_HOUR
 *             mi_fac = utils.US_MINUTE             # <<<<<<<<<<<<<<
 *             ss_fac = utils.US_SECOND
 *             us_fac = 1
 */
    __pyx_v_mi_fac = __pyx_v_7cytimes_5utils_US_MINUTE;

    /* "cytimes/pddt.py":2470
 *             hh_fac = utils.US_HOUR
 *             mi_fac = utils.US_MINUTE
 *             ss_fac = utils.US_SECOND             # <<<<<<<<<<<<<<
 *             us_fac = 1
 *             if my_unit_ch == "n":
 */
    __pyx_v_ss_fac = __pyx_v_7cytimes_5utils_US_SECOND;

    /* "cytimes/pddt.py":2471
 *             mi_fac = utils.US_MINUTE
 *             ss_fac = utils.US_SECOND
 *             us_fac = 1             # <<<<<<<<<<<<<<
 *             if my_unit_ch == "n":
 *                 my_unit_ch, my_unit_adj = "u", "us"
 */
    __pyx_v_us_fac = 1;

    /* "cytimes/pddt.py":2472
 *             ss_fac = utils.US_SECOND
 *             us_fac = 1
 *             if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *                 my_unit_ch, my_unit_adj = "u", "us"
 *         elif my_unit_ch == "m":
 */
    __pyx_t_2 = (__pyx_v_my_unit_ch == 0x6E);
    if (__pyx_t_2) {

      /* "cytimes/pddt.py":2473
 *             us_fac = 1
 *             if my_unit_ch == "n":
 *                 my_unit_ch, my_unit_adj = "u", "us"             # <<<<<<<<<<<<<<
 *         elif my_unit_ch == "m":
 *             hh_fac = utils.MS_HOUR
 */
      __pyx_t_23 = 0x75;
      __pyx_t_4 = __pyx_n_u_us;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_v_my_unit_ch = __pyx_t_23;
      __Pyx_DECREF_SET(__pyx_v_my_unit_adj, ((PyObject*)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/pddt.py":2472
 *             ss_fac = utils.US_SECOND
 *             us_fac = 1
 *             if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *                 my_unit_ch, my_unit_adj = "u", "us"
 *         elif my_unit_ch == "m":
 */
    }

    /* "cytimes/pddt.py":2467
 *             ss_fac = utils.NS_SECOND
 *             us_fac = utils.NS_MICROSECOND
 *         elif my_unit_ch in ("n", "u"):             # <<<<<<<<<<<<<<
 *             hh_fac = utils.US_HOUR
 *             mi_fac = utils.US_MINUTE
 */
    goto __pyx_L16;
  }

  /* "cytimes/pddt.py":2474
 *             if my_unit_ch == "n":
 *                 my_unit_ch, my_unit_adj = "u", "us"
 *         elif my_unit_ch == "m":             # <<<<<<<<<<<<<<
 *             hh_fac = utils.MS_HOUR
 *             mi_fac = utils.MS_MINUTE
 */
  __pyx_t_2 = (__pyx_v_my_unit_ch == 0x6D);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":2475
 *                 my_unit_ch, my_unit_adj = "u", "us"
 *         elif my_unit_ch == "m":
 *             hh_fac = utils.MS_HOUR             # <<<<<<<<<<<<<<
 *             mi_fac = utils.MS_MINUTE
 *             ss_fac = utils.MS_SECOND
 */
    __pyx_v_hh_fac = __pyx_v_7cytimes_5utils_MS_HOUR;

    /* "cytimes/pddt.py":2476
 *         elif my_unit_ch == "m":
 *             hh_fac = utils.MS_HOUR
 *             mi_fac = utils.MS_MINUTE             # <<<<<<<<<<<<<<
 *             ss_fac = utils.MS_SECOND
 *             us_fac = 1
 */
    __pyx_v_mi_fac = __pyx_v_7cytimes_5utils_MS_MINUTE;

    /* "cytimes/pddt.py":2477
 *             hh_fac = utils.MS_HOUR
 *             mi_fac = utils.MS_MINUTE
 *             ss_fac = utils.MS_SECOND             # <<<<<<<<<<<<<<
 *             us_fac = 1
 *             if microsecond != 0:
 */
    __pyx_v_ss_fac = __pyx_v_7cytimes_5utils_MS_SECOND;

    /* "cytimes/pddt.py":2478
 *             mi_fac = utils.MS_MINUTE
 *             ss_fac = utils.MS_SECOND
 *             us_fac = 1             # <<<<<<<<<<<<<<
 *             if microsecond != 0:
 *                 microsecond = min(microsecond, 999_999) // 1_000
 */
    __pyx_v_us_fac = 1;

    /* "cytimes/pddt.py":2479
 *             ss_fac = utils.MS_SECOND
 *             us_fac = 1
 *             if microsecond != 0:             # <<<<<<<<<<<<<<
 *                 microsecond = min(microsecond, 999_999) // 1_000
 *         else:
 */
    __pyx_t_2 = (__pyx_v_microsecond != 0);
    if (__pyx_t_2) {

      /* "cytimes/pddt.py":2480
 *             us_fac = 1
 *             if microsecond != 0:
 *                 microsecond = min(microsecond, 999_999) // 1_000             # <<<<<<<<<<<<<<
 *         else:
 *             hh_fac = utils.SS_HOUR
 */
      __pyx_t_16 = 0xF423F;
      __pyx_t_15 = __pyx_v_microsecond;
      __pyx_t_2 = (__pyx_t_16 < __pyx_t_15);
      if (__pyx_t_2) {
        __pyx_t_14 = __pyx_t_16;
      } else {
        __pyx_t_14 = __pyx_t_15;
      }
      __pyx_v_microsecond = __Pyx_div_long(__pyx_t_14, 0x3E8);

      /* "cytimes/pddt.py":2479
 *             ss_fac = utils.MS_SECOND
 *             us_fac = 1
 *             if microsecond != 0:             # <<<<<<<<<<<<<<
 *                 microsecond = min(microsecond, 999_999) // 1_000
 *         else:
 */
    }

    /* "cytimes/pddt.py":2474
 *             if my_unit_ch == "n":
 *                 my_unit_ch, my_unit_adj = "u", "us"
 *         elif my_unit_ch == "m":             # <<<<<<<<<<<<<<
 *             hh_fac = utils.MS_HOUR
 *             mi_fac = utils.MS_MINUTE
 */
    goto __pyx_L16;
  }

  /* "cytimes/pddt.py":2482
 *                 microsecond = min(microsecond, 999_999) // 1_000
 *         else:
 *             hh_fac = utils.SS_HOUR             # <<<<<<<<<<<<<<
 *             mi_fac = utils.SS_MINUTE
 *             ss_fac = 1
 */
  /*else*/ {
    __pyx_v_hh_fac = __pyx_v_7cytimes_5utils_SS_HOUR;

    /* "cytimes/pddt.py":2483
 *         else:
 *             hh_fac = utils.SS_HOUR
 *             mi_fac = utils.SS_MINUTE             # <<<<<<<<<<<<<<
 *             ss_fac = 1
 *         # . hour
 */
    __pyx_v_mi_fac = __pyx_v_7cytimes_5utils_SS_MINUTE;

    /* "cytimes/pddt.py":2484
 *             hh_fac = utils.SS_HOUR
 *             mi_fac = utils.SS_MINUTE
 *             ss_fac = 1             # <<<<<<<<<<<<<<
 *         # . hour
 *         if hour >= 0:
 */
    __pyx_v_ss_fac = 1;
  }
  __pyx_L16:;

  /* "cytimes/pddt.py":2486
 *             ss_fac = 1
 *         # . hour
 *         if hour >= 0:             # <<<<<<<<<<<<<<
 *             times = utils.arr_add(times, min(hour, 23) * hh_fac)
 *         else:
 */
  __pyx_t_2 = (__pyx_v_hour >= 0);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":2487
 *         # . hour
 *         if hour >= 0:
 *             times = utils.arr_add(times, min(hour, 23) * hh_fac)             # <<<<<<<<<<<<<<
 *         else:
 *             delta = utils.arr_mul(utils.dt64arr_hour(arr, my_unit), hh_fac)
 */
    __pyx_t_14 = 23;
    __pyx_t_15 = __pyx_v_hour;
    __pyx_t_2 = (__pyx_t_14 < __pyx_t_15);
    if (__pyx_t_2) {
      __pyx_t_16 = __pyx_t_14;
    } else {
      __pyx_t_16 = __pyx_t_15;
    }
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_times, (__pyx_t_16 * __pyx_v_hh_fac))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2487, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":2486
 *             ss_fac = 1
 *         # . hour
 *         if hour >= 0:             # <<<<<<<<<<<<<<
 *             times = utils.arr_add(times, min(hour, 23) * hh_fac)
 *         else:
 */
    goto __pyx_L21;
  }

  /* "cytimes/pddt.py":2489
 *             times = utils.arr_add(times, min(hour, 23) * hh_fac)
 *         else:
 *             delta = utils.arr_mul(utils.dt64arr_hour(arr, my_unit), hh_fac)             # <<<<<<<<<<<<<<
 *             times = utils.arr_add_arr(times, delta)
 *         # . minute
 */
  /*else*/ {
    __pyx_t_24.__pyx_n = 1;
    __pyx_t_24.arr_unit = __pyx_v_my_unit;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_hour(__pyx_v_arr, &__pyx_t_24)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2489, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(((PyArrayObject *)__pyx_t_4), __pyx_v_hh_fac, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2489, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2490
 *         else:
 *             delta = utils.arr_mul(utils.dt64arr_hour(arr, my_unit), hh_fac)
 *             times = utils.arr_add_arr(times, delta)             # <<<<<<<<<<<<<<
 *         # . minute
 *         if minute >= 0:
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_times, __pyx_v_delta, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;
  }
  __pyx_L21:;

  /* "cytimes/pddt.py":2492
 *             times = utils.arr_add_arr(times, delta)
 *         # . minute
 *         if minute >= 0:             # <<<<<<<<<<<<<<
 *             times = utils.arr_add(times, min(minute, 59) * mi_fac)
 *         else:
 */
  __pyx_t_2 = (__pyx_v_minute >= 0);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":2493
 *         # . minute
 *         if minute >= 0:
 *             times = utils.arr_add(times, min(minute, 59) * mi_fac)             # <<<<<<<<<<<<<<
 *         else:
 *             delta = utils.arr_mul(utils.dt64arr_minute(arr, my_unit), mi_fac)
 */
    __pyx_t_16 = 59;
    __pyx_t_15 = __pyx_v_minute;
    __pyx_t_2 = (__pyx_t_16 < __pyx_t_15);
    if (__pyx_t_2) {
      __pyx_t_14 = __pyx_t_16;
    } else {
      __pyx_t_14 = __pyx_t_15;
    }
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_times, (__pyx_t_14 * __pyx_v_mi_fac))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2492
 *             times = utils.arr_add_arr(times, delta)
 *         # . minute
 *         if minute >= 0:             # <<<<<<<<<<<<<<
 *             times = utils.arr_add(times, min(minute, 59) * mi_fac)
 *         else:
 */
    goto __pyx_L22;
  }

  /* "cytimes/pddt.py":2495
 *             times = utils.arr_add(times, min(minute, 59) * mi_fac)
 *         else:
 *             delta = utils.arr_mul(utils.dt64arr_minute(arr, my_unit), mi_fac)             # <<<<<<<<<<<<<<
 *             times = utils.arr_add_arr(times, delta)
 *         # . second
 */
  /*else*/ {
    __pyx_t_25.__pyx_n = 1;
    __pyx_t_25.arr_unit = __pyx_v_my_unit;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_minute(__pyx_v_arr, &__pyx_t_25)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(((PyArrayObject *)__pyx_t_3), __pyx_v_mi_fac, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":2496
 *         else:
 *             delta = utils.arr_mul(utils.dt64arr_minute(arr, my_unit), mi_fac)
 *             times = utils.arr_add_arr(times, delta)             # <<<<<<<<<<<<<<
 *         # . second
 *         if second >= 0:
 */
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_times, __pyx_v_delta, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;
  }
  __pyx_L22:;

  /* "cytimes/pddt.py":2498
 *             times = utils.arr_add_arr(times, delta)
 *         # . second
 *         if second >= 0:             # <<<<<<<<<<<<<<
 *             times = utils.arr_add(times, min(second, 59) * ss_fac)
 *         else:
 */
  __pyx_t_2 = (__pyx_v_second >= 0);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":2499
 *         # . second
 *         if second >= 0:
 *             times = utils.arr_add(times, min(second, 59) * ss_fac)             # <<<<<<<<<<<<<<
 *         else:
 *             delta = utils.arr_mul(utils.dt64arr_second(arr, my_unit), ss_fac)
 */
    __pyx_t_14 = 59;
    __pyx_t_15 = __pyx_v_second;
    __pyx_t_2 = (__pyx_t_14 < __pyx_t_15);
    if (__pyx_t_2) {
      __pyx_t_16 = __pyx_t_14;
    } else {
      __pyx_t_16 = __pyx_t_15;
    }
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_times, (__pyx_t_16 * __pyx_v_ss_fac))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":2498
 *             times = utils.arr_add_arr(times, delta)
 *         # . second
 *         if second >= 0:             # <<<<<<<<<<<<<<
 *             times = utils.arr_add(times, min(second, 59) * ss_fac)
 *         else:
 */
    goto __pyx_L23;
  }

  /* "cytimes/pddt.py":2501
 *             times = utils.arr_add(times, min(second, 59) * ss_fac)
 *         else:
 *             delta = utils.arr_mul(utils.dt64arr_second(arr, my_unit), ss_fac)             # <<<<<<<<<<<<<<
 *             times = utils.arr_add_arr(times, delta)
 *         # . microsecond
 */
  /*else*/ {
    __pyx_t_26.__pyx_n = 1;
    __pyx_t_26.arr_unit = __pyx_v_my_unit;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_second(__pyx_v_arr, &__pyx_t_26)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(((PyArrayObject *)__pyx_t_4), __pyx_v_ss_fac, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2502
 *         else:
 *             delta = utils.arr_mul(utils.dt64arr_second(arr, my_unit), ss_fac)
 *             times = utils.arr_add_arr(times, delta)             # <<<<<<<<<<<<<<
 *         # . microsecond
 *         if my_unit_ch != "s":
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_times, __pyx_v_delta, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;
  }
  __pyx_L23:;

  /* "cytimes/pddt.py":2504
 *             times = utils.arr_add_arr(times, delta)
 *         # . microsecond
 *         if my_unit_ch != "s":             # <<<<<<<<<<<<<<
 *             if microsecond >= 0:
 *                 times = utils.arr_add(times, min(microsecond, 999_999) * us_fac)
 */
  __pyx_t_2 = (__pyx_v_my_unit_ch != 0x73);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":2505
 *         # . microsecond
 *         if my_unit_ch != "s":
 *             if microsecond >= 0:             # <<<<<<<<<<<<<<
 *                 times = utils.arr_add(times, min(microsecond, 999_999) * us_fac)
 *             elif my_unit_ch == "m":
 */
    __pyx_t_2 = (__pyx_v_microsecond >= 0);
    if (__pyx_t_2) {

      /* "cytimes/pddt.py":2506
 *         if my_unit_ch != "s":
 *             if microsecond >= 0:
 *                 times = utils.arr_add(times, min(microsecond, 999_999) * us_fac)             # <<<<<<<<<<<<<<
 *             elif my_unit_ch == "m":
 *                 delta = utils.dt64arr_millisecond(arr, my_unit)
 */
      __pyx_t_16 = 0xF423F;
      __pyx_t_15 = __pyx_v_microsecond;
      __pyx_t_2 = (__pyx_t_16 < __pyx_t_15);
      if (__pyx_t_2) {
        __pyx_t_14 = __pyx_t_16;
      } else {
        __pyx_t_14 = __pyx_t_15;
      }
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_times, (__pyx_t_14 * __pyx_v_us_fac))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2506, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/pddt.py":2505
 *         # . microsecond
 *         if my_unit_ch != "s":
 *             if microsecond >= 0:             # <<<<<<<<<<<<<<
 *                 times = utils.arr_add(times, min(microsecond, 999_999) * us_fac)
 *             elif my_unit_ch == "m":
 */
      goto __pyx_L25;
    }

    /* "cytimes/pddt.py":2507
 *             if microsecond >= 0:
 *                 times = utils.arr_add(times, min(microsecond, 999_999) * us_fac)
 *             elif my_unit_ch == "m":             # <<<<<<<<<<<<<<
 *                 delta = utils.dt64arr_millisecond(arr, my_unit)
 *                 times = utils.arr_add_arr(times, delta)
 */
    __pyx_t_2 = (__pyx_v_my_unit_ch == 0x6D);
    if (__pyx_t_2) {

      /* "cytimes/pddt.py":2508
 *                 times = utils.arr_add(times, min(microsecond, 999_999) * us_fac)
 *             elif my_unit_ch == "m":
 *                 delta = utils.dt64arr_millisecond(arr, my_unit)             # <<<<<<<<<<<<<<
 *                 times = utils.arr_add_arr(times, delta)
 *             else:
 */
      __pyx_t_27.__pyx_n = 1;
      __pyx_t_27.arr_unit = __pyx_v_my_unit;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_millisecond(__pyx_v_arr, &__pyx_t_27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2508, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/pddt.py":2509
 *             elif my_unit_ch == "m":
 *                 delta = utils.dt64arr_millisecond(arr, my_unit)
 *                 times = utils.arr_add_arr(times, delta)             # <<<<<<<<<<<<<<
 *             else:
 *                 delta = utils.arr_mul(utils.dt64arr_microsecond(arr, my_unit), us_fac)
 */
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_times, __pyx_v_delta, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2509, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/pddt.py":2507
 *             if microsecond >= 0:
 *                 times = utils.arr_add(times, min(microsecond, 999_999) * us_fac)
 *             elif my_unit_ch == "m":             # <<<<<<<<<<<<<<
 *                 delta = utils.dt64arr_millisecond(arr, my_unit)
 *                 times = utils.arr_add_arr(times, delta)
 */
      goto __pyx_L25;
    }

    /* "cytimes/pddt.py":2511
 *                 times = utils.arr_add_arr(times, delta)
 *             else:
 *                 delta = utils.arr_mul(utils.dt64arr_microsecond(arr, my_unit), us_fac)             # <<<<<<<<<<<<<<
 *                 times = utils.arr_add_arr(times, delta)
 *         # . nanosecond
 */
    /*else*/ {
      __pyx_t_28.__pyx_n = 1;
      __pyx_t_28.arr_unit = __pyx_v_my_unit;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_microsecond(__pyx_v_arr, &__pyx_t_28)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2511, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(((PyArrayObject *)__pyx_t_3), __pyx_v_us_fac, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2511, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/pddt.py":2512
 *             else:
 *                 delta = utils.arr_mul(utils.dt64arr_microsecond(arr, my_unit), us_fac)
 *                 times = utils.arr_add_arr(times, delta)             # <<<<<<<<<<<<<<
 *         # . nanosecond
 *         if my_unit_ch == "n":
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_times, __pyx_v_delta, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2512, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;
    }
    __pyx_L25:;

    /* "cytimes/pddt.py":2504
 *             times = utils.arr_add_arr(times, delta)
 *         # . microsecond
 *         if my_unit_ch != "s":             # <<<<<<<<<<<<<<
 *             if microsecond >= 0:
 *                 times = utils.arr_add(times, min(microsecond, 999_999) * us_fac)
 */
  }

  /* "cytimes/pddt.py":2514
 *                 times = utils.arr_add_arr(times, delta)
 *         # . nanosecond
 *         if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *             if nanosecond >= 0:
 *                 times = utils.arr_add(times, min(nanosecond, 999))
 */
  __pyx_t_2 = (__pyx_v_my_unit_ch == 0x6E);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":2515
 *         # . nanosecond
 *         if my_unit_ch == "n":
 *             if nanosecond >= 0:             # <<<<<<<<<<<<<<
 *                 times = utils.arr_add(times, min(nanosecond, 999))
 *             else:
 */
    __pyx_t_2 = (__pyx_v_nanosecond >= 0);
    if (__pyx_t_2) {

      /* "cytimes/pddt.py":2516
 *         if my_unit_ch == "n":
 *             if nanosecond >= 0:
 *                 times = utils.arr_add(times, min(nanosecond, 999))             # <<<<<<<<<<<<<<
 *             else:
 *                 delta = utils.dt64arr_nanosecond(arr, my_unit)
 */
      __pyx_t_14 = 0x3E7;
      __pyx_t_15 = __pyx_v_nanosecond;
      __pyx_t_2 = (__pyx_t_14 < __pyx_t_15);
      if (__pyx_t_2) {
        __pyx_t_16 = __pyx_t_14;
      } else {
        __pyx_t_16 = __pyx_t_15;
      }
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_times, __pyx_t_16)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/pddt.py":2515
 *         # . nanosecond
 *         if my_unit_ch == "n":
 *             if nanosecond >= 0:             # <<<<<<<<<<<<<<
 *                 times = utils.arr_add(times, min(nanosecond, 999))
 *             else:
 */
      goto __pyx_L27;
    }

    /* "cytimes/pddt.py":2518
 *                 times = utils.arr_add(times, min(nanosecond, 999))
 *             else:
 *                 delta = utils.dt64arr_nanosecond(arr, my_unit)             # <<<<<<<<<<<<<<
 *                 times = utils.arr_add_arr(times, delta)
 * 
 */
    /*else*/ {
      __pyx_t_29.__pyx_n = 1;
      __pyx_t_29.arr_unit = __pyx_v_my_unit;
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_nanosecond(__pyx_v_arr, &__pyx_t_29)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2518, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/pddt.py":2519
 *             else:
 *                 delta = utils.dt64arr_nanosecond(arr, my_unit)
 *                 times = utils.arr_add_arr(times, delta)             # <<<<<<<<<<<<<<
 * 
 *         # Combine dates & times
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_times, __pyx_v_delta, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;
    }
    __pyx_L27:;

    /* "cytimes/pddt.py":2514
 *                 times = utils.arr_add_arr(times, delta)
 *         # . nanosecond
 *         if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *             if nanosecond >= 0:
 *                 times = utils.arr_add(times, min(nanosecond, 999))
 */
  }

  /* "cytimes/pddt.py":2522
 * 
 *         # Combine dates & times
 *         dtype = "datetime64[%s]" % my_unit_adj             # <<<<<<<<<<<<<<
 *         dates = utils.dt64arr_as_int64(datesD, my_unit_adj, "D")  # int64[my_unit]
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 */
  __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_my_unit_adj); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_dtype = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cytimes/pddt.py":2523
 *         # Combine dates & times
 *         dtype = "datetime64[%s]" % my_unit_adj
 *         dates = utils.dt64arr_as_int64(datesD, my_unit_adj, "D")  # int64[my_unit]             # <<<<<<<<<<<<<<
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 */
  __pyx_t_30.__pyx_n = 1;
  __pyx_t_30.arr_unit = __pyx_n_u_D;
  __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_datesD, __pyx_v_my_unit_adj, &__pyx_t_30)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_dates = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cytimes/pddt.py":2524
 *         dtype = "datetime64[%s]" % my_unit_adj
 *         dates = utils.dt64arr_as_int64(datesD, my_unit_adj, "D")  # int64[my_unit]
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_dates, __pyx_v_times, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_astype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_dtype};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2524, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
  __pyx_t_4 = 0;

  /* "cytimes/pddt.py":2525
 *         dates = utils.dt64arr_as_int64(datesD, my_unit_adj, "D")  # int64[my_unit]
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)             # <<<<<<<<<<<<<<
 * 
 *     def to_date(
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_31.__pyx_n = 3;
  __pyx_t_31.tz = __pyx_t_4;
  __pyx_t_31.unit = ((PyObject*)Py_None);
  __pyx_t_31.name = __pyx_t_7;
  __pyx_t_3 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_31); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":2383
 *         return pddt_new_simple(DatetimeIndex.snap(self, freq))
 * 
 *     def to_datetime(             # <<<<<<<<<<<<<<
 *         self,
 *         year: cython.int = -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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_delta);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesM);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesY);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesD);
  __Pyx_XDECREF((PyObject *)__pyx_v_times);
  __Pyx_XDECREF(__pyx_v_my_unit_adj);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XDECREF((PyObject *)__pyx_v_dates);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2527
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_date(             # <<<<<<<<<<<<<<
 *         self,
 *         year: cython.int = -1,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_121to_date(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_120to_date, "Adjust the date with new values `<'Pddt'>`.\n\n        #### Fields set to `-1` means retaining the original values.\n\n        :param year `<'int'>`: Year value, defaults to `-1`.\n        :param month `<'int'>`: Yonth value (1-12), defaults to `-1`.\n        :param day `<'int'>`: Day value (1-31), automacially clamped to the maximum days in the month, defaults to `-1`.\n\n        ### Equivalent to:\n        >>> pt.replace(year=year, month=month, day=day)\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_121to_date = {"to_date", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_121to_date, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_120to_date};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_121to_date(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_year;
  int __pyx_v_month;
  int __pyx_v_day;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_date (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_year,&__pyx_n_s_month,&__pyx_n_s_day,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2527, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_year);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2527, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_month);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2527, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_day);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2527, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_date") < 0)) __PYX_ERR(0, 2527, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    if (values[1]) {
      __pyx_v_year = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_year == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2529, __pyx_L3_error)
    } else {
      __pyx_v_year = ((int)((int)-1));
    }
    if (values[2]) {
      __pyx_v_month = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_month == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2530, __pyx_L3_error)
    } else {
      __pyx_v_month = ((int)((int)-1));
    }
    if (values[3]) {
      __pyx_v_day = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_day == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2531, __pyx_L3_error)
    } else {
      __pyx_v_day = ((int)((int)-1));
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_date", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 2527, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_date", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_120to_date(__pyx_self, __pyx_v_self, __pyx_v_year, __pyx_v_month, __pyx_v_day);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_120to_date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_year, int __pyx_v_month, int __pyx_v_day) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_my_unit = 0;
  PyArrayObject *__pyx_v_delta = 0;
  PyArrayObject *__pyx_v_times = NULL;
  PY_LONG_LONG __pyx_v_months;
  PyArrayObject *__pyx_v_datesM = NULL;
  PyArrayObject *__pyx_v_datesD = NULL;
  int __pyx_v_my_unit_ns;
  PyArrayObject *__pyx_v_dates = NULL;
  PyObject *__pyx_v_dtype = 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;
  unsigned int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_times __pyx_t_8;
  long __pyx_t_9;
  int __pyx_t_10;
  long __pyx_t_11;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_month __pyx_t_12;
  struct __pyx_opt_args_7cytimes_5utils_arr_add_arr __pyx_t_13;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_14;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_days_in_month __pyx_t_15;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_day __pyx_t_16;
  int __pyx_t_17;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_18;
  int __pyx_t_19;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 __pyx_t_20;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_date", 1);

  /* "cytimes/pddt.py":2545
 *         """
 *         # Fast-path
 *         if year <= 0:             # <<<<<<<<<<<<<<
 *             if month <= 0:
 *                 # . D replacements
 */
  __pyx_t_1 = (__pyx_v_year <= 0);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2546
 *         # Fast-path
 *         if year <= 0:
 *             if month <= 0:             # <<<<<<<<<<<<<<
 *                 # . D replacements
 *                 return self.to_curr_month(day)
 */
    __pyx_t_1 = (__pyx_v_month <= 0);
    if (__pyx_t_1) {

      /* "cytimes/pddt.py":2548
 *             if month <= 0:
 *                 # . D replacements
 *                 return self.to_curr_month(day)             # <<<<<<<<<<<<<<
 *             # . M/D replacements
 *             return self.to_curr_year(month, day)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_curr_month); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2548, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2548, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(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;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2548, __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;

      /* "cytimes/pddt.py":2546
 *         # Fast-path
 *         if year <= 0:
 *             if month <= 0:             # <<<<<<<<<<<<<<
 *                 # . D replacements
 *                 return self.to_curr_month(day)
 */
    }

    /* "cytimes/pddt.py":2550
 *                 return self.to_curr_month(day)
 *             # . M/D replacements
 *             return self.to_curr_year(month, day)             # <<<<<<<<<<<<<<
 * 
 *         # Access datetime array & info
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_curr_year); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2550, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_month); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2550, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_day); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2550, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_4, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2550, __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;

    /* "cytimes/pddt.py":2545
 *         """
 *         # Fast-path
 *         if year <= 0:             # <<<<<<<<<<<<<<
 *             if month <= 0:
 *                 # . D replacements
 */
  }

  /* "cytimes/pddt.py":2553
 * 
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 *         delta: np.ndarray
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2553, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2554
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 *         delta: np.ndarray
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 2554, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2558
 * 
 *         # Seperate times
 *         times = utils.dt64arr_times(arr, my_unit)  # int64[my_unit]             # <<<<<<<<<<<<<<
 * 
 *         # Construct dates
 */
  __pyx_t_8.__pyx_n = 1;
  __pyx_t_8.arr_unit = __pyx_v_my_unit;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_times(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_times = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2561
 * 
 *         # Construct dates
 *         months = (year - utils.EPOCH_YEAR) * 12  # year+off             # <<<<<<<<<<<<<<
 *         datesM = utils.arr_full_int64(months, arr.shape[0])  # int64[M]
 *         if month > 0:
 */
  __pyx_v_months = ((__pyx_v_year - __pyx_v_7cytimes_5utils_EPOCH_YEAR) * 12);

  /* "cytimes/pddt.py":2562
 *         # Construct dates
 *         months = (year - utils.EPOCH_YEAR) * 12  # year+off
 *         datesM = utils.arr_full_int64(months, arr.shape[0])  # int64[M]             # <<<<<<<<<<<<<<
 *         if month > 0:
 *             datesM = utils.arr_add(datesM, min(month, 12) - 1)  # int64[M]
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_full_int64(__pyx_v_months, (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_datesM = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2563
 *         months = (year - utils.EPOCH_YEAR) * 12  # year+off
 *         datesM = utils.arr_full_int64(months, arr.shape[0])  # int64[M]
 *         if month > 0:             # <<<<<<<<<<<<<<
 *             datesM = utils.arr_add(datesM, min(month, 12) - 1)  # int64[M]
 *         else:
 */
  __pyx_t_1 = (__pyx_v_month > 0);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2564
 *         datesM = utils.arr_full_int64(months, arr.shape[0])  # int64[M]
 *         if month > 0:
 *             datesM = utils.arr_add(datesM, min(month, 12) - 1)  # int64[M]             # <<<<<<<<<<<<<<
 *         else:
 *             delta = utils.dt64arr_month(arr, my_unit)
 */
    __pyx_t_9 = 12;
    __pyx_t_10 = __pyx_v_month;
    __pyx_t_1 = (__pyx_t_9 < __pyx_t_10);
    if (__pyx_t_1) {
      __pyx_t_11 = __pyx_t_9;
    } else {
      __pyx_t_11 = __pyx_t_10;
    }
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_datesM, (__pyx_t_11 - 1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_datesM, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2563
 *         months = (year - utils.EPOCH_YEAR) * 12  # year+off
 *         datesM = utils.arr_full_int64(months, arr.shape[0])  # int64[M]
 *         if month > 0:             # <<<<<<<<<<<<<<
 *             datesM = utils.arr_add(datesM, min(month, 12) - 1)  # int64[M]
 *         else:
 */
    goto __pyx_L5;
  }

  /* "cytimes/pddt.py":2566
 *             datesM = utils.arr_add(datesM, min(month, 12) - 1)  # int64[M]
 *         else:
 *             delta = utils.dt64arr_month(arr, my_unit)             # <<<<<<<<<<<<<<
 *             datesM = utils.arr_add_arr(datesM, delta, -1)  # int64[M]
 *         datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 */
  /*else*/ {
    __pyx_t_12.__pyx_n = 1;
    __pyx_t_12.arr_unit = __pyx_v_my_unit;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_month(__pyx_v_arr, &__pyx_t_12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2567
 *         else:
 *             delta = utils.dt64arr_month(arr, my_unit)
 *             datesM = utils.arr_add_arr(datesM, delta, -1)  # int64[M]             # <<<<<<<<<<<<<<
 *         datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         delta = utils.dt64arr_days_in_month(datesM, "M")
 */
    __pyx_t_13.__pyx_n = 1;
    __pyx_t_13.offset = -1LL;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesM, __pyx_v_delta, &__pyx_t_13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2567, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_datesM, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;
  }
  __pyx_L5:;

  /* "cytimes/pddt.py":2568
 *             delta = utils.dt64arr_month(arr, my_unit)
 *             datesM = utils.arr_add_arr(datesM, delta, -1)  # int64[M]
 *         datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *         delta = utils.dt64arr_days_in_month(datesM, "M")
 *         if day > 0:
 */
  __pyx_t_14.__pyx_n = 1;
  __pyx_t_14.arr_unit = __pyx_n_u_M;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_datesD = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2569
 *             datesM = utils.arr_add_arr(datesM, delta, -1)  # int64[M]
 *         datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         delta = utils.dt64arr_days_in_month(datesM, "M")             # <<<<<<<<<<<<<<
 *         if day > 0:
 *             delta = utils.arr_min(delta, day)
 */
  __pyx_t_15.__pyx_n = 1;
  __pyx_t_15.arr_unit = __pyx_n_u_M;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_in_month(__pyx_v_datesM, &__pyx_t_15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_XDECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2570
 *         datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         delta = utils.dt64arr_days_in_month(datesM, "M")
 *         if day > 0:             # <<<<<<<<<<<<<<
 *             delta = utils.arr_min(delta, day)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_day > 0);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2571
 *         delta = utils.dt64arr_days_in_month(datesM, "M")
 *         if day > 0:
 *             delta = utils.arr_min(delta, day)             # <<<<<<<<<<<<<<
 *         else:
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))
 */
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_min(__pyx_v_delta, __pyx_v_day, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2571, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2570
 *         datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *         delta = utils.dt64arr_days_in_month(datesM, "M")
 *         if day > 0:             # <<<<<<<<<<<<<<
 *             delta = utils.arr_min(delta, day)
 *         else:
 */
    goto __pyx_L6;
  }

  /* "cytimes/pddt.py":2573
 *             delta = utils.arr_min(delta, day)
 *         else:
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))             # <<<<<<<<<<<<<<
 *         datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]
 * 
 */
  /*else*/ {
    __pyx_t_16.__pyx_n = 1;
    __pyx_t_16.arr_unit = __pyx_v_my_unit;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_day(__pyx_v_arr, &__pyx_t_16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2573, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_min_arr(__pyx_v_delta, ((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2573, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;
  }
  __pyx_L6:;

  /* "cytimes/pddt.py":2574
 *         else:
 *             delta = utils.arr_min_arr(delta, utils.dt64arr_day(arr, my_unit))
 *         datesD = utils.arr_add_arr(datesD, delta, -1)  # int64[D]             # <<<<<<<<<<<<<<
 * 
 *         # Combine dates & times
 */
  __pyx_t_13.__pyx_n = 1;
  __pyx_t_13.offset = -1LL;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesD, __pyx_v_delta, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2577
 * 
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"             # <<<<<<<<<<<<<<
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 */
  __pyx_v_my_unit_ns = (PyUnicode_READ_CHAR(__pyx_v_my_unit, 0) == 0x6E);

  /* "cytimes/pddt.py":2578
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
  if (__pyx_v_my_unit_ns) {
  } else {
    __pyx_t_1 = __pyx_v_my_unit_ns;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_18.__pyx_n = 1;
  __pyx_t_18.arr_unit = __pyx_n_u_D;
  __pyx_t_17 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_datesD, &__pyx_t_18); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 2578, __pyx_L1_error)
  __pyx_t_19 = (!__pyx_t_17);
  __pyx_t_1 = __pyx_t_19;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2579
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]             # <<<<<<<<<<<<<<
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_datesD, __pyx_v_7cytimes_5utils_US_DAY, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2580
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[us]"
 *         else:
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_times, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2581
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 */
    __Pyx_INCREF(__pyx_kp_u_datetime64_us);
    __pyx_v_dtype = __pyx_kp_u_datetime64_us;

    /* "cytimes/pddt.py":2578
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
    goto __pyx_L7;
  }

  /* "cytimes/pddt.py":2583
 *             dtype = "datetime64[us]"
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 */
  /*else*/ {
    __pyx_t_20.__pyx_n = 1;
    __pyx_t_20.arr_unit = __pyx_n_u_D;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_datesD, __pyx_v_my_unit, &__pyx_t_20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2584
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit             # <<<<<<<<<<<<<<
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 */
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_my_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_dtype = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L7:;

  /* "cytimes/pddt.py":2585
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_dates, __pyx_v_times, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_dtype};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2585, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2586
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)             # <<<<<<<<<<<<<<
 * 
 *     def to_time(
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_21.__pyx_n = 3;
  __pyx_t_21.tz = __pyx_t_3;
  __pyx_t_21.unit = ((PyObject*)Py_None);
  __pyx_t_21.name = __pyx_t_5;
  __pyx_t_2 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_21); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":2527
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_date(             # <<<<<<<<<<<<<<
 *         self,
 *         year: cython.int = -1,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_date", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_delta);
  __Pyx_XDECREF((PyObject *)__pyx_v_times);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesM);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesD);
  __Pyx_XDECREF((PyObject *)__pyx_v_dates);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2588
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_time(             # <<<<<<<<<<<<<<
 *         self,
 *         hour: cython.int = -1,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_123to_time(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_122to_time, "Adjust the time fields with new values `<'Pddt'>`.\n\n        #### Fields set to `-1` means retaining the original values.\n\n        :param hour `<'int'>`: Hour value (0-23), defaults to `-1`.\n        :param minute `<'int'>`: Minute value (0-59), defaults to `-1`.\n        :param second `<'int'>`: Second value (0-59), defaults to `-1`.\n        :param microsecond `<'int'>`: Microsecond value (0-999999), defaults to `-1`.\n\n        ### Equivalent to:\n        >>> pt.replace(\n                hour=hour,\n                minute=minute,\n                second=second,\n                microsecond=microsecond,\n            )\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_123to_time = {"to_time", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_123to_time, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_122to_time};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_123to_time(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_hour;
  int __pyx_v_minute;
  int __pyx_v_second;
  int __pyx_v_microsecond;
  int __pyx_v_nanosecond;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_time (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_hour,&__pyx_n_s_minute,&__pyx_n_s_second,&__pyx_n_s_microsecond,&__pyx_n_s_nanosecond,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2588, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hour);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2588, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_minute);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2588, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_second);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2588, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_microsecond);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2588, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nanosecond);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2588, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_time") < 0)) __PYX_ERR(0, 2588, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    if (values[1]) {
      __pyx_v_hour = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_hour == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2590, __pyx_L3_error)
    } else {
      __pyx_v_hour = ((int)((int)-1));
    }
    if (values[2]) {
      __pyx_v_minute = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_minute == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2591, __pyx_L3_error)
    } else {
      __pyx_v_minute = ((int)((int)-1));
    }
    if (values[3]) {
      __pyx_v_second = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_second == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2592, __pyx_L3_error)
    } else {
      __pyx_v_second = ((int)((int)-1));
    }
    if (values[4]) {
      __pyx_v_microsecond = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_microsecond == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2593, __pyx_L3_error)
    } else {
      __pyx_v_microsecond = ((int)((int)-1));
    }
    if (values[5]) {
      __pyx_v_nanosecond = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_nanosecond == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2594, __pyx_L3_error)
    } else {
      __pyx_v_nanosecond = ((int)((int)-1));
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_time", 0, 1, 6, __pyx_nargs); __PYX_ERR(0, 2588, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_122to_time(__pyx_self, __pyx_v_self, __pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_nanosecond);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_122to_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, int __pyx_v_nanosecond) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_my_unit = 0;
  Py_UCS4 __pyx_v_my_unit_ch;
  PyArrayObject *__pyx_v_delta = 0;
  PY_LONG_LONG __pyx_v_hh_fac;
  PY_LONG_LONG __pyx_v_mi_fac;
  PY_LONG_LONG __pyx_v_ss_fac;
  PY_LONG_LONG __pyx_v_us_fac;
  PyArrayObject *__pyx_v_datesD = 0;
  PyObject *__pyx_v_my_unit_adj = 0;
  PyArrayObject *__pyx_v_times = 0;
  PyObject *__pyx_v_dtype = NULL;
  PyArrayObject *__pyx_v_dates = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_4;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  long __pyx_t_7;
  int __pyx_t_8;
  long __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_hour __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_minute __pyx_t_12;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_second __pyx_t_13;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_millisecond __pyx_t_14;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_microsecond __pyx_t_15;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_nanosecond __pyx_t_16;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  unsigned int __pyx_t_19;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_time", 1);

  /* "cytimes/pddt.py":2615
 *         # Fast-path: no changes
 *         if (
 *             hour < 0             # <<<<<<<<<<<<<<
 *             and minute < 0
 *             and second < 0
 */
  __pyx_t_2 = (__pyx_v_hour < 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cytimes/pddt.py":2616
 *         if (
 *             hour < 0
 *             and minute < 0             # <<<<<<<<<<<<<<
 *             and second < 0
 *             and microsecond < 0
 */
  __pyx_t_2 = (__pyx_v_minute < 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cytimes/pddt.py":2617
 *             hour < 0
 *             and minute < 0
 *             and second < 0             # <<<<<<<<<<<<<<
 *             and microsecond < 0
 *             and nanosecond < 0
 */
  __pyx_t_2 = (__pyx_v_second < 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cytimes/pddt.py":2618
 *             and minute < 0
 *             and second < 0
 *             and microsecond < 0             # <<<<<<<<<<<<<<
 *             and nanosecond < 0
 *         ):
 */
  __pyx_t_2 = (__pyx_v_microsecond < 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cytimes/pddt.py":2619
 *             and second < 0
 *             and microsecond < 0
 *             and nanosecond < 0             # <<<<<<<<<<<<<<
 *         ):
 *             return self
 */
  __pyx_t_2 = (__pyx_v_nanosecond < 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;

  /* "cytimes/pddt.py":2614
 *         """
 *         # Fast-path: no changes
 *         if (             # <<<<<<<<<<<<<<
 *             hour < 0
 *             and minute < 0
 */
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2621
 *             and nanosecond < 0
 *         ):
 *             return self             # <<<<<<<<<<<<<<
 * 
 *         # Access datetime array & info
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":2614
 *         """
 *         # Fast-path: no changes
 *         if (             # <<<<<<<<<<<<<<
 *             hour < 0
 *             and minute < 0
 */
  }

  /* "cytimes/pddt.py":2624
 * 
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 *         my_unit_ch: cython.Py_UCS4 = str_read(my_unit, 0)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2624, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2625
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 *         my_unit_ch: cython.Py_UCS4 = str_read(my_unit, 0)
 *         delta: np.ndarray
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_3))) __PYX_ERR(0, 2625, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2626
 *         arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit
 *         my_unit_ch: cython.Py_UCS4 = str_read(my_unit, 0)             # <<<<<<<<<<<<<<
 *         delta: np.ndarray
 *         hh_fac: cython.longlong
 */
  __pyx_v_my_unit_ch = PyUnicode_READ_CHAR(__pyx_v_my_unit, 0);

  /* "cytimes/pddt.py":2634
 * 
 *         # Seperate dates
 *         datesD: np.ndarray = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]             # <<<<<<<<<<<<<<
 * 
 *         # Get conversion factors
 */
  __pyx_t_4.__pyx_n = 1;
  __pyx_t_4.arr_unit = __pyx_v_my_unit;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_datesD = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2637
 * 
 *         # Get conversion factors
 *         my_unit_adj: str = my_unit             # <<<<<<<<<<<<<<
 *         if my_unit_ch == "n" and utils.is_dt64arr_ns_safe(datesD, "D"):
 *             hh_fac = utils.NS_HOUR
 */
  __Pyx_INCREF(__pyx_v_my_unit);
  __pyx_v_my_unit_adj = __pyx_v_my_unit;

  /* "cytimes/pddt.py":2638
 *         # Get conversion factors
 *         my_unit_adj: str = my_unit
 *         if my_unit_ch == "n" and utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             hh_fac = utils.NS_HOUR
 *             mi_fac = utils.NS_MINUTE
 */
  __pyx_t_2 = (__pyx_v_my_unit_ch == 0x6E);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L10_bool_binop_done;
  }
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.arr_unit = __pyx_n_u_D;
  __pyx_t_2 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_datesD, &__pyx_t_5); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2638, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __pyx_L10_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2639
 *         my_unit_adj: str = my_unit
 *         if my_unit_ch == "n" and utils.is_dt64arr_ns_safe(datesD, "D"):
 *             hh_fac = utils.NS_HOUR             # <<<<<<<<<<<<<<
 *             mi_fac = utils.NS_MINUTE
 *             ss_fac = utils.NS_SECOND
 */
    __pyx_v_hh_fac = __pyx_v_7cytimes_5utils_NS_HOUR;

    /* "cytimes/pddt.py":2640
 *         if my_unit_ch == "n" and utils.is_dt64arr_ns_safe(datesD, "D"):
 *             hh_fac = utils.NS_HOUR
 *             mi_fac = utils.NS_MINUTE             # <<<<<<<<<<<<<<
 *             ss_fac = utils.NS_SECOND
 *             us_fac = utils.NS_MICROSECOND
 */
    __pyx_v_mi_fac = __pyx_v_7cytimes_5utils_NS_MINUTE;

    /* "cytimes/pddt.py":2641
 *             hh_fac = utils.NS_HOUR
 *             mi_fac = utils.NS_MINUTE
 *             ss_fac = utils.NS_SECOND             # <<<<<<<<<<<<<<
 *             us_fac = utils.NS_MICROSECOND
 *         elif my_unit_ch in ("n", "u"):
 */
    __pyx_v_ss_fac = __pyx_v_7cytimes_5utils_NS_SECOND;

    /* "cytimes/pddt.py":2642
 *             mi_fac = utils.NS_MINUTE
 *             ss_fac = utils.NS_SECOND
 *             us_fac = utils.NS_MICROSECOND             # <<<<<<<<<<<<<<
 *         elif my_unit_ch in ("n", "u"):
 *             hh_fac = utils.US_HOUR
 */
    __pyx_v_us_fac = __pyx_v_7cytimes_5utils_NS_MICROSECOND;

    /* "cytimes/pddt.py":2638
 *         # Get conversion factors
 *         my_unit_adj: str = my_unit
 *         if my_unit_ch == "n" and utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             hh_fac = utils.NS_HOUR
 *             mi_fac = utils.NS_MINUTE
 */
    goto __pyx_L9;
  }

  /* "cytimes/pddt.py":2643
 *             ss_fac = utils.NS_SECOND
 *             us_fac = utils.NS_MICROSECOND
 *         elif my_unit_ch in ("n", "u"):             # <<<<<<<<<<<<<<
 *             hh_fac = utils.US_HOUR
 *             mi_fac = utils.US_MINUTE
 */
  switch (__pyx_v_my_unit_ch) {
    case 0x6E:
    case 0x75:
    __pyx_t_1 = 1;
    break;
    default:
    __pyx_t_1 = 0;
    break;
  }
  __pyx_t_2 = __pyx_t_1;
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":2644
 *             us_fac = utils.NS_MICROSECOND
 *         elif my_unit_ch in ("n", "u"):
 *             hh_fac = utils.US_HOUR             # <<<<<<<<<<<<<<
 *             mi_fac = utils.US_MINUTE
 *             ss_fac = utils.US_SECOND
 */
    __pyx_v_hh_fac = __pyx_v_7cytimes_5utils_US_HOUR;

    /* "cytimes/pddt.py":2645
 *         elif my_unit_ch in ("n", "u"):
 *             hh_fac = utils.US_HOUR
 *             mi_fac = utils.US_MINUTE             # <<<<<<<<<<<<<<
 *             ss_fac = utils.US_SECOND
 *             us_fac = 1
 */
    __pyx_v_mi_fac = __pyx_v_7cytimes_5utils_US_MINUTE;

    /* "cytimes/pddt.py":2646
 *             hh_fac = utils.US_HOUR
 *             mi_fac = utils.US_MINUTE
 *             ss_fac = utils.US_SECOND             # <<<<<<<<<<<<<<
 *             us_fac = 1
 *             if my_unit_ch == "n":
 */
    __pyx_v_ss_fac = __pyx_v_7cytimes_5utils_US_SECOND;

    /* "cytimes/pddt.py":2647
 *             mi_fac = utils.US_MINUTE
 *             ss_fac = utils.US_SECOND
 *             us_fac = 1             # <<<<<<<<<<<<<<
 *             if my_unit_ch == "n":
 *                 my_unit_ch, my_unit_adj = "u", "us"
 */
    __pyx_v_us_fac = 1;

    /* "cytimes/pddt.py":2648
 *             ss_fac = utils.US_SECOND
 *             us_fac = 1
 *             if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *                 my_unit_ch, my_unit_adj = "u", "us"
 *         elif my_unit_ch == "m":
 */
    __pyx_t_2 = (__pyx_v_my_unit_ch == 0x6E);
    if (__pyx_t_2) {

      /* "cytimes/pddt.py":2649
 *             us_fac = 1
 *             if my_unit_ch == "n":
 *                 my_unit_ch, my_unit_adj = "u", "us"             # <<<<<<<<<<<<<<
 *         elif my_unit_ch == "m":
 *             hh_fac = utils.MS_HOUR
 */
      __pyx_t_6 = 0x75;
      __pyx_t_3 = __pyx_n_u_us;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_v_my_unit_ch = __pyx_t_6;
      __Pyx_DECREF_SET(__pyx_v_my_unit_adj, ((PyObject*)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/pddt.py":2648
 *             ss_fac = utils.US_SECOND
 *             us_fac = 1
 *             if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *                 my_unit_ch, my_unit_adj = "u", "us"
 *         elif my_unit_ch == "m":
 */
    }

    /* "cytimes/pddt.py":2643
 *             ss_fac = utils.NS_SECOND
 *             us_fac = utils.NS_MICROSECOND
 *         elif my_unit_ch in ("n", "u"):             # <<<<<<<<<<<<<<
 *             hh_fac = utils.US_HOUR
 *             mi_fac = utils.US_MINUTE
 */
    goto __pyx_L9;
  }

  /* "cytimes/pddt.py":2650
 *             if my_unit_ch == "n":
 *                 my_unit_ch, my_unit_adj = "u", "us"
 *         elif my_unit_ch == "m":             # <<<<<<<<<<<<<<
 *             hh_fac = utils.MS_HOUR
 *             mi_fac = utils.MS_MINUTE
 */
  __pyx_t_2 = (__pyx_v_my_unit_ch == 0x6D);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":2651
 *                 my_unit_ch, my_unit_adj = "u", "us"
 *         elif my_unit_ch == "m":
 *             hh_fac = utils.MS_HOUR             # <<<<<<<<<<<<<<
 *             mi_fac = utils.MS_MINUTE
 *             ss_fac = utils.MS_SECOND
 */
    __pyx_v_hh_fac = __pyx_v_7cytimes_5utils_MS_HOUR;

    /* "cytimes/pddt.py":2652
 *         elif my_unit_ch == "m":
 *             hh_fac = utils.MS_HOUR
 *             mi_fac = utils.MS_MINUTE             # <<<<<<<<<<<<<<
 *             ss_fac = utils.MS_SECOND
 *             us_fac = 1
 */
    __pyx_v_mi_fac = __pyx_v_7cytimes_5utils_MS_MINUTE;

    /* "cytimes/pddt.py":2653
 *             hh_fac = utils.MS_HOUR
 *             mi_fac = utils.MS_MINUTE
 *             ss_fac = utils.MS_SECOND             # <<<<<<<<<<<<<<
 *             us_fac = 1
 *             if microsecond != 0:
 */
    __pyx_v_ss_fac = __pyx_v_7cytimes_5utils_MS_SECOND;

    /* "cytimes/pddt.py":2654
 *             mi_fac = utils.MS_MINUTE
 *             ss_fac = utils.MS_SECOND
 *             us_fac = 1             # <<<<<<<<<<<<<<
 *             if microsecond != 0:
 *                 microsecond = min(microsecond, 999_999) // 1_000
 */
    __pyx_v_us_fac = 1;

    /* "cytimes/pddt.py":2655
 *             ss_fac = utils.MS_SECOND
 *             us_fac = 1
 *             if microsecond != 0:             # <<<<<<<<<<<<<<
 *                 microsecond = min(microsecond, 999_999) // 1_000
 *         else:
 */
    __pyx_t_2 = (__pyx_v_microsecond != 0);
    if (__pyx_t_2) {

      /* "cytimes/pddt.py":2656
 *             us_fac = 1
 *             if microsecond != 0:
 *                 microsecond = min(microsecond, 999_999) // 1_000             # <<<<<<<<<<<<<<
 *         else:
 *             hh_fac = utils.SS_HOUR
 */
      __pyx_t_7 = 0xF423F;
      __pyx_t_8 = __pyx_v_microsecond;
      __pyx_t_2 = (__pyx_t_7 < __pyx_t_8);
      if (__pyx_t_2) {
        __pyx_t_9 = __pyx_t_7;
      } else {
        __pyx_t_9 = __pyx_t_8;
      }
      __pyx_v_microsecond = __Pyx_div_long(__pyx_t_9, 0x3E8);

      /* "cytimes/pddt.py":2655
 *             ss_fac = utils.MS_SECOND
 *             us_fac = 1
 *             if microsecond != 0:             # <<<<<<<<<<<<<<
 *                 microsecond = min(microsecond, 999_999) // 1_000
 *         else:
 */
    }

    /* "cytimes/pddt.py":2650
 *             if my_unit_ch == "n":
 *                 my_unit_ch, my_unit_adj = "u", "us"
 *         elif my_unit_ch == "m":             # <<<<<<<<<<<<<<
 *             hh_fac = utils.MS_HOUR
 *             mi_fac = utils.MS_MINUTE
 */
    goto __pyx_L9;
  }

  /* "cytimes/pddt.py":2658
 *                 microsecond = min(microsecond, 999_999) // 1_000
 *         else:
 *             hh_fac = utils.SS_HOUR             # <<<<<<<<<<<<<<
 *             mi_fac = utils.SS_MINUTE
 *             ss_fac = 1
 */
  /*else*/ {
    __pyx_v_hh_fac = __pyx_v_7cytimes_5utils_SS_HOUR;

    /* "cytimes/pddt.py":2659
 *         else:
 *             hh_fac = utils.SS_HOUR
 *             mi_fac = utils.SS_MINUTE             # <<<<<<<<<<<<<<
 *             ss_fac = 1
 * 
 */
    __pyx_v_mi_fac = __pyx_v_7cytimes_5utils_SS_MINUTE;

    /* "cytimes/pddt.py":2660
 *             hh_fac = utils.SS_HOUR
 *             mi_fac = utils.SS_MINUTE
 *             ss_fac = 1             # <<<<<<<<<<<<<<
 * 
 *         # Construct times
 */
    __pyx_v_ss_fac = 1;
  }
  __pyx_L9:;

  /* "cytimes/pddt.py":2663
 * 
 *         # Construct times
 *         times: np.ndarray = utils.arr_zero_int64(arr.shape[0])  # int64[my_unit]             # <<<<<<<<<<<<<<
 *         # . hour
 *         if hour >= 0:
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_zero_int64((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_times = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2665
 *         times: np.ndarray = utils.arr_zero_int64(arr.shape[0])  # int64[my_unit]
 *         # . hour
 *         if hour >= 0:             # <<<<<<<<<<<<<<
 *             times = utils.arr_add(times, min(hour, 23) * hh_fac)
 *         else:
 */
  __pyx_t_2 = (__pyx_v_hour >= 0);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":2666
 *         # . hour
 *         if hour >= 0:
 *             times = utils.arr_add(times, min(hour, 23) * hh_fac)             # <<<<<<<<<<<<<<
 *         else:
 *             delta = utils.arr_mul(utils.dt64arr_hour(arr, my_unit), hh_fac)
 */
    __pyx_t_9 = 23;
    __pyx_t_8 = __pyx_v_hour;
    __pyx_t_2 = (__pyx_t_9 < __pyx_t_8);
    if (__pyx_t_2) {
      __pyx_t_7 = __pyx_t_9;
    } else {
      __pyx_t_7 = __pyx_t_8;
    }
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_times, (__pyx_t_7 * __pyx_v_hh_fac))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2665
 *         times: np.ndarray = utils.arr_zero_int64(arr.shape[0])  # int64[my_unit]
 *         # . hour
 *         if hour >= 0:             # <<<<<<<<<<<<<<
 *             times = utils.arr_add(times, min(hour, 23) * hh_fac)
 *         else:
 */
    goto __pyx_L14;
  }

  /* "cytimes/pddt.py":2668
 *             times = utils.arr_add(times, min(hour, 23) * hh_fac)
 *         else:
 *             delta = utils.arr_mul(utils.dt64arr_hour(arr, my_unit), hh_fac)             # <<<<<<<<<<<<<<
 *             times = utils.arr_add_arr(times, delta)
 *         # . minute
 */
  /*else*/ {
    __pyx_t_10.__pyx_n = 1;
    __pyx_t_10.arr_unit = __pyx_v_my_unit;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_hour(__pyx_v_arr, &__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(((PyArrayObject *)__pyx_t_3), __pyx_v_hh_fac, NULL)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_11);
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":2669
 *         else:
 *             delta = utils.arr_mul(utils.dt64arr_hour(arr, my_unit), hh_fac)
 *             times = utils.arr_add_arr(times, delta)             # <<<<<<<<<<<<<<
 *         # . minute
 *         if minute >= 0:
 */
    __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_times, __pyx_v_delta, NULL)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_11));
    __pyx_t_11 = 0;
  }
  __pyx_L14:;

  /* "cytimes/pddt.py":2671
 *             times = utils.arr_add_arr(times, delta)
 *         # . minute
 *         if minute >= 0:             # <<<<<<<<<<<<<<
 *             times = utils.arr_add(times, min(minute, 59) * mi_fac)
 *         else:
 */
  __pyx_t_2 = (__pyx_v_minute >= 0);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":2672
 *         # . minute
 *         if minute >= 0:
 *             times = utils.arr_add(times, min(minute, 59) * mi_fac)             # <<<<<<<<<<<<<<
 *         else:
 *             delta = utils.arr_mul(utils.dt64arr_minute(arr, my_unit), mi_fac)
 */
    __pyx_t_7 = 59;
    __pyx_t_8 = __pyx_v_minute;
    __pyx_t_2 = (__pyx_t_7 < __pyx_t_8);
    if (__pyx_t_2) {
      __pyx_t_9 = __pyx_t_7;
    } else {
      __pyx_t_9 = __pyx_t_8;
    }
    __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_times, (__pyx_t_9 * __pyx_v_mi_fac))); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2672, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_11));
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":2671
 *             times = utils.arr_add_arr(times, delta)
 *         # . minute
 *         if minute >= 0:             # <<<<<<<<<<<<<<
 *             times = utils.arr_add(times, min(minute, 59) * mi_fac)
 *         else:
 */
    goto __pyx_L15;
  }

  /* "cytimes/pddt.py":2674
 *             times = utils.arr_add(times, min(minute, 59) * mi_fac)
 *         else:
 *             delta = utils.arr_mul(utils.dt64arr_minute(arr, my_unit), mi_fac)             # <<<<<<<<<<<<<<
 *             times = utils.arr_add_arr(times, delta)
 *         # . second
 */
  /*else*/ {
    __pyx_t_12.__pyx_n = 1;
    __pyx_t_12.arr_unit = __pyx_v_my_unit;
    __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_minute(__pyx_v_arr, &__pyx_t_12)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(((PyArrayObject *)__pyx_t_11), __pyx_v_mi_fac, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2675
 *         else:
 *             delta = utils.arr_mul(utils.dt64arr_minute(arr, my_unit), mi_fac)
 *             times = utils.arr_add_arr(times, delta)             # <<<<<<<<<<<<<<
 *         # . second
 *         if second >= 0:
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_times, __pyx_v_delta, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;
  }
  __pyx_L15:;

  /* "cytimes/pddt.py":2677
 *             times = utils.arr_add_arr(times, delta)
 *         # . second
 *         if second >= 0:             # <<<<<<<<<<<<<<
 *             times = utils.arr_add(times, min(second, 59) * ss_fac)
 *         else:
 */
  __pyx_t_2 = (__pyx_v_second >= 0);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":2678
 *         # . second
 *         if second >= 0:
 *             times = utils.arr_add(times, min(second, 59) * ss_fac)             # <<<<<<<<<<<<<<
 *         else:
 *             delta = utils.arr_mul(utils.dt64arr_second(arr, my_unit), ss_fac)
 */
    __pyx_t_9 = 59;
    __pyx_t_8 = __pyx_v_second;
    __pyx_t_2 = (__pyx_t_9 < __pyx_t_8);
    if (__pyx_t_2) {
      __pyx_t_7 = __pyx_t_9;
    } else {
      __pyx_t_7 = __pyx_t_8;
    }
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_times, (__pyx_t_7 * __pyx_v_ss_fac))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":2677
 *             times = utils.arr_add_arr(times, delta)
 *         # . second
 *         if second >= 0:             # <<<<<<<<<<<<<<
 *             times = utils.arr_add(times, min(second, 59) * ss_fac)
 *         else:
 */
    goto __pyx_L16;
  }

  /* "cytimes/pddt.py":2680
 *             times = utils.arr_add(times, min(second, 59) * ss_fac)
 *         else:
 *             delta = utils.arr_mul(utils.dt64arr_second(arr, my_unit), ss_fac)             # <<<<<<<<<<<<<<
 *             times = utils.arr_add_arr(times, delta)
 *         # . microsecond
 */
  /*else*/ {
    __pyx_t_13.__pyx_n = 1;
    __pyx_t_13.arr_unit = __pyx_v_my_unit;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_second(__pyx_v_arr, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2680, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(((PyArrayObject *)__pyx_t_3), __pyx_v_ss_fac, NULL)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2680, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_11));
    __pyx_t_11 = 0;

    /* "cytimes/pddt.py":2681
 *         else:
 *             delta = utils.arr_mul(utils.dt64arr_second(arr, my_unit), ss_fac)
 *             times = utils.arr_add_arr(times, delta)             # <<<<<<<<<<<<<<
 *         # . microsecond
 *         if my_unit_ch != "s":
 */
    __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_times, __pyx_v_delta, NULL)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_11));
    __pyx_t_11 = 0;
  }
  __pyx_L16:;

  /* "cytimes/pddt.py":2683
 *             times = utils.arr_add_arr(times, delta)
 *         # . microsecond
 *         if my_unit_ch != "s":             # <<<<<<<<<<<<<<
 *             if microsecond >= 0:
 *                 times = utils.arr_add(times, min(microsecond, 999_999) * us_fac)
 */
  __pyx_t_2 = (__pyx_v_my_unit_ch != 0x73);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":2684
 *         # . microsecond
 *         if my_unit_ch != "s":
 *             if microsecond >= 0:             # <<<<<<<<<<<<<<
 *                 times = utils.arr_add(times, min(microsecond, 999_999) * us_fac)
 *             elif my_unit_ch == "m":
 */
    __pyx_t_2 = (__pyx_v_microsecond >= 0);
    if (__pyx_t_2) {

      /* "cytimes/pddt.py":2685
 *         if my_unit_ch != "s":
 *             if microsecond >= 0:
 *                 times = utils.arr_add(times, min(microsecond, 999_999) * us_fac)             # <<<<<<<<<<<<<<
 *             elif my_unit_ch == "m":
 *                 delta = utils.dt64arr_millisecond(arr, my_unit)
 */
      __pyx_t_7 = 0xF423F;
      __pyx_t_8 = __pyx_v_microsecond;
      __pyx_t_2 = (__pyx_t_7 < __pyx_t_8);
      if (__pyx_t_2) {
        __pyx_t_9 = __pyx_t_7;
      } else {
        __pyx_t_9 = __pyx_t_8;
      }
      __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_times, (__pyx_t_9 * __pyx_v_us_fac))); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2685, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_11));
      __pyx_t_11 = 0;

      /* "cytimes/pddt.py":2684
 *         # . microsecond
 *         if my_unit_ch != "s":
 *             if microsecond >= 0:             # <<<<<<<<<<<<<<
 *                 times = utils.arr_add(times, min(microsecond, 999_999) * us_fac)
 *             elif my_unit_ch == "m":
 */
      goto __pyx_L18;
    }

    /* "cytimes/pddt.py":2686
 *             if microsecond >= 0:
 *                 times = utils.arr_add(times, min(microsecond, 999_999) * us_fac)
 *             elif my_unit_ch == "m":             # <<<<<<<<<<<<<<
 *                 delta = utils.dt64arr_millisecond(arr, my_unit)
 *                 times = utils.arr_add_arr(times, delta)
 */
    __pyx_t_2 = (__pyx_v_my_unit_ch == 0x6D);
    if (__pyx_t_2) {

      /* "cytimes/pddt.py":2687
 *                 times = utils.arr_add(times, min(microsecond, 999_999) * us_fac)
 *             elif my_unit_ch == "m":
 *                 delta = utils.dt64arr_millisecond(arr, my_unit)             # <<<<<<<<<<<<<<
 *                 times = utils.arr_add_arr(times, delta)
 *             else:
 */
      __pyx_t_14.__pyx_n = 1;
      __pyx_t_14.arr_unit = __pyx_v_my_unit;
      __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_millisecond(__pyx_v_arr, &__pyx_t_14)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_XDECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_11));
      __pyx_t_11 = 0;

      /* "cytimes/pddt.py":2688
 *             elif my_unit_ch == "m":
 *                 delta = utils.dt64arr_millisecond(arr, my_unit)
 *                 times = utils.arr_add_arr(times, delta)             # <<<<<<<<<<<<<<
 *             else:
 *                 delta = utils.arr_mul(utils.dt64arr_microsecond(arr, my_unit), us_fac)
 */
      __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_times, __pyx_v_delta, NULL)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_11));
      __pyx_t_11 = 0;

      /* "cytimes/pddt.py":2686
 *             if microsecond >= 0:
 *                 times = utils.arr_add(times, min(microsecond, 999_999) * us_fac)
 *             elif my_unit_ch == "m":             # <<<<<<<<<<<<<<
 *                 delta = utils.dt64arr_millisecond(arr, my_unit)
 *                 times = utils.arr_add_arr(times, delta)
 */
      goto __pyx_L18;
    }

    /* "cytimes/pddt.py":2690
 *                 times = utils.arr_add_arr(times, delta)
 *             else:
 *                 delta = utils.arr_mul(utils.dt64arr_microsecond(arr, my_unit), us_fac)             # <<<<<<<<<<<<<<
 *                 times = utils.arr_add_arr(times, delta)
 *         # . nanosecond
 */
    /*else*/ {
      __pyx_t_15.__pyx_n = 1;
      __pyx_t_15.arr_unit = __pyx_v_my_unit;
      __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_microsecond(__pyx_v_arr, &__pyx_t_15)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2690, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(((PyArrayObject *)__pyx_t_11), __pyx_v_us_fac, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2690, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/pddt.py":2691
 *             else:
 *                 delta = utils.arr_mul(utils.dt64arr_microsecond(arr, my_unit), us_fac)
 *                 times = utils.arr_add_arr(times, delta)             # <<<<<<<<<<<<<<
 *         # . nanosecond
 *         if my_unit_ch == "n":
 */
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_times, __pyx_v_delta, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;
    }
    __pyx_L18:;

    /* "cytimes/pddt.py":2683
 *             times = utils.arr_add_arr(times, delta)
 *         # . microsecond
 *         if my_unit_ch != "s":             # <<<<<<<<<<<<<<
 *             if microsecond >= 0:
 *                 times = utils.arr_add(times, min(microsecond, 999_999) * us_fac)
 */
  }

  /* "cytimes/pddt.py":2693
 *                 times = utils.arr_add_arr(times, delta)
 *         # . nanosecond
 *         if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *             if nanosecond >= 0:
 *                 times = utils.arr_add(times, min(nanosecond, 999))
 */
  __pyx_t_2 = (__pyx_v_my_unit_ch == 0x6E);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":2694
 *         # . nanosecond
 *         if my_unit_ch == "n":
 *             if nanosecond >= 0:             # <<<<<<<<<<<<<<
 *                 times = utils.arr_add(times, min(nanosecond, 999))
 *             else:
 */
    __pyx_t_2 = (__pyx_v_nanosecond >= 0);
    if (__pyx_t_2) {

      /* "cytimes/pddt.py":2695
 *         if my_unit_ch == "n":
 *             if nanosecond >= 0:
 *                 times = utils.arr_add(times, min(nanosecond, 999))             # <<<<<<<<<<<<<<
 *             else:
 *                 delta = utils.dt64arr_nanosecond(arr, my_unit)
 */
      __pyx_t_9 = 0x3E7;
      __pyx_t_8 = __pyx_v_nanosecond;
      __pyx_t_2 = (__pyx_t_9 < __pyx_t_8);
      if (__pyx_t_2) {
        __pyx_t_7 = __pyx_t_9;
      } else {
        __pyx_t_7 = __pyx_t_8;
      }
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_times, __pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2695, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/pddt.py":2694
 *         # . nanosecond
 *         if my_unit_ch == "n":
 *             if nanosecond >= 0:             # <<<<<<<<<<<<<<
 *                 times = utils.arr_add(times, min(nanosecond, 999))
 *             else:
 */
      goto __pyx_L20;
    }

    /* "cytimes/pddt.py":2697
 *                 times = utils.arr_add(times, min(nanosecond, 999))
 *             else:
 *                 delta = utils.dt64arr_nanosecond(arr, my_unit)             # <<<<<<<<<<<<<<
 *                 times = utils.arr_add_arr(times, delta)
 * 
 */
    /*else*/ {
      __pyx_t_16.__pyx_n = 1;
      __pyx_t_16.arr_unit = __pyx_v_my_unit;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_nanosecond(__pyx_v_arr, &__pyx_t_16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2697, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/pddt.py":2698
 *             else:
 *                 delta = utils.dt64arr_nanosecond(arr, my_unit)
 *                 times = utils.arr_add_arr(times, delta)             # <<<<<<<<<<<<<<
 * 
 *         # Combine dates & times
 */
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_times, __pyx_v_delta, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2698, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;
    }
    __pyx_L20:;

    /* "cytimes/pddt.py":2693
 *                 times = utils.arr_add_arr(times, delta)
 *         # . nanosecond
 *         if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *             if nanosecond >= 0:
 *                 times = utils.arr_add(times, min(nanosecond, 999))
 */
  }

  /* "cytimes/pddt.py":2701
 * 
 *         # Combine dates & times
 *         dtype = "datetime64[%s]" % my_unit_adj             # <<<<<<<<<<<<<<
 *         dates = utils.dt64arr_as_int64(datesD, my_unit_adj, "D")  # int64[my_unit]
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 */
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_my_unit_adj); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_dtype = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2702
 *         # Combine dates & times
 *         dtype = "datetime64[%s]" % my_unit_adj
 *         dates = utils.dt64arr_as_int64(datesD, my_unit_adj, "D")  # int64[my_unit]             # <<<<<<<<<<<<<<
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 */
  __pyx_t_17.__pyx_n = 1;
  __pyx_t_17.arr_unit = __pyx_n_u_D;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_datesD, __pyx_v_my_unit_adj, &__pyx_t_17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_dates = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2703
 *         dtype = "datetime64[%s]" % my_unit_adj
 *         dates = utils.dt64arr_as_int64(datesD, my_unit_adj, "D")  # int64[my_unit]
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 */
  __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_dates, __pyx_v_times, NULL)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_astype); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 2703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = NULL;
  __pyx_t_19 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_18))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_18);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_18, function);
      __pyx_t_19 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_dtype};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+1-__pyx_t_19, 1+__pyx_t_19);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2703, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2704
 *         dates = utils.dt64arr_as_int64(datesD, my_unit_adj, "D")  # int64[my_unit]
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)             # <<<<<<<<<<<<<<
 * 
 *     def to_first_of(self, unit: str) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 2704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_20.__pyx_n = 3;
  __pyx_t_20.tz = __pyx_t_3;
  __pyx_t_20.unit = ((PyObject*)Py_None);
  __pyx_t_20.name = __pyx_t_18;
  __pyx_t_11 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_20); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __pyx_r = __pyx_t_11;
  __pyx_t_11 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":2588
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_time(             # <<<<<<<<<<<<<<
 *         self,
 *         hour: cython.int = -1,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_delta);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesD);
  __Pyx_XDECREF(__pyx_v_my_unit_adj);
  __Pyx_XDECREF((PyObject *)__pyx_v_times);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XDECREF((PyObject *)__pyx_v_dates);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2706
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_first_of(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the first day of the specified datetime unit `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_125to_first_of(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_124to_first_of, "Adjust the date to the first day of the specified datetime unit `<'Pddt'>`.\n\n        :param unit `<'str'>`: The datetime unit.\n            - `'Y'`: Sets to the first day of the current year.\n            - `'Q'`: Sets to the first day of the current quarter.\n            - `'M'`: Sets to the first day of the current month.\n            - `'W'`: Sets to the first day (Monday) of the current week.\n            - Month name (e.g., `'Jan'`, `'February'`, `'\344\270\211\346\234\210'`): Sets to the first day of that month.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_125to_first_of = {"to_first_of", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_125to_first_of, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_124to_first_of};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_125to_first_of(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_unit = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_first_of (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_unit,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2706, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2706, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("to_first_of", 1, 2, 2, 1); __PYX_ERR(0, 2706, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_first_of") < 0)) __PYX_ERR(0, 2706, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_unit = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_first_of", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2706, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_first_of", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 0, "unit", 1))) __PYX_ERR(0, 2706, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_124to_first_of(__pyx_self, __pyx_v_self, __pyx_v_unit);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_124to_first_of(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_my_unit = 0;
  PyArrayObject *__pyx_v_times = 0;
  PyArrayObject *__pyx_v_datesD = NULL;
  PyArrayObject *__pyx_v_delta = NULL;
  PyArrayObject *__pyx_v_datesM = NULL;
  PyArrayObject *__pyx_v_datesQ = NULL;
  PyArrayObject *__pyx_v_datesY = NULL;
  int __pyx_v_val;
  int __pyx_v_my_unit_ns;
  PyArrayObject *__pyx_v_dates = NULL;
  PyObject *__pyx_v_dtype = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_times __pyx_t_2;
  int __pyx_t_3;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_4;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_weekday __pyx_t_5;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Q __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  unsigned int __pyx_t_13;
  int __pyx_t_14;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_15;
  int __pyx_t_16;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 __pyx_t_17;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_first_of", 1);

  /* "cytimes/pddt.py":2717
 *         """
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2717, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":2718
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 * 
 *         # Seperate times
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 2718, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":2721
 * 
 *         # Seperate times
 *         times: np.ndarray = utils.dt64arr_times(arr, my_unit)  # int64[my_unit]             # <<<<<<<<<<<<<<
 * 
 *         # To weekday
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.arr_unit = __pyx_v_my_unit;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_times(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_times = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":2724
 * 
 *         # To weekday
 *         if unit == "W":             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *             delta = utils.dt64arr_weekday(datesD, "D")  # weekday
 */
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_W, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2724, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":2725
 *         # To weekday
 *         if unit == "W":
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_weekday(datesD, "D")  # weekday
 *             datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]
 */
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.arr_unit = __pyx_v_my_unit;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2726
 *         if unit == "W":
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *             delta = utils.dt64arr_weekday(datesD, "D")  # weekday             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]
 * 
 */
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.arr_unit = __pyx_n_u_D;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_weekday(__pyx_v_datesD, &__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2727
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *             delta = utils.dt64arr_weekday(datesD, "D")  # weekday
 *             datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]             # <<<<<<<<<<<<<<
 * 
 *         # To month
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_sub_arr(__pyx_v_datesD, __pyx_v_delta, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2724
 * 
 *         # To weekday
 *         if unit == "W":             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *             delta = utils.dt64arr_weekday(datesD, "D")  # weekday
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":2730
 * 
 *         # To month
 *         elif unit == "M":             # <<<<<<<<<<<<<<
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit)  # int64[M]
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 */
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_M, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2730, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":2731
 *         # To month
 *         elif unit == "M":
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit)  # int64[M]             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 * 
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.arr_unit = __pyx_v_my_unit;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_arr, &__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_datesM = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2732
 *         elif unit == "M":
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit)  # int64[M]
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 * 
 *         # To quarter
 */
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.arr_unit = __pyx_n_u_M;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2732, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2730
 * 
 *         # To month
 *         elif unit == "M":             # <<<<<<<<<<<<<<
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit)  # int64[M]
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":2735
 * 
 *         # To quarter
 *         elif unit == "Q":             # <<<<<<<<<<<<<<
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit)  # int64[Q]
 *             datesM = utils.arr_mul(datesQ, 3)  # int64[M]
 */
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_Q, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2735, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":2736
 *         # To quarter
 *         elif unit == "Q":
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit)  # int64[Q]             # <<<<<<<<<<<<<<
 *             datesM = utils.arr_mul(datesQ, 3)  # int64[M]
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 */
    __pyx_t_7.__pyx_n = 1;
    __pyx_t_7.arr_unit = __pyx_v_my_unit;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Q(__pyx_v_arr, &__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_datesQ = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2737
 *         elif unit == "Q":
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit)  # int64[Q]
 *             datesM = utils.arr_mul(datesQ, 3)  # int64[M]             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 * 
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_datesQ, 3, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_datesM = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2738
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit)  # int64[Q]
 *             datesM = utils.arr_mul(datesQ, 3)  # int64[M]
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 * 
 *         # To year
 */
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.arr_unit = __pyx_n_u_M;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2738, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2735
 * 
 *         # To quarter
 *         elif unit == "Q":             # <<<<<<<<<<<<<<
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit)  # int64[Q]
 *             datesM = utils.arr_mul(datesQ, 3)  # int64[M]
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":2741
 * 
 *         # To year
 *         elif unit == "Y":             # <<<<<<<<<<<<<<
 *             datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *             datesD = utils.dt64arr_as_int64_D(datesY, "Y")  # int64[D]
 */
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_Y, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2741, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":2742
 *         # To year
 *         elif unit == "Y":
 *             datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesY, "Y")  # int64[D]
 * 
 */
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.arr_unit = __pyx_v_my_unit;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2742, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_datesY = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2743
 *         elif unit == "Y":
 *             datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *             datesD = utils.dt64arr_as_int64_D(datesY, "Y")  # int64[D]             # <<<<<<<<<<<<<<
 * 
 *         # Custom
 */
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.arr_unit = __pyx_n_u_Y;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesY, &__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2743, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2741
 * 
 *         # To year
 *         elif unit == "Y":             # <<<<<<<<<<<<<<
 *             datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *             datesD = utils.dt64arr_as_int64_D(datesY, "Y")  # int64[D]
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":2748
 *         else:
 *             # Month name
 *             val: cython.int             # <<<<<<<<<<<<<<
 *             if (val := _parse_month(unit, False)) != -1:
 *                 datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 */
  /*else*/ {

    /* "cytimes/pddt.py":2749
 *             # Month name
 *             val: cython.int
 *             if (val := _parse_month(unit, False)) != -1:             # <<<<<<<<<<<<<<
 *                 datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *                 datesM = utils.dt64arr_as_int64_M(datesY, "Y", val - 1)  # int64[M]
 */
    __pyx_t_9 = __pyx_f_7cytimes_4pddt__parse_month(__pyx_v_unit, 0); if (unlikely(__pyx_t_9 == ((int)-2))) __PYX_ERR(0, 2749, __pyx_L1_error)
    __pyx_v_val = __pyx_t_9;
    __pyx_t_3 = (__pyx_t_9 != -1L);
    if (likely(__pyx_t_3)) {

      /* "cytimes/pddt.py":2750
 *             val: cython.int
 *             if (val := _parse_month(unit, False)) != -1:
 *                 datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]             # <<<<<<<<<<<<<<
 *                 datesM = utils.dt64arr_as_int64_M(datesY, "Y", val - 1)  # int64[M]
 *                 datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 */
      __pyx_t_8.__pyx_n = 1;
      __pyx_t_8.arr_unit = __pyx_v_my_unit;
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2750, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_datesY = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "cytimes/pddt.py":2751
 *             if (val := _parse_month(unit, False)) != -1:
 *                 datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *                 datesM = utils.dt64arr_as_int64_M(datesY, "Y", val - 1)  # int64[M]             # <<<<<<<<<<<<<<
 *                 datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 * 
 */
      __pyx_t_6.__pyx_n = 2;
      __pyx_t_6.arr_unit = __pyx_n_u_Y;
      __pyx_t_6.offset = (__pyx_v_val - 1);
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_datesY, &__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2751, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_datesM = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "cytimes/pddt.py":2752
 *                 datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *                 datesM = utils.dt64arr_as_int64_M(datesY, "Y", val - 1)  # int64[M]
 *                 datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 * 
 *             # Invalid
 */
      __pyx_t_4.__pyx_n = 1;
      __pyx_t_4.arr_unit = __pyx_n_u_M;
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2752, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_datesD = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "cytimes/pddt.py":2749
 *             # Month name
 *             val: cython.int
 *             if (val := _parse_month(unit, False)) != -1:             # <<<<<<<<<<<<<<
 *                 datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *                 datesM = utils.dt64arr_as_int64_M(datesY, "Y", val - 1)  # int64[M]
 */
      goto __pyx_L4;
    }

    /* "cytimes/pddt.py":2756
 *             # Invalid
 *             else:
 *                 raise errors.InvalidTimeUnitError(             # <<<<<<<<<<<<<<
 *                     "invalid 'first of' datetime unit '%s'.\nSupports: "
 *                     "['Y', 'Q', 'M', 'W'] or Month name." % unit
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_errors); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2756, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_InvalidTimeUnitError); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2756, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "cytimes/pddt.py":2758
 *                 raise errors.InvalidTimeUnitError(
 *                     "invalid 'first of' datetime unit '%s'.\nSupports: "
 *                     "['Y', 'Q', 'M', 'W'] or Month name." % unit             # <<<<<<<<<<<<<<
 *                 )
 * 
 */
      __pyx_t_10 = PyUnicode_Format(__pyx_kp_u_invalid_first_of_datetime_unit_s, __pyx_v_unit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2758, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_12 = NULL;
      __pyx_t_13 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(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_13 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_10};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2756, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 2756, __pyx_L1_error)
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "cytimes/pddt.py":2762
 * 
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"             # <<<<<<<<<<<<<<
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 */
  __pyx_v_my_unit_ns = (PyUnicode_READ_CHAR(__pyx_v_my_unit, 0) == 0x6E);

  /* "cytimes/pddt.py":2763
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
  if (__pyx_v_my_unit_ns) {
  } else {
    __pyx_t_3 = __pyx_v_my_unit_ns;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_15.__pyx_n = 1;
  __pyx_t_15.arr_unit = __pyx_n_u_D;
  __pyx_t_14 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_datesD, &__pyx_t_15); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 2763, __pyx_L1_error)
  __pyx_t_16 = (!__pyx_t_14);
  __pyx_t_3 = __pyx_t_16;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":2764
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]             # <<<<<<<<<<<<<<
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_datesD, __pyx_v_7cytimes_5utils_US_DAY, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2765
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[us]"
 *         else:
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_times, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2765, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2766
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 */
    __Pyx_INCREF(__pyx_kp_u_datetime64_us);
    __pyx_v_dtype = __pyx_kp_u_datetime64_us;

    /* "cytimes/pddt.py":2763
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
    goto __pyx_L5;
  }

  /* "cytimes/pddt.py":2768
 *             dtype = "datetime64[us]"
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 */
  /*else*/ {
    __pyx_t_17.__pyx_n = 1;
    __pyx_t_17.arr_unit = __pyx_n_u_D;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_datesD, __pyx_v_my_unit, &__pyx_t_17)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2769
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit             # <<<<<<<<<<<<<<
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 */
    __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_my_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2769, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_dtype = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L5:;

  /* "cytimes/pddt.py":2770
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 */
  __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_dates, __pyx_v_times, NULL)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_astype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = NULL;
  __pyx_t_13 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
      __pyx_t_13 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_dtype};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2770, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2770, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":2771
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)             # <<<<<<<<<<<<<<
 * 
 *     def to_last_of(self, unit: str) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_18.__pyx_n = 3;
  __pyx_t_18.tz = __pyx_t_1;
  __pyx_t_18.unit = ((PyObject*)Py_None);
  __pyx_t_18.name = __pyx_t_10;
  __pyx_t_11 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_18); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_r = __pyx_t_11;
  __pyx_t_11 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":2706
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_first_of(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the first day of the specified datetime unit `<'Pddt'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_first_of", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_times);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesD);
  __Pyx_XDECREF((PyObject *)__pyx_v_delta);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesM);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesQ);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesY);
  __Pyx_XDECREF((PyObject *)__pyx_v_dates);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2773
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_last_of(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the last day of the specified datetime unit `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_127to_last_of(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_126to_last_of, "Adjust the date to the last day of the specified datetime unit `<'Pddt'>`.\n\n        :param unit `<'str'>`: The datetime unit.\n            - `'Y'`: Sets to the last day of the current year.\n            - `'Q'`: Sets to the last day of the current quarter.\n            - `'M'`: Sets to the last day of the current month.\n            - `'W'`: Sets to the last day (Sunday) of the current week.\n            - Month name (e.g., `'Jan'`, `'February'`, `'\344\270\211\346\234\210'`): Sets to the last day of that month.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_127to_last_of = {"to_last_of", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_127to_last_of, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_126to_last_of};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_127to_last_of(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_unit = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_last_of (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_unit,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2773, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2773, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("to_last_of", 1, 2, 2, 1); __PYX_ERR(0, 2773, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_last_of") < 0)) __PYX_ERR(0, 2773, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_unit = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_last_of", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2773, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_last_of", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 0, "unit", 1))) __PYX_ERR(0, 2773, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_126to_last_of(__pyx_self, __pyx_v_self, __pyx_v_unit);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_126to_last_of(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_my_unit = 0;
  PyArrayObject *__pyx_v_times = 0;
  PyArrayObject *__pyx_v_datesD = NULL;
  PyArrayObject *__pyx_v_delta = NULL;
  PyArrayObject *__pyx_v_datesM = NULL;
  PyArrayObject *__pyx_v_datesQ = NULL;
  PyArrayObject *__pyx_v_datesY = NULL;
  int __pyx_v_val;
  int __pyx_v_my_unit_ns;
  PyArrayObject *__pyx_v_dates = NULL;
  PyObject *__pyx_v_dtype = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_times __pyx_t_2;
  int __pyx_t_3;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_4;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_weekday __pyx_t_5;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Q __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  unsigned int __pyx_t_13;
  int __pyx_t_14;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_15;
  int __pyx_t_16;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 __pyx_t_17;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_last_of", 1);

  /* "cytimes/pddt.py":2784
 *         """
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2784, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":2785
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 * 
 *         # Seperate times
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 2785, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":2788
 * 
 *         # Seperate times
 *         times: np.ndarray = utils.dt64arr_times(arr, my_unit)  # int64[my_unit]             # <<<<<<<<<<<<<<
 * 
 *         # To weekday
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.arr_unit = __pyx_v_my_unit;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_times(__pyx_v_arr, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_times = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":2791
 * 
 *         # To weekday
 *         if unit == "W":             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *             delta = utils.dt64arr_weekday(datesD, "D", -6)  # weekday-6
 */
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_W, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2791, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":2792
 *         # To weekday
 *         if unit == "W":
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_weekday(datesD, "D", -6)  # weekday-6
 *             datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]
 */
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.arr_unit = __pyx_v_my_unit;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2793
 *         if unit == "W":
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *             delta = utils.dt64arr_weekday(datesD, "D", -6)  # weekday-6             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]
 * 
 */
    __pyx_t_5.__pyx_n = 2;
    __pyx_t_5.arr_unit = __pyx_n_u_D;
    __pyx_t_5.offset = -6LL;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_weekday(__pyx_v_datesD, &__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2793, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2794
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *             delta = utils.dt64arr_weekday(datesD, "D", -6)  # weekday-6
 *             datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]             # <<<<<<<<<<<<<<
 * 
 *         # To month
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_sub_arr(__pyx_v_datesD, __pyx_v_delta, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2791
 * 
 *         # To weekday
 *         if unit == "W":             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *             delta = utils.dt64arr_weekday(datesD, "D", -6)  # weekday-6
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":2797
 * 
 *         # To month
 *         elif unit == "M":             # <<<<<<<<<<<<<<
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit, 1)  # int64[M]+1
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", -1)  # int64[D]-1
 */
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_M, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2797, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":2798
 *         # To month
 *         elif unit == "M":
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit, 1)  # int64[M]+1             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", -1)  # int64[D]-1
 * 
 */
    __pyx_t_6.__pyx_n = 2;
    __pyx_t_6.arr_unit = __pyx_v_my_unit;
    __pyx_t_6.offset = 1;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_arr, &__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2798, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_datesM = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2799
 *         elif unit == "M":
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit, 1)  # int64[M]+1
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", -1)  # int64[D]-1             # <<<<<<<<<<<<<<
 * 
 *         # To quarter
 */
    __pyx_t_4.__pyx_n = 2;
    __pyx_t_4.arr_unit = __pyx_n_u_M;
    __pyx_t_4.offset = -1LL;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2797
 * 
 *         # To month
 *         elif unit == "M":             # <<<<<<<<<<<<<<
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit, 1)  # int64[M]+1
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", -1)  # int64[D]-1
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":2802
 * 
 *         # To quarter
 *         elif unit == "Q":             # <<<<<<<<<<<<<<
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit, 1)  # int64[Q]+1
 *             datesM = utils.arr_mul(datesQ, 3)  # int64[M]
 */
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_Q, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2802, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":2803
 *         # To quarter
 *         elif unit == "Q":
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit, 1)  # int64[Q]+1             # <<<<<<<<<<<<<<
 *             datesM = utils.arr_mul(datesQ, 3)  # int64[M]
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", -1)  # int64[D]-1
 */
    __pyx_t_7.__pyx_n = 2;
    __pyx_t_7.arr_unit = __pyx_v_my_unit;
    __pyx_t_7.offset = 1;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Q(__pyx_v_arr, &__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_datesQ = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2804
 *         elif unit == "Q":
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit, 1)  # int64[Q]+1
 *             datesM = utils.arr_mul(datesQ, 3)  # int64[M]             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", -1)  # int64[D]-1
 * 
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_datesQ, 3, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2804, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_datesM = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2805
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit, 1)  # int64[Q]+1
 *             datesM = utils.arr_mul(datesQ, 3)  # int64[M]
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M", -1)  # int64[D]-1             # <<<<<<<<<<<<<<
 * 
 *         # To year
 */
    __pyx_t_4.__pyx_n = 2;
    __pyx_t_4.arr_unit = __pyx_n_u_M;
    __pyx_t_4.offset = -1LL;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2802
 * 
 *         # To quarter
 *         elif unit == "Q":             # <<<<<<<<<<<<<<
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit, 1)  # int64[Q]+1
 *             datesM = utils.arr_mul(datesQ, 3)  # int64[M]
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":2808
 * 
 *         # To year
 *         elif unit == "Y":             # <<<<<<<<<<<<<<
 *             datesY = utils.dt64arr_as_int64_Y(arr, my_unit, 1)  # int64[Y]+1
 *             datesD = utils.dt64arr_as_int64_D(datesY, "Y", -1)  # int64[D]-1
 */
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_Y, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2808, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":2809
 *         # To year
 *         elif unit == "Y":
 *             datesY = utils.dt64arr_as_int64_Y(arr, my_unit, 1)  # int64[Y]+1             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesY, "Y", -1)  # int64[D]-1
 * 
 */
    __pyx_t_8.__pyx_n = 2;
    __pyx_t_8.arr_unit = __pyx_v_my_unit;
    __pyx_t_8.offset = 1;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2809, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_datesY = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2810
 *         elif unit == "Y":
 *             datesY = utils.dt64arr_as_int64_Y(arr, my_unit, 1)  # int64[Y]+1
 *             datesD = utils.dt64arr_as_int64_D(datesY, "Y", -1)  # int64[D]-1             # <<<<<<<<<<<<<<
 * 
 *         # Custom
 */
    __pyx_t_4.__pyx_n = 2;
    __pyx_t_4.arr_unit = __pyx_n_u_Y;
    __pyx_t_4.offset = -1LL;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesY, &__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2808
 * 
 *         # To year
 *         elif unit == "Y":             # <<<<<<<<<<<<<<
 *             datesY = utils.dt64arr_as_int64_Y(arr, my_unit, 1)  # int64[Y]+1
 *             datesD = utils.dt64arr_as_int64_D(datesY, "Y", -1)  # int64[D]-1
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":2815
 *         else:
 *             # Month name
 *             val: cython.int             # <<<<<<<<<<<<<<
 *             if (val := _parse_month(unit, False)) != -1:
 *                 datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 */
  /*else*/ {

    /* "cytimes/pddt.py":2816
 *             # Month name
 *             val: cython.int
 *             if (val := _parse_month(unit, False)) != -1:             # <<<<<<<<<<<<<<
 *                 datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *                 datesM = utils.dt64arr_as_int64_M(datesY, "Y", val)  # int64[M]+val
 */
    __pyx_t_9 = __pyx_f_7cytimes_4pddt__parse_month(__pyx_v_unit, 0); if (unlikely(__pyx_t_9 == ((int)-2))) __PYX_ERR(0, 2816, __pyx_L1_error)
    __pyx_v_val = __pyx_t_9;
    __pyx_t_3 = (__pyx_t_9 != -1L);
    if (likely(__pyx_t_3)) {

      /* "cytimes/pddt.py":2817
 *             val: cython.int
 *             if (val := _parse_month(unit, False)) != -1:
 *                 datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]             # <<<<<<<<<<<<<<
 *                 datesM = utils.dt64arr_as_int64_M(datesY, "Y", val)  # int64[M]+val
 *                 datesD = utils.dt64arr_as_int64_D(datesM, "M", -1)  # int64[D]-1
 */
      __pyx_t_8.__pyx_n = 1;
      __pyx_t_8.arr_unit = __pyx_v_my_unit;
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2817, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_datesY = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "cytimes/pddt.py":2818
 *             if (val := _parse_month(unit, False)) != -1:
 *                 datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *                 datesM = utils.dt64arr_as_int64_M(datesY, "Y", val)  # int64[M]+val             # <<<<<<<<<<<<<<
 *                 datesD = utils.dt64arr_as_int64_D(datesM, "M", -1)  # int64[D]-1
 * 
 */
      __pyx_t_6.__pyx_n = 2;
      __pyx_t_6.arr_unit = __pyx_n_u_Y;
      __pyx_t_6.offset = __pyx_v_val;
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_datesY, &__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2818, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_datesM = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "cytimes/pddt.py":2819
 *                 datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *                 datesM = utils.dt64arr_as_int64_M(datesY, "Y", val)  # int64[M]+val
 *                 datesD = utils.dt64arr_as_int64_D(datesM, "M", -1)  # int64[D]-1             # <<<<<<<<<<<<<<
 * 
 *             # Invalid
 */
      __pyx_t_4.__pyx_n = 2;
      __pyx_t_4.arr_unit = __pyx_n_u_M;
      __pyx_t_4.offset = -1LL;
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2819, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_datesD = ((PyArrayObject *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "cytimes/pddt.py":2816
 *             # Month name
 *             val: cython.int
 *             if (val := _parse_month(unit, False)) != -1:             # <<<<<<<<<<<<<<
 *                 datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *                 datesM = utils.dt64arr_as_int64_M(datesY, "Y", val)  # int64[M]+val
 */
      goto __pyx_L4;
    }

    /* "cytimes/pddt.py":2823
 *             # Invalid
 *             else:
 *                 raise errors.InvalidTimeUnitError(             # <<<<<<<<<<<<<<
 *                     "invalid 'last of' datetime unit '%s'.\nSupports: "
 *                     "['Y', 'Q', 'M', 'W'] or Month name." % unit
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_errors); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2823, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_InvalidTimeUnitError); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2823, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "cytimes/pddt.py":2825
 *                 raise errors.InvalidTimeUnitError(
 *                     "invalid 'last of' datetime unit '%s'.\nSupports: "
 *                     "['Y', 'Q', 'M', 'W'] or Month name." % unit             # <<<<<<<<<<<<<<
 *                 )
 * 
 */
      __pyx_t_10 = PyUnicode_Format(__pyx_kp_u_invalid_last_of_datetime_unit_s, __pyx_v_unit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2825, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_12 = NULL;
      __pyx_t_13 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(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_13 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_10};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2823, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 2823, __pyx_L1_error)
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "cytimes/pddt.py":2829
 * 
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"             # <<<<<<<<<<<<<<
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 */
  __pyx_v_my_unit_ns = (PyUnicode_READ_CHAR(__pyx_v_my_unit, 0) == 0x6E);

  /* "cytimes/pddt.py":2830
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
  if (__pyx_v_my_unit_ns) {
  } else {
    __pyx_t_3 = __pyx_v_my_unit_ns;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_15.__pyx_n = 1;
  __pyx_t_15.arr_unit = __pyx_n_u_D;
  __pyx_t_14 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_datesD, &__pyx_t_15); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 2830, __pyx_L1_error)
  __pyx_t_16 = (!__pyx_t_14);
  __pyx_t_3 = __pyx_t_16;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":2831
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]             # <<<<<<<<<<<<<<
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_datesD, __pyx_v_7cytimes_5utils_US_DAY, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2831, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2832
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[us]"
 *         else:
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_times, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2832, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2833
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *             dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 */
    __Pyx_INCREF(__pyx_kp_u_datetime64_us);
    __pyx_v_dtype = __pyx_kp_u_datetime64_us;

    /* "cytimes/pddt.py":2830
 *         # Combine dates & times
 *         my_unit_ns: cython.bint = str_read(my_unit, 0) == "n"
 *         if my_unit_ns and not utils.is_dt64arr_ns_safe(datesD, "D"):             # <<<<<<<<<<<<<<
 *             dates = utils.arr_mul(datesD, utils.US_DAY)  # int64[us]
 *             times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 */
    goto __pyx_L5;
  }

  /* "cytimes/pddt.py":2835
 *             dtype = "datetime64[us]"
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]             # <<<<<<<<<<<<<<
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 */
  /*else*/ {
    __pyx_t_17.__pyx_n = 1;
    __pyx_t_17.arr_unit = __pyx_n_u_D;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_datesD, __pyx_v_my_unit, &__pyx_t_17)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_dates = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":2836
 *         else:
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit             # <<<<<<<<<<<<<<
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 */
    __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_my_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2836, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_dtype = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L5:;

  /* "cytimes/pddt.py":2837
 *             dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 */
  __pyx_t_11 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_dates, __pyx_v_times, NULL)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_astype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = NULL;
  __pyx_t_13 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
      __pyx_t_13 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_dtype};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2837, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":2838
 *             dtype = "datetime64[%s]" % my_unit
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)             # <<<<<<<<<<<<<<
 * 
 *     def to_start_of(self, unit: str) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_18.__pyx_n = 3;
  __pyx_t_18.tz = __pyx_t_1;
  __pyx_t_18.unit = ((PyObject*)Py_None);
  __pyx_t_18.name = __pyx_t_10;
  __pyx_t_11 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_18); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_r = __pyx_t_11;
  __pyx_t_11 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":2773
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_last_of(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the last day of the specified datetime unit `<'Pddt'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_last_of", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_times);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesD);
  __Pyx_XDECREF((PyObject *)__pyx_v_delta);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesM);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesQ);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesY);
  __Pyx_XDECREF((PyObject *)__pyx_v_dates);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2840
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_start_of(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the datetime to the start of the specified datetime unit `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_129to_start_of(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_128to_start_of, "Adjust the datetime to the start of the specified datetime unit `<'Pddt'>`.\n\n        :param unit `<'str'>`: The datetime unit.\n            - `'Y'`: Sets date to the first day of the current year & time to '00:00:00.000000'.\n            - `'Q'`: Sets date to the first day of the current quarter & time to '00:00:00.000000'.\n            - `'M'`: Sets date to the first day of the current month & time to '00:00:00.000000'.\n            - `'W'`: Sets date to the first day (Monday) of the current week & time to '00:00:00.000000'.\n            - `'D'`: Retains the original date & sets time to '00:00:00.000000'.\n            - `'h'`: Retains the original date & sets time to 'XX:00:00.000000'.\n            - `'m'`: Retains the original date & sets time to 'XX:XX:00.000000'.\n            - `'s'`: Retains the original date & sets time to 'XX:XX:XX.000000'.\n            - `'ms'`: Retains the original date & sets time to 'XX:XX:XX.XXX000'.\n            - `'us'`: Return the instance itself.\n            - Month name (e.g., `'Jan'`, `'February'`, `'\344\270\211\346\234\210'`): Sets date to first day of that month & time to '00:00:00.000000'.\n            - Weekday name (e.g., `'Mon'`, `'Tuesday'`, `'\346\230\237\346\234\237\344\270\211'`): Sets date to that weekday & time to '00:00:00.000000'.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_129to_start_of = {"to_start_of", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_129to_start_of, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_128to_start_of};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_129to_start_of(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_unit = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_start_of (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_unit,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2840, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2840, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("to_start_of", 1, 2, 2, 1); __PYX_ERR(0, 2840, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_start_of") < 0)) __PYX_ERR(0, 2840, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_unit = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_start_of", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2840, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_start_of", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 0, "unit", 1))) __PYX_ERR(0, 2840, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_128to_start_of(__pyx_self, __pyx_v_self, __pyx_v_unit);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_128to_start_of(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_my_unit = 0;
  PyArrayObject *__pyx_v_datesD = NULL;
  PyArrayObject *__pyx_v_delta = NULL;
  PyArrayObject *__pyx_v_datesM = NULL;
  PyArrayObject *__pyx_v_datesQ = NULL;
  PyArrayObject *__pyx_v_datesY = NULL;
  int __pyx_v_val;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_weekday __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_unit __pyx_t_10;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_11;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Q __pyx_t_12;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_13;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_start_of", 1);

  /* "cytimes/pddt.py":2858
 *         """
 *         # Fast-path
 *         if unit is None:             # <<<<<<<<<<<<<<
 *             return self  # exit: invalid
 *         if unit == "ns":
 */
  __pyx_t_1 = (__pyx_v_unit == ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2859
 *         # Fast-path
 *         if unit is None:
 *             return self  # exit: invalid             # <<<<<<<<<<<<<<
 *         if unit == "ns":
 *             return self  # exit: to nanosecond
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":2858
 *         """
 *         # Fast-path
 *         if unit is None:             # <<<<<<<<<<<<<<
 *             return self  # exit: invalid
 *         if unit == "ns":
 */
  }

  /* "cytimes/pddt.py":2860
 *         if unit is None:
 *             return self  # exit: invalid
 *         if unit == "ns":             # <<<<<<<<<<<<<<
 *             return self  # exit: to nanosecond
 *         if unit in ("D", "h", "m", "min", "s", "ms", "us"):
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ns, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2860, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2861
 *             return self  # exit: invalid
 *         if unit == "ns":
 *             return self  # exit: to nanosecond             # <<<<<<<<<<<<<<
 *         if unit in ("D", "h", "m", "min", "s", "ms", "us"):
 *             return self.floor(unit)  # exit: floor to unit
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":2860
 *         if unit is None:
 *             return self  # exit: invalid
 *         if unit == "ns":             # <<<<<<<<<<<<<<
 *             return self  # exit: to nanosecond
 *         if unit in ("D", "h", "m", "min", "s", "ms", "us"):
 */
  }

  /* "cytimes/pddt.py":2862
 *         if unit == "ns":
 *             return self  # exit: to nanosecond
 *         if unit in ("D", "h", "m", "min", "s", "ms", "us"):             # <<<<<<<<<<<<<<
 *             return self.floor(unit)  # exit: floor to unit
 * 
 */
  __Pyx_INCREF(__pyx_v_unit);
  __pyx_t_2 = __pyx_v_unit;
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_D, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2862, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_h, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2862, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_m, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2862, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_min, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2862, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_s, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2862, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_ms, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2862, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_us, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2862, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L6_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __pyx_t_1;
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":2863
 *             return self  # exit: to nanosecond
 *         if unit in ("D", "h", "m", "min", "s", "ms", "us"):
 *             return self.floor(unit)  # exit: floor to unit             # <<<<<<<<<<<<<<
 * 
 *         # Access datetime array & info
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_floor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_unit};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2863, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "cytimes/pddt.py":2862
 *         if unit == "ns":
 *             return self  # exit: to nanosecond
 *         if unit in ("D", "h", "m", "min", "s", "ms", "us"):             # <<<<<<<<<<<<<<
 *             return self.floor(unit)  # exit: floor to unit
 * 
 */
  }

  /* "cytimes/pddt.py":2866
 * 
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2866, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cytimes/pddt.py":2867
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 * 
 *         # To weekday
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_4))) __PYX_ERR(0, 2867, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cytimes/pddt.py":2870
 * 
 *         # To weekday
 *         if unit == "W":             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *             delta = utils.dt64arr_weekday(datesD, "D")  # weekday
 */
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_W, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2870, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":2871
 *         # To weekday
 *         if unit == "W":
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_weekday(datesD, "D")  # weekday
 *             datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]
 */
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.arr_unit = __pyx_v_my_unit;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2871, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":2872
 *         if unit == "W":
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *             delta = utils.dt64arr_weekday(datesD, "D")  # weekday             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]
 *             arr = utils.dt64arr_as_unit(datesD, my_unit, "D")  # dt64[my_unit]
 */
    __pyx_t_9.__pyx_n = 1;
    __pyx_t_9.arr_unit = __pyx_n_u_D;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_weekday(__pyx_v_datesD, &__pyx_t_9)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":2873
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *             delta = utils.dt64arr_weekday(datesD, "D")  # weekday
 *             datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]             # <<<<<<<<<<<<<<
 *             arr = utils.dt64arr_as_unit(datesD, my_unit, "D")  # dt64[my_unit]
 * 
 */
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_sub_arr(__pyx_v_datesD, __pyx_v_delta, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":2874
 *             delta = utils.dt64arr_weekday(datesD, "D")  # weekday
 *             datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]
 *             arr = utils.dt64arr_as_unit(datesD, my_unit, "D")  # dt64[my_unit]             # <<<<<<<<<<<<<<
 * 
 *         # To month
 */
    __pyx_t_10.__pyx_n = 1;
    __pyx_t_10.arr_unit = __pyx_n_u_D;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_unit(__pyx_v_datesD, __pyx_v_my_unit, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":2870
 * 
 *         # To weekday
 *         if unit == "W":             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *             delta = utils.dt64arr_weekday(datesD, "D")  # weekday
 */
    goto __pyx_L13;
  }

  /* "cytimes/pddt.py":2877
 * 
 *         # To month
 *         elif unit == "M":             # <<<<<<<<<<<<<<
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit)  # int64[M]
 *             arr = utils.dt64arr_as_unit(datesM, my_unit, "M")  # dt64[my_unit]
 */
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_M, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2877, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":2878
 *         # To month
 *         elif unit == "M":
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit)  # int64[M]             # <<<<<<<<<<<<<<
 *             arr = utils.dt64arr_as_unit(datesM, my_unit, "M")  # dt64[my_unit]
 * 
 */
    __pyx_t_11.__pyx_n = 1;
    __pyx_t_11.arr_unit = __pyx_v_my_unit;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_arr, &__pyx_t_11)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2878, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_datesM = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":2879
 *         elif unit == "M":
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit)  # int64[M]
 *             arr = utils.dt64arr_as_unit(datesM, my_unit, "M")  # dt64[my_unit]             # <<<<<<<<<<<<<<
 * 
 *         # To quarter
 */
    __pyx_t_10.__pyx_n = 1;
    __pyx_t_10.arr_unit = __pyx_n_u_M;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_unit(__pyx_v_datesM, __pyx_v_my_unit, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2879, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":2877
 * 
 *         # To month
 *         elif unit == "M":             # <<<<<<<<<<<<<<
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit)  # int64[M]
 *             arr = utils.dt64arr_as_unit(datesM, my_unit, "M")  # dt64[my_unit]
 */
    goto __pyx_L13;
  }

  /* "cytimes/pddt.py":2882
 * 
 *         # To quarter
 *         elif unit == "Q":             # <<<<<<<<<<<<<<
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit)  # int64[Q]
 *             datesM = utils.arr_mul(datesQ, 3)  # int64[M]
 */
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_Q, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2882, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":2883
 *         # To quarter
 *         elif unit == "Q":
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit)  # int64[Q]             # <<<<<<<<<<<<<<
 *             datesM = utils.arr_mul(datesQ, 3)  # int64[M]
 *             arr = utils.dt64arr_as_unit(datesM, my_unit, "M")  # dt64[my_unit]
 */
    __pyx_t_12.__pyx_n = 1;
    __pyx_t_12.arr_unit = __pyx_v_my_unit;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Q(__pyx_v_arr, &__pyx_t_12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2883, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_datesQ = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":2884
 *         elif unit == "Q":
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit)  # int64[Q]
 *             datesM = utils.arr_mul(datesQ, 3)  # int64[M]             # <<<<<<<<<<<<<<
 *             arr = utils.dt64arr_as_unit(datesM, my_unit, "M")  # dt64[my_unit]
 * 
 */
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_datesQ, 3, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2884, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_datesM = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":2885
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit)  # int64[Q]
 *             datesM = utils.arr_mul(datesQ, 3)  # int64[M]
 *             arr = utils.dt64arr_as_unit(datesM, my_unit, "M")  # dt64[my_unit]             # <<<<<<<<<<<<<<
 * 
 *         # To year
 */
    __pyx_t_10.__pyx_n = 1;
    __pyx_t_10.arr_unit = __pyx_n_u_M;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_unit(__pyx_v_datesM, __pyx_v_my_unit, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2885, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":2882
 * 
 *         # To quarter
 *         elif unit == "Q":             # <<<<<<<<<<<<<<
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit)  # int64[Q]
 *             datesM = utils.arr_mul(datesQ, 3)  # int64[M]
 */
    goto __pyx_L13;
  }

  /* "cytimes/pddt.py":2888
 * 
 *         # To year
 *         elif unit == "Y":             # <<<<<<<<<<<<<<
 *             datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *             arr = utils.dt64arr_as_unit(datesY, my_unit, "Y")  # dt64[my_unit]
 */
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_Y, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2888, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "cytimes/pddt.py":2889
 *         # To year
 *         elif unit == "Y":
 *             datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]             # <<<<<<<<<<<<<<
 *             arr = utils.dt64arr_as_unit(datesY, my_unit, "Y")  # dt64[my_unit]
 * 
 */
    __pyx_t_13.__pyx_n = 1;
    __pyx_t_13.arr_unit = __pyx_v_my_unit;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_13)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2889, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_datesY = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":2890
 *         elif unit == "Y":
 *             datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *             arr = utils.dt64arr_as_unit(datesY, my_unit, "Y")  # dt64[my_unit]             # <<<<<<<<<<<<<<
 * 
 *         # Custom
 */
    __pyx_t_10.__pyx_n = 1;
    __pyx_t_10.arr_unit = __pyx_n_u_Y;
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_unit(__pyx_v_datesY, __pyx_v_my_unit, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "cytimes/pddt.py":2888
 * 
 *         # To year
 *         elif unit == "Y":             # <<<<<<<<<<<<<<
 *             datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *             arr = utils.dt64arr_as_unit(datesY, my_unit, "Y")  # dt64[my_unit]
 */
    goto __pyx_L13;
  }

  /* "cytimes/pddt.py":2894
 *         # Custom
 *         else:
 *             val: cython.int             # <<<<<<<<<<<<<<
 *             # Month name
 *             if (val := _parse_month(unit, False)) != -1:
 */
  /*else*/ {

    /* "cytimes/pddt.py":2896
 *             val: cython.int
 *             # Month name
 *             if (val := _parse_month(unit, False)) != -1:             # <<<<<<<<<<<<<<
 *                 datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *                 datesM = utils.dt64arr_as_int64_M(datesY, "Y", val - 1)  # int64[M]
 */
    __pyx_t_14 = __pyx_f_7cytimes_4pddt__parse_month(__pyx_v_unit, 0); if (unlikely(__pyx_t_14 == ((int)-2))) __PYX_ERR(0, 2896, __pyx_L1_error)
    __pyx_v_val = __pyx_t_14;
    __pyx_t_3 = (__pyx_t_14 != -1L);
    if (__pyx_t_3) {

      /* "cytimes/pddt.py":2897
 *             # Month name
 *             if (val := _parse_month(unit, False)) != -1:
 *                 datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]             # <<<<<<<<<<<<<<
 *                 datesM = utils.dt64arr_as_int64_M(datesY, "Y", val - 1)  # int64[M]
 *                 arr = utils.dt64arr_as_unit(datesM, my_unit, "M")  # dt64[my_unit]
 */
      __pyx_t_13.__pyx_n = 1;
      __pyx_t_13.arr_unit = __pyx_v_my_unit;
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_13)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2897, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_datesY = ((PyArrayObject *)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "cytimes/pddt.py":2898
 *             if (val := _parse_month(unit, False)) != -1:
 *                 datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *                 datesM = utils.dt64arr_as_int64_M(datesY, "Y", val - 1)  # int64[M]             # <<<<<<<<<<<<<<
 *                 arr = utils.dt64arr_as_unit(datesM, my_unit, "M")  # dt64[my_unit]
 * 
 */
      __pyx_t_11.__pyx_n = 2;
      __pyx_t_11.arr_unit = __pyx_n_u_Y;
      __pyx_t_11.offset = (__pyx_v_val - 1);
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_datesY, &__pyx_t_11)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2898, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_datesM = ((PyArrayObject *)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "cytimes/pddt.py":2899
 *                 datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *                 datesM = utils.dt64arr_as_int64_M(datesY, "Y", val - 1)  # int64[M]
 *                 arr = utils.dt64arr_as_unit(datesM, my_unit, "M")  # dt64[my_unit]             # <<<<<<<<<<<<<<
 * 
 *             # Weekday name
 */
      __pyx_t_10.__pyx_n = 1;
      __pyx_t_10.arr_unit = __pyx_n_u_M;
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_unit(__pyx_v_datesM, __pyx_v_my_unit, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2899, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/pddt.py":2896
 *             val: cython.int
 *             # Month name
 *             if (val := _parse_month(unit, False)) != -1:             # <<<<<<<<<<<<<<
 *                 datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *                 datesM = utils.dt64arr_as_int64_M(datesY, "Y", val - 1)  # int64[M]
 */
      goto __pyx_L14;
    }

    /* "cytimes/pddt.py":2902
 * 
 *             # Weekday name
 *             elif (val := _parse_weekday(unit, False)) != -1:             # <<<<<<<<<<<<<<
 *                 datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *                 delta = utils.dt64arr_weekday(datesD, "D", -val)  # weekday-val
 */
    __pyx_t_14 = __pyx_f_7cytimes_4pddt__parse_weekday(__pyx_v_unit, 0); if (unlikely(__pyx_t_14 == ((int)-2))) __PYX_ERR(0, 2902, __pyx_L1_error)
    __pyx_v_val = __pyx_t_14;
    __pyx_t_3 = (__pyx_t_14 != -1L);
    if (likely(__pyx_t_3)) {

      /* "cytimes/pddt.py":2903
 *             # Weekday name
 *             elif (val := _parse_weekday(unit, False)) != -1:
 *                 datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]             # <<<<<<<<<<<<<<
 *                 delta = utils.dt64arr_weekday(datesD, "D", -val)  # weekday-val
 *                 datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]
 */
      __pyx_t_8.__pyx_n = 1;
      __pyx_t_8.arr_unit = __pyx_v_my_unit;
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2903, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_datesD = ((PyArrayObject *)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "cytimes/pddt.py":2904
 *             elif (val := _parse_weekday(unit, False)) != -1:
 *                 datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *                 delta = utils.dt64arr_weekday(datesD, "D", -val)  # weekday-val             # <<<<<<<<<<<<<<
 *                 datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]
 *                 arr = utils.dt64arr_as_unit(datesD, my_unit, "D")  # dt64[my_unit]
 */
      __pyx_t_9.__pyx_n = 2;
      __pyx_t_9.arr_unit = __pyx_n_u_D;
      __pyx_t_9.offset = (-__pyx_v_val);
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_weekday(__pyx_v_datesD, &__pyx_t_9)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2904, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_delta = ((PyArrayObject *)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "cytimes/pddt.py":2905
 *                 datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *                 delta = utils.dt64arr_weekday(datesD, "D", -val)  # weekday-val
 *                 datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]             # <<<<<<<<<<<<<<
 *                 arr = utils.dt64arr_as_unit(datesD, my_unit, "D")  # dt64[my_unit]
 * 
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_sub_arr(__pyx_v_datesD, __pyx_v_delta, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2905, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/pddt.py":2906
 *                 delta = utils.dt64arr_weekday(datesD, "D", -val)  # weekday-val
 *                 datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]
 *                 arr = utils.dt64arr_as_unit(datesD, my_unit, "D")  # dt64[my_unit]             # <<<<<<<<<<<<<<
 * 
 *             # Invalid
 */
      __pyx_t_10.__pyx_n = 1;
      __pyx_t_10.arr_unit = __pyx_n_u_D;
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_unit(__pyx_v_datesD, __pyx_v_my_unit, &__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2906, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/pddt.py":2902
 * 
 *             # Weekday name
 *             elif (val := _parse_weekday(unit, False)) != -1:             # <<<<<<<<<<<<<<
 *                 datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *                 delta = utils.dt64arr_weekday(datesD, "D", -val)  # weekday-val
 */
      goto __pyx_L14;
    }

    /* "cytimes/pddt.py":2910
 *             # Invalid
 *             else:
 *                 raise errors.InvalidTimeUnitError(             # <<<<<<<<<<<<<<
 *                     "invalid 'start of' time unit '%s'.\nSupports: "
 *                     "['Y', 'Q', 'M', 'W', 'D', 'h', 'm', 's', 'ms', 'us', 'ns'] "
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_errors); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2910, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_InvalidTimeUnitError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2910, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cytimes/pddt.py":2913
 *                     "invalid 'start of' time unit '%s'.\nSupports: "
 *                     "['Y', 'Q', 'M', 'W', 'D', 'h', 'm', 's', 'ms', 'us', 'ns'] "
 *                     "or Month/Weekday name." % unit             # <<<<<<<<<<<<<<
 *                 )
 * 
 */
      __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_invalid_start_of_time_unit_s_Sup, __pyx_v_unit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2913, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_15 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_15)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_15);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_7 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_5};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2910, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 2910, __pyx_L1_error)
    }
    __pyx_L14:;
  }
  __pyx_L13:;

  /* "cytimes/pddt.py":2917
 * 
 *         # New instance
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)             # <<<<<<<<<<<<<<
 * 
 *     def to_end_of(self, unit: str) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_16.__pyx_n = 3;
  __pyx_t_16.tz = __pyx_t_4;
  __pyx_t_16.unit = ((PyObject*)Py_None);
  __pyx_t_16.name = __pyx_t_6;
  __pyx_t_5 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":2840
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_start_of(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the datetime to the start of the specified datetime unit `<'Pddt'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_start_of", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesD);
  __Pyx_XDECREF((PyObject *)__pyx_v_delta);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesM);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesQ);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesY);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":2919
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_end_of(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the datetime to the end of the specified datetime unit `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_131to_end_of(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_130to_end_of, "Adjust the datetime to the end of the specified datetime unit `<'Pddt'>`.\n\n        :param unit `<'str'>`: The datetime unit.\n            - `'Y'`: Sets date to the last day of the current year & time to '23:59:59.999999'.\n            - `'Q'`: Sets date to the last day of the current quarter & time to '23:59:59.999999'.\n            - `'M'`: Sets date to the last day of the current month & time to '23:59:59.999999'.\n            - `'W'`: Sets date to the last day (Sunday) of the current week & time to '23:59:59.999999'.\n            - `'D'`: Retains the original date & sets time to '23:59:59.999999'.\n            - `'h'`: Retains the original date & sets time to 'XX:59:59.999999'.\n            - `'m'`: Retains the original date & sets time to 'XX:XX:59.999999'.\n            - `'s'`: Retains the original date & sets time to 'XX:XX:XX.999999'.\n            - `'ms'`: Retains the original date & sets time to 'XX:XX:XX.XXX999'.\n            - `'us'`: Return the instance itself.\n            - `'Month name (e.g., `'Jan'`, `'February'`, `'\344\270\211\346\234\210'`): Sets date to last day of that month & time to '23:59:59.999999'.\n            - `'Weekday name (e.g., `'Mon'`, `'Tuesday'`, `'\346\230\237\346\234\237\344\270\211'`): Sets date to that weekday & time to '23:59:59.999999'.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_131to_end_of = {"to_end_of", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_131to_end_of, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_130to_end_of};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_131to_end_of(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_unit = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_end_of (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_unit,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2919, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2919, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("to_end_of", 1, 2, 2, 1); __PYX_ERR(0, 2919, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_end_of") < 0)) __PYX_ERR(0, 2919, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_unit = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_end_of", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2919, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_end_of", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 0, "unit", 1))) __PYX_ERR(0, 2919, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_130to_end_of(__pyx_self, __pyx_v_self, __pyx_v_unit);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_130to_end_of(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit) {
  PyObject *__pyx_v_my_unit = 0;
  PyArrayObject *__pyx_v_arr = 0;
  Py_UCS4 __pyx_v_my_unit_ch;
  PY_LONG_LONG __pyx_v_fac;
  PY_LONG_LONG __pyx_v_mul;
  PY_LONG_LONG __pyx_v_off;
  PyObject *__pyx_v_dtype = NULL;
  PyArrayObject *__pyx_v_datesD = NULL;
  PyArrayObject *__pyx_v_delta = NULL;
  PyArrayObject *__pyx_v_datesM = NULL;
  PyArrayObject *__pyx_v_datesQ = NULL;
  PyArrayObject *__pyx_v_datesY = NULL;
  int __pyx_v_val;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_3;
  struct __pyx_opt_args_7cytimes_5utils_arr_floor_to_mul __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  PY_LONG_LONG __pyx_t_8;
  PY_LONG_LONG __pyx_t_9;
  int __pyx_t_10;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_11;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_weekday __pyx_t_12;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_unit __pyx_t_13;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_14;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Q __pyx_t_15;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_Y __pyx_t_16;
  int __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_end_of", 1);

  /* "cytimes/pddt.py":2937
 *         """
 *         # Fast-path
 *         if unit is None:             # <<<<<<<<<<<<<<
 *             return self  # exit: invalid
 *         if unit == "ns":
 */
  __pyx_t_1 = (__pyx_v_unit == ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2938
 *         # Fast-path
 *         if unit is None:
 *             return self  # exit: invalid             # <<<<<<<<<<<<<<
 *         if unit == "ns":
 *             return self  # exit: to nanosecond
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":2937
 *         """
 *         # Fast-path
 *         if unit is None:             # <<<<<<<<<<<<<<
 *             return self  # exit: invalid
 *         if unit == "ns":
 */
  }

  /* "cytimes/pddt.py":2939
 *         if unit is None:
 *             return self  # exit: invalid
 *         if unit == "ns":             # <<<<<<<<<<<<<<
 *             return self  # exit: to nanosecond
 *         my_unit: str = self.unit
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ns, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2939, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2940
 *             return self  # exit: invalid
 *         if unit == "ns":
 *             return self  # exit: to nanosecond             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 *         if unit == my_unit:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":2939
 *         if unit is None:
 *             return self  # exit: invalid
 *         if unit == "ns":             # <<<<<<<<<<<<<<
 *             return self  # exit: to nanosecond
 *         my_unit: str = self.unit
 */
  }

  /* "cytimes/pddt.py":2941
 *         if unit == "ns":
 *             return self  # exit: to nanosecond
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 *         if unit == my_unit:
 *             return self  # exit: same unit
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 2941, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2942
 *             return self  # exit: to nanosecond
 *         my_unit: str = self.unit
 *         if unit == my_unit:             # <<<<<<<<<<<<<<
 *             return self  # exit: same unit
 * 
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_v_my_unit, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2942, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2943
 *         my_unit: str = self.unit
 *         if unit == my_unit:
 *             return self  # exit: same unit             # <<<<<<<<<<<<<<
 * 
 *         # Access datetime array & info
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":2942
 *             return self  # exit: to nanosecond
 *         my_unit: str = self.unit
 *         if unit == my_unit:             # <<<<<<<<<<<<<<
 *             return self  # exit: same unit
 * 
 */
  }

  /* "cytimes/pddt.py":2946
 * 
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 *         my_unit_ch: cython.Py_UCS4 = str_read(my_unit, 0)
 *         fac: cython.longlong  # floor divisor factor
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2946, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":2947
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive
 *         my_unit_ch: cython.Py_UCS4 = str_read(my_unit, 0)             # <<<<<<<<<<<<<<
 *         fac: cython.longlong  # floor divisor factor
 *         mul: cython.longlong  # multiple after floor
 */
  __pyx_v_my_unit_ch = PyUnicode_READ_CHAR(__pyx_v_my_unit, 0);

  /* "cytimes/pddt.py":2953
 * 
 *         # To microsecond
 *         if unit == "us":             # <<<<<<<<<<<<<<
 *             # my_unit: [ms, s] -> to_unit [us]
 *             if my_unit_ch != "n":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_us, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2953, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2955
 *         if unit == "us":
 *             # my_unit: [ms, s] -> to_unit [us]
 *             if my_unit_ch != "n":             # <<<<<<<<<<<<<<
 *                 return self  # exit: lower unit
 *             # my_unit [ns] -> to_unit [us]
 */
    __pyx_t_1 = (__pyx_v_my_unit_ch != 0x6E);
    if (__pyx_t_1) {

      /* "cytimes/pddt.py":2956
 *             # my_unit: [ms, s] -> to_unit [us]
 *             if my_unit_ch != "n":
 *                 return self  # exit: lower unit             # <<<<<<<<<<<<<<
 *             # my_unit [ns] -> to_unit [us]
 *             fac = utils.NS_MICROSECOND
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self);
      __pyx_r = __pyx_v_self;
      goto __pyx_L0;

      /* "cytimes/pddt.py":2955
 *         if unit == "us":
 *             # my_unit: [ms, s] -> to_unit [us]
 *             if my_unit_ch != "n":             # <<<<<<<<<<<<<<
 *                 return self  # exit: lower unit
 *             # my_unit [ns] -> to_unit [us]
 */
    }

    /* "cytimes/pddt.py":2958
 *                 return self  # exit: lower unit
 *             # my_unit [ns] -> to_unit [us]
 *             fac = utils.NS_MICROSECOND             # <<<<<<<<<<<<<<
 *             if utils.is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = utils.arr_floor_to_mul(arr, fac, fac, fac - 1)
 */
    __pyx_v_fac = __pyx_v_7cytimes_5utils_NS_MICROSECOND;

    /* "cytimes/pddt.py":2959
 *             # my_unit [ns] -> to_unit [us]
 *             fac = utils.NS_MICROSECOND
 *             if utils.is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = utils.arr_floor_to_mul(arr, fac, fac, fac - 1)
 *                 dtype = "datetime64[ns]"
 */
    __pyx_t_3.__pyx_n = 1;
    __pyx_t_3.arr_unit = __pyx_n_u_ns;
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2959, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "cytimes/pddt.py":2960
 *             fac = utils.NS_MICROSECOND
 *             if utils.is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = utils.arr_floor_to_mul(arr, fac, fac, fac - 1)             # <<<<<<<<<<<<<<
 *                 dtype = "datetime64[ns]"
 *             else:
 */
      __pyx_t_4.__pyx_n = 2;
      __pyx_t_4.multiple = __pyx_v_fac;
      __pyx_t_4.offset = (__pyx_v_fac - 1);
      __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_fac, &__pyx_t_4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2960, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "cytimes/pddt.py":2961
 *             if utils.is_dt64arr_ns_safe(arr, "ns"):
 *                 arr = utils.arr_floor_to_mul(arr, fac, fac, fac - 1)
 *                 dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = utils.arr_floor_div(arr, fac)
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
      __pyx_v_dtype = __pyx_kp_u_datetime64_ns;

      /* "cytimes/pddt.py":2959
 *             # my_unit [ns] -> to_unit [us]
 *             fac = utils.NS_MICROSECOND
 *             if utils.is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                 arr = utils.arr_floor_to_mul(arr, fac, fac, fac - 1)
 *                 dtype = "datetime64[ns]"
 */
      goto __pyx_L8;
    }

    /* "cytimes/pddt.py":2963
 *                 dtype = "datetime64[ns]"
 *             else:
 *                 arr = utils.arr_floor_div(arr, fac)             # <<<<<<<<<<<<<<
 *                 dtype = "datetime64[us]"
 *             # back to dt64[my_unit]
 */
    /*else*/ {
      __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_arr, __pyx_v_fac, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2963, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "cytimes/pddt.py":2964
 *             else:
 *                 arr = utils.arr_floor_div(arr, fac)
 *                 dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *             # back to dt64[my_unit]
 *             arr = arr.astype(dtype)
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_dtype = __pyx_kp_u_datetime64_us;
    }
    __pyx_L8:;

    /* "cytimes/pddt.py":2966
 *                 dtype = "datetime64[us]"
 *             # back to dt64[my_unit]
 *             arr = arr.astype(dtype)             # <<<<<<<<<<<<<<
 * 
 *         # To millisecond
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2966, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_dtype};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2966, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2966, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2953
 * 
 *         # To microsecond
 *         if unit == "us":             # <<<<<<<<<<<<<<
 *             # my_unit: [ms, s] -> to_unit [us]
 *             if my_unit_ch != "n":
 */
    goto __pyx_L6;
  }

  /* "cytimes/pddt.py":2969
 * 
 *         # To millisecond
 *         elif unit == "ms":             # <<<<<<<<<<<<<<
 *             # my_unit [s] -> to_unit [ms]
 *             if my_unit_ch == "s":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ms, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2969, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2971
 *         elif unit == "ms":
 *             # my_unit [s] -> to_unit [ms]
 *             if my_unit_ch == "s":             # <<<<<<<<<<<<<<
 *                 return self  # exit: lower unit
 *             # my_unit [ns] -> to_unit [ms]
 */
    __pyx_t_1 = (__pyx_v_my_unit_ch == 0x73);
    if (__pyx_t_1) {

      /* "cytimes/pddt.py":2972
 *             # my_unit [s] -> to_unit [ms]
 *             if my_unit_ch == "s":
 *                 return self  # exit: lower unit             # <<<<<<<<<<<<<<
 *             # my_unit [ns] -> to_unit [ms]
 *             if my_unit_ch == "n":
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self);
      __pyx_r = __pyx_v_self;
      goto __pyx_L0;

      /* "cytimes/pddt.py":2971
 *         elif unit == "ms":
 *             # my_unit [s] -> to_unit [ms]
 *             if my_unit_ch == "s":             # <<<<<<<<<<<<<<
 *                 return self  # exit: lower unit
 *             # my_unit [ns] -> to_unit [ms]
 */
    }

    /* "cytimes/pddt.py":2974
 *                 return self  # exit: lower unit
 *             # my_unit [ns] -> to_unit [ms]
 *             if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *                 fac = utils.NS_MILLISECOND
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 */
    __pyx_t_1 = (__pyx_v_my_unit_ch == 0x6E);
    if (__pyx_t_1) {

      /* "cytimes/pddt.py":2975
 *             # my_unit [ns] -> to_unit [ms]
 *             if my_unit_ch == "n":
 *                 fac = utils.NS_MILLISECOND             # <<<<<<<<<<<<<<
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 *                     mul, off = fac, fac - 1
 */
      __pyx_v_fac = __pyx_v_7cytimes_5utils_NS_MILLISECOND;

      /* "cytimes/pddt.py":2976
 *             if my_unit_ch == "n":
 *                 fac = utils.NS_MILLISECOND
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                     mul, off = fac, fac - 1
 *                     dtype = "datetime64[ns]"
 */
      __pyx_t_3.__pyx_n = 1;
      __pyx_t_3.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2976, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/pddt.py":2977
 *                 fac = utils.NS_MILLISECOND
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 *                     mul, off = fac, fac - 1             # <<<<<<<<<<<<<<
 *                     dtype = "datetime64[ns]"
 *                 else:
 */
        __pyx_t_8 = __pyx_v_fac;
        __pyx_t_9 = (__pyx_v_fac - 1);
        __pyx_v_mul = __pyx_t_8;
        __pyx_v_off = __pyx_t_9;

        /* "cytimes/pddt.py":2978
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 *                     mul, off = fac, fac - 1
 *                     dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *                 else:
 *                     mul, off = utils.US_MILLISECOND, utils.US_MILLISECOND - 1
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/pddt.py":2976
 *             if my_unit_ch == "n":
 *                 fac = utils.NS_MILLISECOND
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                     mul, off = fac, fac - 1
 *                     dtype = "datetime64[ns]"
 */
        goto __pyx_L11;
      }

      /* "cytimes/pddt.py":2980
 *                     dtype = "datetime64[ns]"
 *                 else:
 *                     mul, off = utils.US_MILLISECOND, utils.US_MILLISECOND - 1             # <<<<<<<<<<<<<<
 *                     dtype = "datetime64[us]"
 *             # my_unit [us] -> to_unit [ms]
 */
      /*else*/ {
        __pyx_t_9 = __pyx_v_7cytimes_5utils_US_MILLISECOND;
        __pyx_t_8 = (__pyx_v_7cytimes_5utils_US_MILLISECOND - 1);
        __pyx_v_mul = __pyx_t_9;
        __pyx_v_off = __pyx_t_8;

        /* "cytimes/pddt.py":2981
 *                 else:
 *                     mul, off = utils.US_MILLISECOND, utils.US_MILLISECOND - 1
 *                     dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *             # my_unit [us] -> to_unit [ms]
 *             else:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L11:;

      /* "cytimes/pddt.py":2974
 *                 return self  # exit: lower unit
 *             # my_unit [ns] -> to_unit [ms]
 *             if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *                 fac = utils.NS_MILLISECOND
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 */
      goto __pyx_L10;
    }

    /* "cytimes/pddt.py":2984
 *             # my_unit [us] -> to_unit [ms]
 *             else:
 *                 fac = utils.US_MILLISECOND             # <<<<<<<<<<<<<<
 *                 mul, off = fac, fac - 1
 *                 dtype = "datetime64[us]"
 */
    /*else*/ {
      __pyx_v_fac = __pyx_v_7cytimes_5utils_US_MILLISECOND;

      /* "cytimes/pddt.py":2985
 *             else:
 *                 fac = utils.US_MILLISECOND
 *                 mul, off = fac, fac - 1             # <<<<<<<<<<<<<<
 *                 dtype = "datetime64[us]"
 *             # back to dt64[my_unit]
 */
      __pyx_t_8 = __pyx_v_fac;
      __pyx_t_9 = (__pyx_v_fac - 1);
      __pyx_v_mul = __pyx_t_8;
      __pyx_v_off = __pyx_t_9;

      /* "cytimes/pddt.py":2986
 *                 fac = utils.US_MILLISECOND
 *                 mul, off = fac, fac - 1
 *                 dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *             # back to dt64[my_unit]
 *             arr = utils.arr_floor_to_mul(arr, fac, mul, off).astype(dtype)
 */
      __Pyx_INCREF(__pyx_kp_u_datetime64_us);
      __pyx_v_dtype = __pyx_kp_u_datetime64_us;
    }
    __pyx_L10:;

    /* "cytimes/pddt.py":2988
 *                 dtype = "datetime64[us]"
 *             # back to dt64[my_unit]
 *             arr = utils.arr_floor_to_mul(arr, fac, mul, off).astype(dtype)             # <<<<<<<<<<<<<<
 * 
 *         # To second
 */
    __pyx_t_4.__pyx_n = 2;
    __pyx_t_4.multiple = __pyx_v_mul;
    __pyx_t_4.offset = __pyx_v_off;
    __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_fac, &__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2988, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2988, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_dtype};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2988, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2988, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2969
 * 
 *         # To millisecond
 *         elif unit == "ms":             # <<<<<<<<<<<<<<
 *             # my_unit [s] -> to_unit [ms]
 *             if my_unit_ch == "s":
 */
    goto __pyx_L6;
  }

  /* "cytimes/pddt.py":2991
 * 
 *         # To second
 *         elif unit == "s":             # <<<<<<<<<<<<<<
 *             # my_unit [ns] -> to_unit [s]
 *             if my_unit_ch == "n":  # ns
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_s, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2991, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":2993
 *         elif unit == "s":
 *             # my_unit [ns] -> to_unit [s]
 *             if my_unit_ch == "n":  # ns             # <<<<<<<<<<<<<<
 *                 fac = utils.NS_SECOND
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 */
    __pyx_t_1 = (__pyx_v_my_unit_ch == 0x6E);
    if (__pyx_t_1) {

      /* "cytimes/pddt.py":2994
 *             # my_unit [ns] -> to_unit [s]
 *             if my_unit_ch == "n":  # ns
 *                 fac = utils.NS_SECOND             # <<<<<<<<<<<<<<
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 *                     mul, off = fac, fac - 1
 */
      __pyx_v_fac = __pyx_v_7cytimes_5utils_NS_SECOND;

      /* "cytimes/pddt.py":2995
 *             if my_unit_ch == "n":  # ns
 *                 fac = utils.NS_SECOND
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                     mul, off = fac, fac - 1
 *                     dtype = "datetime64[ns]"
 */
      __pyx_t_3.__pyx_n = 1;
      __pyx_t_3.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2995, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/pddt.py":2996
 *                 fac = utils.NS_SECOND
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 *                     mul, off = fac, fac - 1             # <<<<<<<<<<<<<<
 *                     dtype = "datetime64[ns]"
 *                 else:
 */
        __pyx_t_9 = __pyx_v_fac;
        __pyx_t_8 = (__pyx_v_fac - 1);
        __pyx_v_mul = __pyx_t_9;
        __pyx_v_off = __pyx_t_8;

        /* "cytimes/pddt.py":2997
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 *                     mul, off = fac, fac - 1
 *                     dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *                 else:
 *                     mul, off = utils.US_SECOND, utils.US_SECOND - 1
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/pddt.py":2995
 *             if my_unit_ch == "n":  # ns
 *                 fac = utils.NS_SECOND
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                     mul, off = fac, fac - 1
 *                     dtype = "datetime64[ns]"
 */
        goto __pyx_L13;
      }

      /* "cytimes/pddt.py":2999
 *                     dtype = "datetime64[ns]"
 *                 else:
 *                     mul, off = utils.US_SECOND, utils.US_SECOND - 1             # <<<<<<<<<<<<<<
 *                     dtype = "datetime64[us]"
 *             # my_unit [us, ms] -> to_unit [s]
 */
      /*else*/ {
        __pyx_t_8 = __pyx_v_7cytimes_5utils_US_SECOND;
        __pyx_t_9 = (__pyx_v_7cytimes_5utils_US_SECOND - 1);
        __pyx_v_mul = __pyx_t_8;
        __pyx_v_off = __pyx_t_9;

        /* "cytimes/pddt.py":3000
 *                 else:
 *                     mul, off = utils.US_SECOND, utils.US_SECOND - 1
 *                     dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *             # my_unit [us, ms] -> to_unit [s]
 *             else:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L13:;

      /* "cytimes/pddt.py":2993
 *         elif unit == "s":
 *             # my_unit [ns] -> to_unit [s]
 *             if my_unit_ch == "n":  # ns             # <<<<<<<<<<<<<<
 *                 fac = utils.NS_SECOND
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 */
      goto __pyx_L12;
    }

    /* "cytimes/pddt.py":3003
 *             # my_unit [us, ms] -> to_unit [s]
 *             else:
 *                 if my_unit_ch == "u":             # <<<<<<<<<<<<<<
 *                     fac, dtype = utils.US_SECOND, "datetime64[us]"
 *                 else:
 */
    /*else*/ {
      __pyx_t_1 = (__pyx_v_my_unit_ch == 0x75);
      if (__pyx_t_1) {

        /* "cytimes/pddt.py":3004
 *             else:
 *                 if my_unit_ch == "u":
 *                     fac, dtype = utils.US_SECOND, "datetime64[us]"             # <<<<<<<<<<<<<<
 *                 else:
 *                     fac, dtype = utils.MS_SECOND, "datetime64[ms]"
 */
        __pyx_t_9 = __pyx_v_7cytimes_5utils_US_SECOND;
        __pyx_t_2 = __pyx_kp_u_datetime64_us;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_v_fac = __pyx_t_9;
        __pyx_v_dtype = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;

        /* "cytimes/pddt.py":3003
 *             # my_unit [us, ms] -> to_unit [s]
 *             else:
 *                 if my_unit_ch == "u":             # <<<<<<<<<<<<<<
 *                     fac, dtype = utils.US_SECOND, "datetime64[us]"
 *                 else:
 */
        goto __pyx_L14;
      }

      /* "cytimes/pddt.py":3006
 *                     fac, dtype = utils.US_SECOND, "datetime64[us]"
 *                 else:
 *                     fac, dtype = utils.MS_SECOND, "datetime64[ms]"             # <<<<<<<<<<<<<<
 *                 mul, off = fac, fac - 1
 *             # back to dt64[my_unit]
 */
      /*else*/ {
        __pyx_t_9 = __pyx_v_7cytimes_5utils_MS_SECOND;
        __pyx_t_2 = __pyx_kp_u_datetime64_ms;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_v_fac = __pyx_t_9;
        __pyx_v_dtype = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
      }
      __pyx_L14:;

      /* "cytimes/pddt.py":3007
 *                 else:
 *                     fac, dtype = utils.MS_SECOND, "datetime64[ms]"
 *                 mul, off = fac, fac - 1             # <<<<<<<<<<<<<<
 *             # back to dt64[my_unit]
 *             arr = utils.arr_floor_to_mul(arr, fac, mul, off).astype(dtype)
 */
      __pyx_t_9 = __pyx_v_fac;
      __pyx_t_8 = (__pyx_v_fac - 1);
      __pyx_v_mul = __pyx_t_9;
      __pyx_v_off = __pyx_t_8;
    }
    __pyx_L12:;

    /* "cytimes/pddt.py":3009
 *                 mul, off = fac, fac - 1
 *             # back to dt64[my_unit]
 *             arr = utils.arr_floor_to_mul(arr, fac, mul, off).astype(dtype)             # <<<<<<<<<<<<<<
 * 
 *         # To minute
 */
    __pyx_t_4.__pyx_n = 2;
    __pyx_t_4.multiple = __pyx_v_mul;
    __pyx_t_4.offset = __pyx_v_off;
    __pyx_t_6 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_fac, &__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3009, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3009, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_dtype};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3009, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":2991
 * 
 *         # To second
 *         elif unit == "s":             # <<<<<<<<<<<<<<
 *             # my_unit [ns] -> to_unit [s]
 *             if my_unit_ch == "n":  # ns
 */
    goto __pyx_L6;
  }

  /* "cytimes/pddt.py":3012
 * 
 *         # To minute
 *         elif unit == "m" or unit == "min":             # <<<<<<<<<<<<<<
 *             # my_unit [ns] -> to_unit [s]
 *             if my_unit_ch == "n":
 */
  __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_m, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 3012, __pyx_L1_error)
  if (!__pyx_t_10) {
  } else {
    __pyx_t_1 = __pyx_t_10;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_min, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 3012, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_10;
  __pyx_L15_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":3014
 *         elif unit == "m" or unit == "min":
 *             # my_unit [ns] -> to_unit [s]
 *             if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *                 fac = utils.NS_MINUTE
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 */
    __pyx_t_1 = (__pyx_v_my_unit_ch == 0x6E);
    if (__pyx_t_1) {

      /* "cytimes/pddt.py":3015
 *             # my_unit [ns] -> to_unit [s]
 *             if my_unit_ch == "n":
 *                 fac = utils.NS_MINUTE             # <<<<<<<<<<<<<<
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 *                     mul, off = fac, fac - 1
 */
      __pyx_v_fac = __pyx_v_7cytimes_5utils_NS_MINUTE;

      /* "cytimes/pddt.py":3016
 *             if my_unit_ch == "n":
 *                 fac = utils.NS_MINUTE
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                     mul, off = fac, fac - 1
 *                     dtype = "datetime64[ns]"
 */
      __pyx_t_3.__pyx_n = 1;
      __pyx_t_3.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 3016, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/pddt.py":3017
 *                 fac = utils.NS_MINUTE
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 *                     mul, off = fac, fac - 1             # <<<<<<<<<<<<<<
 *                     dtype = "datetime64[ns]"
 *                 else:
 */
        __pyx_t_8 = __pyx_v_fac;
        __pyx_t_9 = (__pyx_v_fac - 1);
        __pyx_v_mul = __pyx_t_8;
        __pyx_v_off = __pyx_t_9;

        /* "cytimes/pddt.py":3018
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 *                     mul, off = fac, fac - 1
 *                     dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *                 else:
 *                     mul, off = utils.US_MINUTE, utils.US_MINUTE - 1
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/pddt.py":3016
 *             if my_unit_ch == "n":
 *                 fac = utils.NS_MINUTE
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                     mul, off = fac, fac - 1
 *                     dtype = "datetime64[ns]"
 */
        goto __pyx_L18;
      }

      /* "cytimes/pddt.py":3020
 *                     dtype = "datetime64[ns]"
 *                 else:
 *                     mul, off = utils.US_MINUTE, utils.US_MINUTE - 1             # <<<<<<<<<<<<<<
 *                     dtype = "datetime64[us]"
 *             # my_unit [us, ms, s] -> to_unit [m]
 */
      /*else*/ {
        __pyx_t_9 = __pyx_v_7cytimes_5utils_US_MINUTE;
        __pyx_t_8 = (__pyx_v_7cytimes_5utils_US_MINUTE - 1);
        __pyx_v_mul = __pyx_t_9;
        __pyx_v_off = __pyx_t_8;

        /* "cytimes/pddt.py":3021
 *                 else:
 *                     mul, off = utils.US_MINUTE, utils.US_MINUTE - 1
 *                     dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *             # my_unit [us, ms, s] -> to_unit [m]
 *             else:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L18:;

      /* "cytimes/pddt.py":3014
 *         elif unit == "m" or unit == "min":
 *             # my_unit [ns] -> to_unit [s]
 *             if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *                 fac = utils.NS_MINUTE
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 */
      goto __pyx_L17;
    }

    /* "cytimes/pddt.py":3024
 *             # my_unit [us, ms, s] -> to_unit [m]
 *             else:
 *                 if my_unit_ch == "u":             # <<<<<<<<<<<<<<
 *                     fac, dtype = utils.US_MINUTE, "datetime64[us]"
 *                 elif my_unit_ch == "m":
 */
    /*else*/ {

      /* "cytimes/pddt.py":3026
 *                 if my_unit_ch == "u":
 *                     fac, dtype = utils.US_MINUTE, "datetime64[us]"
 *                 elif my_unit_ch == "m":             # <<<<<<<<<<<<<<
 *                     fac, dtype = utils.MS_MINUTE, "datetime64[ms]"
 *                 else:  # s
 */
      switch (__pyx_v_my_unit_ch) {
        case 0x75:

        /* "cytimes/pddt.py":3025
 *             else:
 *                 if my_unit_ch == "u":
 *                     fac, dtype = utils.US_MINUTE, "datetime64[us]"             # <<<<<<<<<<<<<<
 *                 elif my_unit_ch == "m":
 *                     fac, dtype = utils.MS_MINUTE, "datetime64[ms]"
 */
        __pyx_t_8 = __pyx_v_7cytimes_5utils_US_MINUTE;
        __pyx_t_2 = __pyx_kp_u_datetime64_us;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_v_fac = __pyx_t_8;
        __pyx_v_dtype = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;

        /* "cytimes/pddt.py":3024
 *             # my_unit [us, ms, s] -> to_unit [m]
 *             else:
 *                 if my_unit_ch == "u":             # <<<<<<<<<<<<<<
 *                     fac, dtype = utils.US_MINUTE, "datetime64[us]"
 *                 elif my_unit_ch == "m":
 */
        break;
        case 0x6D:

        /* "cytimes/pddt.py":3027
 *                     fac, dtype = utils.US_MINUTE, "datetime64[us]"
 *                 elif my_unit_ch == "m":
 *                     fac, dtype = utils.MS_MINUTE, "datetime64[ms]"             # <<<<<<<<<<<<<<
 *                 else:  # s
 *                     fac, dtype = utils.SS_MINUTE, "datetime64[s]"
 */
        __pyx_t_8 = __pyx_v_7cytimes_5utils_MS_MINUTE;
        __pyx_t_2 = __pyx_kp_u_datetime64_ms;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_v_fac = __pyx_t_8;
        __pyx_v_dtype = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;

        /* "cytimes/pddt.py":3026
 *                 if my_unit_ch == "u":
 *                     fac, dtype = utils.US_MINUTE, "datetime64[us]"
 *                 elif my_unit_ch == "m":             # <<<<<<<<<<<<<<
 *                     fac, dtype = utils.MS_MINUTE, "datetime64[ms]"
 *                 else:  # s
 */
        break;
        default:

        /* "cytimes/pddt.py":3029
 *                     fac, dtype = utils.MS_MINUTE, "datetime64[ms]"
 *                 else:  # s
 *                     fac, dtype = utils.SS_MINUTE, "datetime64[s]"             # <<<<<<<<<<<<<<
 *                 mul, off = fac, fac - 1
 *             # back to dt64[my_unit]
 */
        __pyx_t_8 = __pyx_v_7cytimes_5utils_SS_MINUTE;
        __pyx_t_2 = __pyx_kp_u_datetime64_s_2;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_v_fac = __pyx_t_8;
        __pyx_v_dtype = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
        break;
      }

      /* "cytimes/pddt.py":3030
 *                 else:  # s
 *                     fac, dtype = utils.SS_MINUTE, "datetime64[s]"
 *                 mul, off = fac, fac - 1             # <<<<<<<<<<<<<<
 *             # back to dt64[my_unit]
 *             arr = utils.arr_floor_to_mul(arr, fac, mul, off).astype(dtype)
 */
      __pyx_t_8 = __pyx_v_fac;
      __pyx_t_9 = (__pyx_v_fac - 1);
      __pyx_v_mul = __pyx_t_8;
      __pyx_v_off = __pyx_t_9;
    }
    __pyx_L17:;

    /* "cytimes/pddt.py":3032
 *                 mul, off = fac, fac - 1
 *             # back to dt64[my_unit]
 *             arr = utils.arr_floor_to_mul(arr, fac, mul, off).astype(dtype)             # <<<<<<<<<<<<<<
 * 
 *         # To hour
 */
    __pyx_t_4.__pyx_n = 2;
    __pyx_t_4.multiple = __pyx_v_mul;
    __pyx_t_4.offset = __pyx_v_off;
    __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_fac, &__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3032, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3032, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_dtype};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3032, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3032, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":3012
 * 
 *         # To minute
 *         elif unit == "m" or unit == "min":             # <<<<<<<<<<<<<<
 *             # my_unit [ns] -> to_unit [s]
 *             if my_unit_ch == "n":
 */
    goto __pyx_L6;
  }

  /* "cytimes/pddt.py":3035
 * 
 *         # To hour
 *         elif unit == "h":             # <<<<<<<<<<<<<<
 *             # my_unit [ns] -> to_unit [h]
 *             if my_unit_ch == "n":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_h, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3035, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":3037
 *         elif unit == "h":
 *             # my_unit [ns] -> to_unit [h]
 *             if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *                 fac = utils.NS_HOUR
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 */
    __pyx_t_1 = (__pyx_v_my_unit_ch == 0x6E);
    if (__pyx_t_1) {

      /* "cytimes/pddt.py":3038
 *             # my_unit [ns] -> to_unit [h]
 *             if my_unit_ch == "n":
 *                 fac = utils.NS_HOUR             # <<<<<<<<<<<<<<
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 *                     mul, off = fac, fac - 1
 */
      __pyx_v_fac = __pyx_v_7cytimes_5utils_NS_HOUR;

      /* "cytimes/pddt.py":3039
 *             if my_unit_ch == "n":
 *                 fac = utils.NS_HOUR
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                     mul, off = fac, fac - 1
 *                     dtype = "datetime64[ns]"
 */
      __pyx_t_3.__pyx_n = 1;
      __pyx_t_3.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 3039, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/pddt.py":3040
 *                 fac = utils.NS_HOUR
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 *                     mul, off = fac, fac - 1             # <<<<<<<<<<<<<<
 *                     dtype = "datetime64[ns]"
 *                 else:
 */
        __pyx_t_9 = __pyx_v_fac;
        __pyx_t_8 = (__pyx_v_fac - 1);
        __pyx_v_mul = __pyx_t_9;
        __pyx_v_off = __pyx_t_8;

        /* "cytimes/pddt.py":3041
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 *                     mul, off = fac, fac - 1
 *                     dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *                 else:
 *                     mul, off = utils.US_HOUR, utils.US_HOUR - 1
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/pddt.py":3039
 *             if my_unit_ch == "n":
 *                 fac = utils.NS_HOUR
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                     mul, off = fac, fac - 1
 *                     dtype = "datetime64[ns]"
 */
        goto __pyx_L20;
      }

      /* "cytimes/pddt.py":3043
 *                     dtype = "datetime64[ns]"
 *                 else:
 *                     mul, off = utils.US_HOUR, utils.US_HOUR - 1             # <<<<<<<<<<<<<<
 *                     dtype = "datetime64[us]"
 *             # my_unit [us, ms, s] -> to_unit [h]
 */
      /*else*/ {
        __pyx_t_8 = __pyx_v_7cytimes_5utils_US_HOUR;
        __pyx_t_9 = (__pyx_v_7cytimes_5utils_US_HOUR - 1);
        __pyx_v_mul = __pyx_t_8;
        __pyx_v_off = __pyx_t_9;

        /* "cytimes/pddt.py":3044
 *                 else:
 *                     mul, off = utils.US_HOUR, utils.US_HOUR - 1
 *                     dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *             # my_unit [us, ms, s] -> to_unit [h]
 *             else:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L20:;

      /* "cytimes/pddt.py":3037
 *         elif unit == "h":
 *             # my_unit [ns] -> to_unit [h]
 *             if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *                 fac = utils.NS_HOUR
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 */
      goto __pyx_L19;
    }

    /* "cytimes/pddt.py":3047
 *             # my_unit [us, ms, s] -> to_unit [h]
 *             else:
 *                 if my_unit_ch == "u":  # us             # <<<<<<<<<<<<<<
 *                     fac, dtype = utils.US_HOUR, "datetime64[us]"
 *                 elif my_unit_ch == "m":  # ms
 */
    /*else*/ {

      /* "cytimes/pddt.py":3049
 *                 if my_unit_ch == "u":  # us
 *                     fac, dtype = utils.US_HOUR, "datetime64[us]"
 *                 elif my_unit_ch == "m":  # ms             # <<<<<<<<<<<<<<
 *                     fac, dtype = utils.MS_HOUR, "datetime64[ms]"
 *                 else:  # s
 */
      switch (__pyx_v_my_unit_ch) {
        case 0x75:

        /* "cytimes/pddt.py":3048
 *             else:
 *                 if my_unit_ch == "u":  # us
 *                     fac, dtype = utils.US_HOUR, "datetime64[us]"             # <<<<<<<<<<<<<<
 *                 elif my_unit_ch == "m":  # ms
 *                     fac, dtype = utils.MS_HOUR, "datetime64[ms]"
 */
        __pyx_t_9 = __pyx_v_7cytimes_5utils_US_HOUR;
        __pyx_t_2 = __pyx_kp_u_datetime64_us;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_v_fac = __pyx_t_9;
        __pyx_v_dtype = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;

        /* "cytimes/pddt.py":3047
 *             # my_unit [us, ms, s] -> to_unit [h]
 *             else:
 *                 if my_unit_ch == "u":  # us             # <<<<<<<<<<<<<<
 *                     fac, dtype = utils.US_HOUR, "datetime64[us]"
 *                 elif my_unit_ch == "m":  # ms
 */
        break;
        case 0x6D:

        /* "cytimes/pddt.py":3050
 *                     fac, dtype = utils.US_HOUR, "datetime64[us]"
 *                 elif my_unit_ch == "m":  # ms
 *                     fac, dtype = utils.MS_HOUR, "datetime64[ms]"             # <<<<<<<<<<<<<<
 *                 else:  # s
 *                     fac, dtype = utils.SS_HOUR, "datetime64[s]"
 */
        __pyx_t_9 = __pyx_v_7cytimes_5utils_MS_HOUR;
        __pyx_t_2 = __pyx_kp_u_datetime64_ms;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_v_fac = __pyx_t_9;
        __pyx_v_dtype = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;

        /* "cytimes/pddt.py":3049
 *                 if my_unit_ch == "u":  # us
 *                     fac, dtype = utils.US_HOUR, "datetime64[us]"
 *                 elif my_unit_ch == "m":  # ms             # <<<<<<<<<<<<<<
 *                     fac, dtype = utils.MS_HOUR, "datetime64[ms]"
 *                 else:  # s
 */
        break;
        default:

        /* "cytimes/pddt.py":3052
 *                     fac, dtype = utils.MS_HOUR, "datetime64[ms]"
 *                 else:  # s
 *                     fac, dtype = utils.SS_HOUR, "datetime64[s]"             # <<<<<<<<<<<<<<
 *                 mul, off = fac, fac - 1
 *             # back to dt64[my_unit]
 */
        __pyx_t_9 = __pyx_v_7cytimes_5utils_SS_HOUR;
        __pyx_t_2 = __pyx_kp_u_datetime64_s_2;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_v_fac = __pyx_t_9;
        __pyx_v_dtype = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
        break;
      }

      /* "cytimes/pddt.py":3053
 *                 else:  # s
 *                     fac, dtype = utils.SS_HOUR, "datetime64[s]"
 *                 mul, off = fac, fac - 1             # <<<<<<<<<<<<<<
 *             # back to dt64[my_unit]
 *             arr = utils.arr_floor_to_mul(arr, fac, mul, off).astype(dtype)
 */
      __pyx_t_9 = __pyx_v_fac;
      __pyx_t_8 = (__pyx_v_fac - 1);
      __pyx_v_mul = __pyx_t_9;
      __pyx_v_off = __pyx_t_8;
    }
    __pyx_L19:;

    /* "cytimes/pddt.py":3055
 *                 mul, off = fac, fac - 1
 *             # back to dt64[my_unit]
 *             arr = utils.arr_floor_to_mul(arr, fac, mul, off).astype(dtype)             # <<<<<<<<<<<<<<
 * 
 *         # To day
 */
    __pyx_t_4.__pyx_n = 2;
    __pyx_t_4.multiple = __pyx_v_mul;
    __pyx_t_4.offset = __pyx_v_off;
    __pyx_t_6 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_fac, &__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3055, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3055, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_dtype};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3055, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3055, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":3035
 * 
 *         # To hour
 *         elif unit == "h":             # <<<<<<<<<<<<<<
 *             # my_unit [ns] -> to_unit [h]
 *             if my_unit_ch == "n":
 */
    goto __pyx_L6;
  }

  /* "cytimes/pddt.py":3058
 * 
 *         # To day
 *         elif unit == "D":             # <<<<<<<<<<<<<<
 *             # my_unit [ns] -> to_unit [D]
 *             if my_unit_ch == "n":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_D, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3058, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":3060
 *         elif unit == "D":
 *             # my_unit [ns] -> to_unit [D]
 *             if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *                 fac = utils.NS_DAY
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 */
    __pyx_t_1 = (__pyx_v_my_unit_ch == 0x6E);
    if (__pyx_t_1) {

      /* "cytimes/pddt.py":3061
 *             # my_unit [ns] -> to_unit [D]
 *             if my_unit_ch == "n":
 *                 fac = utils.NS_DAY             # <<<<<<<<<<<<<<
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 *                     mul, off = fac, fac - 1
 */
      __pyx_v_fac = __pyx_v_7cytimes_5utils_NS_DAY;

      /* "cytimes/pddt.py":3062
 *             if my_unit_ch == "n":
 *                 fac = utils.NS_DAY
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                     mul, off = fac, fac - 1
 *                     dtype = "datetime64[ns]"
 */
      __pyx_t_3.__pyx_n = 1;
      __pyx_t_3.arr_unit = __pyx_n_u_ns;
      __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_arr, &__pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 3062, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "cytimes/pddt.py":3063
 *                 fac = utils.NS_DAY
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 *                     mul, off = fac, fac - 1             # <<<<<<<<<<<<<<
 *                     dtype = "datetime64[ns]"
 *                 else:
 */
        __pyx_t_8 = __pyx_v_fac;
        __pyx_t_9 = (__pyx_v_fac - 1);
        __pyx_v_mul = __pyx_t_8;
        __pyx_v_off = __pyx_t_9;

        /* "cytimes/pddt.py":3064
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 *                     mul, off = fac, fac - 1
 *                     dtype = "datetime64[ns]"             # <<<<<<<<<<<<<<
 *                 else:
 *                     mul, off = utils.US_DAY, utils.US_DAY - 1
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_ns);
        __pyx_v_dtype = __pyx_kp_u_datetime64_ns;

        /* "cytimes/pddt.py":3062
 *             if my_unit_ch == "n":
 *                 fac = utils.NS_DAY
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):             # <<<<<<<<<<<<<<
 *                     mul, off = fac, fac - 1
 *                     dtype = "datetime64[ns]"
 */
        goto __pyx_L22;
      }

      /* "cytimes/pddt.py":3066
 *                     dtype = "datetime64[ns]"
 *                 else:
 *                     mul, off = utils.US_DAY, utils.US_DAY - 1             # <<<<<<<<<<<<<<
 *                     dtype = "datetime64[us]"
 *             # my_unit [us, ms, s] -> to_unit [D]
 */
      /*else*/ {
        __pyx_t_9 = __pyx_v_7cytimes_5utils_US_DAY;
        __pyx_t_8 = (__pyx_v_7cytimes_5utils_US_DAY - 1);
        __pyx_v_mul = __pyx_t_9;
        __pyx_v_off = __pyx_t_8;

        /* "cytimes/pddt.py":3067
 *                 else:
 *                     mul, off = utils.US_DAY, utils.US_DAY - 1
 *                     dtype = "datetime64[us]"             # <<<<<<<<<<<<<<
 *             # my_unit [us, ms, s] -> to_unit [D]
 *             else:
 */
        __Pyx_INCREF(__pyx_kp_u_datetime64_us);
        __pyx_v_dtype = __pyx_kp_u_datetime64_us;
      }
      __pyx_L22:;

      /* "cytimes/pddt.py":3060
 *         elif unit == "D":
 *             # my_unit [ns] -> to_unit [D]
 *             if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *                 fac = utils.NS_DAY
 *                 if utils.is_dt64arr_ns_safe(arr, "ns"):
 */
      goto __pyx_L21;
    }

    /* "cytimes/pddt.py":3070
 *             # my_unit [us, ms, s] -> to_unit [D]
 *             else:
 *                 if my_unit_ch == "u":  # us             # <<<<<<<<<<<<<<
 *                     fac, dtype = utils.US_DAY, "datetime64[us]"
 *                 elif my_unit_ch == "m":  # ms
 */
    /*else*/ {

      /* "cytimes/pddt.py":3072
 *                 if my_unit_ch == "u":  # us
 *                     fac, dtype = utils.US_DAY, "datetime64[us]"
 *                 elif my_unit_ch == "m":  # ms             # <<<<<<<<<<<<<<
 *                     fac, dtype = utils.MS_DAY, "datetime64[ms]"
 *                 else:  # s
 */
      switch (__pyx_v_my_unit_ch) {
        case 0x75:

        /* "cytimes/pddt.py":3071
 *             else:
 *                 if my_unit_ch == "u":  # us
 *                     fac, dtype = utils.US_DAY, "datetime64[us]"             # <<<<<<<<<<<<<<
 *                 elif my_unit_ch == "m":  # ms
 *                     fac, dtype = utils.MS_DAY, "datetime64[ms]"
 */
        __pyx_t_8 = __pyx_v_7cytimes_5utils_US_DAY;
        __pyx_t_2 = __pyx_kp_u_datetime64_us;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_v_fac = __pyx_t_8;
        __pyx_v_dtype = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;

        /* "cytimes/pddt.py":3070
 *             # my_unit [us, ms, s] -> to_unit [D]
 *             else:
 *                 if my_unit_ch == "u":  # us             # <<<<<<<<<<<<<<
 *                     fac, dtype = utils.US_DAY, "datetime64[us]"
 *                 elif my_unit_ch == "m":  # ms
 */
        break;
        case 0x6D:

        /* "cytimes/pddt.py":3073
 *                     fac, dtype = utils.US_DAY, "datetime64[us]"
 *                 elif my_unit_ch == "m":  # ms
 *                     fac, dtype = utils.MS_DAY, "datetime64[ms]"             # <<<<<<<<<<<<<<
 *                 else:  # s
 *                     fac, dtype = utils.SS_DAY, "datetime64[s]"
 */
        __pyx_t_8 = __pyx_v_7cytimes_5utils_MS_DAY;
        __pyx_t_2 = __pyx_kp_u_datetime64_ms;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_v_fac = __pyx_t_8;
        __pyx_v_dtype = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;

        /* "cytimes/pddt.py":3072
 *                 if my_unit_ch == "u":  # us
 *                     fac, dtype = utils.US_DAY, "datetime64[us]"
 *                 elif my_unit_ch == "m":  # ms             # <<<<<<<<<<<<<<
 *                     fac, dtype = utils.MS_DAY, "datetime64[ms]"
 *                 else:  # s
 */
        break;
        default:

        /* "cytimes/pddt.py":3075
 *                     fac, dtype = utils.MS_DAY, "datetime64[ms]"
 *                 else:  # s
 *                     fac, dtype = utils.SS_DAY, "datetime64[s]"             # <<<<<<<<<<<<<<
 *                 mul, off = fac, fac - 1
 *             # back to dt64[my_unit]
 */
        __pyx_t_8 = __pyx_v_7cytimes_5utils_SS_DAY;
        __pyx_t_2 = __pyx_kp_u_datetime64_s_2;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_v_fac = __pyx_t_8;
        __pyx_v_dtype = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
        break;
      }

      /* "cytimes/pddt.py":3076
 *                 else:  # s
 *                     fac, dtype = utils.SS_DAY, "datetime64[s]"
 *                 mul, off = fac, fac - 1             # <<<<<<<<<<<<<<
 *             # back to dt64[my_unit]
 *             arr = utils.arr_floor_to_mul(arr, fac, mul, off).astype(dtype)
 */
      __pyx_t_8 = __pyx_v_fac;
      __pyx_t_9 = (__pyx_v_fac - 1);
      __pyx_v_mul = __pyx_t_8;
      __pyx_v_off = __pyx_t_9;
    }
    __pyx_L21:;

    /* "cytimes/pddt.py":3078
 *                 mul, off = fac, fac - 1
 *             # back to dt64[my_unit]
 *             arr = utils.arr_floor_to_mul(arr, fac, mul, off).astype(dtype)             # <<<<<<<<<<<<<<
 * 
 *         # To weekday
 */
    __pyx_t_4.__pyx_n = 2;
    __pyx_t_4.multiple = __pyx_v_mul;
    __pyx_t_4.offset = __pyx_v_off;
    __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_fac, &__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3078, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3078, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_dtype};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3078, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3078, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":3058
 * 
 *         # To day
 *         elif unit == "D":             # <<<<<<<<<<<<<<
 *             # my_unit [ns] -> to_unit [D]
 *             if my_unit_ch == "n":
 */
    goto __pyx_L6;
  }

  /* "cytimes/pddt.py":3081
 * 
 *         # To weekday
 *         elif unit == "W":             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *             delta = utils.dt64arr_weekday(datesD, "D", -7)  # weekday-7
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_W, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3081, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":3082
 *         # To weekday
 *         elif unit == "W":
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_weekday(datesD, "D", -7)  # weekday-7
 *             datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]
 */
    __pyx_t_11.__pyx_n = 1;
    __pyx_t_11.arr_unit = __pyx_v_my_unit;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3082, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":3083
 *         elif unit == "W":
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *             delta = utils.dt64arr_weekday(datesD, "D", -7)  # weekday-7             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]
 *             arr = utils.dt64arr_as_unit(datesD, my_unit, "D") - 1  # dt64[my_unit]-1
 */
    __pyx_t_12.__pyx_n = 2;
    __pyx_t_12.arr_unit = __pyx_n_u_D;
    __pyx_t_12.offset = -7LL;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_weekday(__pyx_v_datesD, &__pyx_t_12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3083, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":3084
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *             delta = utils.dt64arr_weekday(datesD, "D", -7)  # weekday-7
 *             datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]             # <<<<<<<<<<<<<<
 *             arr = utils.dt64arr_as_unit(datesD, my_unit, "D") - 1  # dt64[my_unit]-1
 * 
 */
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_sub_arr(__pyx_v_datesD, __pyx_v_delta, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3084, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":3085
 *             delta = utils.dt64arr_weekday(datesD, "D", -7)  # weekday-7
 *             datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]
 *             arr = utils.dt64arr_as_unit(datesD, my_unit, "D") - 1  # dt64[my_unit]-1             # <<<<<<<<<<<<<<
 * 
 *         # To Month
 */
    __pyx_t_13.__pyx_n = 1;
    __pyx_t_13.arr_unit = __pyx_n_u_D;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_unit(__pyx_v_datesD, __pyx_v_my_unit, &__pyx_t_13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3085, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3085, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3085, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "cytimes/pddt.py":3081
 * 
 *         # To weekday
 *         elif unit == "W":             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *             delta = utils.dt64arr_weekday(datesD, "D", -7)  # weekday-7
 */
    goto __pyx_L6;
  }

  /* "cytimes/pddt.py":3088
 * 
 *         # To Month
 *         elif unit == "M":             # <<<<<<<<<<<<<<
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit, 1)  # int64[M]+1
 *             arr = utils.dt64arr_as_unit(datesM, my_unit, "M") - 1  # dt64[my_unit]-1
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_M, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3088, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":3089
 *         # To Month
 *         elif unit == "M":
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit, 1)  # int64[M]+1             # <<<<<<<<<<<<<<
 *             arr = utils.dt64arr_as_unit(datesM, my_unit, "M") - 1  # dt64[my_unit]-1
 * 
 */
    __pyx_t_14.__pyx_n = 2;
    __pyx_t_14.arr_unit = __pyx_v_my_unit;
    __pyx_t_14.offset = 1;
    __pyx_t_6 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_arr, &__pyx_t_14)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3089, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_v_datesM = ((PyArrayObject *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "cytimes/pddt.py":3090
 *         elif unit == "M":
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit, 1)  # int64[M]+1
 *             arr = utils.dt64arr_as_unit(datesM, my_unit, "M") - 1  # dt64[my_unit]-1             # <<<<<<<<<<<<<<
 * 
 *         # To Quarter
 */
    __pyx_t_13.__pyx_n = 1;
    __pyx_t_13.arr_unit = __pyx_n_u_M;
    __pyx_t_6 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_unit(__pyx_v_datesM, __pyx_v_my_unit, &__pyx_t_13)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3090, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3090, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3090, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":3088
 * 
 *         # To Month
 *         elif unit == "M":             # <<<<<<<<<<<<<<
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit, 1)  # int64[M]+1
 *             arr = utils.dt64arr_as_unit(datesM, my_unit, "M") - 1  # dt64[my_unit]-1
 */
    goto __pyx_L6;
  }

  /* "cytimes/pddt.py":3093
 * 
 *         # To Quarter
 *         elif unit == "Q":             # <<<<<<<<<<<<<<
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit, 1)  # int64[Q]+1
 *             datesM = utils.arr_mul(datesQ, 3)  # int64[M]
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_Q, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3093, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":3094
 *         # To Quarter
 *         elif unit == "Q":
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit, 1)  # int64[Q]+1             # <<<<<<<<<<<<<<
 *             datesM = utils.arr_mul(datesQ, 3)  # int64[M]
 *             arr = utils.dt64arr_as_unit(datesM, my_unit, "M") - 1  # dt64[my_unit]-1
 */
    __pyx_t_15.__pyx_n = 2;
    __pyx_t_15.arr_unit = __pyx_v_my_unit;
    __pyx_t_15.offset = 1;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Q(__pyx_v_arr, &__pyx_t_15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_datesQ = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":3095
 *         elif unit == "Q":
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit, 1)  # int64[Q]+1
 *             datesM = utils.arr_mul(datesQ, 3)  # int64[M]             # <<<<<<<<<<<<<<
 *             arr = utils.dt64arr_as_unit(datesM, my_unit, "M") - 1  # dt64[my_unit]-1
 * 
 */
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_mul(__pyx_v_datesQ, 3, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3095, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_datesM = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":3096
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit, 1)  # int64[Q]+1
 *             datesM = utils.arr_mul(datesQ, 3)  # int64[M]
 *             arr = utils.dt64arr_as_unit(datesM, my_unit, "M") - 1  # dt64[my_unit]-1             # <<<<<<<<<<<<<<
 * 
 *         # To Year
 */
    __pyx_t_13.__pyx_n = 1;
    __pyx_t_13.arr_unit = __pyx_n_u_M;
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_unit(__pyx_v_datesM, __pyx_v_my_unit, &__pyx_t_13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3096, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3096, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3096, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "cytimes/pddt.py":3093
 * 
 *         # To Quarter
 *         elif unit == "Q":             # <<<<<<<<<<<<<<
 *             datesQ = utils.dt64arr_as_int64_Q(arr, my_unit, 1)  # int64[Q]+1
 *             datesM = utils.arr_mul(datesQ, 3)  # int64[M]
 */
    goto __pyx_L6;
  }

  /* "cytimes/pddt.py":3099
 * 
 *         # To Year
 *         elif unit == "Y":             # <<<<<<<<<<<<<<
 *             datesY = utils.dt64arr_as_int64_Y(arr, my_unit, 1)  # int64[Y]
 *             arr = utils.dt64arr_as_unit(datesY, my_unit, "Y") - 1  # dt64[my_unit]-1
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_Y, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3099, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":3100
 *         # To Year
 *         elif unit == "Y":
 *             datesY = utils.dt64arr_as_int64_Y(arr, my_unit, 1)  # int64[Y]             # <<<<<<<<<<<<<<
 *             arr = utils.dt64arr_as_unit(datesY, my_unit, "Y") - 1  # dt64[my_unit]-1
 * 
 */
    __pyx_t_16.__pyx_n = 2;
    __pyx_t_16.arr_unit = __pyx_v_my_unit;
    __pyx_t_16.offset = 1;
    __pyx_t_6 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_16)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_v_datesY = ((PyArrayObject *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "cytimes/pddt.py":3101
 *         elif unit == "Y":
 *             datesY = utils.dt64arr_as_int64_Y(arr, my_unit, 1)  # int64[Y]
 *             arr = utils.dt64arr_as_unit(datesY, my_unit, "Y") - 1  # dt64[my_unit]-1             # <<<<<<<<<<<<<<
 * 
 *         # Custom
 */
    __pyx_t_13.__pyx_n = 1;
    __pyx_t_13.arr_unit = __pyx_n_u_Y;
    __pyx_t_6 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_unit(__pyx_v_datesY, __pyx_v_my_unit, &__pyx_t_13)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3101, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cytimes/pddt.py":3099
 * 
 *         # To Year
 *         elif unit == "Y":             # <<<<<<<<<<<<<<
 *             datesY = utils.dt64arr_as_int64_Y(arr, my_unit, 1)  # int64[Y]
 *             arr = utils.dt64arr_as_unit(datesY, my_unit, "Y") - 1  # dt64[my_unit]-1
 */
    goto __pyx_L6;
  }

  /* "cytimes/pddt.py":3105
 *         # Custom
 *         else:
 *             val: cython.int             # <<<<<<<<<<<<<<
 *             # Month name
 *             if (val := _parse_month(unit, False)) != -1:
 */
  /*else*/ {

    /* "cytimes/pddt.py":3107
 *             val: cython.int
 *             # Month name
 *             if (val := _parse_month(unit, False)) != -1:             # <<<<<<<<<<<<<<
 *                 datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *                 datesM = utils.dt64arr_as_int64_M(datesY, "Y", val)  # int64[M]+val
 */
    __pyx_t_17 = __pyx_f_7cytimes_4pddt__parse_month(__pyx_v_unit, 0); if (unlikely(__pyx_t_17 == ((int)-2))) __PYX_ERR(0, 3107, __pyx_L1_error)
    __pyx_v_val = __pyx_t_17;
    __pyx_t_1 = (__pyx_t_17 != -1L);
    if (__pyx_t_1) {

      /* "cytimes/pddt.py":3108
 *             # Month name
 *             if (val := _parse_month(unit, False)) != -1:
 *                 datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]             # <<<<<<<<<<<<<<
 *                 datesM = utils.dt64arr_as_int64_M(datesY, "Y", val)  # int64[M]+val
 *                 arr = utils.dt64arr_as_unit(datesM, my_unit, "M") - 1  # dt64[my_unit]-1
 */
      __pyx_t_16.__pyx_n = 1;
      __pyx_t_16.arr_unit = __pyx_v_my_unit;
      __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_Y(__pyx_v_arr, &__pyx_t_16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3108, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_datesY = ((PyArrayObject *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "cytimes/pddt.py":3109
 *             if (val := _parse_month(unit, False)) != -1:
 *                 datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *                 datesM = utils.dt64arr_as_int64_M(datesY, "Y", val)  # int64[M]+val             # <<<<<<<<<<<<<<
 *                 arr = utils.dt64arr_as_unit(datesM, my_unit, "M") - 1  # dt64[my_unit]-1
 * 
 */
      __pyx_t_14.__pyx_n = 2;
      __pyx_t_14.arr_unit = __pyx_n_u_Y;
      __pyx_t_14.offset = __pyx_v_val;
      __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_datesY, &__pyx_t_14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3109, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_datesM = ((PyArrayObject *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "cytimes/pddt.py":3110
 *                 datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *                 datesM = utils.dt64arr_as_int64_M(datesY, "Y", val)  # int64[M]+val
 *                 arr = utils.dt64arr_as_unit(datesM, my_unit, "M") - 1  # dt64[my_unit]-1             # <<<<<<<<<<<<<<
 * 
 *             # Weekday name
 */
      __pyx_t_13.__pyx_n = 1;
      __pyx_t_13.arr_unit = __pyx_n_u_M;
      __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_unit(__pyx_v_datesM, __pyx_v_my_unit, &__pyx_t_13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3110, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3110, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3110, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "cytimes/pddt.py":3107
 *             val: cython.int
 *             # Month name
 *             if (val := _parse_month(unit, False)) != -1:             # <<<<<<<<<<<<<<
 *                 datesY = utils.dt64arr_as_int64_Y(arr, my_unit)  # int64[Y]
 *                 datesM = utils.dt64arr_as_int64_M(datesY, "Y", val)  # int64[M]+val
 */
      goto __pyx_L23;
    }

    /* "cytimes/pddt.py":3113
 * 
 *             # Weekday name
 *             elif (val := _parse_weekday(unit, False)) != -1:             # <<<<<<<<<<<<<<
 *                 datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *                 delta = utils.dt64arr_weekday(datesD, "D", -val - 1)  # weekday-val-1
 */
    __pyx_t_17 = __pyx_f_7cytimes_4pddt__parse_weekday(__pyx_v_unit, 0); if (unlikely(__pyx_t_17 == ((int)-2))) __PYX_ERR(0, 3113, __pyx_L1_error)
    __pyx_v_val = __pyx_t_17;
    __pyx_t_1 = (__pyx_t_17 != -1L);
    if (likely(__pyx_t_1)) {

      /* "cytimes/pddt.py":3114
 *             # Weekday name
 *             elif (val := _parse_weekday(unit, False)) != -1:
 *                 datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]             # <<<<<<<<<<<<<<
 *                 delta = utils.dt64arr_weekday(datesD, "D", -val - 1)  # weekday-val-1
 *                 datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]
 */
      __pyx_t_11.__pyx_n = 1;
      __pyx_t_11.arr_unit = __pyx_v_my_unit;
      __pyx_t_6 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_11)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3114, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_v_datesD = ((PyArrayObject *)__pyx_t_6);
      __pyx_t_6 = 0;

      /* "cytimes/pddt.py":3115
 *             elif (val := _parse_weekday(unit, False)) != -1:
 *                 datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *                 delta = utils.dt64arr_weekday(datesD, "D", -val - 1)  # weekday-val-1             # <<<<<<<<<<<<<<
 *                 datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]
 *                 arr = utils.dt64arr_as_unit(datesD, my_unit, "D") - 1  # dt64[my_unit]-1
 */
      __pyx_t_12.__pyx_n = 2;
      __pyx_t_12.arr_unit = __pyx_n_u_D;
      __pyx_t_12.offset = ((-__pyx_v_val) - 1);
      __pyx_t_6 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_weekday(__pyx_v_datesD, &__pyx_t_12)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3115, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_v_delta = ((PyArrayObject *)__pyx_t_6);
      __pyx_t_6 = 0;

      /* "cytimes/pddt.py":3116
 *                 datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *                 delta = utils.dt64arr_weekday(datesD, "D", -val - 1)  # weekday-val-1
 *                 datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]             # <<<<<<<<<<<<<<
 *                 arr = utils.dt64arr_as_unit(datesD, my_unit, "D") - 1  # dt64[my_unit]-1
 * 
 */
      __pyx_t_6 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_sub_arr(__pyx_v_datesD, __pyx_v_delta, NULL)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "cytimes/pddt.py":3117
 *                 delta = utils.dt64arr_weekday(datesD, "D", -val - 1)  # weekday-val-1
 *                 datesD = utils.arr_sub_arr(datesD, delta)  # int64[D]
 *                 arr = utils.dt64arr_as_unit(datesD, my_unit, "D") - 1  # dt64[my_unit]-1             # <<<<<<<<<<<<<<
 * 
 *             # Invalid
 */
      __pyx_t_13.__pyx_n = 1;
      __pyx_t_13.arr_unit = __pyx_n_u_D;
      __pyx_t_6 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_unit(__pyx_v_datesD, __pyx_v_my_unit, &__pyx_t_13)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3117, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3117, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3117, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "cytimes/pddt.py":3113
 * 
 *             # Weekday name
 *             elif (val := _parse_weekday(unit, False)) != -1:             # <<<<<<<<<<<<<<
 *                 datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *                 delta = utils.dt64arr_weekday(datesD, "D", -val - 1)  # weekday-val-1
 */
      goto __pyx_L23;
    }

    /* "cytimes/pddt.py":3121
 *             # Invalid
 *             else:
 *                 raise errors.InvalidTimeUnitError(             # <<<<<<<<<<<<<<
 *                     "invalid 'end of' datetime unit '%s'.\nSupports: "
 *                     "['Y', 'Q', 'M', 'W', 'D', 'h', 'm', 's', 'ms', 'us', 'ns'] "
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_errors); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3121, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_InvalidTimeUnitError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3121, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cytimes/pddt.py":3124
 *                     "invalid 'end of' datetime unit '%s'.\nSupports: "
 *                     "['Y', 'Q', 'M', 'W', 'D', 'h', 'm', 's', 'ms', 'us', 'ns'] "
 *                     "or Month/Weekday name." % unit             # <<<<<<<<<<<<<<
 *                 )
 * 
 */
      __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_invalid_end_of_datetime_unit_s_S, __pyx_v_unit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3124, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_18 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_18)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_18);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_7 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_18, __pyx_t_6};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3121, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 3121, __pyx_L1_error)
    }
    __pyx_L23:;
  }
  __pyx_L6:;

  /* "cytimes/pddt.py":3128
 * 
 *         # New instance
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)             # <<<<<<<<<<<<<<
 * 
 *     # . round / ceil / floor
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_19.__pyx_n = 3;
  __pyx_t_19.tz = __pyx_t_2;
  __pyx_t_19.unit = ((PyObject*)Py_None);
  __pyx_t_19.name = __pyx_t_5;
  __pyx_t_6 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":2919
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_end_of(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the datetime to the end of the specified datetime unit `<'Pddt'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.to_end_of", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesD);
  __Pyx_XDECREF((PyObject *)__pyx_v_delta);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesM);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesQ);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesY);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3131
 * 
 *     # . round / ceil / floor
 *     def round(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Perform round operation to the specified datetime unit `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_133round(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_132round, "Perform round operation to the specified datetime unit `<'Pddt'>`.\n\n        :param unit `<'str'>`: The datetime unit to round to.\n            Supported datetime units: 'D', 'h', 'm', 's', 'ms', 'us', 'ns'.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_133round = {"round", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_133round, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_132round};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_133round(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_unit = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("round (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_unit,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3131, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3131, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("round", 1, 2, 2, 1); __PYX_ERR(0, 3131, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "round") < 0)) __PYX_ERR(0, 3131, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_unit = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("round", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3131, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.round", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 0, "unit", 1))) __PYX_ERR(0, 3131, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_132round(__pyx_self, __pyx_v_self, __pyx_v_unit);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_132round(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit) {
  PyObject *__pyx_v_my_unit = 0;
  PyArrayObject *__pyx_v_arr = 0;
  PyArrayObject *__pyx_v_res = 0;
  PyObject *__pyx_v_err = 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;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_round __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  unsigned int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("round", 1);

  /* "cytimes/pddt.py":3138
 *         """
 *         # No change / Same unit
 *         if unit is None:             # <<<<<<<<<<<<<<
 *             return self  # exit
 *         my_unit: str = self.unit
 */
  __pyx_t_1 = (__pyx_v_unit == ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":3139
 *         # No change / Same unit
 *         if unit is None:
 *             return self  # exit             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 *         if unit == my_unit:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":3138
 *         """
 *         # No change / Same unit
 *         if unit is None:             # <<<<<<<<<<<<<<
 *             return self  # exit
 *         my_unit: str = self.unit
 */
  }

  /* "cytimes/pddt.py":3140
 *         if unit is None:
 *             return self  # exit
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 *         if unit == my_unit:
 *             return self  # exit
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 3140, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3141
 *             return self  # exit
 *         my_unit: str = self.unit
 *         if unit == my_unit:             # <<<<<<<<<<<<<<
 *             return self  # exit
 * 
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_v_my_unit, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3141, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":3142
 *         my_unit: str = self.unit
 *         if unit == my_unit:
 *             return self  # exit             # <<<<<<<<<<<<<<
 * 
 *         # Access datetime array & info
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":3141
 *             return self  # exit
 *         my_unit: str = self.unit
 *         if unit == my_unit:             # <<<<<<<<<<<<<<
 *             return self  # exit
 * 
 */
  }

  /* "cytimes/pddt.py":3145
 * 
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 * 
 *         # Perform operation
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3145, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3148
 * 
 *         # Perform operation
 *         try:             # <<<<<<<<<<<<<<
 *             res: np.ndarray = utils.dt64arr_round(arr, unit, my_unit)
 *         except Exception as err:
 */
  {
    __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:*/ {

      /* "cytimes/pddt.py":3149
 *         # Perform operation
 *         try:
 *             res: np.ndarray = utils.dt64arr_round(arr, unit, my_unit)             # <<<<<<<<<<<<<<
 *         except Exception as err:
 *             raise errors.InvalidTimeUnitError(err) from err
 */
      __pyx_t_6.__pyx_n = 1;
      __pyx_t_6.arr_unit = __pyx_v_my_unit;
      __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_round(__pyx_v_arr, __pyx_v_unit, &__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3149, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "cytimes/pddt.py":3148
 * 
 *         # Perform operation
 *         try:             # <<<<<<<<<<<<<<
 *             res: np.ndarray = utils.dt64arr_round(arr, unit, my_unit)
 *         except Exception as err:
 */
    }
    __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;

    /* "cytimes/pddt.py":3150
 *         try:
 *             res: np.ndarray = utils.dt64arr_round(arr, unit, my_unit)
 *         except Exception as err:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidTimeUnitError(err) from err
 *         if arr is res:
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_7) {
      __Pyx_AddTraceback("cytimes.pddt.Pddt.round", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 3150, __pyx_L7_except_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_v_err = __pyx_t_8;
      /*try:*/ {

        /* "cytimes/pddt.py":3151
 *             res: np.ndarray = utils.dt64arr_round(arr, unit, my_unit)
 *         except Exception as err:
 *             raise errors.InvalidTimeUnitError(err) from err             # <<<<<<<<<<<<<<
 *         if arr is res:
 *             return self
 */
        __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_errors); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3151, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_InvalidTimeUnitError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3151, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = NULL;
        __pyx_t_13 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
            __pyx_t_13 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_err};
          __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3151, __pyx_L16_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_Raise(__pyx_t_10, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __PYX_ERR(0, 3151, __pyx_L16_error)
      }

      /* "cytimes/pddt.py":3150
 *         try:
 *             res: np.ndarray = utils.dt64arr_round(arr, unit, my_unit)
 *         except Exception as err:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidTimeUnitError(err) from err
 *         if arr is res:
 */
      /*finally:*/ {
        __pyx_L16_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_7 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L7_except_error;
        }
      }
    }
    goto __pyx_L7_except_error;

    /* "cytimes/pddt.py":3148
 * 
 *         # Perform operation
 *         try:             # <<<<<<<<<<<<<<
 *             res: np.ndarray = utils.dt64arr_round(arr, unit, my_unit)
 *         except Exception as err:
 */
    __pyx_L7_except_error:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L10_try_end:;
  }

  /* "cytimes/pddt.py":3152
 *         except Exception as err:
 *             raise errors.InvalidTimeUnitError(err) from err
 *         if arr is res:             # <<<<<<<<<<<<<<
 *             return self
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)
 */
  __pyx_t_1 = (__pyx_v_arr == __pyx_v_res);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":3153
 *             raise errors.InvalidTimeUnitError(err) from err
 *         if arr is res:
 *             return self             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":3152
 *         except Exception as err:
 *             raise errors.InvalidTimeUnitError(err) from err
 *         if arr is res:             # <<<<<<<<<<<<<<
 *             return self
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)
 */
  }

  /* "cytimes/pddt.py":3154
 *         if arr is res:
 *             return self
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)             # <<<<<<<<<<<<<<
 * 
 *     def ceil(self, unit: str) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_22.__pyx_n = 3;
  __pyx_t_22.tz = __pyx_t_9;
  __pyx_t_22.unit = ((PyObject*)Py_None);
  __pyx_t_22.name = __pyx_t_8;
  __pyx_t_2 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_res), &__pyx_t_22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3131
 * 
 *     # . round / ceil / floor
 *     def round(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Perform round operation to the specified datetime unit `<'Pddt'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.round", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3156
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)
 * 
 *     def ceil(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Perform ceil operation to the specified datetime unit `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_135ceil(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_134ceil, "Perform ceil operation to the specified datetime unit `<'Pddt'>`.\n\n        :param unit `<'str'>`: The datetime unit to round to.\n            Supported datetime units: 'D', 'h', 'm', 's', 'ms', 'us', 'ns'.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_135ceil = {"ceil", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_135ceil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_134ceil};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_135ceil(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_unit = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ceil (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_unit,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3156, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3156, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("ceil", 1, 2, 2, 1); __PYX_ERR(0, 3156, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ceil") < 0)) __PYX_ERR(0, 3156, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_unit = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ceil", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3156, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 0, "unit", 1))) __PYX_ERR(0, 3156, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_134ceil(__pyx_self, __pyx_v_self, __pyx_v_unit);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_134ceil(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit) {
  PyObject *__pyx_v_my_unit = 0;
  PyArrayObject *__pyx_v_arr = 0;
  PyArrayObject *__pyx_v_res = 0;
  PyObject *__pyx_v_err = 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;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_ceil __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  unsigned int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ceil", 1);

  /* "cytimes/pddt.py":3163
 *         """
 *         # No change / Same unit
 *         if unit is None:             # <<<<<<<<<<<<<<
 *             return self  # exit
 *         my_unit: str = self.unit
 */
  __pyx_t_1 = (__pyx_v_unit == ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":3164
 *         # No change / Same unit
 *         if unit is None:
 *             return self  # exit             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 *         if unit == my_unit:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":3163
 *         """
 *         # No change / Same unit
 *         if unit is None:             # <<<<<<<<<<<<<<
 *             return self  # exit
 *         my_unit: str = self.unit
 */
  }

  /* "cytimes/pddt.py":3165
 *         if unit is None:
 *             return self  # exit
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 *         if unit == my_unit:
 *             return self  # exit
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 3165, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3166
 *             return self  # exit
 *         my_unit: str = self.unit
 *         if unit == my_unit:             # <<<<<<<<<<<<<<
 *             return self  # exit
 * 
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_v_my_unit, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3166, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":3167
 *         my_unit: str = self.unit
 *         if unit == my_unit:
 *             return self  # exit             # <<<<<<<<<<<<<<
 * 
 *         # Access datetime array & info
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":3166
 *             return self  # exit
 *         my_unit: str = self.unit
 *         if unit == my_unit:             # <<<<<<<<<<<<<<
 *             return self  # exit
 * 
 */
  }

  /* "cytimes/pddt.py":3170
 * 
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 * 
 *         # Perform operation
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3170, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3173
 * 
 *         # Perform operation
 *         try:             # <<<<<<<<<<<<<<
 *             res: np.ndarray = utils.dt64arr_ceil(arr, unit, my_unit)
 *         except Exception as err:
 */
  {
    __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:*/ {

      /* "cytimes/pddt.py":3174
 *         # Perform operation
 *         try:
 *             res: np.ndarray = utils.dt64arr_ceil(arr, unit, my_unit)             # <<<<<<<<<<<<<<
 *         except Exception as err:
 *             raise errors.InvalidTimeUnitError(err) from err
 */
      __pyx_t_6.__pyx_n = 1;
      __pyx_t_6.arr_unit = __pyx_v_my_unit;
      __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_ceil(__pyx_v_arr, __pyx_v_unit, &__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3174, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "cytimes/pddt.py":3173
 * 
 *         # Perform operation
 *         try:             # <<<<<<<<<<<<<<
 *             res: np.ndarray = utils.dt64arr_ceil(arr, unit, my_unit)
 *         except Exception as err:
 */
    }
    __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;

    /* "cytimes/pddt.py":3175
 *         try:
 *             res: np.ndarray = utils.dt64arr_ceil(arr, unit, my_unit)
 *         except Exception as err:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidTimeUnitError(err) from err
 *         if arr is res:
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_7) {
      __Pyx_AddTraceback("cytimes.pddt.Pddt.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 3175, __pyx_L7_except_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_v_err = __pyx_t_8;
      /*try:*/ {

        /* "cytimes/pddt.py":3176
 *             res: np.ndarray = utils.dt64arr_ceil(arr, unit, my_unit)
 *         except Exception as err:
 *             raise errors.InvalidTimeUnitError(err) from err             # <<<<<<<<<<<<<<
 *         if arr is res:
 *             return self
 */
        __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_errors); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3176, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_InvalidTimeUnitError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3176, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = NULL;
        __pyx_t_13 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
            __pyx_t_13 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_err};
          __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3176, __pyx_L16_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_Raise(__pyx_t_10, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __PYX_ERR(0, 3176, __pyx_L16_error)
      }

      /* "cytimes/pddt.py":3175
 *         try:
 *             res: np.ndarray = utils.dt64arr_ceil(arr, unit, my_unit)
 *         except Exception as err:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidTimeUnitError(err) from err
 *         if arr is res:
 */
      /*finally:*/ {
        __pyx_L16_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_7 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L7_except_error;
        }
      }
    }
    goto __pyx_L7_except_error;

    /* "cytimes/pddt.py":3173
 * 
 *         # Perform operation
 *         try:             # <<<<<<<<<<<<<<
 *             res: np.ndarray = utils.dt64arr_ceil(arr, unit, my_unit)
 *         except Exception as err:
 */
    __pyx_L7_except_error:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L10_try_end:;
  }

  /* "cytimes/pddt.py":3177
 *         except Exception as err:
 *             raise errors.InvalidTimeUnitError(err) from err
 *         if arr is res:             # <<<<<<<<<<<<<<
 *             return self
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)
 */
  __pyx_t_1 = (__pyx_v_arr == __pyx_v_res);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":3178
 *             raise errors.InvalidTimeUnitError(err) from err
 *         if arr is res:
 *             return self             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":3177
 *         except Exception as err:
 *             raise errors.InvalidTimeUnitError(err) from err
 *         if arr is res:             # <<<<<<<<<<<<<<
 *             return self
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)
 */
  }

  /* "cytimes/pddt.py":3179
 *         if arr is res:
 *             return self
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)             # <<<<<<<<<<<<<<
 * 
 *     def floor(self, unit: str) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_22.__pyx_n = 3;
  __pyx_t_22.tz = __pyx_t_9;
  __pyx_t_22.unit = ((PyObject*)Py_None);
  __pyx_t_22.name = __pyx_t_8;
  __pyx_t_2 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_res), &__pyx_t_22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3156
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)
 * 
 *     def ceil(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Perform ceil operation to the specified datetime unit `<'Pddt'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3181
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)
 * 
 *     def floor(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Perform floor operation to the specified datetime unit `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_137floor(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_136floor, "Perform floor operation to the specified datetime unit `<'Pddt'>`.\n\n        :param unit `<'str'>`: The datetime unit to round to.\n            Supported datetime units: 'D', 'h', 'm', 's', 'ms', 'us', 'ns'.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_137floor = {"floor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_137floor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_136floor};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_137floor(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_unit = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("floor (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_unit,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3181, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3181, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("floor", 1, 2, 2, 1); __PYX_ERR(0, 3181, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "floor") < 0)) __PYX_ERR(0, 3181, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_unit = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("floor", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3181, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 0, "unit", 1))) __PYX_ERR(0, 3181, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_136floor(__pyx_self, __pyx_v_self, __pyx_v_unit);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_136floor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit) {
  PyObject *__pyx_v_my_unit = 0;
  PyArrayObject *__pyx_v_arr = 0;
  PyArrayObject *__pyx_v_res = 0;
  PyObject *__pyx_v_err = 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;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_floor __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  unsigned int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("floor", 1);

  /* "cytimes/pddt.py":3188
 *         """
 *         # No change / Same unit
 *         if unit is None:             # <<<<<<<<<<<<<<
 *             return self  # exit
 *         my_unit: str = self.unit
 */
  __pyx_t_1 = (__pyx_v_unit == ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":3189
 *         # No change / Same unit
 *         if unit is None:
 *             return self  # exit             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 *         if unit == my_unit:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":3188
 *         """
 *         # No change / Same unit
 *         if unit is None:             # <<<<<<<<<<<<<<
 *             return self  # exit
 *         my_unit: str = self.unit
 */
  }

  /* "cytimes/pddt.py":3190
 *         if unit is None:
 *             return self  # exit
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 *         if unit == my_unit:
 *             return self  # exit
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 3190, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3191
 *             return self  # exit
 *         my_unit: str = self.unit
 *         if unit == my_unit:             # <<<<<<<<<<<<<<
 *             return self  # exit
 * 
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_v_my_unit, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3191, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":3192
 *         my_unit: str = self.unit
 *         if unit == my_unit:
 *             return self  # exit             # <<<<<<<<<<<<<<
 * 
 *         # Access datetime array & info
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":3191
 *             return self  # exit
 *         my_unit: str = self.unit
 *         if unit == my_unit:             # <<<<<<<<<<<<<<
 *             return self  # exit
 * 
 */
  }

  /* "cytimes/pddt.py":3195
 * 
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 * 
 *         # Perform operation
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3195, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3198
 * 
 *         # Perform operation
 *         try:             # <<<<<<<<<<<<<<
 *             res: np.ndarray = utils.dt64arr_floor(arr, unit, my_unit)
 *         except Exception as err:
 */
  {
    __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:*/ {

      /* "cytimes/pddt.py":3199
 *         # Perform operation
 *         try:
 *             res: np.ndarray = utils.dt64arr_floor(arr, unit, my_unit)             # <<<<<<<<<<<<<<
 *         except Exception as err:
 *             raise errors.InvalidTimeUnitError(err) from err
 */
      __pyx_t_6.__pyx_n = 1;
      __pyx_t_6.arr_unit = __pyx_v_my_unit;
      __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_floor(__pyx_v_arr, __pyx_v_unit, &__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3199, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "cytimes/pddt.py":3198
 * 
 *         # Perform operation
 *         try:             # <<<<<<<<<<<<<<
 *             res: np.ndarray = utils.dt64arr_floor(arr, unit, my_unit)
 *         except Exception as err:
 */
    }
    __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;

    /* "cytimes/pddt.py":3200
 *         try:
 *             res: np.ndarray = utils.dt64arr_floor(arr, unit, my_unit)
 *         except Exception as err:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidTimeUnitError(err) from err
 *         if arr is res:
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_7) {
      __Pyx_AddTraceback("cytimes.pddt.Pddt.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 3200, __pyx_L7_except_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_v_err = __pyx_t_8;
      /*try:*/ {

        /* "cytimes/pddt.py":3201
 *             res: np.ndarray = utils.dt64arr_floor(arr, unit, my_unit)
 *         except Exception as err:
 *             raise errors.InvalidTimeUnitError(err) from err             # <<<<<<<<<<<<<<
 *         if arr is res:
 *             return self
 */
        __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_errors); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3201, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_InvalidTimeUnitError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3201, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = NULL;
        __pyx_t_13 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
            __pyx_t_13 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_err};
          __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3201, __pyx_L16_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_Raise(__pyx_t_10, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __PYX_ERR(0, 3201, __pyx_L16_error)
      }

      /* "cytimes/pddt.py":3200
 *         try:
 *             res: np.ndarray = utils.dt64arr_floor(arr, unit, my_unit)
 *         except Exception as err:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidTimeUnitError(err) from err
 *         if arr is res:
 */
      /*finally:*/ {
        __pyx_L16_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_7 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L7_except_error;
        }
      }
    }
    goto __pyx_L7_except_error;

    /* "cytimes/pddt.py":3198
 * 
 *         # Perform operation
 *         try:             # <<<<<<<<<<<<<<
 *             res: np.ndarray = utils.dt64arr_floor(arr, unit, my_unit)
 *         except Exception as err:
 */
    __pyx_L7_except_error:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L10_try_end:;
  }

  /* "cytimes/pddt.py":3202
 *         except Exception as err:
 *             raise errors.InvalidTimeUnitError(err) from err
 *         if arr is res:             # <<<<<<<<<<<<<<
 *             return self
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)
 */
  __pyx_t_1 = (__pyx_v_arr == __pyx_v_res);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":3203
 *             raise errors.InvalidTimeUnitError(err) from err
 *         if arr is res:
 *             return self             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":3202
 *         except Exception as err:
 *             raise errors.InvalidTimeUnitError(err) from err
 *         if arr is res:             # <<<<<<<<<<<<<<
 *             return self
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)
 */
  }

  /* "cytimes/pddt.py":3204
 *         if arr is res:
 *             return self
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)             # <<<<<<<<<<<<<<
 * 
 *     # . fsp (fractional seconds precision)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_22.__pyx_n = 3;
  __pyx_t_22.tz = __pyx_t_9;
  __pyx_t_22.unit = ((PyObject*)Py_None);
  __pyx_t_22.name = __pyx_t_8;
  __pyx_t_2 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_res), &__pyx_t_22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3181
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)
 * 
 *     def floor(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Perform floor operation to the specified datetime unit `<'Pddt'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3207
 * 
 *     # . fsp (fractional seconds precision)
 *     def fsp(self, precision: cython.int) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust to the specified fractional seconds precision `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_139fsp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_138fsp, "Adjust to the specified fractional seconds precision `<'Pddt'>`.\n\n        :param precision `<'int'>`: The fractional seconds precision (0-9).\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_139fsp = {"fsp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_139fsp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_138fsp};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_139fsp(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_precision;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fsp (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_precision,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3207, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3207, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("fsp", 1, 2, 2, 1); __PYX_ERR(0, 3207, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fsp") < 0)) __PYX_ERR(0, 3207, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_precision = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_precision == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3207, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fsp", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3207, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.fsp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_138fsp(__pyx_self, __pyx_v_self, __pyx_v_precision);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_138fsp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_precision) {
  PyObject *__pyx_v_my_unit = 0;
  Py_UCS4 __pyx_v_my_unit_ch;
  PY_LONG_LONG __pyx_v_f;
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_res = 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;
  unsigned int __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils_arr_floor_to_mul __pyx_t_7;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fsp", 1);

  /* "cytimes/pddt.py":3213
 *         """
 *         # No change
 *         if precision >= 9:             # <<<<<<<<<<<<<<
 *             return self  # exit: same value
 *         if precision < 0:
 */
  __pyx_t_1 = (__pyx_v_precision >= 9);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":3214
 *         # No change
 *         if precision >= 9:
 *             return self  # exit: same value             # <<<<<<<<<<<<<<
 *         if precision < 0:
 *             raise errors.InvalidFspError(
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":3213
 *         """
 *         # No change
 *         if precision >= 9:             # <<<<<<<<<<<<<<
 *             return self  # exit: same value
 *         if precision < 0:
 */
  }

  /* "cytimes/pddt.py":3215
 *         if precision >= 9:
 *             return self  # exit: same value
 *         if precision < 0:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidFspError(
 *                 "invalid fractional seconds precision '%d'.\n"
 */
  __pyx_t_1 = (__pyx_v_precision < 0);
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/pddt.py":3216
 *             return self  # exit: same value
 *         if precision < 0:
 *             raise errors.InvalidFspError(             # <<<<<<<<<<<<<<
 *                 "invalid fractional seconds precision '%d'.\n"
 *                 "Must be between 0 and 6." % precision
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InvalidFspError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cytimes/pddt.py":3218
 *             raise errors.InvalidFspError(
 *                 "invalid fractional seconds precision '%d'.\n"
 *                 "Must be between 0 and 6." % precision             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_precision); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_invalid_fractional_seconds_preci, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 3216, __pyx_L1_error)

    /* "cytimes/pddt.py":3215
 *         if precision >= 9:
 *             return self  # exit: same value
 *         if precision < 0:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidFspError(
 *                 "invalid fractional seconds precision '%d'.\n"
 */
  }

  /* "cytimes/pddt.py":3222
 * 
 *         # Calcualte factor
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 *         my_unit_ch: cython.Py_UCS4 = str_read(my_unit, 0)
 *         f: cython.longlong  # fsp factor
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 3222, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3223
 *         # Calcualte factor
 *         my_unit: str = self.unit
 *         my_unit_ch: cython.Py_UCS4 = str_read(my_unit, 0)             # <<<<<<<<<<<<<<
 *         f: cython.longlong  # fsp factor
 *         # . nanosecond
 */
  __pyx_v_my_unit_ch = PyUnicode_READ_CHAR(__pyx_v_my_unit, 0);

  /* "cytimes/pddt.py":3226
 *         f: cython.longlong  # fsp factor
 *         # . nanosecond
 *         if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *             f = int(10 ** (9 - precision))
 *         # . microsecond
 */
  switch (__pyx_v_my_unit_ch) {
    case 0x6E:

    /* "cytimes/pddt.py":3227
 *         # . nanosecond
 *         if my_unit_ch == "n":
 *             f = int(10 ** (9 - precision))             # <<<<<<<<<<<<<<
 *         # . microsecond
 *         elif my_unit_ch == "u":
 */
    __pyx_v_f = ((PY_LONG_LONG)pow(10.0, ((double)(9 - __pyx_v_precision))));

    /* "cytimes/pddt.py":3226
 *         f: cython.longlong  # fsp factor
 *         # . nanosecond
 *         if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *             f = int(10 ** (9 - precision))
 *         # . microsecond
 */
    break;
    case 0x75:

    /* "cytimes/pddt.py":3230
 *         # . microsecond
 *         elif my_unit_ch == "u":
 *             if precision >= 6:             # <<<<<<<<<<<<<<
 *                 return self  # exit: same value
 *             f = int(10 ** (6 - precision))
 */
    __pyx_t_1 = (__pyx_v_precision >= 6);
    if (__pyx_t_1) {

      /* "cytimes/pddt.py":3231
 *         elif my_unit_ch == "u":
 *             if precision >= 6:
 *                 return self  # exit: same value             # <<<<<<<<<<<<<<
 *             f = int(10 ** (6 - precision))
 *         # . millisecond
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self);
      __pyx_r = __pyx_v_self;
      goto __pyx_L0;

      /* "cytimes/pddt.py":3230
 *         # . microsecond
 *         elif my_unit_ch == "u":
 *             if precision >= 6:             # <<<<<<<<<<<<<<
 *                 return self  # exit: same value
 *             f = int(10 ** (6 - precision))
 */
    }

    /* "cytimes/pddt.py":3232
 *             if precision >= 6:
 *                 return self  # exit: same value
 *             f = int(10 ** (6 - precision))             # <<<<<<<<<<<<<<
 *         # . millisecond
 *         elif my_unit_ch == "m":
 */
    __pyx_v_f = ((PY_LONG_LONG)pow(10.0, ((double)(6 - __pyx_v_precision))));

    /* "cytimes/pddt.py":3229
 *             f = int(10 ** (9 - precision))
 *         # . microsecond
 *         elif my_unit_ch == "u":             # <<<<<<<<<<<<<<
 *             if precision >= 6:
 *                 return self  # exit: same value
 */
    break;
    case 0x6D:

    /* "cytimes/pddt.py":3235
 *         # . millisecond
 *         elif my_unit_ch == "m":
 *             if precision >= 3:             # <<<<<<<<<<<<<<
 *                 return self  # exit: same value
 *             f = int(10 ** (3 - precision))
 */
    __pyx_t_1 = (__pyx_v_precision >= 3);
    if (__pyx_t_1) {

      /* "cytimes/pddt.py":3236
 *         elif my_unit_ch == "m":
 *             if precision >= 3:
 *                 return self  # exit: same value             # <<<<<<<<<<<<<<
 *             f = int(10 ** (3 - precision))
 *         # . second
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self);
      __pyx_r = __pyx_v_self;
      goto __pyx_L0;

      /* "cytimes/pddt.py":3235
 *         # . millisecond
 *         elif my_unit_ch == "m":
 *             if precision >= 3:             # <<<<<<<<<<<<<<
 *                 return self  # exit: same value
 *             f = int(10 ** (3 - precision))
 */
    }

    /* "cytimes/pddt.py":3237
 *             if precision >= 3:
 *                 return self  # exit: same value
 *             f = int(10 ** (3 - precision))             # <<<<<<<<<<<<<<
 *         # . second
 *         else:
 */
    __pyx_v_f = ((PY_LONG_LONG)pow(10.0, ((double)(3 - __pyx_v_precision))));

    /* "cytimes/pddt.py":3234
 *             f = int(10 ** (6 - precision))
 *         # . millisecond
 *         elif my_unit_ch == "m":             # <<<<<<<<<<<<<<
 *             if precision >= 3:
 *                 return self  # exit: same value
 */
    break;
    default:

    /* "cytimes/pddt.py":3240
 *         # . second
 *         else:
 *             return self  # exit: same value             # <<<<<<<<<<<<<<
 * 
 *         # Perform operation
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;
    break;
  }

  /* "cytimes/pddt.py":3243
 * 
 *         # Perform operation
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 *         res = utils.arr_floor_to_mul(arr, f, f, 0)
 *         res = res.astype("datetime64[%s]" % my_unit)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3243, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3244
 *         # Perform operation
 *         arr: np.ndarray = self.values_naive
 *         res = utils.arr_floor_to_mul(arr, f, f, 0)             # <<<<<<<<<<<<<<
 *         res = res.astype("datetime64[%s]" % my_unit)
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)
 */
  __pyx_t_7.__pyx_n = 2;
  __pyx_t_7.multiple = __pyx_v_f;
  __pyx_t_7.offset = 0;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_to_mul(__pyx_v_arr, __pyx_v_f, &__pyx_t_7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_res = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3245
 *         arr: np.ndarray = self.values_naive
 *         res = utils.arr_floor_to_mul(arr, f, f, 0)
 *         res = res.astype("datetime64[%s]" % my_unit)             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_res, __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_my_unit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF_SET(__pyx_v_res, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3246
 *         res = utils.arr_floor_to_mul(arr, f, f, 0)
 *         res = res.astype("datetime64[%s]" % my_unit)
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)             # <<<<<<<<<<<<<<
 * 
 *     # Calendar -----------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8.__pyx_n = 3;
  __pyx_t_8.tz = __pyx_t_2;
  __pyx_t_8.unit = ((PyObject*)Py_None);
  __pyx_t_8.name = __pyx_t_4;
  __pyx_t_5 = __pyx_f_7cytimes_4pddt_pddt_new_simple(__pyx_v_res, &__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3207
 * 
 *     # . fsp (fractional seconds precision)
 *     def fsp(self, precision: cython.int) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust to the specified fractional seconds precision `<'Pddt'>`.
 * 
 */

  /* 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("cytimes.pddt.Pddt.fsp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3250
 *     # Calendar -----------------------------------------------------------------------------
 *     # . iso
 *     def isocalendar(self) -> DataFrame:             # <<<<<<<<<<<<<<
 *         """Return the ISO calendar `<'DateFrame'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_141isocalendar(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_140isocalendar, "Return the ISO calendar `<'DateFrame'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_141isocalendar = {"isocalendar", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_141isocalendar, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_140isocalendar};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_141isocalendar(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isocalendar (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3250, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isocalendar") < 0)) __PYX_ERR(0, 3250, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("isocalendar", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3250, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.isocalendar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_140isocalendar(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_140isocalendar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyArrayObject *__pyx_v__iso = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isocalendar", 1);

  /* "cytimes/pddt.py":3252
 *     def isocalendar(self) -> DataFrame:
 *         """Return the ISO calendar `<'DateFrame'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)             # <<<<<<<<<<<<<<
 *         return DataFrame(_iso, columns=["year", "week", "weekday"], index=self)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3252, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_isocalendar(((PyArrayObject *)__pyx_t_1), NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v__iso = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3253
 *         """Return the ISO calendar `<'DateFrame'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 *         return DataFrame(_iso, columns=["year", "week", "weekday"], index=self)             # <<<<<<<<<<<<<<
 * 
 *     def isoyear(self) -> Index[np.int64]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_v__iso);
  __Pyx_GIVEREF((PyObject *)__pyx_v__iso);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v__iso))) __PYX_ERR(0, 3253, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_n_u_year);
  __Pyx_GIVEREF(__pyx_n_u_year);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_year)) __PYX_ERR(0, 3253, __pyx_L1_error);
  __Pyx_INCREF(__pyx_n_u_week);
  __Pyx_GIVEREF(__pyx_n_u_week);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_u_week)) __PYX_ERR(0, 3253, __pyx_L1_error);
  __Pyx_INCREF(__pyx_n_u_weekday);
  __Pyx_GIVEREF(__pyx_n_u_weekday);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 2, __pyx_n_u_weekday)) __PYX_ERR(0, 3253, __pyx_L1_error);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_columns, __pyx_t_4) < 0) __PYX_ERR(0, 3253, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_index, __pyx_v_self) < 0) __PYX_ERR(0, 3253, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3253, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3250
 *     # Calendar -----------------------------------------------------------------------------
 *     # . iso
 *     def isocalendar(self) -> DataFrame:             # <<<<<<<<<<<<<<
 *         """Return the ISO calendar `<'DateFrame'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 */

  /* 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("cytimes.pddt.Pddt.isocalendar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__iso);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3255
 *         return DataFrame(_iso, columns=["year", "week", "weekday"], index=self)
 * 
 *     def isoyear(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the ISO calendar years `<'Index[int64]'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_143isoyear(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_142isoyear, "Return the ISO calendar years `<'Index[int64]'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_143isoyear = {"isoyear", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_143isoyear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_142isoyear};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_143isoyear(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isoyear (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3255, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isoyear") < 0)) __PYX_ERR(0, 3255, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("isoyear", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3255, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.isoyear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_142isoyear(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_142isoyear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyArrayObject *__pyx_v__iso = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isoyear", 1);

  /* "cytimes/pddt.py":3257
 *     def isoyear(self) -> Index[np.int64]:
 *         """Return the ISO calendar years `<'Index[int64]'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)             # <<<<<<<<<<<<<<
 *         return Index(_iso[:, 0], name="isoyear")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3257, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_isocalendar(((PyArrayObject *)__pyx_t_1), NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v__iso = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3258
 *         """Return the ISO calendar years `<'Index[int64]'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 *         return Index(_iso[:, 0], name="isoyear")             # <<<<<<<<<<<<<<
 * 
 *     def isoweek(self) -> Index[np.int64]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v__iso), __pyx_tuple__40); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 3258, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_n_u_isoyear) < 0) __PYX_ERR(0, 3258, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3255
 *         return DataFrame(_iso, columns=["year", "week", "weekday"], index=self)
 * 
 *     def isoyear(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the ISO calendar years `<'Index[int64]'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 */

  /* 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("cytimes.pddt.Pddt.isoyear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__iso);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3260
 *         return Index(_iso[:, 0], name="isoyear")
 * 
 *     def isoweek(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the ISO calendar week numbers (1-53) `<'Index[int64]'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_145isoweek(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_144isoweek, "Return the ISO calendar week numbers (1-53) `<'Index[int64]'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_145isoweek = {"isoweek", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_145isoweek, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_144isoweek};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_145isoweek(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isoweek (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3260, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isoweek") < 0)) __PYX_ERR(0, 3260, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("isoweek", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3260, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.isoweek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_144isoweek(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_144isoweek(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyArrayObject *__pyx_v__iso = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isoweek", 1);

  /* "cytimes/pddt.py":3262
 *     def isoweek(self) -> Index[np.int64]:
 *         """Return the ISO calendar week numbers (1-53) `<'Index[int64]'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)             # <<<<<<<<<<<<<<
 *         return Index(_iso[:, 1], name="isoweek")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3262, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_isocalendar(((PyArrayObject *)__pyx_t_1), NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v__iso = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3263
 *         """Return the ISO calendar week numbers (1-53) `<'Index[int64]'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 *         return Index(_iso[:, 1], name="isoweek")             # <<<<<<<<<<<<<<
 * 
 *     def isoweekday(self) -> Index[np.int64]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v__iso), __pyx_tuple__41); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 3263, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_n_u_isoweek) < 0) __PYX_ERR(0, 3263, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3260
 *         return Index(_iso[:, 0], name="isoyear")
 * 
 *     def isoweek(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the ISO calendar week numbers (1-53) `<'Index[int64]'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 */

  /* 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("cytimes.pddt.Pddt.isoweek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__iso);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3265
 *         return Index(_iso[:, 1], name="isoweek")
 * 
 *     def isoweekday(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the ISO calendar weekdays (1=Mon...7=Sun) `<'Index[int64]'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_147isoweekday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_146isoweekday, "Return the ISO calendar weekdays (1=Mon...7=Sun) `<'Index[int64]'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_147isoweekday = {"isoweekday", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_147isoweekday, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_146isoweekday};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_147isoweekday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isoweekday (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3265, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isoweekday") < 0)) __PYX_ERR(0, 3265, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("isoweekday", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3265, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.isoweekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_146isoweekday(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_146isoweekday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyArrayObject *__pyx_v__iso = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isoweekday", 1);

  /* "cytimes/pddt.py":3267
 *     def isoweekday(self) -> Index[np.int64]:
 *         """Return the ISO calendar weekdays (1=Mon...7=Sun) `<'Index[int64]'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)             # <<<<<<<<<<<<<<
 *         return Index(_iso[:, 2], name="isoweekday")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3267, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_isocalendar(((PyArrayObject *)__pyx_t_1), NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v__iso = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3268
 *         """Return the ISO calendar weekdays (1=Mon...7=Sun) `<'Index[int64]'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 *         return Index(_iso[:, 2], name="isoweekday")             # <<<<<<<<<<<<<<
 * 
 *     # . year
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v__iso), __pyx_tuple__42); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 3268, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_n_u_isoweekday) < 0) __PYX_ERR(0, 3268, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3265
 *         return Index(_iso[:, 1], name="isoweek")
 * 
 *     def isoweekday(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the ISO calendar weekdays (1=Mon...7=Sun) `<'Index[int64]'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 */

  /* 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("cytimes.pddt.Pddt.isoweekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__iso);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3271
 * 
 *     # . year
 *     @property             # <<<<<<<<<<<<<<
 *     def year(self) -> Index[np.int64]:
 *         """The years `<'Index[int64]'>`."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_149year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_148year, "The years `<'Index[int64]'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_149year = {"year", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_149year, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_148year};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_149year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("year (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3271, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "year") < 0)) __PYX_ERR(0, 3271, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("year", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3271, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_148year(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_148year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("year", 1);

  /* "cytimes/pddt.py":3274
 *     def year(self) -> Index[np.int64]:
 *         """The years `<'Index[int64]'>`."""
 *         return Index(utils.dt64arr_year(self.values_naive), name="year")             # <<<<<<<<<<<<<<
 * 
 *     def is_leap_year(self) -> Index[bool]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3274, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_year(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3274, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_year) < 0) __PYX_ERR(0, 3274, __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(0, 3274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3271
 * 
 *     # . year
 *     @property             # <<<<<<<<<<<<<<
 *     def year(self) -> Index[np.int64]:
 *         """The years `<'Index[int64]'>`."""
 */

  /* 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("cytimes.pddt.Pddt.year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3276
 *         return Index(utils.dt64arr_year(self.values_naive), name="year")
 * 
 *     def is_leap_year(self) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's years are in a leap year `<'Index[bool]'>`."""
 *         return Index(utils.dt64arr_is_leap_year(self.values_naive), name="is_leap_year")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_151is_leap_year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_150is_leap_year, "Determine if the instance's years are in a leap year `<'Index[bool]'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_151is_leap_year = {"is_leap_year", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_151is_leap_year, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_150is_leap_year};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_151is_leap_year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_leap_year (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3276, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_leap_year") < 0)) __PYX_ERR(0, 3276, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_leap_year", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3276, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.is_leap_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_150is_leap_year(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_150is_leap_year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_leap_year", 1);

  /* "cytimes/pddt.py":3278
 *     def is_leap_year(self) -> Index[bool]:
 *         """Determine if the instance's years are in a leap year `<'Index[bool]'>`."""
 *         return Index(utils.dt64arr_is_leap_year(self.values_naive), name="is_leap_year")             # <<<<<<<<<<<<<<
 * 
 *     def is_long_year(self) -> Index[bool]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3278, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_is_leap_year(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3278, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_is_leap_year) < 0) __PYX_ERR(0, 3278, __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(0, 3278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3276
 *         return Index(utils.dt64arr_year(self.values_naive), name="year")
 * 
 *     def is_leap_year(self) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's years are in a leap year `<'Index[bool]'>`."""
 *         return Index(utils.dt64arr_is_leap_year(self.values_naive), name="is_leap_year")
 */

  /* 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("cytimes.pddt.Pddt.is_leap_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3280
 *         return Index(utils.dt64arr_is_leap_year(self.values_naive), name="is_leap_year")
 * 
 *     def is_long_year(self) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's years are in a long year `<'Index[bool]'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_153is_long_year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_152is_long_year, "Determine if the instance's years are in a long year `<'Index[bool]'>`.\n\n        - Long year: maximum ISO week number is 53.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_153is_long_year = {"is_long_year", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_153is_long_year, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_152is_long_year};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_153is_long_year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_long_year (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3280, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_long_year") < 0)) __PYX_ERR(0, 3280, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_long_year", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3280, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.is_long_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_152is_long_year(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_152is_long_year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_long_year", 1);

  /* "cytimes/pddt.py":3285
 *         - Long year: maximum ISO week number is 53.
 *         """
 *         return Index(utils.dt64arr_is_long_year(self.values_naive), name="is_long_year")             # <<<<<<<<<<<<<<
 * 
 *     def leap_bt_year(self, year: cython.int) -> Index[np.int64]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3285, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_is_long_year(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3285, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_is_long_year) < 0) __PYX_ERR(0, 3285, __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(0, 3285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3280
 *         return Index(utils.dt64arr_is_leap_year(self.values_naive), name="is_leap_year")
 * 
 *     def is_long_year(self) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's years are in a long year `<'Index[bool]'>`.
 * 
 */

  /* 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("cytimes.pddt.Pddt.is_long_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3287
 *         return Index(utils.dt64arr_is_long_year(self.values_naive), name="is_long_year")
 * 
 *     def leap_bt_year(self, year: cython.int) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Compute the number of leap years between the instance's
 *         years and the passed-in 'year' `<'Index[int64]'>`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_155leap_bt_year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_154leap_bt_year, "Compute the number of leap years between the instance's\n        years and the passed-in 'year' `<'Index[int64]'>`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_155leap_bt_year = {"leap_bt_year", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_155leap_bt_year, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_154leap_bt_year};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_155leap_bt_year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_year;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("leap_bt_year (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_year,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3287, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_year)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3287, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("leap_bt_year", 1, 2, 2, 1); __PYX_ERR(0, 3287, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "leap_bt_year") < 0)) __PYX_ERR(0, 3287, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_year = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_year == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3287, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("leap_bt_year", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3287, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.leap_bt_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_154leap_bt_year(__pyx_self, __pyx_v_self, __pyx_v_year);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_154leap_bt_year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_year) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("leap_bt_year", 1);

  /* "cytimes/pddt.py":3291
 *         years and the passed-in 'year' `<'Index[int64]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.dt64arr_leap_bt_year(self.values_naive, year),
 *             name="leap_bt_year",
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cytimes/pddt.py":3292
 *         """
 *         return Index(
 *             utils.dt64arr_leap_bt_year(self.values_naive, year),             # <<<<<<<<<<<<<<
 *             name="leap_bt_year",
 *         )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3292, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_leap_bt_year(((PyArrayObject *)__pyx_t_2), __pyx_v_year, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3291
 *         years and the passed-in 'year' `<'Index[int64]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.dt64arr_leap_bt_year(self.values_naive, year),
 *             name="leap_bt_year",
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3291, __pyx_L1_error);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3293
 *         return Index(
 *             utils.dt64arr_leap_bt_year(self.values_naive, year),
 *             name="leap_bt_year",             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_leap_bt_year) < 0) __PYX_ERR(0, 3293, __pyx_L1_error)

  /* "cytimes/pddt.py":3291
 *         years and the passed-in 'year' `<'Index[int64]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.dt64arr_leap_bt_year(self.values_naive, year),
 *             name="leap_bt_year",
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3287
 *         return Index(utils.dt64arr_is_long_year(self.values_naive), name="is_long_year")
 * 
 *     def leap_bt_year(self, year: cython.int) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Compute the number of leap years between the instance's
 *         years and the passed-in 'year' `<'Index[int64]'>`.
 */

  /* 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("cytimes.pddt.Pddt.leap_bt_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3296
 *         )
 * 
 *     def days_in_year(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the maximum number of days (365, 366)
 *         in the instance's years `<'Index[int64]'>`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_157days_in_year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_156days_in_year, "Return the maximum number of days (365, 366)\n        in the instance's years `<'Index[int64]'>`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_157days_in_year = {"days_in_year", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_157days_in_year, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_156days_in_year};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_157days_in_year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("days_in_year (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3296, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "days_in_year") < 0)) __PYX_ERR(0, 3296, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("days_in_year", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3296, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.days_in_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_156days_in_year(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_156days_in_year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("days_in_year", 1);

  /* "cytimes/pddt.py":3300
 *         in the instance's years `<'Index[int64]'>`.
 *         """
 *         return Index(utils.dt64arr_days_in_year(self.values_naive), name="days_in_year")             # <<<<<<<<<<<<<<
 * 
 *     def days_bf_year(self) -> Index[np.int64]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3300, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_in_year(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3300, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_days_in_year) < 0) __PYX_ERR(0, 3300, __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(0, 3300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3296
 *         )
 * 
 *     def days_in_year(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the maximum number of days (365, 366)
 *         in the instance's years `<'Index[int64]'>`.
 */

  /* 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("cytimes.pddt.Pddt.days_in_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3302
 *         return Index(utils.dt64arr_days_in_year(self.values_naive), name="days_in_year")
 * 
 *     def days_bf_year(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days from January 1st, 1st AD,
 *         to the start of the instance's years `<'Index[int64]'>`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_159days_bf_year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_158days_bf_year, "Return the number of days from January 1st, 1st AD,\n        to the start of the instance's years `<'Index[int64]'>`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_159days_bf_year = {"days_bf_year", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_159days_bf_year, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_158days_bf_year};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_159days_bf_year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("days_bf_year (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3302, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "days_bf_year") < 0)) __PYX_ERR(0, 3302, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("days_bf_year", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3302, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.days_bf_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_158days_bf_year(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_158days_bf_year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("days_bf_year", 1);

  /* "cytimes/pddt.py":3306
 *         to the start of the instance's years `<'Index[int64]'>`.
 *         """
 *         return Index(utils.dt64arr_days_bf_year(self.values_naive), name="days_bf_year")             # <<<<<<<<<<<<<<
 * 
 *     def days_of_year(self) -> Index[np.int64]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3306, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_bf_year(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3306, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_days_bf_year) < 0) __PYX_ERR(0, 3306, __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(0, 3306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3302
 *         return Index(utils.dt64arr_days_in_year(self.values_naive), name="days_in_year")
 * 
 *     def days_bf_year(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days from January 1st, 1st AD,
 *         to the start of the instance's years `<'Index[int64]'>`.
 */

  /* 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("cytimes.pddt.Pddt.days_bf_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3308
 *         return Index(utils.dt64arr_days_bf_year(self.values_naive), name="days_bf_year")
 * 
 *     def days_of_year(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days since the start
 *         of the instance's years `<'Index[int64]'>`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_161days_of_year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_160days_of_year, "Return the number of days since the start\n        of the instance's years `<'Index[int64]'>`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_161days_of_year = {"days_of_year", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_161days_of_year, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_160days_of_year};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_161days_of_year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("days_of_year (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3308, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "days_of_year") < 0)) __PYX_ERR(0, 3308, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("days_of_year", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3308, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.days_of_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_160days_of_year(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_160days_of_year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("days_of_year", 1);

  /* "cytimes/pddt.py":3312
 *         of the instance's years `<'Index[int64]'>`.
 *         """
 *         return Index(utils.dt64arr_days_of_year(self.values_naive), name="days_of_year")             # <<<<<<<<<<<<<<
 * 
 *     def is_year(self, year: cython.int) -> Index[bool]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3312, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_of_year(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3312, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_days_of_year) < 0) __PYX_ERR(0, 3312, __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(0, 3312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3308
 *         return Index(utils.dt64arr_days_bf_year(self.values_naive), name="days_bf_year")
 * 
 *     def days_of_year(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days since the start
 *         of the instance's years `<'Index[int64]'>`.
 */

  /* 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("cytimes.pddt.Pddt.days_of_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3314
 *         return Index(utils.dt64arr_days_of_year(self.values_naive), name="days_of_year")
 * 
 *     def is_year(self, year: cython.int) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's years match
 *         the passed-in 'year' `<'Index[bool]'>`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_163is_year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_162is_year, "Determine if the instance's years match\n        the passed-in 'year' `<'Index[bool]'>`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_163is_year = {"is_year", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_163is_year, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_162is_year};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_163is_year(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_year;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_year (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_year,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3314, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_year)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3314, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("is_year", 1, 2, 2, 1); __PYX_ERR(0, 3314, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_year") < 0)) __PYX_ERR(0, 3314, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_year = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_year == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3314, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_year", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3314, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.is_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_162is_year(__pyx_self, __pyx_v_self, __pyx_v_year);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_162is_year(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_year) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_year", 1);

  /* "cytimes/pddt.py":3318
 *         the passed-in 'year' `<'Index[bool]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.arr_equal_to(utils.dt64arr_year(self.values_naive), year),
 *             name="is_year",
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cytimes/pddt.py":3319
 *         """
 *         return Index(
 *             utils.arr_equal_to(utils.dt64arr_year(self.values_naive), year),             # <<<<<<<<<<<<<<
 *             name="is_year",
 *         )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3319, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_year(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_equal_to(((PyArrayObject *)__pyx_t_3), __pyx_v_year)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3318
 *         the passed-in 'year' `<'Index[bool]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.arr_equal_to(utils.dt64arr_year(self.values_naive), year),
 *             name="is_year",
 */
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 3318, __pyx_L1_error);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3320
 *         return Index(
 *             utils.arr_equal_to(utils.dt64arr_year(self.values_naive), year),
 *             name="is_year",             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name, __pyx_n_u_is_year) < 0) __PYX_ERR(0, 3320, __pyx_L1_error)

  /* "cytimes/pddt.py":3318
 *         the passed-in 'year' `<'Index[bool]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.arr_equal_to(utils.dt64arr_year(self.values_naive), year),
 *             name="is_year",
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3314
 *         return Index(utils.dt64arr_days_of_year(self.values_naive), name="days_of_year")
 * 
 *     def is_year(self, year: cython.int) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's years match
 *         the passed-in 'year' `<'Index[bool]'>`.
 */

  /* 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("cytimes.pddt.Pddt.is_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3324
 * 
 *     # . quarter
 *     @property             # <<<<<<<<<<<<<<
 *     def quarter(self) -> Index[np.int64]:
 *         """The quarters (1-4) `<'Index[int64]'>`."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_165quarter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_164quarter, "The quarters (1-4) `<'Index[int64]'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_165quarter = {"quarter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_165quarter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_164quarter};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_165quarter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("quarter (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3324, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "quarter") < 0)) __PYX_ERR(0, 3324, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("quarter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3324, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_164quarter(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_164quarter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("quarter", 1);

  /* "cytimes/pddt.py":3327
 *     def quarter(self) -> Index[np.int64]:
 *         """The quarters (1-4) `<'Index[int64]'>`."""
 *         return Index(utils.dt64arr_quarter(self.values_naive), name="quarter")             # <<<<<<<<<<<<<<
 * 
 *     def days_in_quarter(self) -> Index[np.int64]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3327, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_quarter(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3327, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_quarter) < 0) __PYX_ERR(0, 3327, __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(0, 3327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3324
 * 
 *     # . quarter
 *     @property             # <<<<<<<<<<<<<<
 *     def quarter(self) -> Index[np.int64]:
 *         """The quarters (1-4) `<'Index[int64]'>`."""
 */

  /* 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("cytimes.pddt.Pddt.quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3329
 *         return Index(utils.dt64arr_quarter(self.values_naive), name="quarter")
 * 
 *     def days_in_quarter(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the maximum number of days (90-92)
 *         in the instance's quarters `<'Index[int64]'>`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_167days_in_quarter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_166days_in_quarter, "Return the maximum number of days (90-92)\n        in the instance's quarters `<'Index[int64]'>`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_167days_in_quarter = {"days_in_quarter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_167days_in_quarter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_166days_in_quarter};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_167days_in_quarter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("days_in_quarter (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3329, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "days_in_quarter") < 0)) __PYX_ERR(0, 3329, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("days_in_quarter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3329, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.days_in_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_166days_in_quarter(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_166days_in_quarter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("days_in_quarter", 1);

  /* "cytimes/pddt.py":3333
 *         in the instance's quarters `<'Index[int64]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.dt64arr_days_in_quarter(self.values_naive),
 *             name="days_in_quarter",
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cytimes/pddt.py":3334
 *         """
 *         return Index(
 *             utils.dt64arr_days_in_quarter(self.values_naive),             # <<<<<<<<<<<<<<
 *             name="days_in_quarter",
 *         )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3334, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_in_quarter(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3333
 *         in the instance's quarters `<'Index[int64]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.dt64arr_days_in_quarter(self.values_naive),
 *             name="days_in_quarter",
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3333, __pyx_L1_error);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3335
 *         return Index(
 *             utils.dt64arr_days_in_quarter(self.values_naive),
 *             name="days_in_quarter",             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_days_in_quarter) < 0) __PYX_ERR(0, 3335, __pyx_L1_error)

  /* "cytimes/pddt.py":3333
 *         in the instance's quarters `<'Index[int64]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.dt64arr_days_in_quarter(self.values_naive),
 *             name="days_in_quarter",
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3329
 *         return Index(utils.dt64arr_quarter(self.values_naive), name="quarter")
 * 
 *     def days_in_quarter(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the maximum number of days (90-92)
 *         in the instance's quarters `<'Index[int64]'>`.
 */

  /* 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("cytimes.pddt.Pddt.days_in_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3338
 *         )
 * 
 *     def days_bf_quarter(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days from the start of the instance's years
 *         to the start of the instance's quarters `<'Index[int64]'>`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_169days_bf_quarter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_168days_bf_quarter, "Return the number of days from the start of the instance's years\n        to the start of the instance's quarters `<'Index[int64]'>`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_169days_bf_quarter = {"days_bf_quarter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_169days_bf_quarter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_168days_bf_quarter};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_169days_bf_quarter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("days_bf_quarter (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3338, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "days_bf_quarter") < 0)) __PYX_ERR(0, 3338, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("days_bf_quarter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3338, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.days_bf_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_168days_bf_quarter(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_168days_bf_quarter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("days_bf_quarter", 1);

  /* "cytimes/pddt.py":3342
 *         to the start of the instance's quarters `<'Index[int64]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.dt64arr_days_bf_quarter(self.values_naive),
 *             name="days_bf_quarter",
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cytimes/pddt.py":3343
 *         """
 *         return Index(
 *             utils.dt64arr_days_bf_quarter(self.values_naive),             # <<<<<<<<<<<<<<
 *             name="days_bf_quarter",
 *         )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3343, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_bf_quarter(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3342
 *         to the start of the instance's quarters `<'Index[int64]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.dt64arr_days_bf_quarter(self.values_naive),
 *             name="days_bf_quarter",
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3342, __pyx_L1_error);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3344
 *         return Index(
 *             utils.dt64arr_days_bf_quarter(self.values_naive),
 *             name="days_bf_quarter",             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_days_bf_quarter) < 0) __PYX_ERR(0, 3344, __pyx_L1_error)

  /* "cytimes/pddt.py":3342
 *         to the start of the instance's quarters `<'Index[int64]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.dt64arr_days_bf_quarter(self.values_naive),
 *             name="days_bf_quarter",
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3338
 *         )
 * 
 *     def days_bf_quarter(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days from the start of the instance's years
 *         to the start of the instance's quarters `<'Index[int64]'>`.
 */

  /* 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("cytimes.pddt.Pddt.days_bf_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3347
 *         )
 * 
 *     def days_of_quarter(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days since the start
 *         of the instance's quarters `<'Index[int64]'>`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_171days_of_quarter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_170days_of_quarter, "Return the number of days since the start\n        of the instance's quarters `<'Index[int64]'>`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_171days_of_quarter = {"days_of_quarter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_171days_of_quarter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_170days_of_quarter};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_171days_of_quarter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("days_of_quarter (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3347, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "days_of_quarter") < 0)) __PYX_ERR(0, 3347, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("days_of_quarter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3347, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.days_of_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_170days_of_quarter(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_170days_of_quarter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("days_of_quarter", 1);

  /* "cytimes/pddt.py":3351
 *         of the instance's quarters `<'Index[int64]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.dt64arr_days_of_quarter(self.values_naive),
 *             name="days_of_quarter",
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cytimes/pddt.py":3352
 *         """
 *         return Index(
 *             utils.dt64arr_days_of_quarter(self.values_naive),             # <<<<<<<<<<<<<<
 *             name="days_of_quarter",
 *         )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3352, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_of_quarter(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3351
 *         of the instance's quarters `<'Index[int64]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.dt64arr_days_of_quarter(self.values_naive),
 *             name="days_of_quarter",
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3351, __pyx_L1_error);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3353
 *         return Index(
 *             utils.dt64arr_days_of_quarter(self.values_naive),
 *             name="days_of_quarter",             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_days_of_quarter) < 0) __PYX_ERR(0, 3353, __pyx_L1_error)

  /* "cytimes/pddt.py":3351
 *         of the instance's quarters `<'Index[int64]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.dt64arr_days_of_quarter(self.values_naive),
 *             name="days_of_quarter",
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3347
 *         )
 * 
 *     def days_of_quarter(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days since the start
 *         of the instance's quarters `<'Index[int64]'>`.
 */

  /* 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("cytimes.pddt.Pddt.days_of_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3356
 *         )
 * 
 *     def is_quarter(self, quarter: cython.int) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's quarters match
 *         the passed-in 'quarter' `<'Index[bool]'>`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_173is_quarter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_172is_quarter, "Determine if the instance's quarters match\n        the passed-in 'quarter' `<'Index[bool]'>`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_173is_quarter = {"is_quarter", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_173is_quarter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_172is_quarter};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_173is_quarter(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_quarter;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_quarter (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_quarter,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3356, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_quarter)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3356, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("is_quarter", 1, 2, 2, 1); __PYX_ERR(0, 3356, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_quarter") < 0)) __PYX_ERR(0, 3356, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_quarter = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_quarter == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3356, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_quarter", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3356, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.is_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_172is_quarter(__pyx_self, __pyx_v_self, __pyx_v_quarter);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_172is_quarter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_quarter) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_quarter", 1);

  /* "cytimes/pddt.py":3360
 *         the passed-in 'quarter' `<'Index[bool]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.arr_equal_to(utils.dt64arr_quarter(self.values_naive), quarter),
 *             name="is_quarter",
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cytimes/pddt.py":3361
 *         """
 *         return Index(
 *             utils.arr_equal_to(utils.dt64arr_quarter(self.values_naive), quarter),             # <<<<<<<<<<<<<<
 *             name="is_quarter",
 *         )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3361, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_quarter(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_equal_to(((PyArrayObject *)__pyx_t_3), __pyx_v_quarter)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3360
 *         the passed-in 'quarter' `<'Index[bool]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.arr_equal_to(utils.dt64arr_quarter(self.values_naive), quarter),
 *             name="is_quarter",
 */
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 3360, __pyx_L1_error);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3362
 *         return Index(
 *             utils.arr_equal_to(utils.dt64arr_quarter(self.values_naive), quarter),
 *             name="is_quarter",             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name, __pyx_n_u_is_quarter) < 0) __PYX_ERR(0, 3362, __pyx_L1_error)

  /* "cytimes/pddt.py":3360
 *         the passed-in 'quarter' `<'Index[bool]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.arr_equal_to(utils.dt64arr_quarter(self.values_naive), quarter),
 *             name="is_quarter",
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3356
 *         )
 * 
 *     def is_quarter(self, quarter: cython.int) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's quarters match
 *         the passed-in 'quarter' `<'Index[bool]'>`.
 */

  /* 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("cytimes.pddt.Pddt.is_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3366
 * 
 *     # . month
 *     @property             # <<<<<<<<<<<<<<
 *     def month(self) -> Index[np.int64]:
 *         """The months (1-12) `<'Index[int64]'>`."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_175month(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_174month, "The months (1-12) `<'Index[int64]'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_175month = {"month", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_175month, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_174month};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_175month(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("month (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3366, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "month") < 0)) __PYX_ERR(0, 3366, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("month", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3366, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_174month(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_174month(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("month", 1);

  /* "cytimes/pddt.py":3369
 *     def month(self) -> Index[np.int64]:
 *         """The months (1-12) `<'Index[int64]'>`."""
 *         return Index(utils.dt64arr_month(self.values_naive), name="month")             # <<<<<<<<<<<<<<
 * 
 *     def days_in_month(self) -> Index[np.int64]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3369, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_month(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3369, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_month) < 0) __PYX_ERR(0, 3369, __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(0, 3369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3366
 * 
 *     # . month
 *     @property             # <<<<<<<<<<<<<<
 *     def month(self) -> Index[np.int64]:
 *         """The months (1-12) `<'Index[int64]'>`."""
 */

  /* 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("cytimes.pddt.Pddt.month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3371
 *         return Index(utils.dt64arr_month(self.values_naive), name="month")
 * 
 *     def days_in_month(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the maximum number of days (28-31)
 *         in the instance's months `<'Index[int64]'>`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_177days_in_month(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_176days_in_month, "Return the maximum number of days (28-31)\n        in the instance's months `<'Index[int64]'>`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_177days_in_month = {"days_in_month", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_177days_in_month, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_176days_in_month};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_177days_in_month(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("days_in_month (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3371, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "days_in_month") < 0)) __PYX_ERR(0, 3371, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("days_in_month", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3371, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.days_in_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_176days_in_month(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_176days_in_month(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("days_in_month", 1);

  /* "cytimes/pddt.py":3375
 *         in the instance's months `<'Index[int64]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.dt64arr_days_in_month(self.values_naive),
 *             name="days_in_month",
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cytimes/pddt.py":3376
 *         """
 *         return Index(
 *             utils.dt64arr_days_in_month(self.values_naive),             # <<<<<<<<<<<<<<
 *             name="days_in_month",
 *         )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3376, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_in_month(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3375
 *         in the instance's months `<'Index[int64]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.dt64arr_days_in_month(self.values_naive),
 *             name="days_in_month",
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3375, __pyx_L1_error);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3377
 *         return Index(
 *             utils.dt64arr_days_in_month(self.values_naive),
 *             name="days_in_month",             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_days_in_month) < 0) __PYX_ERR(0, 3377, __pyx_L1_error)

  /* "cytimes/pddt.py":3375
 *         in the instance's months `<'Index[int64]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.dt64arr_days_in_month(self.values_naive),
 *             name="days_in_month",
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3371
 *         return Index(utils.dt64arr_month(self.values_naive), name="month")
 * 
 *     def days_in_month(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the maximum number of days (28-31)
 *         in the instance's months `<'Index[int64]'>`.
 */

  /* 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("cytimes.pddt.Pddt.days_in_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3380
 *         )
 * 
 *     def days_bf_month(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days from the start of the instance's
 *         years to the start of the instance's months `<'Index[int64]'>`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_179days_bf_month(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_178days_bf_month, "Return the number of days from the start of the instance's\n        years to the start of the instance's months `<'Index[int64]'>`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_179days_bf_month = {"days_bf_month", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_179days_bf_month, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_178days_bf_month};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_179days_bf_month(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("days_bf_month (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3380, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "days_bf_month") < 0)) __PYX_ERR(0, 3380, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("days_bf_month", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3380, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.days_bf_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_178days_bf_month(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_178days_bf_month(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("days_bf_month", 1);

  /* "cytimes/pddt.py":3384
 *         years to the start of the instance's months `<'Index[int64]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.dt64arr_days_bf_month(self.values_naive),
 *             name="days_bf_month",
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cytimes/pddt.py":3385
 *         """
 *         return Index(
 *             utils.dt64arr_days_bf_month(self.values_naive),             # <<<<<<<<<<<<<<
 *             name="days_bf_month",
 *         )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3385, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_days_bf_month(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3384
 *         years to the start of the instance's months `<'Index[int64]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.dt64arr_days_bf_month(self.values_naive),
 *             name="days_bf_month",
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3384, __pyx_L1_error);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3386
 *         return Index(
 *             utils.dt64arr_days_bf_month(self.values_naive),
 *             name="days_bf_month",             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_days_bf_month) < 0) __PYX_ERR(0, 3386, __pyx_L1_error)

  /* "cytimes/pddt.py":3384
 *         years to the start of the instance's months `<'Index[int64]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.dt64arr_days_bf_month(self.values_naive),
 *             name="days_bf_month",
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3380
 *         )
 * 
 *     def days_bf_month(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days from the start of the instance's
 *         years to the start of the instance's months `<'Index[int64]'>`.
 */

  /* 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("cytimes.pddt.Pddt.days_bf_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3389
 *         )
 * 
 *     def days_of_month(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days (1-31) since the start
 *         of the instance's months `<'Index[int64]'>`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_181days_of_month(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_180days_of_month, "Return the number of days (1-31) since the start\n        of the instance's months `<'Index[int64]'>`.\n\n        ### Equivalent to:\n        >>> pt.day\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_181days_of_month = {"days_of_month", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_181days_of_month, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_180days_of_month};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_181days_of_month(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("days_of_month (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3389, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "days_of_month") < 0)) __PYX_ERR(0, 3389, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("days_of_month", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3389, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.days_of_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_180days_of_month(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_180days_of_month(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("days_of_month", 1);

  /* "cytimes/pddt.py":3396
 *         >>> pt.day
 *         """
 *         return Index(utils.dt64arr_day(self.values_naive), name="days_of_month")             # <<<<<<<<<<<<<<
 * 
 *     def is_month(self, month: str | int) -> Index[bool]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3396, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_day(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3396, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_days_of_month) < 0) __PYX_ERR(0, 3396, __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(0, 3396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3389
 *         )
 * 
 *     def days_of_month(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days (1-31) since the start
 *         of the instance's months `<'Index[int64]'>`.
 */

  /* 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("cytimes.pddt.Pddt.days_of_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3398
 *         return Index(utils.dt64arr_day(self.values_naive), name="days_of_month")
 * 
 *     def is_month(self, month: str | int) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's months match
 *         the passed-in 'month' `<'Index[bool]'>`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_183is_month(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_182is_month, "Determine if the instance's months match\n        the passed-in 'month' `<'Index[bool]'>`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_183is_month = {"is_month", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_183is_month, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_182is_month};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_183is_month(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_month = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_month (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_month,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3398, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_month)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3398, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("is_month", 1, 2, 2, 1); __PYX_ERR(0, 3398, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_month") < 0)) __PYX_ERR(0, 3398, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_month = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_month", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3398, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.is_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_182is_month(__pyx_self, __pyx_v_self, __pyx_v_month);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_182is_month(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_month) {
  int __pyx_v_mm;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_month", 1);

  /* "cytimes/pddt.py":3402
 *         the passed-in 'month' `<'Index[bool]'>`.
 *         """
 *         mm: cython.int = _parse_month(month, True)             # <<<<<<<<<<<<<<
 *         return Index(
 *             utils.arr_equal_to(utils.dt64arr_month(self.values_naive), mm),
 */
  __pyx_t_1 = __pyx_f_7cytimes_4pddt__parse_month(__pyx_v_month, 1); if (unlikely(__pyx_t_1 == ((int)-2))) __PYX_ERR(0, 3402, __pyx_L1_error)
  __pyx_v_mm = __pyx_t_1;

  /* "cytimes/pddt.py":3403
 *         """
 *         mm: cython.int = _parse_month(month, True)
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.arr_equal_to(utils.dt64arr_month(self.values_naive), mm),
 *             name="is_month",
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cytimes/pddt.py":3404
 *         mm: cython.int = _parse_month(month, True)
 *         return Index(
 *             utils.arr_equal_to(utils.dt64arr_month(self.values_naive), mm),             # <<<<<<<<<<<<<<
 *             name="is_month",
 *         )
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3404, __pyx_L1_error)
  __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_month(((PyArrayObject *)__pyx_t_3), NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_equal_to(((PyArrayObject *)__pyx_t_4), __pyx_v_mm)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/pddt.py":3403
 *         """
 *         mm: cython.int = _parse_month(month, True)
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.arr_equal_to(utils.dt64arr_month(self.values_naive), mm),
 *             name="is_month",
 */
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 3403, __pyx_L1_error);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3405
 *         return Index(
 *             utils.arr_equal_to(utils.dt64arr_month(self.values_naive), mm),
 *             name="is_month",             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_is_month) < 0) __PYX_ERR(0, 3405, __pyx_L1_error)

  /* "cytimes/pddt.py":3403
 *         """
 *         mm: cython.int = _parse_month(month, True)
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.arr_equal_to(utils.dt64arr_month(self.values_naive), mm),
 *             name="is_month",
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3398
 *         return Index(utils.dt64arr_day(self.values_naive), name="days_of_month")
 * 
 *     def is_month(self, month: str | int) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's months match
 *         the passed-in 'month' `<'Index[bool]'>`.
 */

  /* 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("cytimes.pddt.Pddt.is_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3409
 * 
 *     # . weekday
 *     @property             # <<<<<<<<<<<<<<
 *     def weekday(self) -> Index[np.int64]:
 *         """The weekdays (0=Mon...6=Sun) `<'Index[int64]'>`."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_185weekday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_184weekday, "The weekdays (0=Mon...6=Sun) `<'Index[int64]'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_185weekday = {"weekday", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_185weekday, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_184weekday};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_185weekday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("weekday (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3409, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "weekday") < 0)) __PYX_ERR(0, 3409, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("weekday", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3409, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_184weekday(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_184weekday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("weekday", 1);

  /* "cytimes/pddt.py":3412
 *     def weekday(self) -> Index[np.int64]:
 *         """The weekdays (0=Mon...6=Sun) `<'Index[int64]'>`."""
 *         return Index(utils.dt64arr_weekday(self.values_naive), name="weekday")             # <<<<<<<<<<<<<<
 * 
 *     def is_weekday(self, weekday: int | str) -> Index[bool]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3412, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_weekday(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3412, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_weekday) < 0) __PYX_ERR(0, 3412, __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(0, 3412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3409
 * 
 *     # . weekday
 *     @property             # <<<<<<<<<<<<<<
 *     def weekday(self) -> Index[np.int64]:
 *         """The weekdays (0=Mon...6=Sun) `<'Index[int64]'>`."""
 */

  /* 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("cytimes.pddt.Pddt.weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3414
 *         return Index(utils.dt64arr_weekday(self.values_naive), name="weekday")
 * 
 *     def is_weekday(self, weekday: int | str) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's weekdays match
 *         the passed-in 'weekday' `<'Index[bool]'>`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_187is_weekday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_186is_weekday, "Determine if the instance's weekdays match\n        the passed-in 'weekday' `<'Index[bool]'>`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_187is_weekday = {"is_weekday", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_187is_weekday, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_186is_weekday};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_187is_weekday(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_weekday = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_weekday (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_weekday,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3414, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_weekday)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3414, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("is_weekday", 1, 2, 2, 1); __PYX_ERR(0, 3414, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_weekday") < 0)) __PYX_ERR(0, 3414, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_weekday = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_weekday", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3414, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.is_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_186is_weekday(__pyx_self, __pyx_v_self, __pyx_v_weekday);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_186is_weekday(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_weekday) {
  int __pyx_v_wd;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_weekday", 1);

  /* "cytimes/pddt.py":3418
 *         the passed-in 'weekday' `<'Index[bool]'>`.
 *         """
 *         wd: cython.int = _parse_weekday(weekday, True)             # <<<<<<<<<<<<<<
 *         return Index(
 *             utils.arr_equal_to(utils.dt64arr_weekday(self.values_naive), wd),
 */
  __pyx_t_1 = __pyx_f_7cytimes_4pddt__parse_weekday(__pyx_v_weekday, 1); if (unlikely(__pyx_t_1 == ((int)-2))) __PYX_ERR(0, 3418, __pyx_L1_error)
  __pyx_v_wd = __pyx_t_1;

  /* "cytimes/pddt.py":3419
 *         """
 *         wd: cython.int = _parse_weekday(weekday, True)
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.arr_equal_to(utils.dt64arr_weekday(self.values_naive), wd),
 *             name="is_weekday",
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cytimes/pddt.py":3420
 *         wd: cython.int = _parse_weekday(weekday, True)
 *         return Index(
 *             utils.arr_equal_to(utils.dt64arr_weekday(self.values_naive), wd),             # <<<<<<<<<<<<<<
 *             name="is_weekday",
 *         )
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3420, __pyx_L1_error)
  __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_weekday(((PyArrayObject *)__pyx_t_3), NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_equal_to(((PyArrayObject *)__pyx_t_4), __pyx_v_wd)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/pddt.py":3419
 *         """
 *         wd: cython.int = _parse_weekday(weekday, True)
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.arr_equal_to(utils.dt64arr_weekday(self.values_naive), wd),
 *             name="is_weekday",
 */
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 3419, __pyx_L1_error);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3421
 *         return Index(
 *             utils.arr_equal_to(utils.dt64arr_weekday(self.values_naive), wd),
 *             name="is_weekday",             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_is_weekday) < 0) __PYX_ERR(0, 3421, __pyx_L1_error)

  /* "cytimes/pddt.py":3419
 *         """
 *         wd: cython.int = _parse_weekday(weekday, True)
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.arr_equal_to(utils.dt64arr_weekday(self.values_naive), wd),
 *             name="is_weekday",
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3414
 *         return Index(utils.dt64arr_weekday(self.values_naive), name="weekday")
 * 
 *     def is_weekday(self, weekday: int | str) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's weekdays match
 *         the passed-in 'weekday' `<'Index[bool]'>`.
 */

  /* 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("cytimes.pddt.Pddt.is_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3425
 * 
 *     # . day
 *     @property             # <<<<<<<<<<<<<<
 *     def day(self) -> Index[np.int64]:
 *         """The days (1-31) `<'Index[int64]'>`."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_189day(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_188day, "The days (1-31) `<'Index[int64]'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_189day = {"day", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_189day, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_188day};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_189day(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("day (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3425, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "day") < 0)) __PYX_ERR(0, 3425, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("day", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3425, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.day", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_188day(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_188day(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("day", 1);

  /* "cytimes/pddt.py":3428
 *     def day(self) -> Index[np.int64]:
 *         """The days (1-31) `<'Index[int64]'>`."""
 *         return Index(utils.dt64arr_day(self.values_naive), name="day")             # <<<<<<<<<<<<<<
 * 
 *     def is_day(self, day: cython.int) -> Index[bool]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3428, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_day(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3428, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_day) < 0) __PYX_ERR(0, 3428, __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(0, 3428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3425
 * 
 *     # . day
 *     @property             # <<<<<<<<<<<<<<
 *     def day(self) -> Index[np.int64]:
 *         """The days (1-31) `<'Index[int64]'>`."""
 */

  /* 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("cytimes.pddt.Pddt.day", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3430
 *         return Index(utils.dt64arr_day(self.values_naive), name="day")
 * 
 *     def is_day(self, day: cython.int) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's days match
 *         the passed-in 'day' `<'Index[bool]'>`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_191is_day(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_190is_day, "Determine if the instance's days match\n        the passed-in 'day' `<'Index[bool]'>`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_191is_day = {"is_day", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_191is_day, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_190is_day};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_191is_day(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_day;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_day (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_day,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3430, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_day)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3430, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("is_day", 1, 2, 2, 1); __PYX_ERR(0, 3430, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_day") < 0)) __PYX_ERR(0, 3430, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_day = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_day == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3430, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_day", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3430, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.is_day", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_190is_day(__pyx_self, __pyx_v_self, __pyx_v_day);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_190is_day(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_day) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_day", 1);

  /* "cytimes/pddt.py":3434
 *         the passed-in 'day' `<'Index[bool]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.arr_equal_to(utils.dt64arr_day(self.values_naive), day),
 *             name="is_day",
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cytimes/pddt.py":3435
 *         """
 *         return Index(
 *             utils.arr_equal_to(utils.dt64arr_day(self.values_naive), day),             # <<<<<<<<<<<<<<
 *             name="is_day",
 *         )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3435, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_day(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_equal_to(((PyArrayObject *)__pyx_t_3), __pyx_v_day)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3434
 *         the passed-in 'day' `<'Index[bool]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.arr_equal_to(utils.dt64arr_day(self.values_naive), day),
 *             name="is_day",
 */
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 3434, __pyx_L1_error);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3436
 *         return Index(
 *             utils.arr_equal_to(utils.dt64arr_day(self.values_naive), day),
 *             name="is_day",             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name, __pyx_n_u_is_day) < 0) __PYX_ERR(0, 3436, __pyx_L1_error)

  /* "cytimes/pddt.py":3434
 *         the passed-in 'day' `<'Index[bool]'>`.
 *         """
 *         return Index(             # <<<<<<<<<<<<<<
 *             utils.arr_equal_to(utils.dt64arr_day(self.values_naive), day),
 *             name="is_day",
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3430
 *         return Index(utils.dt64arr_day(self.values_naive), name="day")
 * 
 *     def is_day(self, day: cython.int) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's days match
 *         the passed-in 'day' `<'Index[bool]'>`.
 */

  /* 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("cytimes.pddt.Pddt.is_day", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3440
 * 
 *     # . time
 *     @property             # <<<<<<<<<<<<<<
 *     def hour(self) -> Index[np.int64]:
 *         """The hours (0-23) `<'Index[int64]'>`."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_193hour(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_192hour, "The hours (0-23) `<'Index[int64]'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_193hour = {"hour", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_193hour, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_192hour};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_193hour(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("hour (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3440, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "hour") < 0)) __PYX_ERR(0, 3440, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("hour", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3440, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.hour", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_192hour(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_192hour(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("hour", 1);

  /* "cytimes/pddt.py":3443
 *     def hour(self) -> Index[np.int64]:
 *         """The hours (0-23) `<'Index[int64]'>`."""
 *         return Index(utils.dt64arr_hour(self.values_naive), name="hour")             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3443, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_hour(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3443, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_hour) < 0) __PYX_ERR(0, 3443, __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(0, 3443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3440
 * 
 *     # . time
 *     @property             # <<<<<<<<<<<<<<
 *     def hour(self) -> Index[np.int64]:
 *         """The hours (0-23) `<'Index[int64]'>`."""
 */

  /* 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("cytimes.pddt.Pddt.hour", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3445
 *         return Index(utils.dt64arr_hour(self.values_naive), name="hour")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def minute(self) -> Index[np.int64]:
 *         """The minutes (0-59) `<'Index[int64]'>`."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_195minute(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_194minute, "The minutes (0-59) `<'Index[int64]'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_195minute = {"minute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_195minute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_194minute};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_195minute(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("minute (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3445, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "minute") < 0)) __PYX_ERR(0, 3445, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("minute", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3445, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.minute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_194minute(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_194minute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("minute", 1);

  /* "cytimes/pddt.py":3448
 *     def minute(self) -> Index[np.int64]:
 *         """The minutes (0-59) `<'Index[int64]'>`."""
 *         return Index(utils.dt64arr_minute(self.values_naive), name="minute")             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3448, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_minute(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3448, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_minute) < 0) __PYX_ERR(0, 3448, __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(0, 3448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3445
 *         return Index(utils.dt64arr_hour(self.values_naive), name="hour")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def minute(self) -> Index[np.int64]:
 *         """The minutes (0-59) `<'Index[int64]'>`."""
 */

  /* 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("cytimes.pddt.Pddt.minute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3450
 *         return Index(utils.dt64arr_minute(self.values_naive), name="minute")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def second(self) -> Index[np.int64]:
 *         """The seconds (0-59) `<'Index[int64]'>`."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_197second(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_196second, "The seconds (0-59) `<'Index[int64]'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_197second = {"second", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_197second, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_196second};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_197second(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("second (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3450, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "second") < 0)) __PYX_ERR(0, 3450, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("second", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3450, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.second", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_196second(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_196second(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("second", 1);

  /* "cytimes/pddt.py":3453
 *     def second(self) -> Index[np.int64]:
 *         """The seconds (0-59) `<'Index[int64]'>`."""
 *         return Index(utils.dt64arr_second(self.values_naive), name="second")             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3453, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_second(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3453, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_second) < 0) __PYX_ERR(0, 3453, __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(0, 3453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3450
 *         return Index(utils.dt64arr_minute(self.values_naive), name="minute")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def second(self) -> Index[np.int64]:
 *         """The seconds (0-59) `<'Index[int64]'>`."""
 */

  /* 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("cytimes.pddt.Pddt.second", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3455
 *         return Index(utils.dt64arr_second(self.values_naive), name="second")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def millisecond(self) -> Index[np.int64]:
 *         """The milliseconds (0-999) `<'Index[int64]'>`."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_199millisecond(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_198millisecond, "The milliseconds (0-999) `<'Index[int64]'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_199millisecond = {"millisecond", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_199millisecond, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_198millisecond};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_199millisecond(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("millisecond (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3455, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "millisecond") < 0)) __PYX_ERR(0, 3455, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("millisecond", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3455, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.millisecond", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_198millisecond(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_198millisecond(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("millisecond", 1);

  /* "cytimes/pddt.py":3458
 *     def millisecond(self) -> Index[np.int64]:
 *         """The milliseconds (0-999) `<'Index[int64]'>`."""
 *         return Index(utils.dt64arr_millisecond(self.values_naive), name="millisecond")             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3458, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_millisecond(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3458, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_millisecond) < 0) __PYX_ERR(0, 3458, __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(0, 3458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3455
 *         return Index(utils.dt64arr_second(self.values_naive), name="second")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def millisecond(self) -> Index[np.int64]:
 *         """The milliseconds (0-999) `<'Index[int64]'>`."""
 */

  /* 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("cytimes.pddt.Pddt.millisecond", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3460
 *         return Index(utils.dt64arr_millisecond(self.values_naive), name="millisecond")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def microsecond(self) -> Index[np.int64]:
 *         """The microseconds (0-999999) `<'Index[int64]'>`."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_201microsecond(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_200microsecond, "The microseconds (0-999999) `<'Index[int64]'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_201microsecond = {"microsecond", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_201microsecond, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_200microsecond};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_201microsecond(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("microsecond (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3460, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "microsecond") < 0)) __PYX_ERR(0, 3460, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("microsecond", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3460, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.microsecond", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_200microsecond(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_200microsecond(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("microsecond", 1);

  /* "cytimes/pddt.py":3463
 *     def microsecond(self) -> Index[np.int64]:
 *         """The microseconds (0-999999) `<'Index[int64]'>`."""
 *         return Index(utils.dt64arr_microsecond(self.values_naive), name="microsecond")             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3463, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_microsecond(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3463, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_microsecond) < 0) __PYX_ERR(0, 3463, __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(0, 3463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3460
 *         return Index(utils.dt64arr_millisecond(self.values_naive), name="millisecond")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def microsecond(self) -> Index[np.int64]:
 *         """The microseconds (0-999999) `<'Index[int64]'>`."""
 */

  /* 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("cytimes.pddt.Pddt.microsecond", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3465
 *         return Index(utils.dt64arr_microsecond(self.values_naive), name="microsecond")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nanosecond(self) -> Index[np.int64]:
 *         """The nanoseconds (0-999) `<'Index[int64]'>`."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_203nanosecond(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_202nanosecond, "The nanoseconds (0-999) `<'Index[int64]'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_203nanosecond = {"nanosecond", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_203nanosecond, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_202nanosecond};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_203nanosecond(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("nanosecond (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3465, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "nanosecond") < 0)) __PYX_ERR(0, 3465, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("nanosecond", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3465, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.nanosecond", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_202nanosecond(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_202nanosecond(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("nanosecond", 1);

  /* "cytimes/pddt.py":3468
 *     def nanosecond(self) -> Index[np.int64]:
 *         """The nanoseconds (0-999) `<'Index[int64]'>`."""
 *         return Index(utils.dt64arr_nanosecond(self.values_naive), name="nanosecond")             # <<<<<<<<<<<<<<
 * 
 *     # . date&time
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3468, __pyx_L1_error)
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_nanosecond(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 3468, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_n_u_nanosecond) < 0) __PYX_ERR(0, 3468, __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(0, 3468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3465
 *         return Index(utils.dt64arr_microsecond(self.values_naive), name="microsecond")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nanosecond(self) -> Index[np.int64]:
 *         """The nanoseconds (0-999) `<'Index[int64]'>`."""
 */

  /* 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("cytimes.pddt.Pddt.nanosecond", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3471
 * 
 *     # . date&time
 *     def is_first_of(self, unit: str) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the dates are on the first day of
 *         the specified datetime unit `<'Index[bool]'>`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_205is_first_of(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_204is_first_of, "Determine if the dates are on the first day of\n        the specified datetime unit `<'Index[bool]'>`.\n\n        :param unit `<'str'>`: The datetime unit.\n            - `'Y'`: Is on the first day of the current year.\n            - `'Q'`: Is on the first day of the current quarter.\n            - `'M'`: Is on the first day of the current month.\n            - `'W'`: Is on the first day (Monday) of the current week.\n            - Month name (e.g., `'Jan'`, `'February'`, `'\344\270\211\346\234\210'`): Is the first day of that month.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_205is_first_of = {"is_first_of", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_205is_first_of, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_204is_first_of};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_205is_first_of(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_unit = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_first_of (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_unit,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3471, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3471, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("is_first_of", 1, 2, 2, 1); __PYX_ERR(0, 3471, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_first_of") < 0)) __PYX_ERR(0, 3471, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_unit = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_first_of", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3471, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.is_first_of", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 0, "unit", 1))) __PYX_ERR(0, 3471, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_204is_first_of(__pyx_self, __pyx_v_self, __pyx_v_unit);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_204is_first_of(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit) {
  PyObject *__pyx_v_pt_1st = NULL;
  PyArrayObject *__pyx_v_datesD_1st = NULL;
  PyArrayObject *__pyx_v_datesD = NULL;
  PyArrayObject *__pyx_v_arr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_first_of", 1);

  /* "cytimes/pddt.py":3483
 *         """
 *         # To start of
 *         pt_1st = self.to_first_of(unit)             # <<<<<<<<<<<<<<
 * 
 *         # Compare dates
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_first_of); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_unit};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3483, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_pt_1st = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":3486
 * 
 *         # Compare dates
 *         datesD_1st = utils.dt64arr_as_int64_D(pt_1st.values)  # int64[D]             # <<<<<<<<<<<<<<
 *         datesD = utils.dt64arr_as_int64_D(self.values)  # int64[D]
 *         arr = utils.arr_equal_to_arr(datesD, datesD_1st)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt_1st, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3486, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(((PyArrayObject *)__pyx_t_1), NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_datesD_1st = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3487
 *         # Compare dates
 *         datesD_1st = utils.dt64arr_as_int64_D(pt_1st.values)  # int64[D]
 *         datesD = utils.dt64arr_as_int64_D(self.values)  # int64[D]             # <<<<<<<<<<<<<<
 *         arr = utils.arr_equal_to_arr(datesD, datesD_1st)
 *         return Index(arr, name="is_first_of[%s]" % unit)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3487, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_datesD = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":3488
 *         datesD_1st = utils.dt64arr_as_int64_D(pt_1st.values)  # int64[D]
 *         datesD = utils.dt64arr_as_int64_D(self.values)  # int64[D]
 *         arr = utils.arr_equal_to_arr(datesD, datesD_1st)             # <<<<<<<<<<<<<<
 *         return Index(arr, name="is_first_of[%s]" % unit)
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_equal_to_arr(__pyx_v_datesD, __pyx_v_datesD_1st)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":3489
 *         datesD = utils.dt64arr_as_int64_D(self.values)  # int64[D]
 *         arr = utils.arr_equal_to_arr(datesD, datesD_1st)
 *         return Index(arr, name="is_first_of[%s]" % unit)             # <<<<<<<<<<<<<<
 * 
 *     def is_last_of(self, unit: str) -> Index[bool]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(0, 3489, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_is_first_of_s, __pyx_v_unit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_t_5) < 0) __PYX_ERR(0, 3489, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3471
 * 
 *     # . date&time
 *     def is_first_of(self, unit: str) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the dates are on the first day of
 *         the specified datetime unit `<'Index[bool]'>`.
 */

  /* 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("cytimes.pddt.Pddt.is_first_of", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pt_1st);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesD_1st);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesD);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3491
 *         return Index(arr, name="is_first_of[%s]" % unit)
 * 
 *     def is_last_of(self, unit: str) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the dates are on the last day of
 *         the specified datetime unit `<'Index[bool]'>`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_207is_last_of(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_206is_last_of, "Determine if the dates are on the last day of\n        the specified datetime unit `<'Index[bool]'>`.\n\n        :param unit `<'str'>`: The datetime unit.\n            - `'Y'`: Is on the last day of the current year.\n            - `'Q'`: Is on the last day of the current quarter.\n            - `'M'`: Is on the last day of the current month.\n            - `'W'`: Is on the last day (Sunday) of the current week.\n            - Month name (e.g., `'Jan'`, `'February'`, `'\344\270\211\346\234\210'`): Is the last day of that month.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_207is_last_of = {"is_last_of", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_207is_last_of, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_206is_last_of};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_207is_last_of(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_unit = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_last_of (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_unit,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3491, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3491, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("is_last_of", 1, 2, 2, 1); __PYX_ERR(0, 3491, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_last_of") < 0)) __PYX_ERR(0, 3491, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_unit = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_last_of", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3491, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.is_last_of", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 0, "unit", 1))) __PYX_ERR(0, 3491, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_206is_last_of(__pyx_self, __pyx_v_self, __pyx_v_unit);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_206is_last_of(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit) {
  PyObject *__pyx_v_pt_lst = NULL;
  PyArrayObject *__pyx_v_datesD_lst = NULL;
  PyArrayObject *__pyx_v_datesD = NULL;
  PyArrayObject *__pyx_v_arr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_last_of", 1);

  /* "cytimes/pddt.py":3503
 *         """
 *         # To last of
 *         pt_lst = self.to_last_of(unit)             # <<<<<<<<<<<<<<
 * 
 *         # Compare dates
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_last_of); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_unit};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_pt_lst = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":3506
 * 
 *         # Compare dates
 *         datesD_lst = utils.dt64arr_as_int64_D(pt_lst.values)  # int64[D]             # <<<<<<<<<<<<<<
 *         datesD = utils.dt64arr_as_int64_D(self.values)  # int64[D]
 *         arr = utils.arr_equal_to_arr(datesD, datesD_lst)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt_lst, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3506, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(((PyArrayObject *)__pyx_t_1), NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_datesD_lst = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3507
 *         # Compare dates
 *         datesD_lst = utils.dt64arr_as_int64_D(pt_lst.values)  # int64[D]
 *         datesD = utils.dt64arr_as_int64_D(self.values)  # int64[D]             # <<<<<<<<<<<<<<
 *         arr = utils.arr_equal_to_arr(datesD, datesD_lst)
 *         return Index(arr, name="is_last_of[%s]" % unit)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3507, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(((PyArrayObject *)__pyx_t_2), NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_datesD = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":3508
 *         datesD_lst = utils.dt64arr_as_int64_D(pt_lst.values)  # int64[D]
 *         datesD = utils.dt64arr_as_int64_D(self.values)  # int64[D]
 *         arr = utils.arr_equal_to_arr(datesD, datesD_lst)             # <<<<<<<<<<<<<<
 *         return Index(arr, name="is_last_of[%s]" % unit)
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_equal_to_arr(__pyx_v_datesD, __pyx_v_datesD_lst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":3509
 *         datesD = utils.dt64arr_as_int64_D(self.values)  # int64[D]
 *         arr = utils.arr_equal_to_arr(datesD, datesD_lst)
 *         return Index(arr, name="is_last_of[%s]" % unit)             # <<<<<<<<<<<<<<
 * 
 *     def is_start_of(self, unit: str) -> Index[bool]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(0, 3509, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_is_last_of_s, __pyx_v_unit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_t_5) < 0) __PYX_ERR(0, 3509, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3491
 *         return Index(arr, name="is_first_of[%s]" % unit)
 * 
 *     def is_last_of(self, unit: str) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the dates are on the last day of
 *         the specified datetime unit `<'Index[bool]'>`.
 */

  /* 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("cytimes.pddt.Pddt.is_last_of", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pt_lst);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesD_lst);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesD);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3511
 *         return Index(arr, name="is_last_of[%s]" % unit)
 * 
 *     def is_start_of(self, unit: str) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the datetimes are at the start of
 *         the specified datetime unit `<'Index[bool]'>`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_209is_start_of(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_208is_start_of, "Determine if the datetimes are at the start of\n        the specified datetime unit `<'Index[bool]'>`.\n\n        :param unit `<'str'>`: The datetime unit.\n            - `'Y'`: Is on the first day of the current year at time '00:00:00.000000'.\n            - `'Q'`: Is on the first day of the current quarter at time '00:00:00.000000'.\n            - `'M'`: Is on the first day of the current month at time '00:00:00.000000'.\n            - `'W'`: Is on the first day (Monday) of the current week at time '00:00:00.000000'.\n            - `'D'`: Is at time '00:00:00.000000'.\n            - `'h'`: Is at time 'XX:00:00.000000'.\n            - `'m'`: Is at time 'XX:XX:00.000000'.\n            - `'s'`: Is at time 'XX:XX:XX.000000'.\n            - `'ms'`: Is at time 'XX:XX:XX.XXX000'.\n            - `'us'`: Always return `True`.\n            - Month name (e.g., `'Jan'`, `'February'`, `'\344\270\211\346\234\210'`): Is on the first day of that month at time '00:00:00.000000'.\n            - Weekday name (e.g., `'Mon'`, `'Tuesday'`, `'\346\230\237\346\234\237\344\270\211'`): Is on that weekday at time '00:00:00.000000'.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_209is_start_of = {"is_start_of", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_209is_start_of, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_208is_start_of};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_209is_start_of(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_unit = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_start_of (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_unit,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3511, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3511, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("is_start_of", 1, 2, 2, 1); __PYX_ERR(0, 3511, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_start_of") < 0)) __PYX_ERR(0, 3511, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_unit = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_start_of", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3511, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.is_start_of", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 0, "unit", 1))) __PYX_ERR(0, 3511, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_208is_start_of(__pyx_self, __pyx_v_self, __pyx_v_unit);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_208is_start_of(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit) {
  PyObject *__pyx_v_pt_stt = NULL;
  PyObject *__pyx_v_pt_stt_unit = 0;
  PyArrayObject *__pyx_v_arr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_start_of", 1);

  /* "cytimes/pddt.py":3530
 *         """
 *         # To start of
 *         pt_stt = self.to_start_of(unit)             # <<<<<<<<<<<<<<
 * 
 *         # Compare datetimes
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_start_of); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_unit};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_pt_stt = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":3533
 * 
 *         # Compare datetimes
 *         pt_stt_unit: str = pt_stt.unit             # <<<<<<<<<<<<<<
 *         if pt_stt_unit == self.unit:
 *             arr = utils.arr_equal_to_arr(self.values, pt_stt.values)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt_stt, __pyx_n_s_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 3533, __pyx_L1_error)
  __pyx_v_pt_stt_unit = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":3534
 *         # Compare datetimes
 *         pt_stt_unit: str = pt_stt.unit
 *         if pt_stt_unit == self.unit:             # <<<<<<<<<<<<<<
 *             arr = utils.arr_equal_to_arr(self.values, pt_stt.values)
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_pt_stt_unit, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 3534, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "cytimes/pddt.py":3535
 *         pt_stt_unit: str = pt_stt.unit
 *         if pt_stt_unit == self.unit:
 *             arr = utils.arr_equal_to_arr(self.values, pt_stt.values)             # <<<<<<<<<<<<<<
 *         else:
 *             arr = utils.arr_equal_to_arr(
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3535, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt_stt, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3535, __pyx_L1_error)
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_equal_to_arr(((PyArrayObject *)__pyx_t_1), ((PyArrayObject *)__pyx_t_2))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_arr = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":3534
 *         # Compare datetimes
 *         pt_stt_unit: str = pt_stt.unit
 *         if pt_stt_unit == self.unit:             # <<<<<<<<<<<<<<
 *             arr = utils.arr_equal_to_arr(self.values, pt_stt.values)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":3537
 *             arr = utils.arr_equal_to_arr(self.values, pt_stt.values)
 *         else:
 *             arr = utils.arr_equal_to_arr(             # <<<<<<<<<<<<<<
 *                 utils.dt64arr_as_unit(self.values, pt_stt_unit), pt_stt.values
 *             )
 */
  /*else*/ {

    /* "cytimes/pddt.py":3538
 *         else:
 *             arr = utils.arr_equal_to_arr(
 *                 utils.dt64arr_as_unit(self.values, pt_stt_unit), pt_stt.values             # <<<<<<<<<<<<<<
 *             )
 *         return Index(arr, name="is_start_of[%s]" % unit)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3538, __pyx_L1_error)
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_unit(((PyArrayObject *)__pyx_t_3), __pyx_v_pt_stt_unit, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt_stt, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3538, __pyx_L1_error)

    /* "cytimes/pddt.py":3537
 *             arr = utils.arr_equal_to_arr(self.values, pt_stt.values)
 *         else:
 *             arr = utils.arr_equal_to_arr(             # <<<<<<<<<<<<<<
 *                 utils.dt64arr_as_unit(self.values, pt_stt_unit), pt_stt.values
 *             )
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_equal_to_arr(((PyArrayObject *)__pyx_t_2), ((PyArrayObject *)__pyx_t_3))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "cytimes/pddt.py":3540
 *                 utils.dt64arr_as_unit(self.values, pt_stt_unit), pt_stt.values
 *             )
 *         return Index(arr, name="is_start_of[%s]" % unit)             # <<<<<<<<<<<<<<
 * 
 *     def is_end_of(self, unit: str) -> Index[bool]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(0, 3540, __pyx_L1_error);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_is_start_of_s, __pyx_v_unit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name, __pyx_t_6) < 0) __PYX_ERR(0, 3540, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3511
 *         return Index(arr, name="is_last_of[%s]" % unit)
 * 
 *     def is_start_of(self, unit: str) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the datetimes are at the start of
 *         the specified datetime unit `<'Index[bool]'>`.
 */

  /* 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("cytimes.pddt.Pddt.is_start_of", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pt_stt);
  __Pyx_XDECREF(__pyx_v_pt_stt_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3542
 *         return Index(arr, name="is_start_of[%s]" % unit)
 * 
 *     def is_end_of(self, unit: str) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the datetimes are at the end of
 *         the specified datetime unit `<'Index[bool]'>`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_211is_end_of(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_210is_end_of, "Determine if the datetimes are at the end of\n        the specified datetime unit `<'Index[bool]'>`.\n\n        :param unit `<'str'>`: The datetime unit.\n            - `'Y'`: Is on the last day of the current year at time '23:59:59.999999'.\n            - `'Q'`: Is on the last day of the current quarter at time '23:59:59.999999'.\n            - `'M'`: Is on the last day of the current month at time '23:59:59.999999'.\n            - `'W'`: Is on the last day (Sunday) of the current week at time '23:59:59.999999'.\n            - `'D'`: Is at time '23:59:59.999999'.\n            - `'h'`: Is at time 'XX:59:59.999999'.\n            - `'m'`: Is at time 'XX:XX:59.999999'.\n            - `'s'`: Is at time 'XX:XX:XX.999999'.\n            - `'ms'`: Is at time 'XX:XX:XX.XXX999'.\n            - `'us'`: Always return `True`.\n            - Month name (e.g., `'Jan'`, `'February'`, `'\344\270\211\346\234\210'`): Is on the last day of that month at time '23:59:59.999999'.\n            - Weekday name (e.g., `'Mon'`, `'Tuesday'`, `'\346\230\237\346\234\237\344\270\211'`): Is on that weekday at time '23:59:59.999999'.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_211is_end_of = {"is_end_of", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_211is_end_of, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_210is_end_of};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_211is_end_of(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_unit = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_end_of (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_unit,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3542, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3542, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("is_end_of", 1, 2, 2, 1); __PYX_ERR(0, 3542, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_end_of") < 0)) __PYX_ERR(0, 3542, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_unit = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_end_of", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3542, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.is_end_of", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 0, "unit", 1))) __PYX_ERR(0, 3542, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_210is_end_of(__pyx_self, __pyx_v_self, __pyx_v_unit);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_210is_end_of(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit) {
  PyObject *__pyx_v_pt_end = NULL;
  PyObject *__pyx_v_pt_end_unit = 0;
  PyArrayObject *__pyx_v_arr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_end_of", 1);

  /* "cytimes/pddt.py":3561
 *         """
 *         # To end of
 *         pt_end = self.to_end_of(unit)             # <<<<<<<<<<<<<<
 * 
 *         # Compare datetimes
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_to_end_of); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_unit};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_pt_end = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":3564
 * 
 *         # Compare datetimes
 *         pt_end_unit: str = pt_end.unit             # <<<<<<<<<<<<<<
 *         if pt_end_unit == self.unit:
 *             arr = utils.arr_equal_to_arr(self.values, pt_end.values)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt_end, __pyx_n_s_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 3564, __pyx_L1_error)
  __pyx_v_pt_end_unit = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":3565
 *         # Compare datetimes
 *         pt_end_unit: str = pt_end.unit
 *         if pt_end_unit == self.unit:             # <<<<<<<<<<<<<<
 *             arr = utils.arr_equal_to_arr(self.values, pt_end.values)
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_pt_end_unit, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 3565, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "cytimes/pddt.py":3566
 *         pt_end_unit: str = pt_end.unit
 *         if pt_end_unit == self.unit:
 *             arr = utils.arr_equal_to_arr(self.values, pt_end.values)             # <<<<<<<<<<<<<<
 *         else:
 *             arr = utils.arr_equal_to_arr(
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3566, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt_end, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3566, __pyx_L1_error)
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_equal_to_arr(((PyArrayObject *)__pyx_t_1), ((PyArrayObject *)__pyx_t_2))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_arr = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":3565
 *         # Compare datetimes
 *         pt_end_unit: str = pt_end.unit
 *         if pt_end_unit == self.unit:             # <<<<<<<<<<<<<<
 *             arr = utils.arr_equal_to_arr(self.values, pt_end.values)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":3568
 *             arr = utils.arr_equal_to_arr(self.values, pt_end.values)
 *         else:
 *             arr = utils.arr_equal_to_arr(             # <<<<<<<<<<<<<<
 *                 utils.dt64arr_as_unit(self.values, pt_end_unit), pt_end.values
 *             )
 */
  /*else*/ {

    /* "cytimes/pddt.py":3569
 *         else:
 *             arr = utils.arr_equal_to_arr(
 *                 utils.dt64arr_as_unit(self.values, pt_end_unit), pt_end.values             # <<<<<<<<<<<<<<
 *             )
 *         return Index(arr, name="is_end_of[%s]" % unit)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3569, __pyx_L1_error)
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_unit(((PyArrayObject *)__pyx_t_3), __pyx_v_pt_end_unit, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt_end, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3569, __pyx_L1_error)

    /* "cytimes/pddt.py":3568
 *             arr = utils.arr_equal_to_arr(self.values, pt_end.values)
 *         else:
 *             arr = utils.arr_equal_to_arr(             # <<<<<<<<<<<<<<
 *                 utils.dt64arr_as_unit(self.values, pt_end_unit), pt_end.values
 *             )
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_equal_to_arr(((PyArrayObject *)__pyx_t_2), ((PyArrayObject *)__pyx_t_3))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "cytimes/pddt.py":3571
 *                 utils.dt64arr_as_unit(self.values, pt_end_unit), pt_end.values
 *             )
 *         return Index(arr, name="is_end_of[%s]" % unit)             # <<<<<<<<<<<<<<
 * 
 *     # Timezone -----------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(0, 3571, __pyx_L1_error);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_is_end_of_s, __pyx_v_unit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name, __pyx_t_6) < 0) __PYX_ERR(0, 3571, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3542
 *         return Index(arr, name="is_start_of[%s]" % unit)
 * 
 *     def is_end_of(self, unit: str) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the datetimes are at the end of
 *         the specified datetime unit `<'Index[bool]'>`.
 */

  /* 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("cytimes.pddt.Pddt.is_end_of", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pt_end);
  __Pyx_XDECREF(__pyx_v_pt_end_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3574
 * 
 *     # Timezone -----------------------------------------------------------------------------
 *     @property             # <<<<<<<<<<<<<<
 *     def tz_available(self) -> set[str]:
 *         """The available timezone names `<'set[str]'>`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_213tz_available(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_212tz_available, "The available timezone names `<'set[str]'>`.\n\n        ### Equivalent to:\n        >>> zoneinfo.available_timezones()\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_213tz_available = {"tz_available", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_213tz_available, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_212tz_available};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_213tz_available(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tz_available (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3574, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tz_available") < 0)) __PYX_ERR(0, 3574, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tz_available", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3574, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.tz_available", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_212tz_available(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_212tz_available(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tz_available", 1);

  /* "cytimes/pddt.py":3581
 *         >>> zoneinfo.available_timezones()
 *         """
 *         return _available_timezones()             # <<<<<<<<<<<<<<
 * 
 *     def is_local(self) -> bool:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_available_timezones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3581, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("set", __pyx_t_1))) __PYX_ERR(0, 3581, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3574
 * 
 *     # Timezone -----------------------------------------------------------------------------
 *     @property             # <<<<<<<<<<<<<<
 *     def tz_available(self) -> set[str]:
 *         """The available timezone names `<'set[str]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.tz_available", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3583
 *         return _available_timezones()
 * 
 *     def is_local(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Determine if the instance is in the local timezone `<'bool'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_215is_local(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_214is_local, "Determine if the instance is in the local timezone `<'bool'>`.\n\n        #### Timezone-naive instance always returns `False`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_215is_local = {"is_local", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_215is_local, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_214is_local};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_215is_local(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_local (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3583, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_local") < 0)) __PYX_ERR(0, 3583, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_local", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3583, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.is_local", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_214is_local(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_214is_local(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_tz_local __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_local", 1);

  /* "cytimes/pddt.py":3588
 *         #### Timezone-naive instance always returns `False`.
 *         """
 *         return self.tzinfo is utils.tz_local(None)             # <<<<<<<<<<<<<<
 * 
 *     def is_utc(self) -> bool:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.dt = ((PyDateTime_DateTime *)Py_None);
  __pyx_t_2 = __pyx_f_7cytimes_5utils_tz_local(&__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__pyx_t_1 == __pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3583
 *         return _available_timezones()
 * 
 *     def is_local(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Determine if the instance is in the local timezone `<'bool'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.is_local", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3590
 *         return self.tzinfo is utils.tz_local(None)
 * 
 *     def is_utc(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Determine if the instance is in the UTC timezone `<'bool'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_217is_utc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_216is_utc, "Determine if the instance is in the UTC timezone `<'bool'>`.\n\n        #### Timezone-naive instance always returns `False`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_217is_utc = {"is_utc", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_217is_utc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_216is_utc};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_217is_utc(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_utc (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3590, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_utc") < 0)) __PYX_ERR(0, 3590, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_utc", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3590, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.is_utc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_216is_utc(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_216is_utc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_utc", 1);

  /* "cytimes/pddt.py":3595
 *         #### Timezone-naive instance always returns `False`.
 *         """
 *         return self.tzinfo is utils.UTC             # <<<<<<<<<<<<<<
 * 
 *     def tzname(self) -> str:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == ((PyObject *)__pyx_v_7cytimes_5utils_UTC));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3590
 *         return self.tzinfo is utils.tz_local(None)
 * 
 *     def is_utc(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Determine if the instance is in the UTC timezone `<'bool'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.is_utc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3597
 *         return self.tzinfo is utils.UTC
 * 
 *     def tzname(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the timezone name of the instance `<'str/None'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_219tzname(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_218tzname, "Return the timezone name of the instance `<'str/None'>`.\n\n        #### Timezone-naive instance always returns `None`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_219tzname = {"tzname", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_219tzname, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_218tzname};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_219tzname(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tzname (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3597, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tzname") < 0)) __PYX_ERR(0, 3597, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tzname", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3597, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.tzname", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_218tzname(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_218tzname(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_my_tz = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tzname", 1);

  /* "cytimes/pddt.py":3602
 *         #### Timezone-naive instance always returns `None`.
 *         """
 *         my_tz = self.tzinfo             # <<<<<<<<<<<<<<
 *         return None if my_tz is None else my_tz.tzname(self[0])
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_my_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":3603
 *         """
 *         my_tz = self.tzinfo
 *         return None if my_tz is None else my_tz.tzname(self[0])             # <<<<<<<<<<<<<<
 * 
 *     def astimezone(
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = (__pyx_v_my_tz == Py_None);
  if (__pyx_t_2) {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  } else {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_my_tz, __pyx_n_s_tzname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3603, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_self, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3603, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3603, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_3))) __PYX_ERR(0, 3603, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 3603, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3597
 *         return self.tzinfo is utils.UTC
 * 
 *     def tzname(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the timezone name of the instance `<'str/None'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.tzname", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_my_tz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3605
 *         return None if my_tz is None else my_tz.tzname(self[0])
 * 
 *     def astimezone(             # <<<<<<<<<<<<<<
 *         self,
 *         tz: datetime.tzinfo | str | None = None,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_221astimezone(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_220astimezone, "Convert the instance to the target timezone\n        (retaining the same point in UTC time). `<'Pddt'>`.\n\n        #### Similar to `datetime.datetime.astimezone()`.\n\n        - If the instance is timezone-aware, converts to the target timezone directly.\n        - If the instance is timezone-naive, first localizes to the local timezone,\n          then converts to the targer timezone.\n\n        :param tz `<'str/tzinfo/None'>`: The target timezone to convert to, defaults to `None`.\n            - `<'datetime.tzinfo'>` A subclass of `datetime.tzinfo`.\n            - `<'str'>` Timezone name supported by the 'Zoneinfo' module, or `'local'` for local timezone.\n            - `<'None'>` Convert to local timezone.\n\n        :param ambiguous `<'str/ndarray'>`: How to handle ambiguous times, defaults to `'raise'`.\n            - `<'str'>` Accepts 'infer' or 'raise' for ambiguous times handling.\n            - `<'ndarray'>` A boolean array that specifies ambiguous times ('True' for DST time).\n\n        :param nonexistent `<'str/timedelta'>`: How to handle nonexistent times, defaults to `'raise'`.\n            - `<'str'>` Accepts 'shift_forward', 'shift_backward' or 'raise' for nonexistent times handling.\n            - `<'timedelta'>` An instance of timedelta to shift the nonexistent times.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_221astimezone = {"astimezone", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_221astimezone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_220astimezone};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_221astimezone(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_tz = 0;
  PyObject *__pyx_v_ambiguous = 0;
  PyObject *__pyx_v_nonexistent = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("astimezone (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_tz,&__pyx_n_s_ambiguous,&__pyx_n_s_nonexistent,0};

    /* "cytimes/pddt.py":3607
 *     def astimezone(
 *         self,
 *         tz: datetime.tzinfo | str | None = None,             # <<<<<<<<<<<<<<
 *         ambiguous: object = "raise",
 *         nonexistent: object = "raise",
 */
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_n_u_raise)));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_n_u_raise)));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3605, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tz);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3605, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ambiguous);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3605, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nonexistent);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3605, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "astimezone") < 0)) __PYX_ERR(0, 3605, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_tz = values[1];
    __pyx_v_ambiguous = values[2];
    __pyx_v_nonexistent = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("astimezone", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 3605, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.astimezone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_220astimezone(__pyx_self, __pyx_v_self, __pyx_v_tz, __pyx_v_ambiguous, __pyx_v_nonexistent);

  /* "cytimes/pddt.py":3605
 *         return None if my_tz is None else my_tz.tzname(self[0])
 * 
 *     def astimezone(             # <<<<<<<<<<<<<<
 *         self,
 *         tz: datetime.tzinfo | str | None = None,
 */

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_220astimezone(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_tz, PyObject *__pyx_v_ambiguous, PyObject *__pyx_v_nonexistent) {
  PyObject *__pyx_v_my_tz = NULL;
  PyObject *__pyx_v_pt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  struct __pyx_opt_args_7cytimes_5utils_tz_local __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("astimezone", 0);
  __Pyx_INCREF(__pyx_v_tz);

  /* "cytimes/pddt.py":3634
 *         """
 *         # Adjust target timezone
 *         tz = utils.tz_parse(tz)             # <<<<<<<<<<<<<<
 *         my_tz = self.tzinfo
 *         if tz is None:
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_tz_parse(__pyx_v_tz); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":3635
 *         # Adjust target timezone
 *         tz = utils.tz_parse(tz)
 *         my_tz = self.tzinfo             # <<<<<<<<<<<<<<
 *         if tz is None:
 *             tz = utils.tz_local(None)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_my_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":3636
 *         tz = utils.tz_parse(tz)
 *         my_tz = self.tzinfo
 *         if tz is None:             # <<<<<<<<<<<<<<
 *             tz = utils.tz_local(None)
 *             if my_tz is None:
 */
  __pyx_t_2 = (__pyx_v_tz == Py_None);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":3637
 *         my_tz = self.tzinfo
 *         if tz is None:
 *             tz = utils.tz_local(None)             # <<<<<<<<<<<<<<
 *             if my_tz is None:
 *                 # Since instance is timezone-naive, we
 */
    __pyx_t_3.__pyx_n = 1;
    __pyx_t_3.dt = ((PyDateTime_DateTime *)Py_None);
    __pyx_t_1 = __pyx_f_7cytimes_5utils_tz_local(&__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3637, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":3638
 *         if tz is None:
 *             tz = utils.tz_local(None)
 *             if my_tz is None:             # <<<<<<<<<<<<<<
 *                 # Since instance is timezone-naive, we
 *                 # simply localize to local timezone.
 */
    __pyx_t_2 = (__pyx_v_my_tz == Py_None);
    if (__pyx_t_2) {

      /* "cytimes/pddt.py":3641
 *                 # Since instance is timezone-naive, we
 *                 # simply localize to local timezone.
 *                 return self.tz_localize(tz, ambiguous, nonexistent)             # <<<<<<<<<<<<<<
 * 
 *         # Adjust my timezone
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tz_localize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3641, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (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;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_tz, __pyx_v_ambiguous, __pyx_v_nonexistent};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3641, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "cytimes/pddt.py":3638
 *         if tz is None:
 *             tz = utils.tz_local(None)
 *             if my_tz is None:             # <<<<<<<<<<<<<<
 *                 # Since instance is timezone-naive, we
 *                 # simply localize to local timezone.
 */
    }

    /* "cytimes/pddt.py":3636
 *         tz = utils.tz_parse(tz)
 *         my_tz = self.tzinfo
 *         if tz is None:             # <<<<<<<<<<<<<<
 *             tz = utils.tz_local(None)
 *             if my_tz is None:
 */
  }

  /* "cytimes/pddt.py":3644
 * 
 *         # Adjust my timezone
 *         if my_tz is None:             # <<<<<<<<<<<<<<
 *             my_tz = utils.tz_local(None)
 *             pt = self.tz_localize(my_tz, ambiguous, nonexistent)
 */
  __pyx_t_2 = (__pyx_v_my_tz == Py_None);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":3645
 *         # Adjust my timezone
 *         if my_tz is None:
 *             my_tz = utils.tz_local(None)             # <<<<<<<<<<<<<<
 *             pt = self.tz_localize(my_tz, ambiguous, nonexistent)
 *         else:
 */
    __pyx_t_3.__pyx_n = 1;
    __pyx_t_3.dt = ((PyDateTime_DateTime *)Py_None);
    __pyx_t_1 = __pyx_f_7cytimes_5utils_tz_local(&__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_my_tz, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":3646
 *         if my_tz is None:
 *             my_tz = utils.tz_local(None)
 *             pt = self.tz_localize(my_tz, ambiguous, nonexistent)             # <<<<<<<<<<<<<<
 *         else:
 *             my_tz = utils.tz_parse(my_tz)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tz_localize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3646, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_my_tz, __pyx_v_ambiguous, __pyx_v_nonexistent};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3646, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_v_pt = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":3644
 * 
 *         # Adjust my timezone
 *         if my_tz is None:             # <<<<<<<<<<<<<<
 *             my_tz = utils.tz_local(None)
 *             pt = self.tz_localize(my_tz, ambiguous, nonexistent)
 */
    goto __pyx_L5;
  }

  /* "cytimes/pddt.py":3648
 *             pt = self.tz_localize(my_tz, ambiguous, nonexistent)
 *         else:
 *             my_tz = utils.tz_parse(my_tz)             # <<<<<<<<<<<<<<
 *             pt = self
 * 
 */
  /*else*/ {
    __pyx_t_1 = __pyx_f_7cytimes_5utils_tz_parse(__pyx_v_my_tz); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_my_tz, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":3649
 *         else:
 *             my_tz = utils.tz_parse(my_tz)
 *             pt = self             # <<<<<<<<<<<<<<
 * 
 *         # Same timezone
 */
    __Pyx_INCREF(__pyx_v_self);
    __pyx_v_pt = __pyx_v_self;
  }
  __pyx_L5:;

  /* "cytimes/pddt.py":3652
 * 
 *         # Same timezone
 *         if my_tz is tz:             # <<<<<<<<<<<<<<
 *             return pt  # exit: same timezone
 * 
 */
  __pyx_t_2 = (__pyx_v_my_tz == __pyx_v_tz);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":3653
 *         # Same timezone
 *         if my_tz is tz:
 *             return pt  # exit: same timezone             # <<<<<<<<<<<<<<
 * 
 *         # Convert timezone
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_pt);
    __pyx_r = __pyx_v_pt;
    goto __pyx_L0;

    /* "cytimes/pddt.py":3652
 * 
 *         # Same timezone
 *         if my_tz is tz:             # <<<<<<<<<<<<<<
 *             return pt  # exit: same timezone
 * 
 */
  }

  /* "cytimes/pddt.py":3656
 * 
 *         # Convert timezone
 *         return pt.tz_convert(tz)             # <<<<<<<<<<<<<<
 * 
 *     def tz_localize(
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt, __pyx_n_s_tz_convert); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_tz};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3656, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3605
 *         return None if my_tz is None else my_tz.tzname(self[0])
 * 
 *     def astimezone(             # <<<<<<<<<<<<<<
 *         self,
 *         tz: datetime.tzinfo | str | None = None,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.astimezone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_my_tz);
  __Pyx_XDECREF(__pyx_v_pt);
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3658
 *         return pt.tz_convert(tz)
 * 
 *     def tz_localize(             # <<<<<<<<<<<<<<
 *         self,
 *         tz: datetime.tzinfo | str | None,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_223tz_localize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_222tz_localize, "Localize timezone-naive instance to the specific timezone;\n        or timezone-aware instance to timezone naive (without moving\n        the time fields) `<'Pddt'>`.\n\n        :param tz `<'tzinfo/str/None'>`: The timezone to localize to, defaults to `None`.\n            - `<'datetime.tzinfo'>` Subclass of datetime.tzinfo.\n            - `<'str'>` Timezone name supported by the 'Zoneinfo' module, or `'local'` for local timezone.\n            - `<'None'>` Localize to timezone-naive.\n\n        :param ambiguous `<'str/ndarray'>`: How to handle ambiguous times, defaults to `'raise'`.\n            - `<'str'>` Accepts 'infer' or 'raise' for ambiguous times handling.\n            - `<'ndarray'>` A boolean array that specifies ambiguous times ('True' for DST time).\n\n        :param nonexistent `<'str/timedelta'>`: How to handle nonexistent times, defaults to `'raise'`.\n            - `<'str'>` Accepts 'shift_forward', 'shift_backward' or 'raise' for nonexistent times handling.\n            - `<'timedelta'>` An instance of timedelta to shift the nonexistent times.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_223tz_localize = {"tz_localize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_223tz_localize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_222tz_localize};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_223tz_localize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_tz = 0;
  PyObject *__pyx_v_ambiguous = 0;
  PyObject *__pyx_v_nonexistent = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tz_localize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_tz,&__pyx_n_s_ambiguous,&__pyx_n_s_nonexistent,0};
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_n_u_raise)));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_n_u_raise)));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3658, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tz)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3658, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("tz_localize", 0, 2, 4, 1); __PYX_ERR(0, 3658, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ambiguous);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3658, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nonexistent);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3658, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tz_localize") < 0)) __PYX_ERR(0, 3658, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_tz = values[1];
    __pyx_v_ambiguous = values[2];
    __pyx_v_nonexistent = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tz_localize", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 3658, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.tz_localize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_222tz_localize(__pyx_self, __pyx_v_self, __pyx_v_tz, __pyx_v_ambiguous, __pyx_v_nonexistent);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_222tz_localize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_tz, PyObject *__pyx_v_ambiguous, PyObject *__pyx_v_nonexistent) {
  PyObject *__pyx_v_my_tz = NULL;
  PyObject *__pyx_v_pt = NULL;
  PyObject *__pyx_v_err = 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;
  unsigned int __pyx_t_5;
  int __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  char const *__pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  char const *__pyx_t_24;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tz_localize", 0);
  __Pyx_INCREF(__pyx_v_tz);

  /* "cytimes/pddt.py":3682
 *         """
 *         # Timezone-aware
 *         tz = utils.tz_parse(tz)             # <<<<<<<<<<<<<<
 *         my_tz = self.tzinfo
 *         if my_tz is not None:
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_tz_parse(__pyx_v_tz); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":3683
 *         # Timezone-aware
 *         tz = utils.tz_parse(tz)
 *         my_tz = self.tzinfo             # <<<<<<<<<<<<<<
 *         if my_tz is not None:
 *             if tz is not None:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_my_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":3684
 *         tz = utils.tz_parse(tz)
 *         my_tz = self.tzinfo
 *         if my_tz is not None:             # <<<<<<<<<<<<<<
 *             if tz is not None:
 *                 raise errors.InvalidTimezoneError(
 */
  __pyx_t_2 = (__pyx_v_my_tz != Py_None);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":3685
 *         my_tz = self.tzinfo
 *         if my_tz is not None:
 *             if tz is not None:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidTimezoneError(
 *                     "instance is already timezone-aware.\n"
 */
    __pyx_t_2 = (__pyx_v_tz != Py_None);
    if (unlikely(__pyx_t_2)) {

      /* "cytimes/pddt.py":3686
 *         if my_tz is not None:
 *             if tz is not None:
 *                 raise errors.InvalidTimezoneError(             # <<<<<<<<<<<<<<
 *                     "instance is already timezone-aware.\n"
 *                     "Use 'tz_convert()' or 'tz_switch()' method "
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InvalidTimezoneError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3686, __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
      if (unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_instance_is_already_timezone_awa};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3686, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 3686, __pyx_L1_error)

      /* "cytimes/pddt.py":3685
 *         my_tz = self.tzinfo
 *         if my_tz is not None:
 *             if tz is not None:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidTimezoneError(
 *                     "instance is already timezone-aware.\n"
 */
    }

    /* "cytimes/pddt.py":3692
 *                 )
 *             # . localize: aware => naive
 *             return super(Pddt, self).tz_localize(None)             # <<<<<<<<<<<<<<
 * 
 *         # Timezone-naive
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Pddt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 3692, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 3692, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_tz_localize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, Py_None};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3692, __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;

    /* "cytimes/pddt.py":3684
 *         tz = utils.tz_parse(tz)
 *         my_tz = self.tzinfo
 *         if my_tz is not None:             # <<<<<<<<<<<<<<
 *             if tz is not None:
 *                 raise errors.InvalidTimezoneError(
 */
  }

  /* "cytimes/pddt.py":3695
 * 
 *         # Timezone-naive
 *         if tz is None:             # <<<<<<<<<<<<<<
 *             return self  # exit: same timezone
 *         else:
 */
  __pyx_t_2 = (__pyx_v_tz == Py_None);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":3696
 *         # Timezone-naive
 *         if tz is None:
 *             return self  # exit: same timezone             # <<<<<<<<<<<<<<
 *         else:
 *             if ambiguous == "NaT":
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":3695
 * 
 *         # Timezone-naive
 *         if tz is None:             # <<<<<<<<<<<<<<
 *             return self  # exit: same timezone
 *         else:
 */
  }

  /* "cytimes/pddt.py":3698
 *             return self  # exit: same timezone
 *         else:
 *             if ambiguous == "NaT":             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidArgumentError("ambiguous='NaT' is not supported.")
 *             if nonexistent == "NaT":
 */
  /*else*/ {
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_ambiguous, __pyx_n_u_NaT, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 3698, __pyx_L1_error)
    if (unlikely(__pyx_t_2)) {

      /* "cytimes/pddt.py":3699
 *         else:
 *             if ambiguous == "NaT":
 *                 raise errors.InvalidArgumentError("ambiguous='NaT' is not supported.")             # <<<<<<<<<<<<<<
 *             if nonexistent == "NaT":
 *                 raise errors.InvalidArgumentError("nonexistent='NaT' is not supported.")
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3699, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3699, __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
      if (unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_ambiguous_NaT_is_not_supported};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3699, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 3699, __pyx_L1_error)

      /* "cytimes/pddt.py":3698
 *             return self  # exit: same timezone
 *         else:
 *             if ambiguous == "NaT":             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidArgumentError("ambiguous='NaT' is not supported.")
 *             if nonexistent == "NaT":
 */
    }

    /* "cytimes/pddt.py":3700
 *             if ambiguous == "NaT":
 *                 raise errors.InvalidArgumentError("ambiguous='NaT' is not supported.")
 *             if nonexistent == "NaT":             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidArgumentError("nonexistent='NaT' is not supported.")
 *         # . localize: naive => aware
 */
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_nonexistent, __pyx_n_u_NaT, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 3700, __pyx_L1_error)
    if (unlikely(__pyx_t_2)) {

      /* "cytimes/pddt.py":3701
 *                 raise errors.InvalidArgumentError("ambiguous='NaT' is not supported.")
 *             if nonexistent == "NaT":
 *                 raise errors.InvalidArgumentError("nonexistent='NaT' is not supported.")             # <<<<<<<<<<<<<<
 *         # . localize: naive => aware
 *         #: To prevent 'ns' overflow issue, we manually check if
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3701, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3701, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (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;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_nonexistent_NaT_is_not_supported};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3701, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 3701, __pyx_L1_error)

      /* "cytimes/pddt.py":3700
 *             if ambiguous == "NaT":
 *                 raise errors.InvalidArgumentError("ambiguous='NaT' is not supported.")
 *             if nonexistent == "NaT":             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidArgumentError("nonexistent='NaT' is not supported.")
 *         # . localize: naive => aware
 */
    }
  }

  /* "cytimes/pddt.py":3705
 *         #: To prevent 'ns' overflow issue, we manually check if
 *         #: the values are in safe 'ns' range before localization.
 *         if self.unit == "ns" and not utils.is_dt64arr_ns_safe(self.values, "ns"):             # <<<<<<<<<<<<<<
 *             pt = self.as_unit("us")
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_ns, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 3705, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {
  } else {
    __pyx_t_2 = __pyx_t_6;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3705, __pyx_L1_error)
  __pyx_t_7.__pyx_n = 1;
  __pyx_t_7.arr_unit = __pyx_n_u_ns;
  __pyx_t_6 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(((PyArrayObject *)__pyx_t_1), &__pyx_t_7); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 3705, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = (!__pyx_t_6);
  __pyx_t_2 = __pyx_t_8;
  __pyx_L9_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":3706
 *         #: the values are in safe 'ns' range before localization.
 *         if self.unit == "ns" and not utils.is_dt64arr_ns_safe(self.values, "ns"):
 *             pt = self.as_unit("us")             # <<<<<<<<<<<<<<
 *         else:
 *             pt = self
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_as_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_n_u_us};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3706, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_v_pt = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":3705
 *         #: To prevent 'ns' overflow issue, we manually check if
 *         #: the values are in safe 'ns' range before localization.
 *         if self.unit == "ns" and not utils.is_dt64arr_ns_safe(self.values, "ns"):             # <<<<<<<<<<<<<<
 *             pt = self.as_unit("us")
 *         else:
 */
    goto __pyx_L8;
  }

  /* "cytimes/pddt.py":3708
 *             pt = self.as_unit("us")
 *         else:
 *             pt = self             # <<<<<<<<<<<<<<
 *         try:
 *             return super(Pddt, pt).tz_localize(tz, ambiguous, nonexistent)
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_self);
    __pyx_v_pt = __pyx_v_self;
  }
  __pyx_L8:;

  /* "cytimes/pddt.py":3709
 *         else:
 *             pt = self
 *         try:             # <<<<<<<<<<<<<<
 *             return super(Pddt, pt).tz_localize(tz, ambiguous, nonexistent)
 *         except pd_err.OutOfBoundsDatetime as err:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_11);
    /*try:*/ {

      /* "cytimes/pddt.py":3710
 *             pt = self
 *         try:
 *             return super(Pddt, pt).tz_localize(tz, ambiguous, nonexistent)             # <<<<<<<<<<<<<<
 *         except pd_err.OutOfBoundsDatetime as err:
 *             raise errors.OutOfBoundsDatetimeError(err) from err
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Pddt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3710, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3710, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 3710, __pyx_L11_error);
      __Pyx_INCREF(__pyx_v_pt);
      __Pyx_GIVEREF(__pyx_v_pt);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_pt)) __PYX_ERR(0, 3710, __pyx_L11_error);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3710, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tz_localize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3710, __pyx_L11_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
      if (likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_tz, __pyx_v_ambiguous, __pyx_v_nonexistent};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3710, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L15_try_return;

      /* "cytimes/pddt.py":3709
 *         else:
 *             pt = self
 *         try:             # <<<<<<<<<<<<<<
 *             return super(Pddt, pt).tz_localize(tz, ambiguous, nonexistent)
 *         except pd_err.OutOfBoundsDatetime as err:
 */
    }
    __pyx_L11_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cytimes/pddt.py":3711
 *         try:
 *             return super(Pddt, pt).tz_localize(tz, ambiguous, nonexistent)
 *         except pd_err.OutOfBoundsDatetime as err:             # <<<<<<<<<<<<<<
 *             raise errors.OutOfBoundsDatetimeError(err) from err
 *         except Exception as err:
 */
    __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_4, &__pyx_t_3);
    __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_pd_err); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3711, __pyx_L13_except_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_OutOfBoundsDatetime); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3711, __pyx_L13_except_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_14 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_13);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_ErrRestore(__pyx_t_1, __pyx_t_4, __pyx_t_3);
    __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0;
    if (__pyx_t_14) {
      __Pyx_AddTraceback("cytimes.pddt.Pddt.tz_localize", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_1) < 0) __PYX_ERR(0, 3711, __pyx_L13_except_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_v_err = __pyx_t_4;
      /*try:*/ {

        /* "cytimes/pddt.py":3712
 *             return super(Pddt, pt).tz_localize(tz, ambiguous, nonexistent)
 *         except pd_err.OutOfBoundsDatetime as err:
 *             raise errors.OutOfBoundsDatetimeError(err) from err             # <<<<<<<<<<<<<<
 *         except Exception as err:
 *             raise errors.InvalidArgumentError(err) from err
 */
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_errors); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3712, __pyx_L22_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_OutOfBoundsDatetimeError); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3712, __pyx_L22_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_15))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_15);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_15, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_err};
          __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3712, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        }
        __Pyx_Raise(__pyx_t_13, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __PYX_ERR(0, 3712, __pyx_L22_error)
      }

      /* "cytimes/pddt.py":3711
 *         try:
 *             return super(Pddt, pt).tz_localize(tz, ambiguous, nonexistent)
 *         except pd_err.OutOfBoundsDatetime as err:             # <<<<<<<<<<<<<<
 *             raise errors.OutOfBoundsDatetimeError(err) from err
 *         except Exception as err:
 */
      /*finally:*/ {
        __pyx_L22_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __Pyx_XGOTREF(__pyx_t_23);
          __pyx_t_14 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_XGIVEREF(__pyx_t_23);
            __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
          }
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_ErrRestore(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17;
          goto __pyx_L13_except_error;
        }
      }
    }

    /* "cytimes/pddt.py":3713
 *         except pd_err.OutOfBoundsDatetime as err:
 *             raise errors.OutOfBoundsDatetimeError(err) from err
 *         except Exception as err:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidArgumentError(err) from err
 * 
 */
    __pyx_t_16 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_16) {
      __Pyx_AddTraceback("cytimes.pddt.Pddt.tz_localize", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 3713, __pyx_L13_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_v_err = __pyx_t_4;
      /*try:*/ {

        /* "cytimes/pddt.py":3714
 *             raise errors.OutOfBoundsDatetimeError(err) from err
 *         except Exception as err:
 *             raise errors.InvalidArgumentError(err) from err             # <<<<<<<<<<<<<<
 * 
 *     def tz_convert(self, tz: datetime.tzinfo | str | None) -> Self:
 */
        __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_errors); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3714, __pyx_L33_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3714, __pyx_L33_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_15 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_15)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_15);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_err};
          __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3714, __pyx_L33_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_Raise(__pyx_t_13, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __PYX_ERR(0, 3714, __pyx_L33_error)
      }

      /* "cytimes/pddt.py":3713
 *         except pd_err.OutOfBoundsDatetime as err:
 *             raise errors.OutOfBoundsDatetimeError(err) from err
 *         except Exception as err:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidArgumentError(err) from err
 * 
 */
      /*finally:*/ {
        __pyx_L33_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_23);
          __Pyx_XGOTREF(__pyx_t_22);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_18);
          __pyx_t_16 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_24 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
          }
          __Pyx_XGIVEREF(__pyx_t_23);
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_ErrRestore(__pyx_t_23, __pyx_t_22, __pyx_t_21);
          __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
          __pyx_lineno = __pyx_t_16; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_24;
          goto __pyx_L13_except_error;
        }
      }
    }
    goto __pyx_L13_except_error;

    /* "cytimes/pddt.py":3709
 *         else:
 *             pt = self
 *         try:             # <<<<<<<<<<<<<<
 *             return super(Pddt, pt).tz_localize(tz, ambiguous, nonexistent)
 *         except pd_err.OutOfBoundsDatetime as err:
 */
    __pyx_L13_except_error:;
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    goto __pyx_L1_error;
    __pyx_L15_try_return:;
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    goto __pyx_L0;
  }

  /* "cytimes/pddt.py":3658
 *         return pt.tz_convert(tz)
 * 
 *     def tz_localize(             # <<<<<<<<<<<<<<
 *         self,
 *         tz: datetime.tzinfo | str | None,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.tz_localize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_my_tz);
  __Pyx_XDECREF(__pyx_v_pt);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3716
 *             raise errors.InvalidArgumentError(err) from err
 * 
 *     def tz_convert(self, tz: datetime.tzinfo | str | None) -> Self:             # <<<<<<<<<<<<<<
 *         """Convert timezone-aware instance to another timezone `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_225tz_convert(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_224tz_convert, "Convert timezone-aware instance to another timezone `<'Pddt'>`.\n\n        :param tz `<'tzinfo/str/None'>`: The timezone to localize to, defaults to `None`.\n            - `<'datetime.tzinfo'>` Subclass of datetime.tzinfo.\n            - `<'str'>` Timezone name supported by the 'Zoneinfo' module, or `'local'` for local timezone.\n            - `<'None'>` Convert to UTC timezone and localize to timezone-naive.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_225tz_convert = {"tz_convert", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_225tz_convert, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_224tz_convert};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_225tz_convert(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_tz = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tz_convert (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_tz,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3716, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tz)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3716, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("tz_convert", 1, 2, 2, 1); __PYX_ERR(0, 3716, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tz_convert") < 0)) __PYX_ERR(0, 3716, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_tz = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tz_convert", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3716, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.tz_convert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_224tz_convert(__pyx_self, __pyx_v_self, __pyx_v_tz);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_224tz_convert(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_tz) {
  PyObject *__pyx_v_my_tz = NULL;
  PyObject *__pyx_v_pt = NULL;
  PyObject *__pyx_v_err = 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;
  unsigned int __pyx_t_5;
  int __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  char const *__pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  char const *__pyx_t_24;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tz_convert", 0);
  __Pyx_INCREF(__pyx_v_tz);

  /* "cytimes/pddt.py":3725
 *         """
 *         # Validate
 *         my_tz = self.tzinfo             # <<<<<<<<<<<<<<
 *         if my_tz is None:
 *             raise errors.InvalidTimezoneError(
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_my_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":3726
 *         # Validate
 *         my_tz = self.tzinfo
 *         if my_tz is None:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidTimezoneError(
 *                 "instance is timezone-naive.\n"
 */
  __pyx_t_2 = (__pyx_v_my_tz == Py_None);
  if (unlikely(__pyx_t_2)) {

    /* "cytimes/pddt.py":3727
 *         my_tz = self.tzinfo
 *         if my_tz is None:
 *             raise errors.InvalidTimezoneError(             # <<<<<<<<<<<<<<
 *                 "instance is timezone-naive.\n"
 *                 "Use 'tz_localize()' method instead to localize to a timezone.\n"
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InvalidTimezoneError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3727, __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
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_instance_is_timezone_naive_Use_t};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3727, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 3727, __pyx_L1_error)

    /* "cytimes/pddt.py":3726
 *         # Validate
 *         my_tz = self.tzinfo
 *         if my_tz is None:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidTimezoneError(
 *                 "instance is timezone-naive.\n"
 */
  }

  /* "cytimes/pddt.py":3735
 * 
 *         # Same timezone
 *         my_tz = utils.tz_parse(my_tz)             # <<<<<<<<<<<<<<
 *         tz = utils.tz_parse(tz)
 *         if my_tz is tz:
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_tz_parse(__pyx_v_my_tz); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_my_tz, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":3736
 *         # Same timezone
 *         my_tz = utils.tz_parse(my_tz)
 *         tz = utils.tz_parse(tz)             # <<<<<<<<<<<<<<
 *         if my_tz is tz:
 *             return self
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_tz_parse(__pyx_v_tz); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_tz, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":3737
 *         my_tz = utils.tz_parse(my_tz)
 *         tz = utils.tz_parse(tz)
 *         if my_tz is tz:             # <<<<<<<<<<<<<<
 *             return self
 * 
 */
  __pyx_t_2 = (__pyx_v_my_tz == __pyx_v_tz);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":3738
 *         tz = utils.tz_parse(tz)
 *         if my_tz is tz:
 *             return self             # <<<<<<<<<<<<<<
 * 
 *         # Convert: aware => aware
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":3737
 *         my_tz = utils.tz_parse(my_tz)
 *         tz = utils.tz_parse(tz)
 *         if my_tz is tz:             # <<<<<<<<<<<<<<
 *             return self
 * 
 */
  }

  /* "cytimes/pddt.py":3743
 *         #: To prevent 'ns' overflow issue, we manually check if
 *         #: the values are in safe 'ns' range before conversion.
 *         if self.unit == "ns" and not utils.is_dt64arr_ns_safe(self.values_naive, "ns"):             # <<<<<<<<<<<<<<
 *             pt = self.as_unit("us")  # cast to 'us' to prevent overflow
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_ns, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 3743, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {
  } else {
    __pyx_t_2 = __pyx_t_6;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3743, __pyx_L1_error)
  __pyx_t_7.__pyx_n = 1;
  __pyx_t_7.arr_unit = __pyx_n_u_ns;
  __pyx_t_6 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(((PyArrayObject *)__pyx_t_1), &__pyx_t_7); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 3743, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = (!__pyx_t_6);
  __pyx_t_2 = __pyx_t_8;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":3744
 *         #: the values are in safe 'ns' range before conversion.
 *         if self.unit == "ns" and not utils.is_dt64arr_ns_safe(self.values_naive, "ns"):
 *             pt = self.as_unit("us")  # cast to 'us' to prevent overflow             # <<<<<<<<<<<<<<
 *         else:
 *             pt = self
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_as_unit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_u_us};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3744, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_v_pt = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":3743
 *         #: To prevent 'ns' overflow issue, we manually check if
 *         #: the values are in safe 'ns' range before conversion.
 *         if self.unit == "ns" and not utils.is_dt64arr_ns_safe(self.values_naive, "ns"):             # <<<<<<<<<<<<<<
 *             pt = self.as_unit("us")  # cast to 'us' to prevent overflow
 *         else:
 */
    goto __pyx_L5;
  }

  /* "cytimes/pddt.py":3746
 *             pt = self.as_unit("us")  # cast to 'us' to prevent overflow
 *         else:
 *             pt = self             # <<<<<<<<<<<<<<
 *         try:
 *             return super(Pddt, pt).tz_convert(tz)
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_self);
    __pyx_v_pt = __pyx_v_self;
  }
  __pyx_L5:;

  /* "cytimes/pddt.py":3747
 *         else:
 *             pt = self
 *         try:             # <<<<<<<<<<<<<<
 *             return super(Pddt, pt).tz_convert(tz)
 *         except pd_err.OutOfBoundsDatetime as err:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_11);
    /*try:*/ {

      /* "cytimes/pddt.py":3748
 *             pt = self
 *         try:
 *             return super(Pddt, pt).tz_convert(tz)             # <<<<<<<<<<<<<<
 *         except pd_err.OutOfBoundsDatetime as err:
 *             raise errors.OutOfBoundsDatetimeError(err) from err
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Pddt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3748, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3748, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 3748, __pyx_L8_error);
      __Pyx_INCREF(__pyx_v_pt);
      __Pyx_GIVEREF(__pyx_v_pt);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_pt)) __PYX_ERR(0, 3748, __pyx_L8_error);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3748, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_tz_convert); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3748, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(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;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_tz};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3748, __pyx_L8_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_L12_try_return;

      /* "cytimes/pddt.py":3747
 *         else:
 *             pt = self
 *         try:             # <<<<<<<<<<<<<<
 *             return super(Pddt, pt).tz_convert(tz)
 *         except pd_err.OutOfBoundsDatetime as err:
 */
    }
    __pyx_L8_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cytimes/pddt.py":3749
 *         try:
 *             return super(Pddt, pt).tz_convert(tz)
 *         except pd_err.OutOfBoundsDatetime as err:             # <<<<<<<<<<<<<<
 *             raise errors.OutOfBoundsDatetimeError(err) from err
 *         except Exception as err:
 */
    __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_pd_err); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3749, __pyx_L10_except_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_OutOfBoundsDatetime); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3749, __pyx_L10_except_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_14 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_13);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_ErrRestore(__pyx_t_1, __pyx_t_3, __pyx_t_4);
    __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0;
    if (__pyx_t_14) {
      __Pyx_AddTraceback("cytimes.pddt.Pddt.tz_convert", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(0, 3749, __pyx_L10_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_v_err = __pyx_t_3;
      /*try:*/ {

        /* "cytimes/pddt.py":3750
 *             return super(Pddt, pt).tz_convert(tz)
 *         except pd_err.OutOfBoundsDatetime as err:
 *             raise errors.OutOfBoundsDatetimeError(err) from err             # <<<<<<<<<<<<<<
 *         except Exception as err:
 *             raise errors.InvalidArgumentError(err) from err
 */
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_errors); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3750, __pyx_L19_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_OutOfBoundsDatetimeError); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3750, __pyx_L19_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_15))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_15);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_15, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_err};
          __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3750, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        }
        __Pyx_Raise(__pyx_t_13, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __PYX_ERR(0, 3750, __pyx_L19_error)
      }

      /* "cytimes/pddt.py":3749
 *         try:
 *             return super(Pddt, pt).tz_convert(tz)
 *         except pd_err.OutOfBoundsDatetime as err:             # <<<<<<<<<<<<<<
 *             raise errors.OutOfBoundsDatetimeError(err) from err
 *         except Exception as err:
 */
      /*finally:*/ {
        __pyx_L19_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __Pyx_XGOTREF(__pyx_t_23);
          __pyx_t_14 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_XGIVEREF(__pyx_t_23);
            __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
          }
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_ErrRestore(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17;
          goto __pyx_L10_except_error;
        }
      }
    }

    /* "cytimes/pddt.py":3751
 *         except pd_err.OutOfBoundsDatetime as err:
 *             raise errors.OutOfBoundsDatetimeError(err) from err
 *         except Exception as err:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidArgumentError(err) from err
 * 
 */
    __pyx_t_16 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_16) {
      __Pyx_AddTraceback("cytimes.pddt.Pddt.tz_convert", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 3751, __pyx_L10_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_v_err = __pyx_t_3;
      /*try:*/ {

        /* "cytimes/pddt.py":3752
 *             raise errors.OutOfBoundsDatetimeError(err) from err
 *         except Exception as err:
 *             raise errors.InvalidArgumentError(err) from err             # <<<<<<<<<<<<<<
 * 
 *     def tz_switch(
 */
        __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_errors); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3752, __pyx_L30_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3752, __pyx_L30_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_15 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_15)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_15);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_err};
          __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3752, __pyx_L30_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_Raise(__pyx_t_13, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __PYX_ERR(0, 3752, __pyx_L30_error)
      }

      /* "cytimes/pddt.py":3751
 *         except pd_err.OutOfBoundsDatetime as err:
 *             raise errors.OutOfBoundsDatetimeError(err) from err
 *         except Exception as err:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidArgumentError(err) from err
 * 
 */
      /*finally:*/ {
        __pyx_L30_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_23);
          __Pyx_XGOTREF(__pyx_t_22);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_18);
          __pyx_t_16 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_24 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
          }
          __Pyx_XGIVEREF(__pyx_t_23);
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_ErrRestore(__pyx_t_23, __pyx_t_22, __pyx_t_21);
          __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
          __pyx_lineno = __pyx_t_16; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_24;
          goto __pyx_L10_except_error;
        }
      }
    }
    goto __pyx_L10_except_error;

    /* "cytimes/pddt.py":3747
 *         else:
 *             pt = self
 *         try:             # <<<<<<<<<<<<<<
 *             return super(Pddt, pt).tz_convert(tz)
 *         except pd_err.OutOfBoundsDatetime as err:
 */
    __pyx_L10_except_error:;
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    goto __pyx_L1_error;
    __pyx_L12_try_return:;
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    goto __pyx_L0;
  }

  /* "cytimes/pddt.py":3716
 *             raise errors.InvalidArgumentError(err) from err
 * 
 *     def tz_convert(self, tz: datetime.tzinfo | str | None) -> Self:             # <<<<<<<<<<<<<<
 *         """Convert timezone-aware instance to another timezone `<'Pddt'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.tz_convert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_my_tz);
  __Pyx_XDECREF(__pyx_v_pt);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3754
 *             raise errors.InvalidArgumentError(err) from err
 * 
 *     def tz_switch(             # <<<<<<<<<<<<<<
 *         self,
 *         targ_tz: datetime.tzinfo | str | None,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_227tz_switch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_226tz_switch, "Switch (convert) the instance from base timezone to the target timezone `<'Pddt'>`.\n\n        This method extends the functionality of `astimezone()` by allowing\n        user to specify a base timezone for timezone-naive instances before\n        converting to the target timezone.\n\n        - If the instance is timezone-aware, the 'base_tz' argument is `ignored`,\n          and this method behaves identically to `astimezone()`, converting the\n          instance to the target timezone.\n        - If the instance is timezone-naive, it first localizes the instance\n          to the `base_tz`, and then converts to the target timezone.\n\n        :param targ_tz `<'tzinfo/str/None'>`: The target timezone to convert to.\n        :param base_tz `<'tzinfo/str/None'>`: The base timezone for timezone-naive instance, defaults to `None`.\n        :param naive `<'bool'>`: If 'True', returns timezone-naive instance after conversion, defaults to `False`.\n        :param ambiguous `<'str/ndarray'>`: How to handle ambiguous times, defaults to `'raise'`.\n            - `<'str'>` Accepts 'infer' or 'raise' for ambiguous times handling.\n            - `<'ndarray'>` A boolean array that specifies ambiguous times ('True' for DST time).\n\n        :param nonexistent `<'str/timedelta'>`: How to handle nonexistent times, defaults to `'raise'`.\n            - `<'str'>` Accepts 'shift_forward', 'shift_backward' or 'raise' for nonexistent times handling.\n            - `<'timedelta'>` An instance of timedelta to shift the nonexistent times.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_227tz_switch = {"tz_switch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_227tz_switch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_226tz_switch};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_227tz_switch(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_targ_tz = 0;
  PyObject *__pyx_v_base_tz = 0;
  int __pyx_v_naive;
  PyObject *__pyx_v_ambiguous = 0;
  PyObject *__pyx_v_nonexistent = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tz_switch (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_targ_tz,&__pyx_n_s_base_tz,&__pyx_n_s_naive,&__pyx_n_s_ambiguous,&__pyx_n_s_nonexistent,0};

    /* "cytimes/pddt.py":3757
 *         self,
 *         targ_tz: datetime.tzinfo | str | None,
 *         base_tz: datetime.tzinfo | str | None = None,             # <<<<<<<<<<<<<<
 *         naive: cython.bint = False,
 *         ambiguous: object = "raise",
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_n_u_raise)));
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_n_u_raise)));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3754, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_targ_tz)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3754, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("tz_switch", 0, 2, 6, 1); __PYX_ERR(0, 3754, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_base_tz);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3754, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_naive);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3754, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ambiguous);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3754, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nonexistent);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3754, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tz_switch") < 0)) __PYX_ERR(0, 3754, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_targ_tz = values[1];
    __pyx_v_base_tz = values[2];
    if (values[3]) {
      __pyx_v_naive = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_naive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3758, __pyx_L3_error)
    } else {

      /* "cytimes/pddt.py":3758
 *         targ_tz: datetime.tzinfo | str | None,
 *         base_tz: datetime.tzinfo | str | None = None,
 *         naive: cython.bint = False,             # <<<<<<<<<<<<<<
 *         ambiguous: object = "raise",
 *         nonexistent: object = "raise",
 */
      __pyx_v_naive = ((int)((int)0));
    }
    __pyx_v_ambiguous = values[4];
    __pyx_v_nonexistent = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tz_switch", 0, 2, 6, __pyx_nargs); __PYX_ERR(0, 3754, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.tz_switch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_226tz_switch(__pyx_self, __pyx_v_self, __pyx_v_targ_tz, __pyx_v_base_tz, __pyx_v_naive, __pyx_v_ambiguous, __pyx_v_nonexistent);

  /* "cytimes/pddt.py":3754
 *             raise errors.InvalidArgumentError(err) from err
 * 
 *     def tz_switch(             # <<<<<<<<<<<<<<
 *         self,
 *         targ_tz: datetime.tzinfo | str | None,
 */

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_226tz_switch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_targ_tz, PyObject *__pyx_v_base_tz, int __pyx_v_naive, PyObject *__pyx_v_ambiguous, PyObject *__pyx_v_nonexistent) {
  PyObject *__pyx_v_my_tz = NULL;
  PyObject *__pyx_v_pt = 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;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tz_switch", 0);
  __Pyx_INCREF(__pyx_v_targ_tz);
  __Pyx_INCREF(__pyx_v_base_tz);

  /* "cytimes/pddt.py":3786
 *         """
 *         # Timezone-aware
 *         targ_tz = utils.tz_parse(targ_tz)             # <<<<<<<<<<<<<<
 *         my_tz = self.tzinfo
 *         if my_tz is not None:
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_tz_parse(__pyx_v_targ_tz); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_targ_tz, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":3787
 *         # Timezone-aware
 *         targ_tz = utils.tz_parse(targ_tz)
 *         my_tz = self.tzinfo             # <<<<<<<<<<<<<<
 *         if my_tz is not None:
 *             # . target timezone is None
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_my_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":3788
 *         targ_tz = utils.tz_parse(targ_tz)
 *         my_tz = self.tzinfo
 *         if my_tz is not None:             # <<<<<<<<<<<<<<
 *             # . target timezone is None
 *             if targ_tz is None:
 */
  __pyx_t_2 = (__pyx_v_my_tz != Py_None);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":3790
 *         if my_tz is not None:
 *             # . target timezone is None
 *             if targ_tz is None:             # <<<<<<<<<<<<<<
 *                 return self.tz_localize(None)
 *             # . target timezone is mytz
 */
    __pyx_t_2 = (__pyx_v_targ_tz == Py_None);
    if (__pyx_t_2) {

      /* "cytimes/pddt.py":3791
 *             # . target timezone is None
 *             if targ_tz is None:
 *                 return self.tz_localize(None)             # <<<<<<<<<<<<<<
 *             # . target timezone is mytz
 *             elif targ_tz is utils.tz_parse(my_tz):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tz_localize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3791, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(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;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, Py_None};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3791, __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;

      /* "cytimes/pddt.py":3790
 *         if my_tz is not None:
 *             # . target timezone is None
 *             if targ_tz is None:             # <<<<<<<<<<<<<<
 *                 return self.tz_localize(None)
 *             # . target timezone is mytz
 */
    }

    /* "cytimes/pddt.py":3793
 *                 return self.tz_localize(None)
 *             # . target timezone is mytz
 *             elif targ_tz is utils.tz_parse(my_tz):             # <<<<<<<<<<<<<<
 *                 return self.tz_localize(None) if naive else self
 *             # . mytz => target timezone
 */
    __pyx_t_1 = __pyx_f_7cytimes_5utils_tz_parse(__pyx_v_my_tz); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3793, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = (__pyx_v_targ_tz == __pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "cytimes/pddt.py":3794
 *             # . target timezone is mytz
 *             elif targ_tz is utils.tz_parse(my_tz):
 *                 return self.tz_localize(None) if naive else self             # <<<<<<<<<<<<<<
 *             # . mytz => target timezone
 *             else:
 */
      __Pyx_XDECREF(__pyx_r);
      if (__pyx_v_naive) {
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tz_localize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3794, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (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_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, Py_None};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3794, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __pyx_t_1 = __pyx_t_3;
        __pyx_t_3 = 0;
      } else {
        __Pyx_INCREF(__pyx_v_self);
        __pyx_t_1 = __pyx_v_self;
      }
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "cytimes/pddt.py":3793
 *                 return self.tz_localize(None)
 *             # . target timezone is mytz
 *             elif targ_tz is utils.tz_parse(my_tz):             # <<<<<<<<<<<<<<
 *                 return self.tz_localize(None) if naive else self
 *             # . mytz => target timezone
 */
    }

    /* "cytimes/pddt.py":3797
 *             # . mytz => target timezone
 *             else:
 *                 pt = self.tz_convert(targ_tz)             # <<<<<<<<<<<<<<
 *                 return pt.tz_localize(None) if naive else pt
 * 
 */
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tz_convert); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3797, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(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;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_targ_tz};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3797, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __pyx_v_pt = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "cytimes/pddt.py":3798
 *             else:
 *                 pt = self.tz_convert(targ_tz)
 *                 return pt.tz_localize(None) if naive else pt             # <<<<<<<<<<<<<<
 * 
 *         # Timezone-naive
 */
      __Pyx_XDECREF(__pyx_r);
      if (__pyx_v_naive) {
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt, __pyx_n_s_tz_localize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3798, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (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_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, Py_None};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3798, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __pyx_t_1 = __pyx_t_3;
        __pyx_t_3 = 0;
      } else {
        __Pyx_INCREF(__pyx_v_pt);
        __pyx_t_1 = __pyx_v_pt;
      }
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }

    /* "cytimes/pddt.py":3788
 *         targ_tz = utils.tz_parse(targ_tz)
 *         my_tz = self.tzinfo
 *         if my_tz is not None:             # <<<<<<<<<<<<<<
 *             # . target timezone is None
 *             if targ_tz is None:
 */
  }

  /* "cytimes/pddt.py":3802
 *         # Timezone-naive
 *         # . target timezone is None
 *         if targ_tz is None:             # <<<<<<<<<<<<<<
 *             return self  # exit
 *         # . base timezone is target timezone
 */
  __pyx_t_2 = (__pyx_v_targ_tz == Py_None);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":3803
 *         # . target timezone is None
 *         if targ_tz is None:
 *             return self  # exit             # <<<<<<<<<<<<<<
 *         # . base timezone is target timezone
 *         base_tz = utils.tz_parse(base_tz)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":3802
 *         # Timezone-naive
 *         # . target timezone is None
 *         if targ_tz is None:             # <<<<<<<<<<<<<<
 *             return self  # exit
 *         # . base timezone is target timezone
 */
  }

  /* "cytimes/pddt.py":3805
 *             return self  # exit
 *         # . base timezone is target timezone
 *         base_tz = utils.tz_parse(base_tz)             # <<<<<<<<<<<<<<
 *         if base_tz is None:
 *             raise errors.InvalidTimezoneError(
 */
  __pyx_t_1 = __pyx_f_7cytimes_5utils_tz_parse(__pyx_v_base_tz); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_base_tz, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":3806
 *         # . base timezone is target timezone
 *         base_tz = utils.tz_parse(base_tz)
 *         if base_tz is None:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidTimezoneError(
 *                 "instance is timezone-naive.\n"
 */
  __pyx_t_2 = (__pyx_v_base_tz == Py_None);
  if (unlikely(__pyx_t_2)) {

    /* "cytimes/pddt.py":3807
 *         base_tz = utils.tz_parse(base_tz)
 *         if base_tz is None:
 *             raise errors.InvalidTimezoneError(             # <<<<<<<<<<<<<<
 *                 "instance is timezone-naive.\n"
 *                 "Cannot switch timezone-naive instance to the "
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3807, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InvalidTimezoneError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3807, __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
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_instance_is_timezone_naive_Canno};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3807, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 3807, __pyx_L1_error)

    /* "cytimes/pddt.py":3806
 *         # . base timezone is target timezone
 *         base_tz = utils.tz_parse(base_tz)
 *         if base_tz is None:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidTimezoneError(
 *                 "instance is timezone-naive.\n"
 */
  }

  /* "cytimes/pddt.py":3812
 *                 "target timezone without providing a 'base_tz'."
 *             )
 *         if base_tz is targ_tz:             # <<<<<<<<<<<<<<
 *             return self if naive else self.tz_localize(targ_tz, ambiguous, nonexistent)
 *         # . base timezone => target timezone
 */
  __pyx_t_2 = (__pyx_v_base_tz == __pyx_v_targ_tz);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":3813
 *             )
 *         if base_tz is targ_tz:
 *             return self if naive else self.tz_localize(targ_tz, ambiguous, nonexistent)             # <<<<<<<<<<<<<<
 *         # . base timezone => target timezone
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);
    if (__pyx_v_naive) {
      __Pyx_INCREF(__pyx_v_self);
      __pyx_t_1 = __pyx_v_self;
    } else {
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tz_localize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3813, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(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_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_v_targ_tz, __pyx_v_ambiguous, __pyx_v_nonexistent};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3813, __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;
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/pddt.py":3812
 *                 "target timezone without providing a 'base_tz'."
 *             )
 *         if base_tz is targ_tz:             # <<<<<<<<<<<<<<
 *             return self if naive else self.tz_localize(targ_tz, ambiguous, nonexistent)
 *         # . base timezone => target timezone
 */
  }

  /* "cytimes/pddt.py":3816
 *         # . base timezone => target timezone
 *         else:
 *             pt = self.tz_localize(base_tz, ambiguous, nonexistent)             # <<<<<<<<<<<<<<
 *             pt = pt.tz_convert(targ_tz)
 *             return pt.tz_localize(None) if naive else pt
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tz_localize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3816, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_base_tz, __pyx_v_ambiguous, __pyx_v_nonexistent};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3816, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_v_pt = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":3817
 *         else:
 *             pt = self.tz_localize(base_tz, ambiguous, nonexistent)
 *             pt = pt.tz_convert(targ_tz)             # <<<<<<<<<<<<<<
 *             return pt.tz_localize(None) if naive else pt
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt, __pyx_n_s_tz_convert); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_targ_tz};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3817, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_pt, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":3818
 *             pt = self.tz_localize(base_tz, ambiguous, nonexistent)
 *             pt = pt.tz_convert(targ_tz)
 *             return pt.tz_localize(None) if naive else pt             # <<<<<<<<<<<<<<
 * 
 *     # Values -------------------------------------------------------------------------------
 */
    __Pyx_XDECREF(__pyx_r);
    if (__pyx_v_naive) {
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt, __pyx_n_s_tz_localize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3818, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(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_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, Py_None};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3818, __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 {
      __Pyx_INCREF(__pyx_v_pt);
      __pyx_t_1 = __pyx_v_pt;
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "cytimes/pddt.py":3754
 *             raise errors.InvalidArgumentError(err) from err
 * 
 *     def tz_switch(             # <<<<<<<<<<<<<<
 *         self,
 *         targ_tz: datetime.tzinfo | str | None,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.tz_switch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_my_tz);
  __Pyx_XDECREF(__pyx_v_pt);
  __Pyx_XDECREF(__pyx_v_targ_tz);
  __Pyx_XDECREF(__pyx_v_base_tz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3821
 * 
 *     # Values -------------------------------------------------------------------------------
 *     @property             # <<<<<<<<<<<<<<
 *     def values_naive(self) -> np.ndarray[np.datetime64]:
 *         """Return an array of the timezone-naive datetime values `<'ndarray[datetime64]'>`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_229values_naive(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_228values_naive, "Return an array of the timezone-naive datetime values `<'ndarray[datetime64]'>`.\n\n        - If the instance is timezone-aware, equivalent to 'pt.tz_localize(None).values'.\n        - If the instance is timezone-naive, equivalent to 'pt.values'.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_229values_naive = {"values_naive", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_229values_naive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_228values_naive};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_229values_naive(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("values_naive (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3821, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "values_naive") < 0)) __PYX_ERR(0, 3821, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("values_naive", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3821, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.values_naive", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_228values_naive(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_228values_naive(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_my_tz = 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;
  unsigned int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("values_naive", 1);

  /* "cytimes/pddt.py":3828
 *         - If the instance is timezone-naive, equivalent to 'pt.values'.
 *         """
 *         my_tz = self.tzinfo             # <<<<<<<<<<<<<<
 *         if my_tz is None or my_tz is utils.UTC:
 *             return self.values
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_my_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":3829
 *         """
 *         my_tz = self.tzinfo
 *         if my_tz is None or my_tz is utils.UTC:             # <<<<<<<<<<<<<<
 *             return self.values
 *         return super(Pddt, self).tz_localize(None).values
 */
  __pyx_t_3 = (__pyx_v_my_tz == Py_None);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_my_tz == ((PyObject *)__pyx_v_7cytimes_5utils_UTC));
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":3830
 *         my_tz = self.tzinfo
 *         if my_tz is None or my_tz is utils.UTC:
 *             return self.values             # <<<<<<<<<<<<<<
 *         return super(Pddt, self).tz_localize(None).values
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/pddt.py":3829
 *         """
 *         my_tz = self.tzinfo
 *         if my_tz is None or my_tz is utils.UTC:             # <<<<<<<<<<<<<<
 *             return self.values
 *         return super(Pddt, self).tz_localize(None).values
 */
  }

  /* "cytimes/pddt.py":3831
 *         if my_tz is None or my_tz is utils.UTC:
 *             return self.values
 *         return super(Pddt, self).tz_localize(None).values             # <<<<<<<<<<<<<<
 * 
 *     def as_unit(self, unit: str) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Pddt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 3831, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self)) __PYX_ERR(0, 3831, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_tz_localize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, Py_None};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3831, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_values); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3821
 * 
 *     # Values -------------------------------------------------------------------------------
 *     @property             # <<<<<<<<<<<<<<
 *     def values_naive(self) -> np.ndarray[np.datetime64]:
 *         """Return an array of the timezone-naive datetime values `<'ndarray[datetime64]'>`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.values_naive", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_my_tz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3833
 *         return super(Pddt, self).tz_localize(None).values
 * 
 *     def as_unit(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Set the datetime unit resolution of the instance `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_231as_unit(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_230as_unit, "Set the datetime unit resolution of the instance `<'Pddt'>`.\n\n        #### Supports timezone-aware instance.\n\n        :param unit `<'str/None'>`: Set the datetime unit.\n            Supported datetime units: 's', 'ms', 'us', 'ns'.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_231as_unit = {"as_unit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_231as_unit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_230as_unit};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_231as_unit(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_unit = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_unit (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_unit,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3833, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3833, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("as_unit", 1, 2, 2, 1); __PYX_ERR(0, 3833, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "as_unit") < 0)) __PYX_ERR(0, 3833, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_unit = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("as_unit", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3833, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.as_unit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 0, "unit", 1))) __PYX_ERR(0, 3833, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_230as_unit(__pyx_self, __pyx_v_self, __pyx_v_unit);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_230as_unit(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_unit) {
  PyObject *__pyx_v_my_unit = 0;
  PyArrayObject *__pyx_v_arr = 0;
  PyArrayObject *__pyx_v_res = 0;
  PyObject *__pyx_v_err = 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;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_unit __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  unsigned int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("as_unit", 1);

  /* "cytimes/pddt.py":3842
 *         """
 *         # No change / Same unit
 *         if unit is None:             # <<<<<<<<<<<<<<
 *             return self  # exit
 *         my_unit: str = self.unit
 */
  __pyx_t_1 = (__pyx_v_unit == ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":3843
 *         # No change / Same unit
 *         if unit is None:
 *             return self  # exit             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 *         if unit == my_unit:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":3842
 *         """
 *         # No change / Same unit
 *         if unit is None:             # <<<<<<<<<<<<<<
 *             return self  # exit
 *         my_unit: str = self.unit
 */
  }

  /* "cytimes/pddt.py":3844
 *         if unit is None:
 *             return self  # exit
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 *         if unit == my_unit:
 *             return self  # exit
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_2))) __PYX_ERR(0, 3844, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3845
 *             return self  # exit
 *         my_unit: str = self.unit
 *         if unit == my_unit:             # <<<<<<<<<<<<<<
 *             return self  # exit
 * 
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_v_my_unit, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3845, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":3846
 *         my_unit: str = self.unit
 *         if unit == my_unit:
 *             return self  # exit             # <<<<<<<<<<<<<<
 * 
 *         # Access datetime array & info
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":3845
 *             return self  # exit
 *         my_unit: str = self.unit
 *         if unit == my_unit:             # <<<<<<<<<<<<<<
 *             return self  # exit
 * 
 */
  }

  /* "cytimes/pddt.py":3849
 * 
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 * 
 *         # Perform operation
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3849, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/pddt.py":3852
 * 
 *         # Perform operation
 *         try:             # <<<<<<<<<<<<<<
 *             res: np.ndarray = utils.dt64arr_as_unit(arr, unit, my_unit, True)
 *         except Exception as err:
 */
  {
    __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:*/ {

      /* "cytimes/pddt.py":3853
 *         # Perform operation
 *         try:
 *             res: np.ndarray = utils.dt64arr_as_unit(arr, unit, my_unit, True)             # <<<<<<<<<<<<<<
 *         except Exception as err:
 *             raise errors.InvalidTimeUnitError(err) from err
 */
      __pyx_t_6.__pyx_n = 2;
      __pyx_t_6.arr_unit = __pyx_v_my_unit;
      __pyx_t_6.limit = 1;
      __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_unit(__pyx_v_arr, __pyx_v_unit, &__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3853, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_res = ((PyArrayObject *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "cytimes/pddt.py":3852
 * 
 *         # Perform operation
 *         try:             # <<<<<<<<<<<<<<
 *             res: np.ndarray = utils.dt64arr_as_unit(arr, unit, my_unit, True)
 *         except Exception as err:
 */
    }
    __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;

    /* "cytimes/pddt.py":3854
 *         try:
 *             res: np.ndarray = utils.dt64arr_as_unit(arr, unit, my_unit, True)
 *         except Exception as err:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidTimeUnitError(err) from err
 *         if arr is res:
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_7) {
      __Pyx_AddTraceback("cytimes.pddt.Pddt.as_unit", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 3854, __pyx_L7_except_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_v_err = __pyx_t_8;
      /*try:*/ {

        /* "cytimes/pddt.py":3855
 *             res: np.ndarray = utils.dt64arr_as_unit(arr, unit, my_unit, True)
 *         except Exception as err:
 *             raise errors.InvalidTimeUnitError(err) from err             # <<<<<<<<<<<<<<
 *         if arr is res:
 *             return self
 */
        __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_errors); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3855, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_InvalidTimeUnitError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3855, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = NULL;
        __pyx_t_13 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
            __pyx_t_13 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_err};
          __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3855, __pyx_L16_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_Raise(__pyx_t_10, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __PYX_ERR(0, 3855, __pyx_L16_error)
      }

      /* "cytimes/pddt.py":3854
 *         try:
 *             res: np.ndarray = utils.dt64arr_as_unit(arr, unit, my_unit, True)
 *         except Exception as err:             # <<<<<<<<<<<<<<
 *             raise errors.InvalidTimeUnitError(err) from err
 *         if arr is res:
 */
      /*finally:*/ {
        __pyx_L16_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_7 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L7_except_error;
        }
      }
    }
    goto __pyx_L7_except_error;

    /* "cytimes/pddt.py":3852
 * 
 *         # Perform operation
 *         try:             # <<<<<<<<<<<<<<
 *             res: np.ndarray = utils.dt64arr_as_unit(arr, unit, my_unit, True)
 *         except Exception as err:
 */
    __pyx_L7_except_error:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L10_try_end:;
  }

  /* "cytimes/pddt.py":3856
 *         except Exception as err:
 *             raise errors.InvalidTimeUnitError(err) from err
 *         if arr is res:             # <<<<<<<<<<<<<<
 *             return self
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)
 */
  __pyx_t_1 = (__pyx_v_arr == __pyx_v_res);
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":3857
 *             raise errors.InvalidTimeUnitError(err) from err
 *         if arr is res:
 *             return self             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":3856
 *         except Exception as err:
 *             raise errors.InvalidTimeUnitError(err) from err
 *         if arr is res:             # <<<<<<<<<<<<<<
 *             return self
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)
 */
  }

  /* "cytimes/pddt.py":3858
 *         if arr is res:
 *             return self
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)             # <<<<<<<<<<<<<<
 * 
 *     # Arithmetic ---------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_22.__pyx_n = 3;
  __pyx_t_22.tz = __pyx_t_9;
  __pyx_t_22.unit = ((PyObject*)Py_None);
  __pyx_t_22.name = __pyx_t_8;
  __pyx_t_2 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_res), &__pyx_t_22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3833
 *         return super(Pddt, self).tz_localize(None).values
 * 
 *     def as_unit(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Set the datetime unit resolution of the instance `<'Pddt'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.as_unit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3861
 * 
 *     # Arithmetic ---------------------------------------------------------------------------
 *     def add(             # <<<<<<<<<<<<<<
 *         self,
 *         years: cython.int = 0,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_233add(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_232add, "Add relative delta to the instance `<'Pddt'>`.\n\n        :param years `<'int'>`: Relative delta of years, defaults to `0`.\n        :param quarters `<'int'>`: Relative delta of quarters (3 months), defaults to `0`.\n        :param months `<'int'>`: Relative delta of months, defaults to `0`.\n        :param weeks `<'int'>`: Relative delta of weeks (7 days), defaults to `0`.\n        :param days `<'int'>`: Relative delta of days, defaults to `0`.\n        :param hours `<'int'>`: Relative delta of hours, defaults to `0`.\n        :param minutes `<'int'>`: Relative delta of minutes, defaults to `0`.\n        :param seconds `<'int'>`: Relative delta of seconds, defaults to `0`.\n        :param milliseconds `<'int'>`: Relative delta of milliseconds, defaults to `0`.\n        :param microseconds `<'int'>`: Relative delta of microseconds, defaults to `0`.\n        :param nanoseconds `<'int'>`: Relative delta of nanoseconds, defaults to `0`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_233add = {"add", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_233add, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_232add};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_233add(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_years;
  int __pyx_v_quarters;
  int __pyx_v_months;
  int __pyx_v_weeks;
  int __pyx_v_days;
  int __pyx_v_hours;
  int __pyx_v_minutes;
  int __pyx_v_seconds;
  int __pyx_v_milliseconds;
  int __pyx_v_microseconds;
  int __pyx_v_nanoseconds;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_years,&__pyx_n_s_quarters,&__pyx_n_s_months,&__pyx_n_s_weeks,&__pyx_n_s_days,&__pyx_n_s_hours,&__pyx_n_s_minutes,&__pyx_n_s_seconds,&__pyx_n_s_milliseconds,&__pyx_n_s_microseconds,&__pyx_n_s_nanoseconds,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3861, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_years);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3861, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_quarters);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3861, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_months);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3861, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_weeks);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3861, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_days);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3861, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hours);
          if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3861, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_minutes);
          if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3861, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_seconds);
          if (value) { values[8] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3861, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_milliseconds);
          if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3861, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_microseconds);
          if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3861, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nanoseconds);
          if (value) { values[11] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3861, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add") < 0)) __PYX_ERR(0, 3861, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    if (values[1]) {
      __pyx_v_years = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_years == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3863, __pyx_L3_error)
    } else {
      __pyx_v_years = ((int)((int)0));
    }
    if (values[2]) {
      __pyx_v_quarters = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_quarters == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3864, __pyx_L3_error)
    } else {
      __pyx_v_quarters = ((int)((int)0));
    }
    if (values[3]) {
      __pyx_v_months = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_months == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3865, __pyx_L3_error)
    } else {
      __pyx_v_months = ((int)((int)0));
    }
    if (values[4]) {
      __pyx_v_weeks = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_weeks == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3866, __pyx_L3_error)
    } else {
      __pyx_v_weeks = ((int)((int)0));
    }
    if (values[5]) {
      __pyx_v_days = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_days == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3867, __pyx_L3_error)
    } else {
      __pyx_v_days = ((int)((int)0));
    }
    if (values[6]) {
      __pyx_v_hours = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_hours == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3868, __pyx_L3_error)
    } else {
      __pyx_v_hours = ((int)((int)0));
    }
    if (values[7]) {
      __pyx_v_minutes = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_minutes == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3869, __pyx_L3_error)
    } else {
      __pyx_v_minutes = ((int)((int)0));
    }
    if (values[8]) {
      __pyx_v_seconds = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_seconds == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3870, __pyx_L3_error)
    } else {
      __pyx_v_seconds = ((int)((int)0));
    }
    if (values[9]) {
      __pyx_v_milliseconds = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_milliseconds == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3871, __pyx_L3_error)
    } else {
      __pyx_v_milliseconds = ((int)((int)0));
    }
    if (values[10]) {
      __pyx_v_microseconds = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_microseconds == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3872, __pyx_L3_error)
    } else {
      __pyx_v_microseconds = ((int)((int)0));
    }
    if (values[11]) {
      __pyx_v_nanoseconds = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_nanoseconds == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3873, __pyx_L3_error)
    } else {
      __pyx_v_nanoseconds = ((int)((int)0));
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add", 0, 1, 12, __pyx_nargs); __PYX_ERR(0, 3861, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_232add(__pyx_self, __pyx_v_self, __pyx_v_years, __pyx_v_quarters, __pyx_v_months, __pyx_v_weeks, __pyx_v_days, __pyx_v_hours, __pyx_v_minutes, __pyx_v_seconds, __pyx_v_milliseconds, __pyx_v_microseconds, __pyx_v_nanoseconds);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_232add(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_years, int __pyx_v_quarters, int __pyx_v_months, int __pyx_v_weeks, int __pyx_v_days, int __pyx_v_hours, int __pyx_v_minutes, int __pyx_v_seconds, int __pyx_v_milliseconds, int __pyx_v_microseconds, int __pyx_v_nanoseconds) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_my_unit = 0;
  Py_UCS4 __pyx_v_my_unit_ch;
  PyArrayObject *__pyx_v_delta = 0;
  PyArrayObject *__pyx_v_datesM = NULL;
  PyArrayObject *__pyx_v_datesD = NULL;
  PyArrayObject *__pyx_v_times = 0;
  PyObject *__pyx_v_dtype = NULL;
  PyArrayObject *__pyx_v_dates = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_M __pyx_t_4;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64_D __pyx_t_5;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_day __pyx_t_6;
  struct __pyx_opt_args_7cytimes_5utils_arr_add_arr __pyx_t_7;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_times __pyx_t_8;
  struct __pyx_opt_args_7cytimes_5utils_is_dt64arr_ns_safe __pyx_t_9;
  PY_LONG_LONG __pyx_t_10;
  PY_LONG_LONG __pyx_t_11;
  PY_LONG_LONG __pyx_t_12;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  unsigned int __pyx_t_16;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add", 1);

  /* "cytimes/pddt.py":3891
 *         # No change
 *         if (
 *             years == 0             # <<<<<<<<<<<<<<
 *             and quarters == 0
 *             and months == 0
 */
  __pyx_t_2 = (__pyx_v_years == 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cytimes/pddt.py":3892
 *         if (
 *             years == 0
 *             and quarters == 0             # <<<<<<<<<<<<<<
 *             and months == 0
 *             and weeks == 0
 */
  __pyx_t_2 = (__pyx_v_quarters == 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cytimes/pddt.py":3893
 *             years == 0
 *             and quarters == 0
 *             and months == 0             # <<<<<<<<<<<<<<
 *             and weeks == 0
 *             and days == 0
 */
  __pyx_t_2 = (__pyx_v_months == 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cytimes/pddt.py":3894
 *             and quarters == 0
 *             and months == 0
 *             and weeks == 0             # <<<<<<<<<<<<<<
 *             and days == 0
 *             and hours == 0
 */
  __pyx_t_2 = (__pyx_v_weeks == 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cytimes/pddt.py":3895
 *             and months == 0
 *             and weeks == 0
 *             and days == 0             # <<<<<<<<<<<<<<
 *             and hours == 0
 *             and minutes == 0
 */
  __pyx_t_2 = (__pyx_v_days == 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cytimes/pddt.py":3896
 *             and weeks == 0
 *             and days == 0
 *             and hours == 0             # <<<<<<<<<<<<<<
 *             and minutes == 0
 *             and seconds == 0
 */
  __pyx_t_2 = (__pyx_v_hours == 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cytimes/pddt.py":3897
 *             and days == 0
 *             and hours == 0
 *             and minutes == 0             # <<<<<<<<<<<<<<
 *             and seconds == 0
 *             and milliseconds == 0
 */
  __pyx_t_2 = (__pyx_v_minutes == 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cytimes/pddt.py":3898
 *             and hours == 0
 *             and minutes == 0
 *             and seconds == 0             # <<<<<<<<<<<<<<
 *             and milliseconds == 0
 *             and microseconds == 0
 */
  __pyx_t_2 = (__pyx_v_seconds == 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cytimes/pddt.py":3899
 *             and minutes == 0
 *             and seconds == 0
 *             and milliseconds == 0             # <<<<<<<<<<<<<<
 *             and microseconds == 0
 *             and nanoseconds == 0
 */
  __pyx_t_2 = (__pyx_v_milliseconds == 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cytimes/pddt.py":3900
 *             and seconds == 0
 *             and milliseconds == 0
 *             and microseconds == 0             # <<<<<<<<<<<<<<
 *             and nanoseconds == 0
 *         ):
 */
  __pyx_t_2 = (__pyx_v_microseconds == 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cytimes/pddt.py":3901
 *             and milliseconds == 0
 *             and microseconds == 0
 *             and nanoseconds == 0             # <<<<<<<<<<<<<<
 *         ):
 *             return self  # exit
 */
  __pyx_t_2 = (__pyx_v_nanoseconds == 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;

  /* "cytimes/pddt.py":3890
 *         """
 *         # No change
 *         if (             # <<<<<<<<<<<<<<
 *             years == 0
 *             and quarters == 0
 */
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":3903
 *             and nanoseconds == 0
 *         ):
 *             return self  # exit             # <<<<<<<<<<<<<<
 * 
 *         # Access datetime array & info
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self);
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "cytimes/pddt.py":3890
 *         """
 *         # No change
 *         if (             # <<<<<<<<<<<<<<
 *             years == 0
 *             and quarters == 0
 */
  }

  /* "cytimes/pddt.py":3906
 * 
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 *         my_unit_ch: cython.Py_UCS4 = str_read(my_unit, 0)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3906, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3907
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 *         my_unit_ch: cython.Py_UCS4 = str_read(my_unit, 0)
 *         delta: np.ndarray
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_3))) __PYX_ERR(0, 3907, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3908
 *         arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit
 *         my_unit_ch: cython.Py_UCS4 = str_read(my_unit, 0)             # <<<<<<<<<<<<<<
 *         delta: np.ndarray
 * 
 */
  __pyx_v_my_unit_ch = PyUnicode_READ_CHAR(__pyx_v_my_unit, 0);

  /* "cytimes/pddt.py":3912
 * 
 *         # Adjust dates
 *         if years != 0 or quarters != 0 or months != 0:             # <<<<<<<<<<<<<<
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit)  # int64[M]
 *             datesM = utils.arr_add(datesM, years * 12 + quarters * 3 + months)
 */
  __pyx_t_2 = (__pyx_v_years != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L16_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_quarters != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L16_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_months != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L16_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cytimes/pddt.py":3913
 *         # Adjust dates
 *         if years != 0 or quarters != 0 or months != 0:
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit)  # int64[M]             # <<<<<<<<<<<<<<
 *             datesM = utils.arr_add(datesM, years * 12 + quarters * 3 + months)
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 */
    __pyx_t_4.__pyx_n = 1;
    __pyx_t_4.arr_unit = __pyx_v_my_unit;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_M(__pyx_v_arr, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3913, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesM = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":3914
 *         if years != 0 or quarters != 0 or months != 0:
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit)  # int64[M]
 *             datesM = utils.arr_add(datesM, years * 12 + quarters * 3 + months)             # <<<<<<<<<<<<<<
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_day(arr, my_unit)  # original day
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_datesM, (((__pyx_v_years * 12) + (__pyx_v_quarters * 3)) + __pyx_v_months))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3914, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_datesM, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":3915
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit)  # int64[M]
 *             datesM = utils.arr_add(datesM, years * 12 + quarters * 3 + months)
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]             # <<<<<<<<<<<<<<
 *             delta = utils.dt64arr_day(arr, my_unit)  # original day
 *             datesD = utils.arr_add_arr(datesD, delta, weeks * 7 + days - 1)  # int64[D]
 */
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.arr_unit = __pyx_n_u_M;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_datesM, &__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3915, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":3916
 *             datesM = utils.arr_add(datesM, years * 12 + quarters * 3 + months)
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_day(arr, my_unit)  # original day             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_add_arr(datesD, delta, weeks * 7 + days - 1)  # int64[D]
 *         else:
 */
    __pyx_t_6.__pyx_n = 1;
    __pyx_t_6.arr_unit = __pyx_v_my_unit;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_day(__pyx_v_arr, &__pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3916, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_delta = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":3917
 *             datesD = utils.dt64arr_as_int64_D(datesM, "M")  # int64[D]
 *             delta = utils.dt64arr_day(arr, my_unit)  # original day
 *             datesD = utils.arr_add_arr(datesD, delta, weeks * 7 + days - 1)  # int64[D]             # <<<<<<<<<<<<<<
 *         else:
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 */
    __pyx_t_7.__pyx_n = 1;
    __pyx_t_7.offset = (((__pyx_v_weeks * 7) + __pyx_v_days) - 1);
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesD, __pyx_v_delta, &__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":3912
 * 
 *         # Adjust dates
 *         if years != 0 or quarters != 0 or months != 0:             # <<<<<<<<<<<<<<
 *             datesM = utils.dt64arr_as_int64_M(arr, my_unit)  # int64[M]
 *             datesM = utils.arr_add(datesM, years * 12 + quarters * 3 + months)
 */
    goto __pyx_L15;
  }

  /* "cytimes/pddt.py":3919
 *             datesD = utils.arr_add_arr(datesD, delta, weeks * 7 + days - 1)  # int64[D]
 *         else:
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]             # <<<<<<<<<<<<<<
 *             datesD = utils.arr_add(datesD, weeks * 7 + days)  # int64[D]
 * 
 */
  /*else*/ {
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.arr_unit = __pyx_v_my_unit;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64_D(__pyx_v_arr, &__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3919, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_datesD = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":3920
 *         else:
 *             datesD = utils.dt64arr_as_int64_D(arr, my_unit)  # int64[D]
 *             datesD = utils.arr_add(datesD, weeks * 7 + days)  # int64[D]             # <<<<<<<<<<<<<<
 * 
 *         # Adjust times
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_datesD, ((__pyx_v_weeks * 7) + __pyx_v_days))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3920, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_datesD, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;
  }
  __pyx_L15:;

  /* "cytimes/pddt.py":3923
 * 
 *         # Adjust times
 *         times: np.ndarray = utils.dt64arr_times(arr, my_unit)  # int64[my_unit]             # <<<<<<<<<<<<<<
 *         # . nanosecond
 *         if my_unit_ch == "n":
 */
  __pyx_t_8.__pyx_n = 1;
  __pyx_t_8.arr_unit = __pyx_v_my_unit;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_times(__pyx_v_arr, &__pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_times = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3925
 *         times: np.ndarray = utils.dt64arr_times(arr, my_unit)  # int64[my_unit]
 *         # . nanosecond
 *         if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *             if (
 *                 hours != 0
 */
  switch (__pyx_v_my_unit_ch) {
    case 0x6E:

    /* "cytimes/pddt.py":3927
 *         if my_unit_ch == "n":
 *             if (
 *                 hours != 0             # <<<<<<<<<<<<<<
 *                 or minutes != 0
 *                 or seconds != 0
 */
    __pyx_t_2 = (__pyx_v_hours != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L20_bool_binop_done;
    }

    /* "cytimes/pddt.py":3928
 *             if (
 *                 hours != 0
 *                 or minutes != 0             # <<<<<<<<<<<<<<
 *                 or seconds != 0
 *                 or milliseconds != 0
 */
    __pyx_t_2 = (__pyx_v_minutes != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L20_bool_binop_done;
    }

    /* "cytimes/pddt.py":3929
 *                 hours != 0
 *                 or minutes != 0
 *                 or seconds != 0             # <<<<<<<<<<<<<<
 *                 or milliseconds != 0
 *                 or microseconds != 0
 */
    __pyx_t_2 = (__pyx_v_seconds != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L20_bool_binop_done;
    }

    /* "cytimes/pddt.py":3930
 *                 or minutes != 0
 *                 or seconds != 0
 *                 or milliseconds != 0             # <<<<<<<<<<<<<<
 *                 or microseconds != 0
 *                 or nanoseconds != 0
 */
    __pyx_t_2 = (__pyx_v_milliseconds != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L20_bool_binop_done;
    }

    /* "cytimes/pddt.py":3931
 *                 or seconds != 0
 *                 or milliseconds != 0
 *                 or microseconds != 0             # <<<<<<<<<<<<<<
 *                 or nanoseconds != 0
 *             ):
 */
    __pyx_t_2 = (__pyx_v_microseconds != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L20_bool_binop_done;
    }

    /* "cytimes/pddt.py":3932
 *                 or milliseconds != 0
 *                 or microseconds != 0
 *                 or nanoseconds != 0             # <<<<<<<<<<<<<<
 *             ):
 *                 times = utils.arr_add(  # int64[ns]
 */
    __pyx_t_2 = (__pyx_v_nanoseconds != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L20_bool_binop_done:;

    /* "cytimes/pddt.py":3926
 *         # . nanosecond
 *         if my_unit_ch == "n":
 *             if (             # <<<<<<<<<<<<<<
 *                 hours != 0
 *                 or minutes != 0
 */
    if (__pyx_t_1) {

      /* "cytimes/pddt.py":3934
 *                 or nanoseconds != 0
 *             ):
 *                 times = utils.arr_add(  # int64[ns]             # <<<<<<<<<<<<<<
 *                     times,
 *                     (hours * 3600 + minutes * 60 + seconds) * utils.NS_SECOND
 */
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_times, (((((((__pyx_v_hours * 0xE10) + (__pyx_v_minutes * 60)) + __pyx_v_seconds) * __pyx_v_7cytimes_5utils_NS_SECOND) + (__pyx_v_milliseconds * __pyx_v_7cytimes_5utils_NS_MILLISECOND)) + (__pyx_v_microseconds * __pyx_v_7cytimes_5utils_NS_MICROSECOND)) + __pyx_v_nanoseconds))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3934, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/pddt.py":3941
 *                     + nanoseconds,
 *                 )
 *                 delta = utils.arr_floor_div(times, utils.NS_DAY)  # int64[D]             # <<<<<<<<<<<<<<
 *                 delta = utils.arr_add_arr(datesD, delta)  # int64[D]
 *             else:
 */
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_times, __pyx_v_7cytimes_5utils_NS_DAY, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3941, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/pddt.py":3942
 *                 )
 *                 delta = utils.arr_floor_div(times, utils.NS_DAY)  # int64[D]
 *                 delta = utils.arr_add_arr(datesD, delta)  # int64[D]             # <<<<<<<<<<<<<<
 *             else:
 *                 delta = datesD  # int64[D]
 */
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_datesD, __pyx_v_delta, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3942, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_delta, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/pddt.py":3926
 *         # . nanosecond
 *         if my_unit_ch == "n":
 *             if (             # <<<<<<<<<<<<<<
 *                 hours != 0
 *                 or minutes != 0
 */
      goto __pyx_L19;
    }

    /* "cytimes/pddt.py":3944
 *                 delta = utils.arr_add_arr(datesD, delta)  # int64[D]
 *             else:
 *                 delta = datesD  # int64[D]             # <<<<<<<<<<<<<<
 *             # Prevent 'ns' overflow: cast to 'us'
 *             if not utils.is_dt64arr_ns_safe(delta, "D"):
 */
    /*else*/ {
      __Pyx_INCREF((PyObject *)__pyx_v_datesD);
      __Pyx_XDECREF_SET(__pyx_v_delta, __pyx_v_datesD);
    }
    __pyx_L19:;

    /* "cytimes/pddt.py":3946
 *                 delta = datesD  # int64[D]
 *             # Prevent 'ns' overflow: cast to 'us'
 *             if not utils.is_dt64arr_ns_safe(delta, "D"):             # <<<<<<<<<<<<<<
 *                 times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *                 my_unit = "us"  # change to 'us' from 'ns'
 */
    __pyx_t_9.__pyx_n = 1;
    __pyx_t_9.arr_unit = __pyx_n_u_D;
    __pyx_t_1 = __pyx_f_7cytimes_5utils_is_dt64arr_ns_safe(__pyx_v_delta, &__pyx_t_9); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 3946, __pyx_L1_error)
    __pyx_t_2 = (!__pyx_t_1);
    if (__pyx_t_2) {

      /* "cytimes/pddt.py":3947
 *             # Prevent 'ns' overflow: cast to 'us'
 *             if not utils.is_dt64arr_ns_safe(delta, "D"):
 *                 times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]             # <<<<<<<<<<<<<<
 *                 my_unit = "us"  # change to 'us' from 'ns'
 *         # . microsecond
 */
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_floor_div(__pyx_v_times, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3947, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/pddt.py":3948
 *             if not utils.is_dt64arr_ns_safe(delta, "D"):
 *                 times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *                 my_unit = "us"  # change to 'us' from 'ns'             # <<<<<<<<<<<<<<
 *         # . microsecond
 *         elif my_unit_ch == "u":
 */
      __Pyx_INCREF(__pyx_n_u_us);
      __Pyx_DECREF_SET(__pyx_v_my_unit, __pyx_n_u_us);

      /* "cytimes/pddt.py":3946
 *                 delta = datesD  # int64[D]
 *             # Prevent 'ns' overflow: cast to 'us'
 *             if not utils.is_dt64arr_ns_safe(delta, "D"):             # <<<<<<<<<<<<<<
 *                 times = utils.arr_floor_div(times, utils.NS_MICROSECOND)  # int64[us]
 *                 my_unit = "us"  # change to 'us' from 'ns'
 */
    }

    /* "cytimes/pddt.py":3925
 *         times: np.ndarray = utils.dt64arr_times(arr, my_unit)  # int64[my_unit]
 *         # . nanosecond
 *         if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *             if (
 *                 hours != 0
 */
    break;
    case 0x75:

    /* "cytimes/pddt.py":3956
 *                 + milliseconds * utils.US_MILLISECOND
 *                 + microseconds
 *                 + utils.math_round_div(nanoseconds, utils.NS_MICROSECOND),             # <<<<<<<<<<<<<<
 *             )
 *         # . millisecond
 */
    __pyx_t_10 = __pyx_f_7cytimes_5utils_math_round_div(__pyx_v_nanoseconds, __pyx_v_7cytimes_5utils_NS_MICROSECOND, NULL); if (unlikely(__pyx_t_10 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 3956, __pyx_L1_error)

    /* "cytimes/pddt.py":3951
 *         # . microsecond
 *         elif my_unit_ch == "u":
 *             times = utils.arr_add(  # int64[us]             # <<<<<<<<<<<<<<
 *                 times,
 *                 (hours * 3600 + minutes * 60 + seconds) * utils.US_SECOND
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_times, (((((((__pyx_v_hours * 0xE10) + (__pyx_v_minutes * 60)) + __pyx_v_seconds) * __pyx_v_7cytimes_5utils_US_SECOND) + (__pyx_v_milliseconds * __pyx_v_7cytimes_5utils_US_MILLISECOND)) + __pyx_v_microseconds) + __pyx_t_10))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3951, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":3950
 *                 my_unit = "us"  # change to 'us' from 'ns'
 *         # . microsecond
 *         elif my_unit_ch == "u":             # <<<<<<<<<<<<<<
 *             times = utils.arr_add(  # int64[us]
 *                 times,
 */
    break;
    case 0x6D:

    /* "cytimes/pddt.py":3964
 *                 (hours * 3600 + minutes * 60 + seconds) * utils.MS_SECOND
 *                 + milliseconds
 *                 + utils.math_round_div(microseconds, utils.US_MILLISECOND)             # <<<<<<<<<<<<<<
 *                 + utils.math_round_div(nanoseconds, utils.NS_MILLISECOND),
 *             )
 */
    __pyx_t_10 = __pyx_f_7cytimes_5utils_math_round_div(__pyx_v_microseconds, __pyx_v_7cytimes_5utils_US_MILLISECOND, NULL); if (unlikely(__pyx_t_10 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 3964, __pyx_L1_error)

    /* "cytimes/pddt.py":3965
 *                 + milliseconds
 *                 + utils.math_round_div(microseconds, utils.US_MILLISECOND)
 *                 + utils.math_round_div(nanoseconds, utils.NS_MILLISECOND),             # <<<<<<<<<<<<<<
 *             )
 *         # . second
 */
    __pyx_t_11 = __pyx_f_7cytimes_5utils_math_round_div(__pyx_v_nanoseconds, __pyx_v_7cytimes_5utils_NS_MILLISECOND, NULL); if (unlikely(__pyx_t_11 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 3965, __pyx_L1_error)

    /* "cytimes/pddt.py":3960
 *         # . millisecond
 *         elif my_unit_ch == "m":
 *             times = utils.arr_add(  # int64[ms]             # <<<<<<<<<<<<<<
 *                 times,
 *                 (hours * 3600 + minutes * 60 + seconds) * utils.MS_SECOND
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_times, (((((((__pyx_v_hours * 0xE10) + (__pyx_v_minutes * 60)) + __pyx_v_seconds) * __pyx_v_7cytimes_5utils_MS_SECOND) + __pyx_v_milliseconds) + __pyx_t_10) + __pyx_t_11))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3960, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":3959
 *             )
 *         # . millisecond
 *         elif my_unit_ch == "m":             # <<<<<<<<<<<<<<
 *             times = utils.arr_add(  # int64[ms]
 *                 times,
 */
    break;
    case 0x73:

    /* "cytimes/pddt.py":3972
 *                 times,
 *                 (hours * 3600 + minutes * 60 + seconds)
 *                 + utils.math_round_div(milliseconds, utils.MS_SECOND)             # <<<<<<<<<<<<<<
 *                 + utils.math_round_div(microseconds, utils.US_SECOND)
 *                 + utils.math_round_div(nanoseconds, utils.NS_SECOND),
 */
    __pyx_t_11 = __pyx_f_7cytimes_5utils_math_round_div(__pyx_v_milliseconds, __pyx_v_7cytimes_5utils_MS_SECOND, NULL); if (unlikely(__pyx_t_11 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 3972, __pyx_L1_error)

    /* "cytimes/pddt.py":3973
 *                 (hours * 3600 + minutes * 60 + seconds)
 *                 + utils.math_round_div(milliseconds, utils.MS_SECOND)
 *                 + utils.math_round_div(microseconds, utils.US_SECOND)             # <<<<<<<<<<<<<<
 *                 + utils.math_round_div(nanoseconds, utils.NS_SECOND),
 *             )
 */
    __pyx_t_10 = __pyx_f_7cytimes_5utils_math_round_div(__pyx_v_microseconds, __pyx_v_7cytimes_5utils_US_SECOND, NULL); if (unlikely(__pyx_t_10 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 3973, __pyx_L1_error)

    /* "cytimes/pddt.py":3974
 *                 + utils.math_round_div(milliseconds, utils.MS_SECOND)
 *                 + utils.math_round_div(microseconds, utils.US_SECOND)
 *                 + utils.math_round_div(nanoseconds, utils.NS_SECOND),             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_12 = __pyx_f_7cytimes_5utils_math_round_div(__pyx_v_nanoseconds, __pyx_v_7cytimes_5utils_NS_SECOND, NULL); if (unlikely(__pyx_t_12 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 3974, __pyx_L1_error)

    /* "cytimes/pddt.py":3969
 *         # . second
 *         elif my_unit_ch == "s":
 *             times = utils.arr_add(  # int64[s]             # <<<<<<<<<<<<<<
 *                 times,
 *                 (hours * 3600 + minutes * 60 + seconds)
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add(__pyx_v_times, ((((((__pyx_v_hours * 0xE10) + (__pyx_v_minutes * 60)) + __pyx_v_seconds) + __pyx_t_11) + __pyx_t_10) + __pyx_t_12))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3969, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_times, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":3968
 *             )
 *         # . second
 *         elif my_unit_ch == "s":             # <<<<<<<<<<<<<<
 *             times = utils.arr_add(  # int64[s]
 *                 times,
 */
    break;
    default: break;
  }

  /* "cytimes/pddt.py":3978
 * 
 *         # Combine dates & times
 *         dtype = "datetime64[%s]" % my_unit             # <<<<<<<<<<<<<<
 *         dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 */
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_my_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_dtype = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3979
 *         # Combine dates & times
 *         dtype = "datetime64[%s]" % my_unit
 *         dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]             # <<<<<<<<<<<<<<
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 */
  __pyx_t_13.__pyx_n = 1;
  __pyx_t_13.arr_unit = __pyx_n_u_D;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_datesD, __pyx_v_my_unit, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_dates = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3980
 *         dtype = "datetime64[%s]" % my_unit
 *         dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 */
  __pyx_t_14 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_add_arr(__pyx_v_dates, __pyx_v_times, NULL)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_astype); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = NULL;
  __pyx_t_16 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_15))) {
    __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15);
    if (likely(__pyx_t_14)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_15, function);
      __pyx_t_16 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_v_dtype};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3980, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 3980, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3981
 *         dates = utils.dt64arr_as_int64(datesD, my_unit, "D")  # int64[my_unit]
 *         arr = utils.arr_add_arr(dates, times).astype(dtype)  # dt64[my_unit]
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)             # <<<<<<<<<<<<<<
 * 
 *     def sub(
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_17.__pyx_n = 3;
  __pyx_t_17.tz = __pyx_t_3;
  __pyx_t_17.unit = ((PyObject*)Py_None);
  __pyx_t_17.name = __pyx_t_15;
  __pyx_t_14 = __pyx_f_7cytimes_4pddt_pddt_new_simple(((PyObject *)__pyx_v_arr), &__pyx_t_17); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_r = __pyx_t_14;
  __pyx_t_14 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":3861
 * 
 *     # Arithmetic ---------------------------------------------------------------------------
 *     def add(             # <<<<<<<<<<<<<<
 *         self,
 *         years: cython.int = 0,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_delta);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesM);
  __Pyx_XDECREF((PyObject *)__pyx_v_datesD);
  __Pyx_XDECREF((PyObject *)__pyx_v_times);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XDECREF((PyObject *)__pyx_v_dates);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":3983
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def sub(             # <<<<<<<<<<<<<<
 *         self,
 *         years: cython.int = 0,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_235sub(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_234sub, "Substract relative delta from the instance `<'Pddt'>`.\n\n        :param years `<'int'>`: Relative delta of years, defaults to `0`.\n        :param quarters `<'int'>`: Relative delta of quarters (3 months), defaults to `0`.\n        :param months `<'int'>`: Relative delta of months, defaults to `0`.\n        :param weeks `<'int'>`: Relative delta of weeks (7 days), defaults to `0`.\n        :param days `<'int'>`: Relative delta of days, defaults to `0`.\n        :param hours `<'int'>`: Relative delta of hours, defaults to `0`.\n        :param minutes `<'int'>`: Relative delta of minutes, defaults to `0`.\n        :param seconds `<'int'>`: Relative delta of seconds, defaults to `0`.\n        :param milliseconds `<'int'>`: Relative delta of milliseconds, defaults to `0`.\n        :param microseconds `<'int'>`: Relative delta of microseconds, defaults to `0`.\n        :param nanoseconds `<'int'>`: Relative delta of nanoseconds, defaults to `0`.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_235sub = {"sub", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_235sub, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_234sub};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_235sub(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  int __pyx_v_years;
  int __pyx_v_quarters;
  int __pyx_v_months;
  int __pyx_v_weeks;
  int __pyx_v_days;
  int __pyx_v_hours;
  int __pyx_v_minutes;
  int __pyx_v_seconds;
  int __pyx_v_milliseconds;
  int __pyx_v_microseconds;
  int __pyx_v_nanoseconds;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sub (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_years,&__pyx_n_s_quarters,&__pyx_n_s_months,&__pyx_n_s_weeks,&__pyx_n_s_days,&__pyx_n_s_hours,&__pyx_n_s_minutes,&__pyx_n_s_seconds,&__pyx_n_s_milliseconds,&__pyx_n_s_microseconds,&__pyx_n_s_nanoseconds,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3983, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_years);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3983, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_quarters);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3983, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_months);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3983, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_weeks);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3983, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_days);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3983, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hours);
          if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3983, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_minutes);
          if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3983, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_seconds);
          if (value) { values[8] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3983, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_milliseconds);
          if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3983, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_microseconds);
          if (value) { values[10] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3983, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nanoseconds);
          if (value) { values[11] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3983, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "sub") < 0)) __PYX_ERR(0, 3983, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case 12: values[11] = __Pyx_Arg_FASTCALL(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    if (values[1]) {
      __pyx_v_years = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_years == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3985, __pyx_L3_error)
    } else {
      __pyx_v_years = ((int)((int)0));
    }
    if (values[2]) {
      __pyx_v_quarters = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_quarters == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3986, __pyx_L3_error)
    } else {
      __pyx_v_quarters = ((int)((int)0));
    }
    if (values[3]) {
      __pyx_v_months = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_months == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3987, __pyx_L3_error)
    } else {
      __pyx_v_months = ((int)((int)0));
    }
    if (values[4]) {
      __pyx_v_weeks = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_weeks == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3988, __pyx_L3_error)
    } else {
      __pyx_v_weeks = ((int)((int)0));
    }
    if (values[5]) {
      __pyx_v_days = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_days == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3989, __pyx_L3_error)
    } else {
      __pyx_v_days = ((int)((int)0));
    }
    if (values[6]) {
      __pyx_v_hours = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_hours == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3990, __pyx_L3_error)
    } else {
      __pyx_v_hours = ((int)((int)0));
    }
    if (values[7]) {
      __pyx_v_minutes = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_minutes == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3991, __pyx_L3_error)
    } else {
      __pyx_v_minutes = ((int)((int)0));
    }
    if (values[8]) {
      __pyx_v_seconds = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_seconds == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3992, __pyx_L3_error)
    } else {
      __pyx_v_seconds = ((int)((int)0));
    }
    if (values[9]) {
      __pyx_v_milliseconds = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_milliseconds == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3993, __pyx_L3_error)
    } else {
      __pyx_v_milliseconds = ((int)((int)0));
    }
    if (values[10]) {
      __pyx_v_microseconds = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_microseconds == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3994, __pyx_L3_error)
    } else {
      __pyx_v_microseconds = ((int)((int)0));
    }
    if (values[11]) {
      __pyx_v_nanoseconds = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_nanoseconds == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3995, __pyx_L3_error)
    } else {
      __pyx_v_nanoseconds = ((int)((int)0));
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sub", 0, 1, 12, __pyx_nargs); __PYX_ERR(0, 3983, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_234sub(__pyx_self, __pyx_v_self, __pyx_v_years, __pyx_v_quarters, __pyx_v_months, __pyx_v_weeks, __pyx_v_days, __pyx_v_hours, __pyx_v_minutes, __pyx_v_seconds, __pyx_v_milliseconds, __pyx_v_microseconds, __pyx_v_nanoseconds);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_234sub(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_years, int __pyx_v_quarters, int __pyx_v_months, int __pyx_v_weeks, int __pyx_v_days, int __pyx_v_hours, int __pyx_v_minutes, int __pyx_v_seconds, int __pyx_v_milliseconds, int __pyx_v_microseconds, int __pyx_v_nanoseconds) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  unsigned int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sub", 1);

  /* "cytimes/pddt.py":4012
 *         """
 *         # fmt: off
 *         return self.add(             # <<<<<<<<<<<<<<
 *             -years, -quarters, -months, -weeks, -days,
 *             -hours, -minutes, -seconds, -milliseconds,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_add); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cytimes/pddt.py":4013
 *         # fmt: off
 *         return self.add(
 *             -years, -quarters, -months, -weeks, -days,             # <<<<<<<<<<<<<<
 *             -hours, -minutes, -seconds, -milliseconds,
 *             -microseconds, -nanoseconds
 */
  __pyx_t_3 = __Pyx_PyInt_From_int((-__pyx_v_years)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int((-__pyx_v_quarters)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_int((-__pyx_v_months)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyInt_From_int((-__pyx_v_weeks)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyInt_From_int((-__pyx_v_days)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "cytimes/pddt.py":4014
 *         return self.add(
 *             -years, -quarters, -months, -weeks, -days,
 *             -hours, -minutes, -seconds, -milliseconds,             # <<<<<<<<<<<<<<
 *             -microseconds, -nanoseconds
 *         )
 */
  __pyx_t_8 = __Pyx_PyInt_From_int((-__pyx_v_hours)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyInt_From_int((-__pyx_v_minutes)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyInt_From_int((-__pyx_v_seconds)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyInt_From_int((-__pyx_v_milliseconds)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);

  /* "cytimes/pddt.py":4015
 *             -years, -quarters, -months, -weeks, -days,
 *             -hours, -minutes, -seconds, -milliseconds,
 *             -microseconds, -nanoseconds             # <<<<<<<<<<<<<<
 *         )
 *         # fmt: on
 */
  __pyx_t_12 = __Pyx_PyInt_From_int((-__pyx_v_microseconds)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyInt_From_int((-__pyx_v_nanoseconds)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 4015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = NULL;
  __pyx_t_15 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_14)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_15 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[12] = {__pyx_t_14, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_15, 11+__pyx_t_15);
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4012, __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;

  /* "cytimes/pddt.py":3983
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def sub(             # <<<<<<<<<<<<<<
 *         self,
 *         years: cython.int = 0,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":4019
 *         # fmt: on
 * 
 *     def diff(             # <<<<<<<<<<<<<<
 *         self,
 *         data: object,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_237diff(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_236diff, "Calculate the difference between the instance and\n        another datetime-like data `<'np.ndarray[int64]'>`.\n\n        The differences are computed in the specified datetime 'unit'\n        and adjusted based on the 'inclusive' argument to determine\n        the inclusivity of the start and end times.\n\n        :param data `<'object'>`: Datetime-like data.\n            - `<'Array-Like'>` An array-like object containing datetime information.\n            - `<'str'>` A datetime string containing datetime information.\n            - `<'datetime.datetime'>` An instance of `datetime.datetime`.\n            - `<'datetime.date'>` An instance of `datetime.date` (time fields set to 0).\n            - `<'np.datetime64'>` An instance of `np.datetime64`.\n            - `<'None'>` Current datetime with the same timezone of the instance.\n\n        :param unit `<'str'>`: The datetime unit for calculating the difference.\n            Supports: 'Y', 'Q', 'M', 'W', 'D', 'h', 'm', 's', 'ms', 'us', 'ns'\n\n        :param absolute `<'bool'>`: If 'True', compute the absolute difference, defaults to `False`.\n\n        :param inclusive `<'str'>`: Specifies the inclusivity of the start and end times, defaults to `'both'`.\n            - `'one'`: Include either the start or end time.\n            - `'both'`: Include both the start and end times.\n            - `'neither'`: Exclude both the start and end times.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_237diff = {"diff", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_237diff, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_236diff};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_237diff(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_unit = 0;
  int __pyx_v_absolute;
  PyObject *__pyx_v_inclusive = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("diff (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,&__pyx_n_s_unit,&__pyx_n_s_absolute,&__pyx_n_s_inclusive,0};
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)((PyObject*)__pyx_n_u_both)));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4019, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4019, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("diff", 0, 3, 5, 1); __PYX_ERR(0, 4019, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unit)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4019, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("diff", 0, 3, 5, 2); __PYX_ERR(0, 4019, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_absolute);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4019, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_inclusive);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4019, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "diff") < 0)) __PYX_ERR(0, 4019, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_data = values[1];
    __pyx_v_unit = ((PyObject*)values[2]);
    if (values[3]) {
      __pyx_v_absolute = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_absolute == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4023, __pyx_L3_error)
    } else {

      /* "cytimes/pddt.py":4023
 *         data: object,
 *         unit: str,
 *         absolute: cython.bint = False,             # <<<<<<<<<<<<<<
 *         inclusive: str = "both",
 *     ) -> np.ndarray[np.int64]:
 */
      __pyx_v_absolute = ((int)((int)0));
    }
    __pyx_v_inclusive = ((PyObject*)values[4]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("diff", 0, 3, 5, __pyx_nargs); __PYX_ERR(0, 4019, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.diff", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unit), (&PyUnicode_Type), 0, "unit", 1))) __PYX_ERR(0, 4022, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_inclusive), (&PyUnicode_Type), 0, "inclusive", 1))) __PYX_ERR(0, 4024, __pyx_L1_error)
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_236diff(__pyx_self, __pyx_v_self, __pyx_v_data, __pyx_v_unit, __pyx_v_absolute, __pyx_v_inclusive);

  /* "cytimes/pddt.py":4019
 *         # fmt: on
 * 
 *     def diff(             # <<<<<<<<<<<<<<
 *         self,
 *         data: object,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_236diff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_unit, int __pyx_v_absolute, PyObject *__pyx_v_inclusive) {
  PyArrayObject *__pyx_v_my_arr = 0;
  PyObject *__pyx_v_my_unit = 0;
  PyObject *__pyx_v_my_tz = NULL;
  Py_ssize_t __pyx_v_arr_size;
  PyObject *__pyx_v_pt = NULL;
  PyArrayObject *__pyx_v_pt_arr = 0;
  PyObject *__pyx_v_pt_unit = 0;
  PyObject *__pyx_v_pt_tz = NULL;
  int __pyx_v_my_unit_int;
  int __pyx_v_pt_unit_int;
  int __pyx_v_incl_off;
  PyArrayObject *__pyx_v_arr = NULL;
  npy_int64 __pyx_v_i;
  npy_int64 *__pyx_v_arr_ptr;
  npy_int64 __pyx_v_val;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  struct __pyx_opt_args_7cytimes_4pddt__raise_incomparable_error __pyx_t_11;
  int __pyx_t_12;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 __pyx_t_13;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_iso_W __pyx_t_14;
  struct __pyx_opt_args_7cytimes_5utils_arr_abs __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  npy_int64 __pyx_t_17;
  npy_int64 __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("diff", 1);

  /* "cytimes/pddt.py":4052
 *         """
 *         # Access 'my' datetime array & info
 *         my_arr: np.ndarray = self.values             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 *         my_tz = self.tzinfo
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4052, __pyx_L1_error)
  __pyx_v_my_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":4053
 *         # Access 'my' datetime array & info
 *         my_arr: np.ndarray = self.values
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 *         my_tz = self.tzinfo
 *         arr_size: cython.Py_ssize_t = my_arr.shape[0]
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 4053, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":4054
 *         my_arr: np.ndarray = self.values
 *         my_unit: str = self.unit
 *         my_tz = self.tzinfo             # <<<<<<<<<<<<<<
 *         arr_size: cython.Py_ssize_t = my_arr.shape[0]
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4054, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_my_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":4055
 *         my_unit: str = self.unit
 *         my_tz = self.tzinfo
 *         arr_size: cython.Py_ssize_t = my_arr.shape[0]             # <<<<<<<<<<<<<<
 * 
 *         # Parse dtobjs to Pddt
 */
  __pyx_v_arr_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_my_arr)[0]);

  /* "cytimes/pddt.py":4058
 * 
 *         # Parse dtobjs to Pddt
 *         if data is None:             # <<<<<<<<<<<<<<
 *             pt = self.now(my_tz, arr_size)
 *         elif isinstance(data, (str, datetime.date, np.datetime64)):
 */
  __pyx_t_2 = (__pyx_v_data == Py_None);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":4059
 *         # Parse dtobjs to Pddt
 *         if data is None:
 *             pt = self.now(my_tz, arr_size)             # <<<<<<<<<<<<<<
 *         elif isinstance(data, (str, datetime.date, np.datetime64)):
 *             pt = Pddt([data])
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_now); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4059, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_arr_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4059, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_my_tz, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4059, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_v_pt = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":4058
 * 
 *         # Parse dtobjs to Pddt
 *         if data is None:             # <<<<<<<<<<<<<<
 *             pt = self.now(my_tz, arr_size)
 *         elif isinstance(data, (str, datetime.date, np.datetime64)):
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":4060
 *         if data is None:
 *             pt = self.now(my_tz, arr_size)
 *         elif isinstance(data, (str, datetime.date, np.datetime64)):             # <<<<<<<<<<<<<<
 *             pt = Pddt([data])
 *         elif isinstance(data, Pddt):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_datetime64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = PyUnicode_Check(__pyx_v_data); 
  if (!__pyx_t_7) {
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_7 = __Pyx_TypeCheck(__pyx_v_data, __pyx_ptype_7cpython_8datetime_date); 
  if (!__pyx_t_7) {
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_7 = PyObject_IsInstance(__pyx_v_data, __pyx_t_3); 
  __pyx_t_2 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":4061
 *             pt = self.now(my_tz, arr_size)
 *         elif isinstance(data, (str, datetime.date, np.datetime64)):
 *             pt = Pddt([data])             # <<<<<<<<<<<<<<
 *         elif isinstance(data, Pddt):
 *             pt = data
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Pddt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_data)) __PYX_ERR(0, 4061, __pyx_L1_error);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __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(0, 4061, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_v_pt = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":4060
 *         if data is None:
 *             pt = self.now(my_tz, arr_size)
 *         elif isinstance(data, (str, datetime.date, np.datetime64)):             # <<<<<<<<<<<<<<
 *             pt = Pddt([data])
 *         elif isinstance(data, Pddt):
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":4062
 *         elif isinstance(data, (str, datetime.date, np.datetime64)):
 *             pt = Pddt([data])
 *         elif isinstance(data, Pddt):             # <<<<<<<<<<<<<<
 *             pt = data
 *         else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Pddt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_data, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4062, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":4063
 *             pt = Pddt([data])
 *         elif isinstance(data, Pddt):
 *             pt = data             # <<<<<<<<<<<<<<
 *         else:
 *             pt = Pddt(data)
 */
    __Pyx_INCREF(__pyx_v_data);
    __pyx_v_pt = __pyx_v_data;

    /* "cytimes/pddt.py":4062
 *         elif isinstance(data, (str, datetime.date, np.datetime64)):
 *             pt = Pddt([data])
 *         elif isinstance(data, Pddt):             # <<<<<<<<<<<<<<
 *             pt = data
 *         else:
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":4065
 *             pt = data
 *         else:
 *             pt = Pddt(data)             # <<<<<<<<<<<<<<
 * 
 *         # Access 'pt' datetime array & info
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Pddt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4065, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_data};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4065, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_v_pt = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "cytimes/pddt.py":4068
 * 
 *         # Access 'pt' datetime array & info
 *         pt_arr: np.ndarray = pt.values             # <<<<<<<<<<<<<<
 *         pt_unit: str = pt.unit
 *         pt_tz = pt.tzinfo
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4068, __pyx_L1_error)
  __pyx_v_pt_arr = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":4069
 *         # Access 'pt' datetime array & info
 *         pt_arr: np.ndarray = pt.values
 *         pt_unit: str = pt.unit             # <<<<<<<<<<<<<<
 *         pt_tz = pt.tzinfo
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt, __pyx_n_s_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_3))) __PYX_ERR(0, 4069, __pyx_L1_error)
  __pyx_v_pt_unit = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":4070
 *         pt_arr: np.ndarray = pt.values
 *         pt_unit: str = pt.unit
 *         pt_tz = pt.tzinfo             # <<<<<<<<<<<<<<
 * 
 *         # Validate two arrays
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_pt_tz = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":4074
 *         # Validate two arrays
 *         # . shape
 *         if arr_size != pt_arr.shape[0]:             # <<<<<<<<<<<<<<
 *             raise errors.IncomparableError(
 *                 "cannot compare between arrays with different shapes ['%d' vs '%d']."
 */
  __pyx_t_2 = (__pyx_v_arr_size != (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_pt_arr)[0]));
  if (unlikely(__pyx_t_2)) {

    /* "cytimes/pddt.py":4075
 *         # . shape
 *         if arr_size != pt_arr.shape[0]:
 *             raise errors.IncomparableError(             # <<<<<<<<<<<<<<
 *                 "cannot compare between arrays with different shapes ['%d' vs '%d']."
 *                 % (arr_size, pt_arr.shape[0])
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_errors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4075, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_IncomparableError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4075, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/pddt.py":4076
 *         if arr_size != pt_arr.shape[0]:
 *             raise errors.IncomparableError(
 *                 "cannot compare between arrays with different shapes ['%d' vs '%d']."             # <<<<<<<<<<<<<<
 *                 % (arr_size, pt_arr.shape[0])
 *             )
 */
    __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = 0;
    __pyx_t_9 = 127;
    __Pyx_INCREF(__pyx_kp_u_cannot_compare_between_arrays_wi);
    __pyx_t_8 += 54;
    __Pyx_GIVEREF(__pyx_kp_u_cannot_compare_between_arrays_wi);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_cannot_compare_between_arrays_wi);

    /* "cytimes/pddt.py":4077
 *             raise errors.IncomparableError(
 *                 "cannot compare between arrays with different shapes ['%d' vs '%d']."
 *                 % (arr_size, pt_arr.shape[0])             # <<<<<<<<<<<<<<
 *             )
 *         # . tzinfo
 */
    __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_arr_size, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4077, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u_vs);
    __pyx_t_8 += 6;
    __Pyx_GIVEREF(__pyx_kp_u_vs);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_vs);
    __pyx_t_5 = __Pyx_PyInt_From_npy_intp((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_pt_arr)[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4077, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_IntOrLong(__pyx_t_5), __pyx_n_u_d); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4077, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_kp_u__43);
    __pyx_t_8 += 3;
    __Pyx_GIVEREF(__pyx_kp_u__43);
    PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__43);

    /* "cytimes/pddt.py":4076
 *         if arr_size != pt_arr.shape[0]:
 *             raise errors.IncomparableError(
 *                 "cannot compare between arrays with different shapes ['%d' vs '%d']."             # <<<<<<<<<<<<<<
 *                 % (arr_size, pt_arr.shape[0])
 *             )
 */
    __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_10};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4075, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 4075, __pyx_L1_error)

    /* "cytimes/pddt.py":4074
 *         # Validate two arrays
 *         # . shape
 *         if arr_size != pt_arr.shape[0]:             # <<<<<<<<<<<<<<
 *             raise errors.IncomparableError(
 *                 "cannot compare between arrays with different shapes ['%d' vs '%d']."
 */
  }

  /* "cytimes/pddt.py":4080
 *             )
 *         # . tzinfo
 *         if my_tz is not pt_tz and (my_tz is None or pt_tz is None):             # <<<<<<<<<<<<<<
 *             _raise_incomparable_error(self, pt, "calcuate average")
 *         # . unit
 */
  __pyx_t_7 = (__pyx_v_my_tz != __pyx_v_pt_tz);
  if (__pyx_t_7) {
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_my_tz == Py_None);
  if (!__pyx_t_7) {
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_pt_tz == Py_None);
  __pyx_t_2 = __pyx_t_7;
  __pyx_L9_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":4081
 *         # . tzinfo
 *         if my_tz is not pt_tz and (my_tz is None or pt_tz is None):
 *             _raise_incomparable_error(self, pt, "calcuate average")             # <<<<<<<<<<<<<<
 *         # . unit
 *         my_unit_int = utils.map_nptime_unit_str2int(my_unit)
 */
    __pyx_t_11.__pyx_n = 1;
    __pyx_t_11.desc = __pyx_kp_u_calcuate_average;
    __pyx_t_2 = __pyx_f_7cytimes_4pddt__raise_incomparable_error(__pyx_v_self, __pyx_v_pt, &__pyx_t_11); if (unlikely(__pyx_t_2 == ((int)-2))) __PYX_ERR(0, 4081, __pyx_L1_error)

    /* "cytimes/pddt.py":4080
 *             )
 *         # . tzinfo
 *         if my_tz is not pt_tz and (my_tz is None or pt_tz is None):             # <<<<<<<<<<<<<<
 *             _raise_incomparable_error(self, pt, "calcuate average")
 *         # . unit
 */
  }

  /* "cytimes/pddt.py":4083
 *             _raise_incomparable_error(self, pt, "calcuate average")
 *         # . unit
 *         my_unit_int = utils.map_nptime_unit_str2int(my_unit)             # <<<<<<<<<<<<<<
 *         pt_unit_int = utils.map_nptime_unit_str2int(pt_unit)
 *         if my_unit_int != pt_unit_int:
 */
  __pyx_t_12 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_my_unit); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 4083, __pyx_L1_error)
  __pyx_v_my_unit_int = __pyx_t_12;

  /* "cytimes/pddt.py":4084
 *         # . unit
 *         my_unit_int = utils.map_nptime_unit_str2int(my_unit)
 *         pt_unit_int = utils.map_nptime_unit_str2int(pt_unit)             # <<<<<<<<<<<<<<
 *         if my_unit_int != pt_unit_int:
 *             # Cast to lower resolution
 */
  __pyx_t_12 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_pt_unit); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 4084, __pyx_L1_error)
  __pyx_v_pt_unit_int = __pyx_t_12;

  /* "cytimes/pddt.py":4085
 *         my_unit_int = utils.map_nptime_unit_str2int(my_unit)
 *         pt_unit_int = utils.map_nptime_unit_str2int(pt_unit)
 *         if my_unit_int != pt_unit_int:             # <<<<<<<<<<<<<<
 *             # Cast to lower resolution
 *             if my_unit_int < pt_unit_int:
 */
  __pyx_t_2 = (__pyx_v_my_unit_int != __pyx_v_pt_unit_int);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":4087
 *         if my_unit_int != pt_unit_int:
 *             # Cast to lower resolution
 *             if my_unit_int < pt_unit_int:             # <<<<<<<<<<<<<<
 *                 pt_arr = utils.dt64arr_as_int64(pt_arr, my_unit, pt_unit)  # int64
 *             else:
 */
    __pyx_t_2 = (__pyx_v_my_unit_int < __pyx_v_pt_unit_int);
    if (__pyx_t_2) {

      /* "cytimes/pddt.py":4088
 *             # Cast to lower resolution
 *             if my_unit_int < pt_unit_int:
 *                 pt_arr = utils.dt64arr_as_int64(pt_arr, my_unit, pt_unit)  # int64             # <<<<<<<<<<<<<<
 *             else:
 *                 my_arr = utils.dt64arr_as_int64(my_arr, pt_unit, my_unit)  # int64
 */
      __pyx_t_13.__pyx_n = 1;
      __pyx_t_13.arr_unit = __pyx_v_pt_unit;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_pt_arr, __pyx_v_my_unit, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4088, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_pt_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/pddt.py":4087
 *         if my_unit_int != pt_unit_int:
 *             # Cast to lower resolution
 *             if my_unit_int < pt_unit_int:             # <<<<<<<<<<<<<<
 *                 pt_arr = utils.dt64arr_as_int64(pt_arr, my_unit, pt_unit)  # int64
 *             else:
 */
      goto __pyx_L13;
    }

    /* "cytimes/pddt.py":4090
 *                 pt_arr = utils.dt64arr_as_int64(pt_arr, my_unit, pt_unit)  # int64
 *             else:
 *                 my_arr = utils.dt64arr_as_int64(my_arr, pt_unit, my_unit)  # int64             # <<<<<<<<<<<<<<
 *                 my_unit = pt_unit  # change my_unit to pt_unit
 * 
 */
    /*else*/ {
      __pyx_t_13.__pyx_n = 1;
      __pyx_t_13.arr_unit = __pyx_v_my_unit;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_my_arr, __pyx_v_pt_unit, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4090, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_my_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/pddt.py":4091
 *             else:
 *                 my_arr = utils.dt64arr_as_int64(my_arr, pt_unit, my_unit)  # int64
 *                 my_unit = pt_unit  # change my_unit to pt_unit             # <<<<<<<<<<<<<<
 * 
 *         # Handle inclusive
 */
      __Pyx_INCREF(__pyx_v_pt_unit);
      __Pyx_DECREF_SET(__pyx_v_my_unit, __pyx_v_pt_unit);
    }
    __pyx_L13:;

    /* "cytimes/pddt.py":4085
 *         my_unit_int = utils.map_nptime_unit_str2int(my_unit)
 *         pt_unit_int = utils.map_nptime_unit_str2int(pt_unit)
 *         if my_unit_int != pt_unit_int:             # <<<<<<<<<<<<<<
 *             # Cast to lower resolution
 *             if my_unit_int < pt_unit_int:
 */
  }

  /* "cytimes/pddt.py":4094
 * 
 *         # Handle inclusive
 *         if inclusive == "both":             # <<<<<<<<<<<<<<
 *             incl_off: cython.int = 1
 *         elif inclusive == "one":
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_inclusive, __pyx_n_u_both, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 4094, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":4095
 *         # Handle inclusive
 *         if inclusive == "both":
 *             incl_off: cython.int = 1             # <<<<<<<<<<<<<<
 *         elif inclusive == "one":
 *             incl_off: cython.int = 0
 */
    __pyx_v_incl_off = 1;

    /* "cytimes/pddt.py":4094
 * 
 *         # Handle inclusive
 *         if inclusive == "both":             # <<<<<<<<<<<<<<
 *             incl_off: cython.int = 1
 *         elif inclusive == "one":
 */
    goto __pyx_L14;
  }

  /* "cytimes/pddt.py":4096
 *         if inclusive == "both":
 *             incl_off: cython.int = 1
 *         elif inclusive == "one":             # <<<<<<<<<<<<<<
 *             incl_off: cython.int = 0
 *         elif inclusive == "neither":
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_inclusive, __pyx_n_u_one, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 4096, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":4097
 *             incl_off: cython.int = 1
 *         elif inclusive == "one":
 *             incl_off: cython.int = 0             # <<<<<<<<<<<<<<
 *         elif inclusive == "neither":
 *             incl_off: cython.int = -1
 */
    __pyx_v_incl_off = 0;

    /* "cytimes/pddt.py":4096
 *         if inclusive == "both":
 *             incl_off: cython.int = 1
 *         elif inclusive == "one":             # <<<<<<<<<<<<<<
 *             incl_off: cython.int = 0
 *         elif inclusive == "neither":
 */
    goto __pyx_L14;
  }

  /* "cytimes/pddt.py":4098
 *         elif inclusive == "one":
 *             incl_off: cython.int = 0
 *         elif inclusive == "neither":             # <<<<<<<<<<<<<<
 *             incl_off: cython.int = -1
 *         else:
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_inclusive, __pyx_n_u_neither, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 4098, __pyx_L1_error)
  if (likely(__pyx_t_2)) {

    /* "cytimes/pddt.py":4099
 *             incl_off: cython.int = 0
 *         elif inclusive == "neither":
 *             incl_off: cython.int = -1             # <<<<<<<<<<<<<<
 *         else:
 *             raise errors.InvalidArgumentError(
 */
    __pyx_v_incl_off = -1;

    /* "cytimes/pddt.py":4098
 *         elif inclusive == "one":
 *             incl_off: cython.int = 0
 *         elif inclusive == "neither":             # <<<<<<<<<<<<<<
 *             incl_off: cython.int = -1
 *         else:
 */
    goto __pyx_L14;
  }

  /* "cytimes/pddt.py":4101
 *             incl_off: cython.int = -1
 *         else:
 *             raise errors.InvalidArgumentError(             # <<<<<<<<<<<<<<
 *                 "invalid input '%s' for inclusive.\n"
 *                 "Supports: ['one', 'both', 'neither']." % inclusive
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cytimes/pddt.py":4103
 *             raise errors.InvalidArgumentError(
 *                 "invalid input '%s' for inclusive.\n"
 *                 "Supports: ['one', 'both', 'neither']." % inclusive             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_invalid_input_s_for_inclusive_Su, __pyx_v_inclusive); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_4};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4101, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 4101, __pyx_L1_error)
  }
  __pyx_L14:;

  /* "cytimes/pddt.py":4107
 * 
 *         # Calculate difference
 *         if unit == "W":             # <<<<<<<<<<<<<<
 *             my_arr = utils.dt64arr_as_iso_W(my_arr, 1, my_unit)  # int64[W]
 *             pt_arr = utils.dt64arr_as_iso_W(pt_arr, 1, my_unit)  # int64[W]
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_W, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 4107, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":4108
 *         # Calculate difference
 *         if unit == "W":
 *             my_arr = utils.dt64arr_as_iso_W(my_arr, 1, my_unit)  # int64[W]             # <<<<<<<<<<<<<<
 *             pt_arr = utils.dt64arr_as_iso_W(pt_arr, 1, my_unit)  # int64[W]
 *         else:
 */
    __pyx_t_14.__pyx_n = 1;
    __pyx_t_14.arr_unit = __pyx_v_my_unit;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_iso_W(__pyx_v_my_arr, 1, &__pyx_t_14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_my_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":4109
 *         if unit == "W":
 *             my_arr = utils.dt64arr_as_iso_W(my_arr, 1, my_unit)  # int64[W]
 *             pt_arr = utils.dt64arr_as_iso_W(pt_arr, 1, my_unit)  # int64[W]             # <<<<<<<<<<<<<<
 *         else:
 *             my_arr = utils.dt64arr_as_int64(my_arr, unit, my_unit)  # int64[unit]
 */
    __pyx_t_14.__pyx_n = 1;
    __pyx_t_14.arr_unit = __pyx_v_my_unit;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_iso_W(__pyx_v_pt_arr, 1, &__pyx_t_14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_pt_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":4107
 * 
 *         # Calculate difference
 *         if unit == "W":             # <<<<<<<<<<<<<<
 *             my_arr = utils.dt64arr_as_iso_W(my_arr, 1, my_unit)  # int64[W]
 *             pt_arr = utils.dt64arr_as_iso_W(pt_arr, 1, my_unit)  # int64[W]
 */
    goto __pyx_L15;
  }

  /* "cytimes/pddt.py":4111
 *             pt_arr = utils.dt64arr_as_iso_W(pt_arr, 1, my_unit)  # int64[W]
 *         else:
 *             my_arr = utils.dt64arr_as_int64(my_arr, unit, my_unit)  # int64[unit]             # <<<<<<<<<<<<<<
 *             pt_arr = utils.dt64arr_as_int64(pt_arr, unit, my_unit)  # int64[unit]
 *         arr = utils.arr_sub_arr(my_arr, pt_arr)
 */
  /*else*/ {
    __pyx_t_13.__pyx_n = 1;
    __pyx_t_13.arr_unit = __pyx_v_my_unit;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_my_arr, __pyx_v_unit, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_my_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":4112
 *         else:
 *             my_arr = utils.dt64arr_as_int64(my_arr, unit, my_unit)  # int64[unit]
 *             pt_arr = utils.dt64arr_as_int64(pt_arr, unit, my_unit)  # int64[unit]             # <<<<<<<<<<<<<<
 *         arr = utils.arr_sub_arr(my_arr, pt_arr)
 *         # . absolute = True
 */
    __pyx_t_13.__pyx_n = 1;
    __pyx_t_13.arr_unit = __pyx_v_my_unit;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_pt_arr, __pyx_v_unit, &__pyx_t_13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_pt_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;
  }
  __pyx_L15:;

  /* "cytimes/pddt.py":4113
 *             my_arr = utils.dt64arr_as_int64(my_arr, unit, my_unit)  # int64[unit]
 *             pt_arr = utils.dt64arr_as_int64(pt_arr, unit, my_unit)  # int64[unit]
 *         arr = utils.arr_sub_arr(my_arr, pt_arr)             # <<<<<<<<<<<<<<
 *         # . absolute = True
 *         if absolute:
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_sub_arr(__pyx_v_my_arr, __pyx_v_pt_arr, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":4115
 *         arr = utils.arr_sub_arr(my_arr, pt_arr)
 *         # . absolute = True
 *         if absolute:             # <<<<<<<<<<<<<<
 *             arr = utils.arr_abs(arr, incl_off)
 *         # . absolute = False | adj offset
 */
  if (__pyx_v_absolute) {

    /* "cytimes/pddt.py":4116
 *         # . absolute = True
 *         if absolute:
 *             arr = utils.arr_abs(arr, incl_off)             # <<<<<<<<<<<<<<
 *         # . absolute = False | adj offset
 *         elif incl_off != 0:
 */
    __pyx_t_15.__pyx_n = 1;
    __pyx_t_15.offset = __pyx_v_incl_off;
    __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_abs(__pyx_v_arr, &__pyx_t_15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":4115
 *         arr = utils.arr_sub_arr(my_arr, pt_arr)
 *         # . absolute = True
 *         if absolute:             # <<<<<<<<<<<<<<
 *             arr = utils.arr_abs(arr, incl_off)
 *         # . absolute = False | adj offset
 */
    goto __pyx_L16;
  }

  /* "cytimes/pddt.py":4118
 *             arr = utils.arr_abs(arr, incl_off)
 *         # . absolute = False | adj offset
 *         elif incl_off != 0:             # <<<<<<<<<<<<<<
 *             i: np.npy_int64
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 */
  __pyx_t_2 = (__pyx_v_incl_off != 0);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":4120
 *         elif incl_off != 0:
 *             i: np.npy_int64
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))             # <<<<<<<<<<<<<<
 *             for i in range(arr_size):
 *                 val: np.npy_int64 = arr_ptr[i]
 */
    __pyx_v_arr_ptr = ((npy_int64 *)PyArray_DATA(__pyx_v_arr));

    /* "cytimes/pddt.py":4121
 *             i: np.npy_int64
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 *             for i in range(arr_size):             # <<<<<<<<<<<<<<
 *                 val: np.npy_int64 = arr_ptr[i]
 *                 arr_ptr[i] = val - incl_off if val < 0 else val + incl_off
 */
    __pyx_t_8 = __pyx_v_arr_size;
    __pyx_t_16 = __pyx_t_8;
    for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
      __pyx_v_i = __pyx_t_17;

      /* "cytimes/pddt.py":4122
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 *             for i in range(arr_size):
 *                 val: np.npy_int64 = arr_ptr[i]             # <<<<<<<<<<<<<<
 *                 arr_ptr[i] = val - incl_off if val < 0 else val + incl_off
 *         return Index(arr, name="diff")
 */
      __pyx_v_val = (__pyx_v_arr_ptr[__pyx_v_i]);

      /* "cytimes/pddt.py":4123
 *             for i in range(arr_size):
 *                 val: np.npy_int64 = arr_ptr[i]
 *                 arr_ptr[i] = val - incl_off if val < 0 else val + incl_off             # <<<<<<<<<<<<<<
 *         return Index(arr, name="diff")
 * 
 */
      __pyx_t_2 = (__pyx_v_val < 0);
      if (__pyx_t_2) {
        __pyx_t_18 = (__pyx_v_val - __pyx_v_incl_off);
      } else {
        __pyx_t_18 = (__pyx_v_val + __pyx_v_incl_off);
      }
      (__pyx_v_arr_ptr[__pyx_v_i]) = __pyx_t_18;
    }

    /* "cytimes/pddt.py":4118
 *             arr = utils.arr_abs(arr, incl_off)
 *         # . absolute = False | adj offset
 *         elif incl_off != 0:             # <<<<<<<<<<<<<<
 *             i: np.npy_int64
 *             arr_ptr = cython.cast(cython.pointer(np.npy_int64), np.PyArray_DATA(arr))
 */
  }
  __pyx_L16:;

  /* "cytimes/pddt.py":4124
 *                 val: np.npy_int64 = arr_ptr[i]
 *                 arr_ptr[i] = val - incl_off if val < 0 else val + incl_off
 *         return Index(arr, name="diff")             # <<<<<<<<<<<<<<
 * 
 *     # Comparison ---------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(0, 4124, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_name, __pyx_n_u_diff) < 0) __PYX_ERR(0, 4124, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":4019
 *         # fmt: on
 * 
 *     def diff(             # <<<<<<<<<<<<<<
 *         self,
 *         data: object,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.diff", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_my_arr);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF(__pyx_v_my_tz);
  __Pyx_XDECREF(__pyx_v_pt);
  __Pyx_XDECREF((PyObject *)__pyx_v_pt_arr);
  __Pyx_XDECREF(__pyx_v_pt_unit);
  __Pyx_XDECREF(__pyx_v_pt_tz);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":4127
 * 
 *     # Comparison ---------------------------------------------------------------------------
 *     def is_past(self) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the datetimes are in the past `<'Index[bool]'>`."""
 *         # Access datetime array & info
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_239is_past(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_238is_past, "Determine if the datetimes are in the past `<'Index[bool]'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_239is_past = {"is_past", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_239is_past, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_238is_past};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_239is_past(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_past (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4127, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_past") < 0)) __PYX_ERR(0, 4127, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_past", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4127, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.is_past", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_238is_past(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_238is_past(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_my_tz = NULL;
  PyObject *__pyx_v_my_unit = 0;
  Py_UCS4 __pyx_v_my_unit_ch;
  PyDateTime_DateTime *__pyx_v_dt = NULL;
  PY_LONG_LONG __pyx_v_dt_val;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt_now __pyx_t_2;
  PY_LONG_LONG __pyx_t_3;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_us __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_past", 1);

  /* "cytimes/pddt.py":4130
 *         """Determine if the datetimes are in the past `<'Index[bool]'>`."""
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values             # <<<<<<<<<<<<<<
 *         my_tz = self.tzinfo
 *         my_unit: str = self.unit
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4130, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":4131
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values
 *         my_tz = self.tzinfo             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 *         my_unit_ch: cython.Py_UCS4 = str_read(my_unit, 0)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_my_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":4132
 *         arr: np.ndarray = self.values
 *         my_tz = self.tzinfo
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 *         my_unit_ch: cython.Py_UCS4 = str_read(my_unit, 0)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 4132, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":4133
 *         my_tz = self.tzinfo
 *         my_unit: str = self.unit
 *         my_unit_ch: cython.Py_UCS4 = str_read(my_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *         # Generate current datetime
 */
  __pyx_v_my_unit_ch = PyUnicode_READ_CHAR(__pyx_v_my_unit, 0);

  /* "cytimes/pddt.py":4136
 * 
 *         # Generate current datetime
 *         dt = utils.dt_now(my_tz)             # <<<<<<<<<<<<<<
 *         dt_val: cython.longlong = utils.dt_to_us(dt, True)
 *         if my_unit_ch == "n":
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.tz = __pyx_v_my_tz;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_now(&__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dt = ((PyDateTime_DateTime *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":4137
 *         # Generate current datetime
 *         dt = utils.dt_now(my_tz)
 *         dt_val: cython.longlong = utils.dt_to_us(dt, True)             # <<<<<<<<<<<<<<
 *         if my_unit_ch == "n":
 *             dt_val *= utils.NS_MICROSECOND
 */
  __pyx_t_4.__pyx_n = 1;
  __pyx_t_4.utc = 1;
  __pyx_t_3 = __pyx_f_7cytimes_5utils_dt_to_us(__pyx_v_dt, &__pyx_t_4); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 4137, __pyx_L1_error)
  __pyx_v_dt_val = __pyx_t_3;

  /* "cytimes/pddt.py":4138
 *         dt = utils.dt_now(my_tz)
 *         dt_val: cython.longlong = utils.dt_to_us(dt, True)
 *         if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *             dt_val *= utils.NS_MICROSECOND
 *         elif my_unit_ch == "m":
 */
  switch (__pyx_v_my_unit_ch) {
    case 0x6E:

    /* "cytimes/pddt.py":4139
 *         dt_val: cython.longlong = utils.dt_to_us(dt, True)
 *         if my_unit_ch == "n":
 *             dt_val *= utils.NS_MICROSECOND             # <<<<<<<<<<<<<<
 *         elif my_unit_ch == "m":
 *             dt_val = utils.math_floor_div(dt_val, utils.US_MILLISECOND)
 */
    __pyx_v_dt_val = (__pyx_v_dt_val * __pyx_v_7cytimes_5utils_NS_MICROSECOND);

    /* "cytimes/pddt.py":4138
 *         dt = utils.dt_now(my_tz)
 *         dt_val: cython.longlong = utils.dt_to_us(dt, True)
 *         if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *             dt_val *= utils.NS_MICROSECOND
 *         elif my_unit_ch == "m":
 */
    break;
    case 0x6D:

    /* "cytimes/pddt.py":4141
 *             dt_val *= utils.NS_MICROSECOND
 *         elif my_unit_ch == "m":
 *             dt_val = utils.math_floor_div(dt_val, utils.US_MILLISECOND)             # <<<<<<<<<<<<<<
 *         elif my_unit_ch == "s":
 *             dt_val = utils.math_floor_div(dt_val, utils.US_SECOND)
 */
    __pyx_t_3 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_dt_val, __pyx_v_7cytimes_5utils_US_MILLISECOND, NULL); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 4141, __pyx_L1_error)
    __pyx_v_dt_val = __pyx_t_3;

    /* "cytimes/pddt.py":4140
 *         if my_unit_ch == "n":
 *             dt_val *= utils.NS_MICROSECOND
 *         elif my_unit_ch == "m":             # <<<<<<<<<<<<<<
 *             dt_val = utils.math_floor_div(dt_val, utils.US_MILLISECOND)
 *         elif my_unit_ch == "s":
 */
    break;
    case 0x73:

    /* "cytimes/pddt.py":4143
 *             dt_val = utils.math_floor_div(dt_val, utils.US_MILLISECOND)
 *         elif my_unit_ch == "s":
 *             dt_val = utils.math_floor_div(dt_val, utils.US_SECOND)             # <<<<<<<<<<<<<<
 * 
 *         # Compare
 */
    __pyx_t_3 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_dt_val, __pyx_v_7cytimes_5utils_US_SECOND, NULL); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 4143, __pyx_L1_error)
    __pyx_v_dt_val = __pyx_t_3;

    /* "cytimes/pddt.py":4142
 *         elif my_unit_ch == "m":
 *             dt_val = utils.math_floor_div(dt_val, utils.US_MILLISECOND)
 *         elif my_unit_ch == "s":             # <<<<<<<<<<<<<<
 *             dt_val = utils.math_floor_div(dt_val, utils.US_SECOND)
 * 
 */
    break;
    default: break;
  }

  /* "cytimes/pddt.py":4146
 * 
 *         # Compare
 *         arr = utils.arr_less_than(arr, dt_val)             # <<<<<<<<<<<<<<
 *         return Index(arr, name="is_past")
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_less_than(__pyx_v_arr, __pyx_v_dt_val)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":4147
 *         # Compare
 *         arr = utils.arr_less_than(arr, dt_val)
 *         return Index(arr, name="is_past")             # <<<<<<<<<<<<<<
 * 
 *     def is_future(self) -> Index[bool]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(0, 4147, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_name, __pyx_n_u_is_past) < 0) __PYX_ERR(0, 4147, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":4127
 * 
 *     # Comparison ---------------------------------------------------------------------------
 *     def is_past(self) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the datetimes are in the past `<'Index[bool]'>`."""
 *         # Access datetime array & info
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.is_past", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_my_tz);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_dt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":4149
 *         return Index(arr, name="is_past")
 * 
 *     def is_future(self) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the datetimes are in the future `<'Index[bool]'>`."""
 *         # Access datetime array & info
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_241is_future(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_240is_future, "Determine if the datetimes are in the future `<'Index[bool]'>`.");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_241is_future = {"is_future", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_241is_future, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_240is_future};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_241is_future(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_future (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4149, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_future") < 0)) __PYX_ERR(0, 4149, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_future", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4149, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.is_future", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_240is_future(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_240is_future(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_my_tz = NULL;
  PyObject *__pyx_v_my_unit = 0;
  Py_UCS4 __pyx_v_my_unit_ch;
  PyDateTime_DateTime *__pyx_v_dt = NULL;
  PY_LONG_LONG __pyx_v_dt_val;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_5utils_dt_now __pyx_t_2;
  PY_LONG_LONG __pyx_t_3;
  struct __pyx_opt_args_7cytimes_5utils_dt_to_us __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_future", 1);

  /* "cytimes/pddt.py":4152
 *         """Determine if the datetimes are in the future `<'Index[bool]'>`."""
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values             # <<<<<<<<<<<<<<
 *         my_tz = self.tzinfo
 *         my_unit: str = self.unit
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4152, __pyx_L1_error)
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":4153
 *         # Access datetime array & info
 *         arr: np.ndarray = self.values
 *         my_tz = self.tzinfo             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 *         my_unit_ch: cython.Py_UCS4 = str_read(my_unit, 0)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_my_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":4154
 *         arr: np.ndarray = self.values
 *         my_tz = self.tzinfo
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 *         my_unit_ch: cython.Py_UCS4 = str_read(my_unit, 0)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 4154, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":4155
 *         my_tz = self.tzinfo
 *         my_unit: str = self.unit
 *         my_unit_ch: cython.Py_UCS4 = str_read(my_unit, 0)             # <<<<<<<<<<<<<<
 * 
 *         # Generate current datetime
 */
  __pyx_v_my_unit_ch = PyUnicode_READ_CHAR(__pyx_v_my_unit, 0);

  /* "cytimes/pddt.py":4158
 * 
 *         # Generate current datetime
 *         dt = utils.dt_now(my_tz)             # <<<<<<<<<<<<<<
 *         dt_val: cython.longlong = utils.dt_to_us(dt, True)
 *         if my_unit_ch == "n":
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.tz = __pyx_v_my_tz;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_dt_now(&__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dt = ((PyDateTime_DateTime *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":4159
 *         # Generate current datetime
 *         dt = utils.dt_now(my_tz)
 *         dt_val: cython.longlong = utils.dt_to_us(dt, True)             # <<<<<<<<<<<<<<
 *         if my_unit_ch == "n":
 *             dt_val *= utils.NS_MICROSECOND
 */
  __pyx_t_4.__pyx_n = 1;
  __pyx_t_4.utc = 1;
  __pyx_t_3 = __pyx_f_7cytimes_5utils_dt_to_us(__pyx_v_dt, &__pyx_t_4); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 4159, __pyx_L1_error)
  __pyx_v_dt_val = __pyx_t_3;

  /* "cytimes/pddt.py":4160
 *         dt = utils.dt_now(my_tz)
 *         dt_val: cython.longlong = utils.dt_to_us(dt, True)
 *         if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *             dt_val *= utils.NS_MICROSECOND
 *         elif my_unit_ch == "m":
 */
  switch (__pyx_v_my_unit_ch) {
    case 0x6E:

    /* "cytimes/pddt.py":4161
 *         dt_val: cython.longlong = utils.dt_to_us(dt, True)
 *         if my_unit_ch == "n":
 *             dt_val *= utils.NS_MICROSECOND             # <<<<<<<<<<<<<<
 *         elif my_unit_ch == "m":
 *             dt_val = utils.math_floor_div(dt_val, utils.US_MILLISECOND)
 */
    __pyx_v_dt_val = (__pyx_v_dt_val * __pyx_v_7cytimes_5utils_NS_MICROSECOND);

    /* "cytimes/pddt.py":4160
 *         dt = utils.dt_now(my_tz)
 *         dt_val: cython.longlong = utils.dt_to_us(dt, True)
 *         if my_unit_ch == "n":             # <<<<<<<<<<<<<<
 *             dt_val *= utils.NS_MICROSECOND
 *         elif my_unit_ch == "m":
 */
    break;
    case 0x6D:

    /* "cytimes/pddt.py":4163
 *             dt_val *= utils.NS_MICROSECOND
 *         elif my_unit_ch == "m":
 *             dt_val = utils.math_floor_div(dt_val, utils.US_MILLISECOND)             # <<<<<<<<<<<<<<
 *         elif my_unit_ch == "s":
 *             dt_val = utils.math_floor_div(dt_val, utils.US_SECOND)
 */
    __pyx_t_3 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_dt_val, __pyx_v_7cytimes_5utils_US_MILLISECOND, NULL); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 4163, __pyx_L1_error)
    __pyx_v_dt_val = __pyx_t_3;

    /* "cytimes/pddt.py":4162
 *         if my_unit_ch == "n":
 *             dt_val *= utils.NS_MICROSECOND
 *         elif my_unit_ch == "m":             # <<<<<<<<<<<<<<
 *             dt_val = utils.math_floor_div(dt_val, utils.US_MILLISECOND)
 *         elif my_unit_ch == "s":
 */
    break;
    case 0x73:

    /* "cytimes/pddt.py":4165
 *             dt_val = utils.math_floor_div(dt_val, utils.US_MILLISECOND)
 *         elif my_unit_ch == "s":
 *             dt_val = utils.math_floor_div(dt_val, utils.US_SECOND)             # <<<<<<<<<<<<<<
 * 
 *         # Compare
 */
    __pyx_t_3 = __pyx_f_7cytimes_5utils_math_floor_div(__pyx_v_dt_val, __pyx_v_7cytimes_5utils_US_SECOND, NULL); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 4165, __pyx_L1_error)
    __pyx_v_dt_val = __pyx_t_3;

    /* "cytimes/pddt.py":4164
 *         elif my_unit_ch == "m":
 *             dt_val = utils.math_floor_div(dt_val, utils.US_MILLISECOND)
 *         elif my_unit_ch == "s":             # <<<<<<<<<<<<<<
 *             dt_val = utils.math_floor_div(dt_val, utils.US_SECOND)
 * 
 */
    break;
    default: break;
  }

  /* "cytimes/pddt.py":4168
 * 
 *         # Compare
 *         arr = utils.arr_greater_than(arr, dt_val)             # <<<<<<<<<<<<<<
 *         return Index(arr, name="is_future")
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_5utils_arr_greater_than(__pyx_v_arr, __pyx_v_dt_val)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":4169
 *         # Compare
 *         arr = utils.arr_greater_than(arr, dt_val)
 *         return Index(arr, name="is_future")             # <<<<<<<<<<<<<<
 * 
 *     def closest(self, data: object) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(0, 4169, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_name, __pyx_n_u_is_future) < 0) __PYX_ERR(0, 4169, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":4149
 *         return Index(arr, name="is_past")
 * 
 *     def is_future(self) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the datetimes are in the future `<'Index[bool]'>`."""
 *         # Access datetime array & info
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.is_future", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_my_tz);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF((PyObject *)__pyx_v_dt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":4171
 *         return Index(arr, name="is_future")
 * 
 *     def closest(self, data: object) -> Self:             # <<<<<<<<<<<<<<
 *         """Find the closest datetime to each of the instance values `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_243closest(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_242closest, "Find the closest datetime to each of the instance values `<'Pddt'>`.\n\n        This method compares each elements of the instance with the\n        provided datetime-like data and returns the closest datetime\n        (from 'data') to each of the instance values.\n\n        :param data `<'object'>`: Datetime-like data.\n            - `<'Array-Like'>` An array-like object containing datetime information.\n            - `<'str'>` A datetime string containing datetime information.\n            - `<'datetime.datetime'>` An instance of `datetime.datetime`.\n            - `<'datetime.date'>` An instance of `datetime.date` (time fields set to 0).\n            - `<'np.datetime64'>` An instance of `np.datetime64`.\n            - `<'None'>` Current datetime with the same timezone of the instance.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_243closest = {"closest", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_243closest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_242closest};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_243closest(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_data = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("closest (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4171, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4171, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("closest", 1, 2, 2, 1); __PYX_ERR(0, 4171, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closest") < 0)) __PYX_ERR(0, 4171, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_data = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("closest", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4171, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.closest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_242closest(__pyx_self, __pyx_v_self, __pyx_v_data);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_242closest(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  PyArrayObject *__pyx_v_my_arr = 0;
  PyObject *__pyx_v_my_unit = 0;
  PyObject *__pyx_v_my_tz = NULL;
  Py_ssize_t __pyx_v_arr_size;
  PyObject *__pyx_v_pt = NULL;
  PyArrayObject *__pyx_v_pt_arr = 0;
  PyObject *__pyx_v_pt_unit = 0;
  PyObject *__pyx_v_pt_tz = NULL;
  int __pyx_v_my_unit_int;
  int __pyx_v_pt_unit_int;
  PyObject *__pyx_v_arr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_opt_args_7cytimes_4pddt__raise_incomparable_error __pyx_t_8;
  int __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 __pyx_t_10;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("closest", 1);

  /* "cytimes/pddt.py":4187
 *         """
 *         # Access 'my' datetime array & info
 *         my_arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 *         my_tz = self.tzinfo
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4187, __pyx_L1_error)
  __pyx_v_my_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":4188
 *         # Access 'my' datetime array & info
 *         my_arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 *         my_tz = self.tzinfo
 *         arr_size: cython.Py_ssize_t = my_arr.shape[0]
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 4188, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":4189
 *         my_arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit
 *         my_tz = self.tzinfo             # <<<<<<<<<<<<<<
 *         arr_size: cython.Py_ssize_t = my_arr.shape[0]
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_my_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":4190
 *         my_unit: str = self.unit
 *         my_tz = self.tzinfo
 *         arr_size: cython.Py_ssize_t = my_arr.shape[0]             # <<<<<<<<<<<<<<
 * 
 *         # Parse dtobjs to Pddt
 */
  __pyx_v_arr_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_my_arr)[0]);

  /* "cytimes/pddt.py":4193
 * 
 *         # Parse dtobjs to Pddt
 *         if data is None:             # <<<<<<<<<<<<<<
 *             pt = self.now(my_tz, arr_size)
 *         elif isinstance(data, (str, datetime.date, np.datetime64)):
 */
  __pyx_t_2 = (__pyx_v_data == Py_None);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":4194
 *         # Parse dtobjs to Pddt
 *         if data is None:
 *             pt = self.now(my_tz, arr_size)             # <<<<<<<<<<<<<<
 *         elif isinstance(data, (str, datetime.date, np.datetime64)):
 *             pt = Pddt([data])
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_now); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_arr_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_my_tz, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_v_pt = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":4193
 * 
 *         # Parse dtobjs to Pddt
 *         if data is None:             # <<<<<<<<<<<<<<
 *             pt = self.now(my_tz, arr_size)
 *         elif isinstance(data, (str, datetime.date, np.datetime64)):
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":4195
 *         if data is None:
 *             pt = self.now(my_tz, arr_size)
 *         elif isinstance(data, (str, datetime.date, np.datetime64)):             # <<<<<<<<<<<<<<
 *             pt = Pddt([data])
 *         elif isinstance(data, Pddt):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_datetime64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = PyUnicode_Check(__pyx_v_data); 
  if (!__pyx_t_7) {
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_7 = __Pyx_TypeCheck(__pyx_v_data, __pyx_ptype_7cpython_8datetime_date); 
  if (!__pyx_t_7) {
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_7 = PyObject_IsInstance(__pyx_v_data, __pyx_t_3); 
  __pyx_t_2 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":4196
 *             pt = self.now(my_tz, arr_size)
 *         elif isinstance(data, (str, datetime.date, np.datetime64)):
 *             pt = Pddt([data])             # <<<<<<<<<<<<<<
 *         elif isinstance(data, Pddt):
 *             pt = data
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Pddt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_data)) __PYX_ERR(0, 4196, __pyx_L1_error);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __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(0, 4196, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_v_pt = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":4195
 *         if data is None:
 *             pt = self.now(my_tz, arr_size)
 *         elif isinstance(data, (str, datetime.date, np.datetime64)):             # <<<<<<<<<<<<<<
 *             pt = Pddt([data])
 *         elif isinstance(data, Pddt):
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":4197
 *         elif isinstance(data, (str, datetime.date, np.datetime64)):
 *             pt = Pddt([data])
 *         elif isinstance(data, Pddt):             # <<<<<<<<<<<<<<
 *             pt = data
 *         else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Pddt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_data, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":4198
 *             pt = Pddt([data])
 *         elif isinstance(data, Pddt):
 *             pt = data             # <<<<<<<<<<<<<<
 *         else:
 *             pt = Pddt(data)
 */
    __Pyx_INCREF(__pyx_v_data);
    __pyx_v_pt = __pyx_v_data;

    /* "cytimes/pddt.py":4197
 *         elif isinstance(data, (str, datetime.date, np.datetime64)):
 *             pt = Pddt([data])
 *         elif isinstance(data, Pddt):             # <<<<<<<<<<<<<<
 *             pt = data
 *         else:
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":4200
 *             pt = data
 *         else:
 *             pt = Pddt(data)             # <<<<<<<<<<<<<<
 * 
 *         # Access 'pt' datetime array & info
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Pddt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4200, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_data};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4200, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_v_pt = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "cytimes/pddt.py":4203
 * 
 *         # Access 'pt' datetime array & info
 *         pt_arr: np.ndarray = pt.values_naive             # <<<<<<<<<<<<<<
 *         pt_unit: str = pt.unit
 *         pt_tz = pt.tzinfo
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4203, __pyx_L1_error)
  __pyx_v_pt_arr = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":4204
 *         # Access 'pt' datetime array & info
 *         pt_arr: np.ndarray = pt.values_naive
 *         pt_unit: str = pt.unit             # <<<<<<<<<<<<<<
 *         pt_tz = pt.tzinfo
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt, __pyx_n_s_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_3))) __PYX_ERR(0, 4204, __pyx_L1_error)
  __pyx_v_pt_unit = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":4205
 *         pt_arr: np.ndarray = pt.values_naive
 *         pt_unit: str = pt.unit
 *         pt_tz = pt.tzinfo             # <<<<<<<<<<<<<<
 * 
 *         # Validate arrays
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_pt_tz = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":4209
 *         # Validate arrays
 *         # . tzinfo
 *         if my_tz is not pt_tz and (my_tz is None or pt_tz is None):             # <<<<<<<<<<<<<<
 *             _raise_incomparable_error(self, pt, "find closest")
 *         # . unit
 */
  __pyx_t_7 = (__pyx_v_my_tz != __pyx_v_pt_tz);
  if (__pyx_t_7) {
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_my_tz == Py_None);
  if (!__pyx_t_7) {
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_pt_tz == Py_None);
  __pyx_t_2 = __pyx_t_7;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":4210
 *         # . tzinfo
 *         if my_tz is not pt_tz and (my_tz is None or pt_tz is None):
 *             _raise_incomparable_error(self, pt, "find closest")             # <<<<<<<<<<<<<<
 *         # . unit
 *         my_unit_int = utils.map_nptime_unit_str2int(my_unit)
 */
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.desc = __pyx_kp_u_find_closest;
    __pyx_t_2 = __pyx_f_7cytimes_4pddt__raise_incomparable_error(__pyx_v_self, __pyx_v_pt, &__pyx_t_8); if (unlikely(__pyx_t_2 == ((int)-2))) __PYX_ERR(0, 4210, __pyx_L1_error)

    /* "cytimes/pddt.py":4209
 *         # Validate arrays
 *         # . tzinfo
 *         if my_tz is not pt_tz and (my_tz is None or pt_tz is None):             # <<<<<<<<<<<<<<
 *             _raise_incomparable_error(self, pt, "find closest")
 *         # . unit
 */
  }

  /* "cytimes/pddt.py":4212
 *             _raise_incomparable_error(self, pt, "find closest")
 *         # . unit
 *         my_unit_int = utils.map_nptime_unit_str2int(my_unit)             # <<<<<<<<<<<<<<
 *         pt_unit_int = utils.map_nptime_unit_str2int(pt_unit)
 *         if my_unit_int != pt_unit_int:
 */
  __pyx_t_9 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_my_unit); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 4212, __pyx_L1_error)
  __pyx_v_my_unit_int = __pyx_t_9;

  /* "cytimes/pddt.py":4213
 *         # . unit
 *         my_unit_int = utils.map_nptime_unit_str2int(my_unit)
 *         pt_unit_int = utils.map_nptime_unit_str2int(pt_unit)             # <<<<<<<<<<<<<<
 *         if my_unit_int != pt_unit_int:
 *             # Cast to lower resolution
 */
  __pyx_t_9 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_pt_unit); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 4213, __pyx_L1_error)
  __pyx_v_pt_unit_int = __pyx_t_9;

  /* "cytimes/pddt.py":4214
 *         my_unit_int = utils.map_nptime_unit_str2int(my_unit)
 *         pt_unit_int = utils.map_nptime_unit_str2int(pt_unit)
 *         if my_unit_int != pt_unit_int:             # <<<<<<<<<<<<<<
 *             # Cast to lower resolution
 *             if my_unit_int < pt_unit_int:
 */
  __pyx_t_2 = (__pyx_v_my_unit_int != __pyx_v_pt_unit_int);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":4216
 *         if my_unit_int != pt_unit_int:
 *             # Cast to lower resolution
 *             if my_unit_int < pt_unit_int:             # <<<<<<<<<<<<<<
 *                 pt_arr = utils.dt64arr_as_int64(pt_arr, my_unit, pt_unit)  # int64
 *             else:
 */
    __pyx_t_2 = (__pyx_v_my_unit_int < __pyx_v_pt_unit_int);
    if (__pyx_t_2) {

      /* "cytimes/pddt.py":4217
 *             # Cast to lower resolution
 *             if my_unit_int < pt_unit_int:
 *                 pt_arr = utils.dt64arr_as_int64(pt_arr, my_unit, pt_unit)  # int64             # <<<<<<<<<<<<<<
 *             else:
 *                 my_arr = utils.dt64arr_as_int64(my_arr, pt_unit, my_unit)  # int64
 */
      __pyx_t_10.__pyx_n = 1;
      __pyx_t_10.arr_unit = __pyx_v_pt_unit;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_pt_arr, __pyx_v_my_unit, &__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4217, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_pt_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/pddt.py":4216
 *         if my_unit_int != pt_unit_int:
 *             # Cast to lower resolution
 *             if my_unit_int < pt_unit_int:             # <<<<<<<<<<<<<<
 *                 pt_arr = utils.dt64arr_as_int64(pt_arr, my_unit, pt_unit)  # int64
 *             else:
 */
      goto __pyx_L12;
    }

    /* "cytimes/pddt.py":4219
 *                 pt_arr = utils.dt64arr_as_int64(pt_arr, my_unit, pt_unit)  # int64
 *             else:
 *                 my_arr = utils.dt64arr_as_int64(my_arr, pt_unit, my_unit)  # int64             # <<<<<<<<<<<<<<
 *                 my_unit = pt_unit  # change my_unit to pt_unit
 * 
 */
    /*else*/ {
      __pyx_t_10.__pyx_n = 1;
      __pyx_t_10.arr_unit = __pyx_v_my_unit;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_my_arr, __pyx_v_pt_unit, &__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4219, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_my_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/pddt.py":4220
 *             else:
 *                 my_arr = utils.dt64arr_as_int64(my_arr, pt_unit, my_unit)  # int64
 *                 my_unit = pt_unit  # change my_unit to pt_unit             # <<<<<<<<<<<<<<
 * 
 *         # Find closest
 */
      __Pyx_INCREF(__pyx_v_pt_unit);
      __Pyx_DECREF_SET(__pyx_v_my_unit, __pyx_v_pt_unit);
    }
    __pyx_L12:;

    /* "cytimes/pddt.py":4214
 *         my_unit_int = utils.map_nptime_unit_str2int(my_unit)
 *         pt_unit_int = utils.map_nptime_unit_str2int(pt_unit)
 *         if my_unit_int != pt_unit_int:             # <<<<<<<<<<<<<<
 *             # Cast to lower resolution
 *             if my_unit_int < pt_unit_int:
 */
  }

  /* "cytimes/pddt.py":4223
 * 
 *         # Find closest
 *         arr = utils.dt64arr_find_closest(my_arr, pt_arr)             # <<<<<<<<<<<<<<
 *         arr = arr.astype("datetime64[%s]" % my_unit)
 *         return pddt_new_simple(arr, pt_tz, None, "closest")
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_find_closest(__pyx_v_my_arr, __pyx_v_pt_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_arr = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":4224
 *         # Find closest
 *         arr = utils.dt64arr_find_closest(my_arr, pt_arr)
 *         arr = arr.astype("datetime64[%s]" % my_unit)             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(arr, pt_tz, None, "closest")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_my_unit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __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(0, 4224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":4225
 *         arr = utils.dt64arr_find_closest(my_arr, pt_arr)
 *         arr = arr.astype("datetime64[%s]" % my_unit)
 *         return pddt_new_simple(arr, pt_tz, None, "closest")             # <<<<<<<<<<<<<<
 * 
 *     def farthest(self, dtobjs: object) -> Self:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_11.__pyx_n = 3;
  __pyx_t_11.tz = __pyx_v_pt_tz;
  __pyx_t_11.unit = ((PyObject*)Py_None);
  __pyx_t_11.name = __pyx_n_u_closest;
  __pyx_t_3 = __pyx_f_7cytimes_4pddt_pddt_new_simple(__pyx_v_arr, &__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":4171
 *         return Index(arr, name="is_future")
 * 
 *     def closest(self, data: object) -> Self:             # <<<<<<<<<<<<<<
 *         """Find the closest datetime to each of the instance values `<'Pddt'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.closest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_my_arr);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF(__pyx_v_my_tz);
  __Pyx_XDECREF(__pyx_v_pt);
  __Pyx_XDECREF((PyObject *)__pyx_v_pt_arr);
  __Pyx_XDECREF(__pyx_v_pt_unit);
  __Pyx_XDECREF(__pyx_v_pt_tz);
  __Pyx_XDECREF(__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/pddt.py":4227
 *         return pddt_new_simple(arr, pt_tz, None, "closest")
 * 
 *     def farthest(self, dtobjs: object) -> Self:             # <<<<<<<<<<<<<<
 *         """Find the farthest datetime to each of the instance values `<'Pddt'>`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_245farthest(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7cytimes_4pddt_4Pddt_244farthest, "Find the farthest datetime to each of the instance values `<'Pddt'>`.\n\n        This method compares each elements of the instance with the\n        provided datetime-like data and returns the farthest datetime\n        (from 'data') to each of the instance values.\n\n        :param data `<'object'>`: Datetime-like data.\n            - `<'Array-Like'>` An array-like object containing datetime information.\n            - `<'str'>` A datetime string containing datetime information.\n            - `<'datetime.datetime'>` An instance of `datetime.datetime`.\n            - `<'datetime.date'>` An instance of `datetime.date` (time fields set to 0).\n            - `<'np.datetime64'>` An instance of `np.datetime64`.\n            - `<'None'>` Current datetime with the same timezone of the instance.\n        ");
static PyMethodDef __pyx_mdef_7cytimes_4pddt_4Pddt_245farthest = {"farthest", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7cytimes_4pddt_4Pddt_245farthest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7cytimes_4pddt_4Pddt_244farthest};
static PyObject *__pyx_pw_7cytimes_4pddt_4Pddt_245farthest(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_dtobjs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("farthest (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_dtobjs,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4227, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dtobjs)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4227, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("farthest", 1, 2, 2, 1); __PYX_ERR(0, 4227, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "farthest") < 0)) __PYX_ERR(0, 4227, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_dtobjs = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("farthest", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4227, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("cytimes.pddt.Pddt.farthest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytimes_4pddt_4Pddt_244farthest(__pyx_self, __pyx_v_self, __pyx_v_dtobjs);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7cytimes_4pddt_4Pddt_244farthest(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_dtobjs) {
  PyArrayObject *__pyx_v_my_arr = 0;
  PyObject *__pyx_v_my_unit = 0;
  PyObject *__pyx_v_my_tz = NULL;
  Py_ssize_t __pyx_v_arr_size;
  PyObject *__pyx_v_pt = NULL;
  PyArrayObject *__pyx_v_pt_arr = 0;
  PyObject *__pyx_v_pt_unit = 0;
  PyObject *__pyx_v_pt_tz = NULL;
  int __pyx_v_my_unit_int;
  int __pyx_v_pt_unit_int;
  PyObject *__pyx_v_arr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_opt_args_7cytimes_4pddt__raise_incomparable_error __pyx_t_8;
  int __pyx_t_9;
  struct __pyx_opt_args_7cytimes_5utils_dt64arr_as_int64 __pyx_t_10;
  struct __pyx_opt_args_7cytimes_4pddt_pddt_new_simple __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("farthest", 1);

  /* "cytimes/pddt.py":4243
 *         """
 *         # Access 'my' datetime array & info
 *         my_arr: np.ndarray = self.values_naive             # <<<<<<<<<<<<<<
 *         my_unit: str = self.unit
 *         my_tz = self.tzinfo
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4243, __pyx_L1_error)
  __pyx_v_my_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":4244
 *         # Access 'my' datetime array & info
 *         my_arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit             # <<<<<<<<<<<<<<
 *         my_tz = self.tzinfo
 *         arr_size: cython.Py_ssize_t = my_arr.shape[0]
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(0, 4244, __pyx_L1_error)
  __pyx_v_my_unit = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":4245
 *         my_arr: np.ndarray = self.values_naive
 *         my_unit: str = self.unit
 *         my_tz = self.tzinfo             # <<<<<<<<<<<<<<
 *         arr_size: cython.Py_ssize_t = my_arr.shape[0]
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_my_tz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytimes/pddt.py":4246
 *         my_unit: str = self.unit
 *         my_tz = self.tzinfo
 *         arr_size: cython.Py_ssize_t = my_arr.shape[0]             # <<<<<<<<<<<<<<
 * 
 *         # Parse dtobjs to Pddt
 */
  __pyx_v_arr_size = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_my_arr)[0]);

  /* "cytimes/pddt.py":4249
 * 
 *         # Parse dtobjs to Pddt
 *         if dtobjs is None:             # <<<<<<<<<<<<<<
 *             pt = self.now(my_tz, arr_size)
 *         elif isinstance(dtobjs, (str, datetime.date, np.datetime64)):
 */
  __pyx_t_2 = (__pyx_v_dtobjs == Py_None);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":4250
 *         # Parse dtobjs to Pddt
 *         if dtobjs is None:
 *             pt = self.now(my_tz, arr_size)             # <<<<<<<<<<<<<<
 *         elif isinstance(dtobjs, (str, datetime.date, np.datetime64)):
 *             pt = Pddt([dtobjs])
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_now); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_arr_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_my_tz, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4250, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_v_pt = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cytimes/pddt.py":4249
 * 
 *         # Parse dtobjs to Pddt
 *         if dtobjs is None:             # <<<<<<<<<<<<<<
 *             pt = self.now(my_tz, arr_size)
 *         elif isinstance(dtobjs, (str, datetime.date, np.datetime64)):
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":4251
 *         if dtobjs is None:
 *             pt = self.now(my_tz, arr_size)
 *         elif isinstance(dtobjs, (str, datetime.date, np.datetime64)):             # <<<<<<<<<<<<<<
 *             pt = Pddt([dtobjs])
 *         elif isinstance(dtobjs, Pddt):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_datetime64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = PyUnicode_Check(__pyx_v_dtobjs); 
  if (!__pyx_t_7) {
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_7 = __Pyx_TypeCheck(__pyx_v_dtobjs, __pyx_ptype_7cpython_8datetime_date); 
  if (!__pyx_t_7) {
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_7 = PyObject_IsInstance(__pyx_v_dtobjs, __pyx_t_3); 
  __pyx_t_2 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":4252
 *             pt = self.now(my_tz, arr_size)
 *         elif isinstance(dtobjs, (str, datetime.date, np.datetime64)):
 *             pt = Pddt([dtobjs])             # <<<<<<<<<<<<<<
 *         elif isinstance(dtobjs, Pddt):
 *             pt = dtobjs
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Pddt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_dtobjs);
    __Pyx_GIVEREF(__pyx_v_dtobjs);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_dtobjs)) __PYX_ERR(0, 4252, __pyx_L1_error);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __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(0, 4252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_v_pt = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cytimes/pddt.py":4251
 *         if dtobjs is None:
 *             pt = self.now(my_tz, arr_size)
 *         elif isinstance(dtobjs, (str, datetime.date, np.datetime64)):             # <<<<<<<<<<<<<<
 *             pt = Pddt([dtobjs])
 *         elif isinstance(dtobjs, Pddt):
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":4253
 *         elif isinstance(dtobjs, (str, datetime.date, np.datetime64)):
 *             pt = Pddt([dtobjs])
 *         elif isinstance(dtobjs, Pddt):             # <<<<<<<<<<<<<<
 *             pt = dtobjs
 *         else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Pddt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_dtobjs, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 4253, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":4254
 *             pt = Pddt([dtobjs])
 *         elif isinstance(dtobjs, Pddt):
 *             pt = dtobjs             # <<<<<<<<<<<<<<
 *         else:
 *             pt = Pddt(dtobjs)
 */
    __Pyx_INCREF(__pyx_v_dtobjs);
    __pyx_v_pt = __pyx_v_dtobjs;

    /* "cytimes/pddt.py":4253
 *         elif isinstance(dtobjs, (str, datetime.date, np.datetime64)):
 *             pt = Pddt([dtobjs])
 *         elif isinstance(dtobjs, Pddt):             # <<<<<<<<<<<<<<
 *             pt = dtobjs
 *         else:
 */
    goto __pyx_L3;
  }

  /* "cytimes/pddt.py":4256
 *             pt = dtobjs
 *         else:
 *             pt = Pddt(dtobjs)             # <<<<<<<<<<<<<<
 * 
 *         # Access 'pt' datetime array & info
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Pddt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_dtobjs};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_v_pt = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "cytimes/pddt.py":4259
 * 
 *         # Access 'pt' datetime array & info
 *         pt_arr: np.ndarray = pt.values_naive             # <<<<<<<<<<<<<<
 *         pt_unit: str = pt.unit
 *         pt_tz = pt.tzinfo
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt, __pyx_n_s_values_naive); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 4259, __pyx_L1_error)
  __pyx_v_pt_arr = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":4260
 *         # Access 'pt' datetime array & info
 *         pt_arr: np.ndarray = pt.values_naive
 *         pt_unit: str = pt.unit             # <<<<<<<<<<<<<<
 *         pt_tz = pt.tzinfo
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt, __pyx_n_s_unit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_3))) __PYX_ERR(0, 4260, __pyx_L1_error)
  __pyx_v_pt_unit = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":4261
 *         pt_arr: np.ndarray = pt.values_naive
 *         pt_unit: str = pt.unit
 *         pt_tz = pt.tzinfo             # <<<<<<<<<<<<<<
 * 
 *         # Validate arrays
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pt, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_pt_tz = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":4265
 *         # Validate arrays
 *         # . tzinfo
 *         if my_tz is not pt_tz and (my_tz is None or pt_tz is None):             # <<<<<<<<<<<<<<
 *             _raise_incomparable_error(self, pt, "find farthest")
 *         # . unit
 */
  __pyx_t_7 = (__pyx_v_my_tz != __pyx_v_pt_tz);
  if (__pyx_t_7) {
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_my_tz == Py_None);
  if (!__pyx_t_7) {
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_pt_tz == Py_None);
  __pyx_t_2 = __pyx_t_7;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":4266
 *         # . tzinfo
 *         if my_tz is not pt_tz and (my_tz is None or pt_tz is None):
 *             _raise_incomparable_error(self, pt, "find farthest")             # <<<<<<<<<<<<<<
 *         # . unit
 *         my_unit_int = utils.map_nptime_unit_str2int(my_unit)
 */
    __pyx_t_8.__pyx_n = 1;
    __pyx_t_8.desc = __pyx_kp_u_find_farthest;
    __pyx_t_2 = __pyx_f_7cytimes_4pddt__raise_incomparable_error(__pyx_v_self, __pyx_v_pt, &__pyx_t_8); if (unlikely(__pyx_t_2 == ((int)-2))) __PYX_ERR(0, 4266, __pyx_L1_error)

    /* "cytimes/pddt.py":4265
 *         # Validate arrays
 *         # . tzinfo
 *         if my_tz is not pt_tz and (my_tz is None or pt_tz is None):             # <<<<<<<<<<<<<<
 *             _raise_incomparable_error(self, pt, "find farthest")
 *         # . unit
 */
  }

  /* "cytimes/pddt.py":4268
 *             _raise_incomparable_error(self, pt, "find farthest")
 *         # . unit
 *         my_unit_int = utils.map_nptime_unit_str2int(my_unit)             # <<<<<<<<<<<<<<
 *         pt_unit_int = utils.map_nptime_unit_str2int(pt_unit)
 *         if my_unit_int != pt_unit_int:
 */
  __pyx_t_9 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_my_unit); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 4268, __pyx_L1_error)
  __pyx_v_my_unit_int = __pyx_t_9;

  /* "cytimes/pddt.py":4269
 *         # . unit
 *         my_unit_int = utils.map_nptime_unit_str2int(my_unit)
 *         pt_unit_int = utils.map_nptime_unit_str2int(pt_unit)             # <<<<<<<<<<<<<<
 *         if my_unit_int != pt_unit_int:
 *             # Cast to lower resolution
 */
  __pyx_t_9 = __pyx_f_7cytimes_5utils_map_nptime_unit_str2int(__pyx_v_pt_unit); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 4269, __pyx_L1_error)
  __pyx_v_pt_unit_int = __pyx_t_9;

  /* "cytimes/pddt.py":4270
 *         my_unit_int = utils.map_nptime_unit_str2int(my_unit)
 *         pt_unit_int = utils.map_nptime_unit_str2int(pt_unit)
 *         if my_unit_int != pt_unit_int:             # <<<<<<<<<<<<<<
 *             # Cast to lower resolution
 *             if my_unit_int < pt_unit_int:
 */
  __pyx_t_2 = (__pyx_v_my_unit_int != __pyx_v_pt_unit_int);
  if (__pyx_t_2) {

    /* "cytimes/pddt.py":4272
 *         if my_unit_int != pt_unit_int:
 *             # Cast to lower resolution
 *             if my_unit_int < pt_unit_int:             # <<<<<<<<<<<<<<
 *                 pt_arr = utils.dt64arr_as_int64(pt_arr, my_unit, pt_unit)  # int64
 *             else:
 */
    __pyx_t_2 = (__pyx_v_my_unit_int < __pyx_v_pt_unit_int);
    if (__pyx_t_2) {

      /* "cytimes/pddt.py":4273
 *             # Cast to lower resolution
 *             if my_unit_int < pt_unit_int:
 *                 pt_arr = utils.dt64arr_as_int64(pt_arr, my_unit, pt_unit)  # int64             # <<<<<<<<<<<<<<
 *             else:
 *                 my_arr = utils.dt64arr_as_int64(my_arr, pt_unit, my_unit)  # int64
 */
      __pyx_t_10.__pyx_n = 1;
      __pyx_t_10.arr_unit = __pyx_v_pt_unit;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_pt_arr, __pyx_v_my_unit, &__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_pt_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/pddt.py":4272
 *         if my_unit_int != pt_unit_int:
 *             # Cast to lower resolution
 *             if my_unit_int < pt_unit_int:             # <<<<<<<<<<<<<<
 *                 pt_arr = utils.dt64arr_as_int64(pt_arr, my_unit, pt_unit)  # int64
 *             else:
 */
      goto __pyx_L12;
    }

    /* "cytimes/pddt.py":4275
 *                 pt_arr = utils.dt64arr_as_int64(pt_arr, my_unit, pt_unit)  # int64
 *             else:
 *                 my_arr = utils.dt64arr_as_int64(my_arr, pt_unit, my_unit)  # int64             # <<<<<<<<<<<<<<
 *                 my_unit = pt_unit  # change my_unit to pt_unit
 * 
 */
    /*else*/ {
      __pyx_t_10.__pyx_n = 1;
      __pyx_t_10.arr_unit = __pyx_v_my_unit;
      __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_as_int64(__pyx_v_my_arr, __pyx_v_pt_unit, &__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4275, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_my_arr, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cytimes/pddt.py":4276
 *             else:
 *                 my_arr = utils.dt64arr_as_int64(my_arr, pt_unit, my_unit)  # int64
 *                 my_unit = pt_unit  # change my_unit to pt_unit             # <<<<<<<<<<<<<<
 * 
 *         # Find farthest
 */
      __Pyx_INCREF(__pyx_v_pt_unit);
      __Pyx_DECREF_SET(__pyx_v_my_unit, __pyx_v_pt_unit);
    }
    __pyx_L12:;

    /* "cytimes/pddt.py":4270
 *         my_unit_int = utils.map_nptime_unit_str2int(my_unit)
 *         pt_unit_int = utils.map_nptime_unit_str2int(pt_unit)
 *         if my_unit_int != pt_unit_int:             # <<<<<<<<<<<<<<
 *             # Cast to lower resolution
 *             if my_unit_int < pt_unit_int:
 */
  }

  /* "cytimes/pddt.py":4279
 * 
 *         # Find farthest
 *         arr = utils.dt64arr_find_farthest(my_arr, pt_arr)             # <<<<<<<<<<<<<<
 *         arr = arr.astype("datetime64[%s]" % my_unit)
 *         return pddt_new_simple(arr, pt_tz, None, "farthest")
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_5utils_dt64arr_find_farthest(__pyx_v_my_arr, __pyx_v_pt_arr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_arr = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":4280
 *         # Find farthest
 *         arr = utils.dt64arr_find_farthest(my_arr, pt_arr)
 *         arr = arr.astype("datetime64[%s]" % my_unit)             # <<<<<<<<<<<<<<
 *         return pddt_new_simple(arr, pt_tz, None, "farthest")
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_datetime64_s, __pyx_v_my_unit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __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(0, 4280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/pddt.py":4281
 *         arr = utils.dt64arr_find_farthest(my_arr, pt_arr)
 *         arr = arr.astype("datetime64[%s]" % my_unit)
 *         return pddt_new_simple(arr, pt_tz, None, "farthest")             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_11.__pyx_n = 3;
  __pyx_t_11.tz = __pyx_v_pt_tz;
  __pyx_t_11.unit = ((PyObject*)Py_None);
  __pyx_t_11.name = __pyx_n_u_farthest;
  __pyx_t_3 = __pyx_f_7cytimes_4pddt_pddt_new_simple(__pyx_v_arr, &__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cytimes/pddt.py":4227
 *         return pddt_new_simple(arr, pt_tz, None, "closest")
 * 
 *     def farthest(self, dtobjs: object) -> Self:             # <<<<<<<<<<<<<<
 *         """Find the farthest datetime to each of the instance values `<'Pddt'>`.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.pddt.Pddt.farthest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_my_arr);
  __Pyx_XDECREF(__pyx_v_my_unit);
  __Pyx_XDECREF(__pyx_v_my_tz);
  __Pyx_XDECREF(__pyx_v_pt);
  __Pyx_XDECREF((PyObject *)__pyx_v_pt_arr);
  __Pyx_XDECREF(__pyx_v_pt_unit);
  __Pyx_XDECREF(__pyx_v_pt_tz);
  __Pyx_XDECREF(__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar *__pyx_freelist_7cytimes_4pddt___pyx_scope_struct__fromisocalendar[8];
static int __pyx_freecount_7cytimes_4pddt___pyx_scope_struct__fromisocalendar = 0;
#endif

static PyObject *__pyx_tp_new_7cytimes_4pddt___pyx_scope_struct__fromisocalendar(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_7cytimes_4pddt___pyx_scope_struct__fromisocalendar > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar)))) {
    o = (PyObject*)__pyx_freelist_7cytimes_4pddt___pyx_scope_struct__fromisocalendar[--__pyx_freecount_7cytimes_4pddt___pyx_scope_struct__fromisocalendar];
    memset(o, 0, sizeof(struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_7cytimes_4pddt___pyx_scope_struct__fromisocalendar(PyObject *o) {
  struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar *p = (struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7cytimes_4pddt___pyx_scope_struct__fromisocalendar) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_tz);
  Py_CLEAR(p->__pyx_v_week);
  Py_CLEAR(p->__pyx_v_weekday);
  Py_CLEAR(p->__pyx_v_year);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_7cytimes_4pddt___pyx_scope_struct__fromisocalendar < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar)))) {
    __pyx_freelist_7cytimes_4pddt___pyx_scope_struct__fromisocalendar[__pyx_freecount_7cytimes_4pddt___pyx_scope_struct__fromisocalendar++] = ((struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_7cytimes_4pddt___pyx_scope_struct__fromisocalendar(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar *p = (struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar *)o;
  if (p->__pyx_v_tz) {
    e = (*v)(p->__pyx_v_tz, a); if (e) return e;
  }
  if (p->__pyx_v_week) {
    e = (*v)(p->__pyx_v_week, a); if (e) return e;
  }
  if (p->__pyx_v_weekday) {
    e = (*v)(p->__pyx_v_weekday, a); if (e) return e;
  }
  if (p->__pyx_v_year) {
    e = (*v)(p->__pyx_v_year, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7cytimes_4pddt___pyx_scope_struct__fromisocalendar(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar *p = (struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar *)o;
  tmp = ((PyObject*)p->__pyx_v_tz);
  p->__pyx_v_tz = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_week);
  p->__pyx_v_week = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_weekday);
  p->__pyx_v_weekday = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_year);
  p->__pyx_v_year = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7cytimes_4pddt___pyx_scope_struct__fromisocalendar_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7cytimes_4pddt___pyx_scope_struct__fromisocalendar},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7cytimes_4pddt___pyx_scope_struct__fromisocalendar},
  {Py_tp_clear, (void *)__pyx_tp_clear_7cytimes_4pddt___pyx_scope_struct__fromisocalendar},
  {Py_tp_new, (void *)__pyx_tp_new_7cytimes_4pddt___pyx_scope_struct__fromisocalendar},
  {0, 0},
};
static PyType_Spec __pyx_type_7cytimes_4pddt___pyx_scope_struct__fromisocalendar_spec = {
  "cytimes.pddt.__pyx_scope_struct__fromisocalendar",
  sizeof(struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_7cytimes_4pddt___pyx_scope_struct__fromisocalendar_slots,
};
#else

static PyTypeObject __pyx_type_7cytimes_4pddt___pyx_scope_struct__fromisocalendar = {
  PyVarObject_HEAD_INIT(0, 0)
  "cytimes.pddt.""__pyx_scope_struct__fromisocalendar", /*tp_name*/
  sizeof(struct __pyx_obj_7cytimes_4pddt___pyx_scope_struct__fromisocalendar), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytimes_4pddt___pyx_scope_struct__fromisocalendar, /*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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7cytimes_4pddt___pyx_scope_struct__fromisocalendar, /*tp_traverse*/
  __pyx_tp_clear_7cytimes_4pddt___pyx_scope_struct__fromisocalendar, /*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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7cytimes_4pddt___pyx_scope_struct__fromisocalendar, /*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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};
#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
/* #### Code section: pystring_table ### */

static int __Pyx_CreateStringTabAndInitStrings(void) {
  __Pyx_StringTabEntry __pyx_string_tab[] = {
    {&__pyx_kp_u_00, __pyx_k_00, sizeof(__pyx_k_00), 0, 1, 0, 0},
    {&__pyx_kp_u_00_00, __pyx_k_00_00, sizeof(__pyx_k_00_00), 0, 1, 0, 0},
    {&__pyx_kp_u_00_00_00_06d, __pyx_k_00_00_00_06d, sizeof(__pyx_k_00_00_00_06d), 0, 1, 0, 0},
    {&__pyx_kp_u_00_00_02d, __pyx_k_00_00_02d, sizeof(__pyx_k_00_00_02d), 0, 1, 0, 0},
    {&__pyx_kp_u_02d, __pyx_k_02d, sizeof(__pyx_k_02d), 0, 1, 0, 0},
    {&__pyx_kp_u_04d, __pyx_k_04d, sizeof(__pyx_k_04d), 0, 1, 0, 0},
    {&__pyx_kp_u_06d, __pyx_k_06d, sizeof(__pyx_k_06d), 0, 1, 0, 0},
    {&__pyx_kp_u_06d_2, __pyx_k_06d_2, sizeof(__pyx_k_06d_2), 0, 1, 0, 0},
    {&__pyx_kp_u_2d, __pyx_k_2d, sizeof(__pyx_k_2d), 0, 1, 0, 0},
    {&__pyx_kp_s_A_drop_in_replacement_for_Pandas, __pyx_k_A_drop_in_replacement_for_Pandas, sizeof(__pyx_k_A_drop_in_replacement_for_Pandas), 0, 0, 1, 0},
    {&__pyx_kp_u_Adjust_the_date_and_time_fields, __pyx_k_Adjust_the_date_and_time_fields, sizeof(__pyx_k_Adjust_the_date_and_time_fields), 0, 1, 0, 0},
    {&__pyx_kp_u_Adjust_the_date_to_the_specific, __pyx_k_Adjust_the_date_to_the_specific, sizeof(__pyx_k_Adjust_the_date_to_the_specific), 0, 1, 0, 0},
    {&__pyx_kp_u_Adjust_the_date_to_the_specific_2, __pyx_k_Adjust_the_date_to_the_specific_2, sizeof(__pyx_k_Adjust_the_date_to_the_specific_2), 0, 1, 0, 0},
    {&__pyx_kp_u_Adjust_the_date_to_the_specific_3, __pyx_k_Adjust_the_date_to_the_specific_3, sizeof(__pyx_k_Adjust_the_date_to_the_specific_3), 0, 1, 0, 0},
    {&__pyx_kp_u_Adjust_the_date_to_the_specific_4, __pyx_k_Adjust_the_date_to_the_specific_4, sizeof(__pyx_k_Adjust_the_date_to_the_specific_4), 0, 1, 0, 0},
    {&__pyx_kp_u_Adjust_the_date_to_the_specified, __pyx_k_Adjust_the_date_to_the_specified, sizeof(__pyx_k_Adjust_the_date_to_the_specified), 0, 1, 0, 0},
    {&__pyx_kp_u_Adjust_the_date_to_the_specified_10, __pyx_k_Adjust_the_date_to_the_specified_10, sizeof(__pyx_k_Adjust_the_date_to_the_specified_10), 0, 1, 0, 0},
    {&__pyx_kp_u_Adjust_the_date_to_the_specified_11, __pyx_k_Adjust_the_date_to_the_specified_11, sizeof(__pyx_k_Adjust_the_date_to_the_specified_11), 0, 1, 0, 0},
    {&__pyx_kp_u_Adjust_the_date_to_the_specified_12, __pyx_k_Adjust_the_date_to_the_specified_12, sizeof(__pyx_k_Adjust_the_date_to_the_specified_12), 0, 1, 0, 0},
    {&__pyx_kp_u_Adjust_the_date_to_the_specified_2, __pyx_k_Adjust_the_date_to_the_specified_2, sizeof(__pyx_k_Adjust_the_date_to_the_specified_2), 0, 1, 0, 0},
    {&__pyx_kp_u_Adjust_the_date_to_the_specified_3, __pyx_k_Adjust_the_date_to_the_specified_3, sizeof(__pyx_k_Adjust_the_date_to_the_specified_3), 0, 1, 0, 0},
    {&__pyx_kp_u_Adjust_the_date_to_the_specified_4, __pyx_k_Adjust_the_date_to_the_specified_4, sizeof(__pyx_k_Adjust_the_date_to_the_specified_4), 0, 1, 0, 0},
    {&__pyx_kp_u_Adjust_the_date_to_the_specified_5, __pyx_k_Adjust_the_date_to_the_specified_5, sizeof(__pyx_k_Adjust_the_date_to_the_specified_5), 0, 1, 0, 0},
    {&__pyx_kp_u_Adjust_the_date_to_the_specified_6, __pyx_k_Adjust_the_date_to_the_specified_6, sizeof(__pyx_k_Adjust_the_date_to_the_specified_6), 0, 1, 0, 0},
    {&__pyx_kp_u_Adjust_the_date_to_the_specified_7, __pyx_k_Adjust_the_date_to_the_specified_7, sizeof(__pyx_k_Adjust_the_date_to_the_specified_7), 0, 1, 0, 0},
    {&__pyx_kp_u_Adjust_the_date_to_the_specified_8, __pyx_k_Adjust_the_date_to_the_specified_8, sizeof(__pyx_k_Adjust_the_date_to_the_specified_8), 0, 1, 0, 0},
    {&__pyx_kp_u_Adjust_the_date_to_the_specified_9, __pyx_k_Adjust_the_date_to_the_specified_9, sizeof(__pyx_k_Adjust_the_date_to_the_specified_9), 0, 1, 0, 0},
    {&__pyx_kp_u_Adjust_the_date_with_new_values, __pyx_k_Adjust_the_date_with_new_values, sizeof(__pyx_k_Adjust_the_date_with_new_values), 0, 1, 0, 0},
    {&__pyx_kp_u_Adjust_the_time_fields_with_new, __pyx_k_Adjust_the_time_fields_with_new, sizeof(__pyx_k_Adjust_the_time_fields_with_new), 0, 1, 0, 0},
    {&__pyx_n_s_AmbiguousTimeError, __pyx_k_AmbiguousTimeError, sizeof(__pyx_k_AmbiguousTimeError), 0, 0, 1, 1},
    {&__pyx_n_u_Apr, __pyx_k_Apr, sizeof(__pyx_k_Apr), 0, 1, 0, 1},
    {&__pyx_kp_u_Array_with_dtype_of_datetime64, __pyx_k_Array_with_dtype_of_datetime64, sizeof(__pyx_k_Array_with_dtype_of_datetime64), 0, 1, 0, 0},
    {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
    {&__pyx_n_u_Aug, __pyx_k_Aug, sizeof(__pyx_k_Aug), 0, 1, 0, 1},
    {&__pyx_n_s_Configs, __pyx_k_Configs, sizeof(__pyx_k_Configs), 0, 0, 1, 1},
    {&__pyx_kp_u_Conversion_limits_to_datetime_u, __pyx_k_Conversion_limits_to_datetime_u, sizeof(__pyx_k_Conversion_limits_to_datetime_u), 0, 1, 0, 0},
    {&__pyx_n_u_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 1, 0, 1},
    {&__pyx_n_s_DataFrame, __pyx_k_DataFrame, sizeof(__pyx_k_DataFrame), 0, 0, 1, 1},
    {&__pyx_n_s_DateParseError, __pyx_k_DateParseError, sizeof(__pyx_k_DateParseError), 0, 0, 1, 1},
    {&__pyx_n_s_DatetimeArray, __pyx_k_DatetimeArray, sizeof(__pyx_k_DatetimeArray), 0, 0, 1, 1},
    {&__pyx_n_s_DatetimeIndex, __pyx_k_DatetimeIndex, sizeof(__pyx_k_DatetimeIndex), 0, 0, 1, 1},
    {&__pyx_n_u_Dec, __pyx_k_Dec, sizeof(__pyx_k_Dec), 0, 1, 0, 1},
    {&__pyx_n_u_Feb, __pyx_k_Feb, sizeof(__pyx_k_Feb), 0, 1, 0, 1},
    {&__pyx_kp_u_For_comparision_array_size_must, __pyx_k_For_comparision_array_size_must, sizeof(__pyx_k_For_comparision_array_size_must), 0, 1, 0, 0},
    {&__pyx_n_u_Fri, __pyx_k_Fri, sizeof(__pyx_k_Fri), 0, 1, 0, 1},
    {&__pyx_kp_u_H_M_S_f_z, __pyx_k_H_M_S_f_z, sizeof(__pyx_k_H_M_S_f_z), 0, 1, 0, 0},
    {&__pyx_n_s_Hashable, __pyx_k_Hashable, sizeof(__pyx_k_Hashable), 0, 0, 1, 1},
    {&__pyx_kp_s_Hashable_None, __pyx_k_Hashable_None, sizeof(__pyx_k_Hashable_None), 0, 0, 1, 0},
    {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
    {&__pyx_n_s_IncomparableError, __pyx_k_IncomparableError, sizeof(__pyx_k_IncomparableError), 0, 0, 1, 1},
    {&__pyx_n_s_Index, __pyx_k_Index, sizeof(__pyx_k_Index), 0, 0, 1, 1},
    {&__pyx_kp_s_Index_bool, __pyx_k_Index_bool, sizeof(__pyx_k_Index_bool), 0, 0, 1, 0},
    {&__pyx_kp_s_Index_np_float64, __pyx_k_Index_np_float64, sizeof(__pyx_k_Index_np_float64), 0, 0, 1, 0},
    {&__pyx_kp_s_Index_np_int64, __pyx_k_Index_np_int64, sizeof(__pyx_k_Index_np_int64), 0, 0, 1, 0},
    {&__pyx_kp_s_Index_str, __pyx_k_Index_str, sizeof(__pyx_k_Index_str), 0, 0, 1, 0},
    {&__pyx_n_s_InvalidArgumentError, __pyx_k_InvalidArgumentError, sizeof(__pyx_k_InvalidArgumentError), 0, 0, 1, 1},
    {&__pyx_n_s_InvalidFspError, __pyx_k_InvalidFspError, sizeof(__pyx_k_InvalidFspError), 0, 0, 1, 1},
    {&__pyx_n_s_InvalidMonthError, __pyx_k_InvalidMonthError, sizeof(__pyx_k_InvalidMonthError), 0, 0, 1, 1},
    {&__pyx_n_s_InvalidTimeUnitError, __pyx_k_InvalidTimeUnitError, sizeof(__pyx_k_InvalidTimeUnitError), 0, 0, 1, 1},
    {&__pyx_n_s_InvalidTimezoneError, __pyx_k_InvalidTimezoneError, sizeof(__pyx_k_InvalidTimezoneError), 0, 0, 1, 1},
    {&__pyx_n_s_InvalidTypeError, __pyx_k_InvalidTypeError, sizeof(__pyx_k_InvalidTypeError), 0, 0, 1, 1},
    {&__pyx_n_s_InvalidWeekdayError, __pyx_k_InvalidWeekdayError, sizeof(__pyx_k_InvalidWeekdayError), 0, 0, 1, 1},
    {&__pyx_n_u_Jan, __pyx_k_Jan, sizeof(__pyx_k_Jan), 0, 1, 0, 1},
    {&__pyx_n_u_Jul, __pyx_k_Jul, sizeof(__pyx_k_Jul), 0, 1, 0, 1},
    {&__pyx_n_u_Jun, __pyx_k_Jun, sizeof(__pyx_k_Jun), 0, 1, 0, 1},
    {&__pyx_n_s_Literal, __pyx_k_Literal, sizeof(__pyx_k_Literal), 0, 0, 1, 1},
    {&__pyx_n_u_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 1, 0, 1},
    {&__pyx_n_u_Mar, __pyx_k_Mar, sizeof(__pyx_k_Mar), 0, 1, 0, 1},
    {&__pyx_n_u_May, __pyx_k_May, sizeof(__pyx_k_May), 0, 1, 0, 1},
    {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
    {&__pyx_n_u_Mon, __pyx_k_Mon, sizeof(__pyx_k_Mon), 0, 1, 0, 1},
    {&__pyx_n_u_NaT, __pyx_k_NaT, sizeof(__pyx_k_NaT), 0, 1, 0, 1},
    {&__pyx_kp_u_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0, 0},
    {&__pyx_n_u_Nov, __pyx_k_Nov, sizeof(__pyx_k_Nov), 0, 1, 0, 1},
    {&__pyx_n_u_Oct, __pyx_k_Oct, sizeof(__pyx_k_Oct), 0, 1, 0, 1},
    {&__pyx_n_s_OutOfBoundsDatetime, __pyx_k_OutOfBoundsDatetime, sizeof(__pyx_k_OutOfBoundsDatetime), 0, 0, 1, 1},
    {&__pyx_n_s_OutOfBoundsDatetimeError, __pyx_k_OutOfBoundsDatetimeError, sizeof(__pyx_k_OutOfBoundsDatetimeError), 0, 0, 1, 1},
    {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1},
    {&__pyx_n_s_ParserError, __pyx_k_ParserError, sizeof(__pyx_k_ParserError), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt, __pyx_k_Pddt, sizeof(__pyx_k_Pddt), 0, 0, 1, 1},
    {&__pyx_n_u_Pddt, __pyx_k_Pddt, sizeof(__pyx_k_Pddt), 0, 1, 0, 1},
    {&__pyx_n_s_Pddt___new, __pyx_k_Pddt___new, sizeof(__pyx_k_Pddt___new), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt__to_curr_weekday, __pyx_k_Pddt__to_curr_weekday, sizeof(__pyx_k_Pddt__to_curr_weekday), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_add, __pyx_k_Pddt_add, sizeof(__pyx_k_Pddt_add), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_as_unit, __pyx_k_Pddt_as_unit, sizeof(__pyx_k_Pddt_as_unit), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_astimezone, __pyx_k_Pddt_astimezone, sizeof(__pyx_k_Pddt_astimezone), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_ceil, __pyx_k_Pddt_ceil, sizeof(__pyx_k_Pddt_ceil), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_closest, __pyx_k_Pddt_closest, sizeof(__pyx_k_Pddt_closest), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_combine, __pyx_k_Pddt_combine, sizeof(__pyx_k_Pddt_combine), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_ctime, __pyx_k_Pddt_ctime, sizeof(__pyx_k_Pddt_ctime), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_date, __pyx_k_Pddt_date, sizeof(__pyx_k_Pddt_date), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_date_range, __pyx_k_Pddt_date_range, sizeof(__pyx_k_Pddt_date_range), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_datetime, __pyx_k_Pddt_datetime, sizeof(__pyx_k_Pddt_datetime), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_day, __pyx_k_Pddt_day, sizeof(__pyx_k_Pddt_day), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_days_bf_month, __pyx_k_Pddt_days_bf_month, sizeof(__pyx_k_Pddt_days_bf_month), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_days_bf_quarter, __pyx_k_Pddt_days_bf_quarter, sizeof(__pyx_k_Pddt_days_bf_quarter), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_days_bf_year, __pyx_k_Pddt_days_bf_year, sizeof(__pyx_k_Pddt_days_bf_year), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_days_in_month, __pyx_k_Pddt_days_in_month, sizeof(__pyx_k_Pddt_days_in_month), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_days_in_quarter, __pyx_k_Pddt_days_in_quarter, sizeof(__pyx_k_Pddt_days_in_quarter), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_days_in_year, __pyx_k_Pddt_days_in_year, sizeof(__pyx_k_Pddt_days_in_year), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_days_of_month, __pyx_k_Pddt_days_of_month, sizeof(__pyx_k_Pddt_days_of_month), 0, 0, 1, 1},
    {&__pyx_kp_u_Pddt_days_of_month_line_3389, __pyx_k_Pddt_days_of_month_line_3389, sizeof(__pyx_k_Pddt_days_of_month_line_3389), 0, 1, 0, 0},
    {&__pyx_n_s_Pddt_days_of_quarter, __pyx_k_Pddt_days_of_quarter, sizeof(__pyx_k_Pddt_days_of_quarter), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_days_of_year, __pyx_k_Pddt_days_of_year, sizeof(__pyx_k_Pddt_days_of_year), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_diff, __pyx_k_Pddt_diff, sizeof(__pyx_k_Pddt_diff), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_farthest, __pyx_k_Pddt_farthest, sizeof(__pyx_k_Pddt_farthest), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_floor, __pyx_k_Pddt_floor, sizeof(__pyx_k_Pddt_floor), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_fromdate, __pyx_k_Pddt_fromdate, sizeof(__pyx_k_Pddt_fromdate), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_fromdatetime, __pyx_k_Pddt_fromdatetime, sizeof(__pyx_k_Pddt_fromdatetime), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_fromdatetime64, __pyx_k_Pddt_fromdatetime64, sizeof(__pyx_k_Pddt_fromdatetime64), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_fromicroseconds, __pyx_k_Pddt_fromicroseconds, sizeof(__pyx_k_Pddt_fromicroseconds), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_fromisocalendar, __pyx_k_Pddt_fromisocalendar, sizeof(__pyx_k_Pddt_fromisocalendar), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_fromisocalendar_locals__par, __pyx_k_Pddt_fromisocalendar_locals__par, sizeof(__pyx_k_Pddt_fromisocalendar_locals__par), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_fromisocalendar_locals__par_2, __pyx_k_Pddt_fromisocalendar_locals__par_2, sizeof(__pyx_k_Pddt_fromisocalendar_locals__par_2), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_fromisoformat, __pyx_k_Pddt_fromisoformat, sizeof(__pyx_k_Pddt_fromisoformat), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_fromordinal, __pyx_k_Pddt_fromordinal, sizeof(__pyx_k_Pddt_fromordinal), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_fromseconds, __pyx_k_Pddt_fromseconds, sizeof(__pyx_k_Pddt_fromseconds), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_fromtimestamp, __pyx_k_Pddt_fromtimestamp, sizeof(__pyx_k_Pddt_fromtimestamp), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_fsp, __pyx_k_Pddt_fsp, sizeof(__pyx_k_Pddt_fsp), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_hour, __pyx_k_Pddt_hour, sizeof(__pyx_k_Pddt_hour), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_is_day, __pyx_k_Pddt_is_day, sizeof(__pyx_k_Pddt_is_day), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_is_end_of, __pyx_k_Pddt_is_end_of, sizeof(__pyx_k_Pddt_is_end_of), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_is_first_of, __pyx_k_Pddt_is_first_of, sizeof(__pyx_k_Pddt_is_first_of), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_is_future, __pyx_k_Pddt_is_future, sizeof(__pyx_k_Pddt_is_future), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_is_last_of, __pyx_k_Pddt_is_last_of, sizeof(__pyx_k_Pddt_is_last_of), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_is_leap_year, __pyx_k_Pddt_is_leap_year, sizeof(__pyx_k_Pddt_is_leap_year), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_is_local, __pyx_k_Pddt_is_local, sizeof(__pyx_k_Pddt_is_local), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_is_long_year, __pyx_k_Pddt_is_long_year, sizeof(__pyx_k_Pddt_is_long_year), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_is_month, __pyx_k_Pddt_is_month, sizeof(__pyx_k_Pddt_is_month), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_is_past, __pyx_k_Pddt_is_past, sizeof(__pyx_k_Pddt_is_past), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_is_quarter, __pyx_k_Pddt_is_quarter, sizeof(__pyx_k_Pddt_is_quarter), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_is_start_of, __pyx_k_Pddt_is_start_of, sizeof(__pyx_k_Pddt_is_start_of), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_is_utc, __pyx_k_Pddt_is_utc, sizeof(__pyx_k_Pddt_is_utc), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_is_weekday, __pyx_k_Pddt_is_weekday, sizeof(__pyx_k_Pddt_is_weekday), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_is_year, __pyx_k_Pddt_is_year, sizeof(__pyx_k_Pddt_is_year), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_isocalendar, __pyx_k_Pddt_isocalendar, sizeof(__pyx_k_Pddt_isocalendar), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_isoformat, __pyx_k_Pddt_isoformat, sizeof(__pyx_k_Pddt_isoformat), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_isoweek, __pyx_k_Pddt_isoweek, sizeof(__pyx_k_Pddt_isoweek), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_isoweekday, __pyx_k_Pddt_isoweekday, sizeof(__pyx_k_Pddt_isoweekday), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_isoyear, __pyx_k_Pddt_isoyear, sizeof(__pyx_k_Pddt_isoyear), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_leap_bt_year, __pyx_k_Pddt_leap_bt_year, sizeof(__pyx_k_Pddt_leap_bt_year), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_microsecond, __pyx_k_Pddt_microsecond, sizeof(__pyx_k_Pddt_microsecond), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_microseconds, __pyx_k_Pddt_microseconds, sizeof(__pyx_k_Pddt_microseconds), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_millisecond, __pyx_k_Pddt_millisecond, sizeof(__pyx_k_Pddt_millisecond), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_minute, __pyx_k_Pddt_minute, sizeof(__pyx_k_Pddt_minute), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_month, __pyx_k_Pddt_month, sizeof(__pyx_k_Pddt_month), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_nanosecond, __pyx_k_Pddt_nanosecond, sizeof(__pyx_k_Pddt_nanosecond), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_now, __pyx_k_Pddt_now, sizeof(__pyx_k_Pddt_now), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_parse, __pyx_k_Pddt_parse, sizeof(__pyx_k_Pddt_parse), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_quarter, __pyx_k_Pddt_quarter, sizeof(__pyx_k_Pddt_quarter), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_replace, __pyx_k_Pddt_replace, sizeof(__pyx_k_Pddt_replace), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_round, __pyx_k_Pddt_round, sizeof(__pyx_k_Pddt_round), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_second, __pyx_k_Pddt_second, sizeof(__pyx_k_Pddt_second), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_seconds, __pyx_k_Pddt_seconds, sizeof(__pyx_k_Pddt_seconds), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_snap, __pyx_k_Pddt_snap, sizeof(__pyx_k_Pddt_snap), 0, 0, 1, 1},
    {&__pyx_kp_u_Pddt_snap_line_2367, __pyx_k_Pddt_snap_line_2367, sizeof(__pyx_k_Pddt_snap_line_2367), 0, 1, 0, 0},
    {&__pyx_n_s_Pddt_strptime, __pyx_k_Pddt_strptime, sizeof(__pyx_k_Pddt_strptime), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_sub, __pyx_k_Pddt_sub, sizeof(__pyx_k_Pddt_sub), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_time, __pyx_k_Pddt_time, sizeof(__pyx_k_Pddt_time), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_timedf, __pyx_k_Pddt_timedf, sizeof(__pyx_k_Pddt_timedf), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_timestamp, __pyx_k_Pddt_timestamp, sizeof(__pyx_k_Pddt_timestamp), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_timetz, __pyx_k_Pddt_timetz, sizeof(__pyx_k_Pddt_timetz), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_to_curr_month, __pyx_k_Pddt_to_curr_month, sizeof(__pyx_k_Pddt_to_curr_month), 0, 0, 1, 1},
    {&__pyx_kp_u_Pddt_to_curr_month_line_2028, __pyx_k_Pddt_to_curr_month_line_2028, sizeof(__pyx_k_Pddt_to_curr_month_line_2028), 0, 1, 0, 0},
    {&__pyx_n_s_Pddt_to_curr_quarter, __pyx_k_Pddt_to_curr_quarter, sizeof(__pyx_k_Pddt_to_curr_quarter), 0, 0, 1, 1},
    {&__pyx_kp_u_Pddt_to_curr_quarter_line_1853, __pyx_k_Pddt_to_curr_quarter_line_1853, sizeof(__pyx_k_Pddt_to_curr_quarter_line_1853), 0, 1, 0, 0},
    {&__pyx_n_s_Pddt_to_curr_weekday, __pyx_k_Pddt_to_curr_weekday, sizeof(__pyx_k_Pddt_to_curr_weekday), 0, 0, 1, 1},
    {&__pyx_kp_u_Pddt_to_curr_weekday_line_2200, __pyx_k_Pddt_to_curr_weekday_line_2200, sizeof(__pyx_k_Pddt_to_curr_weekday_line_2200), 0, 1, 0, 0},
    {&__pyx_n_s_Pddt_to_curr_year, __pyx_k_Pddt_to_curr_year, sizeof(__pyx_k_Pddt_to_curr_year), 0, 0, 1, 1},
    {&__pyx_kp_u_Pddt_to_curr_year_line_1652, __pyx_k_Pddt_to_curr_year_line_1652, sizeof(__pyx_k_Pddt_to_curr_year_line_1652), 0, 1, 0, 0},
    {&__pyx_n_s_Pddt_to_date, __pyx_k_Pddt_to_date, sizeof(__pyx_k_Pddt_to_date), 0, 0, 1, 1},
    {&__pyx_kp_u_Pddt_to_date_line_2527, __pyx_k_Pddt_to_date_line_2527, sizeof(__pyx_k_Pddt_to_date_line_2527), 0, 1, 0, 0},
    {&__pyx_n_s_Pddt_to_datetime, __pyx_k_Pddt_to_datetime, sizeof(__pyx_k_Pddt_to_datetime), 0, 0, 1, 1},
    {&__pyx_kp_u_Pddt_to_datetime_line_2383, __pyx_k_Pddt_to_datetime_line_2383, sizeof(__pyx_k_Pddt_to_datetime_line_2383), 0, 1, 0, 0},
    {&__pyx_n_s_Pddt_to_day, __pyx_k_Pddt_to_day, sizeof(__pyx_k_Pddt_to_day), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_to_end_of, __pyx_k_Pddt_to_end_of, sizeof(__pyx_k_Pddt_to_end_of), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_to_first_of, __pyx_k_Pddt_to_first_of, sizeof(__pyx_k_Pddt_to_first_of), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_to_friday, __pyx_k_Pddt_to_friday, sizeof(__pyx_k_Pddt_to_friday), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_to_last_of, __pyx_k_Pddt_to_last_of, sizeof(__pyx_k_Pddt_to_last_of), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_to_monday, __pyx_k_Pddt_to_monday, sizeof(__pyx_k_Pddt_to_monday), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_to_month, __pyx_k_Pddt_to_month, sizeof(__pyx_k_Pddt_to_month), 0, 0, 1, 1},
    {&__pyx_kp_u_Pddt_to_month_line_2109, __pyx_k_Pddt_to_month_line_2109, sizeof(__pyx_k_Pddt_to_month_line_2109), 0, 1, 0, 0},
    {&__pyx_n_s_Pddt_to_next_month, __pyx_k_Pddt_to_next_month, sizeof(__pyx_k_Pddt_to_next_month), 0, 0, 1, 1},
    {&__pyx_kp_u_Pddt_to_next_month_line_2096, __pyx_k_Pddt_to_next_month_line_2096, sizeof(__pyx_k_Pddt_to_next_month_line_2096), 0, 1, 0, 0},
    {&__pyx_n_s_Pddt_to_next_quarter, __pyx_k_Pddt_to_next_quarter, sizeof(__pyx_k_Pddt_to_next_quarter), 0, 0, 1, 1},
    {&__pyx_kp_u_Pddt_to_next_quarter_line_1935, __pyx_k_Pddt_to_next_quarter_line_1935, sizeof(__pyx_k_Pddt_to_next_quarter_line_1935), 0, 1, 0, 0},
    {&__pyx_n_s_Pddt_to_next_weekday, __pyx_k_Pddt_to_next_weekday, sizeof(__pyx_k_Pddt_to_next_weekday), 0, 0, 1, 1},
    {&__pyx_kp_u_Pddt_to_next_weekday_line_2228, __pyx_k_Pddt_to_next_weekday_line_2228, sizeof(__pyx_k_Pddt_to_next_weekday_line_2228), 0, 1, 0, 0},
    {&__pyx_n_s_Pddt_to_next_year, __pyx_k_Pddt_to_next_year, sizeof(__pyx_k_Pddt_to_next_year), 0, 0, 1, 1},
    {&__pyx_kp_u_Pddt_to_next_year_line_1748, __pyx_k_Pddt_to_next_year_line_1748, sizeof(__pyx_k_Pddt_to_next_year_line_1748), 0, 1, 0, 0},
    {&__pyx_n_s_Pddt_to_prev_month, __pyx_k_Pddt_to_prev_month, sizeof(__pyx_k_Pddt_to_prev_month), 0, 0, 1, 1},
    {&__pyx_kp_u_Pddt_to_prev_month_line_2083, __pyx_k_Pddt_to_prev_month_line_2083, sizeof(__pyx_k_Pddt_to_prev_month_line_2083), 0, 1, 0, 0},
    {&__pyx_n_s_Pddt_to_prev_quarter, __pyx_k_Pddt_to_prev_quarter, sizeof(__pyx_k_Pddt_to_prev_quarter), 0, 0, 1, 1},
    {&__pyx_kp_u_Pddt_to_prev_quarter_line_1918, __pyx_k_Pddt_to_prev_quarter_line_1918, sizeof(__pyx_k_Pddt_to_prev_quarter_line_1918), 0, 1, 0, 0},
    {&__pyx_n_s_Pddt_to_prev_weekday, __pyx_k_Pddt_to_prev_weekday, sizeof(__pyx_k_Pddt_to_prev_weekday), 0, 0, 1, 1},
    {&__pyx_kp_u_Pddt_to_prev_weekday_line_2214, __pyx_k_Pddt_to_prev_weekday_line_2214, sizeof(__pyx_k_Pddt_to_prev_weekday_line_2214), 0, 1, 0, 0},
    {&__pyx_n_s_Pddt_to_prev_year, __pyx_k_Pddt_to_prev_year, sizeof(__pyx_k_Pddt_to_prev_year), 0, 0, 1, 1},
    {&__pyx_kp_u_Pddt_to_prev_year_line_1725, __pyx_k_Pddt_to_prev_year_line_1725, sizeof(__pyx_k_Pddt_to_prev_year_line_1725), 0, 1, 0, 0},
    {&__pyx_n_s_Pddt_to_quarter, __pyx_k_Pddt_to_quarter, sizeof(__pyx_k_Pddt_to_quarter), 0, 0, 1, 1},
    {&__pyx_kp_u_Pddt_to_quarter_line_1952, __pyx_k_Pddt_to_quarter_line_1952, sizeof(__pyx_k_Pddt_to_quarter_line_1952), 0, 1, 0, 0},
    {&__pyx_n_s_Pddt_to_saturday, __pyx_k_Pddt_to_saturday, sizeof(__pyx_k_Pddt_to_saturday), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_to_start_of, __pyx_k_Pddt_to_start_of, sizeof(__pyx_k_Pddt_to_start_of), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_to_sunday, __pyx_k_Pddt_to_sunday, sizeof(__pyx_k_Pddt_to_sunday), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_to_thursday, __pyx_k_Pddt_to_thursday, sizeof(__pyx_k_Pddt_to_thursday), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_to_time, __pyx_k_Pddt_to_time, sizeof(__pyx_k_Pddt_to_time), 0, 0, 1, 1},
    {&__pyx_kp_u_Pddt_to_time_line_2588, __pyx_k_Pddt_to_time_line_2588, sizeof(__pyx_k_Pddt_to_time_line_2588), 0, 1, 0, 0},
    {&__pyx_n_s_Pddt_to_tomorrow, __pyx_k_Pddt_to_tomorrow, sizeof(__pyx_k_Pddt_to_tomorrow), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_to_tuesday, __pyx_k_Pddt_to_tuesday, sizeof(__pyx_k_Pddt_to_tuesday), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_to_wednesday, __pyx_k_Pddt_to_wednesday, sizeof(__pyx_k_Pddt_to_wednesday), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_to_weekday, __pyx_k_Pddt_to_weekday, sizeof(__pyx_k_Pddt_to_weekday), 0, 0, 1, 1},
    {&__pyx_kp_u_Pddt_to_weekday_line_2242, __pyx_k_Pddt_to_weekday_line_2242, sizeof(__pyx_k_Pddt_to_weekday_line_2242), 0, 1, 0, 0},
    {&__pyx_n_s_Pddt_to_year, __pyx_k_Pddt_to_year, sizeof(__pyx_k_Pddt_to_year), 0, 0, 1, 1},
    {&__pyx_kp_u_Pddt_to_year_line_1771, __pyx_k_Pddt_to_year_line_1771, sizeof(__pyx_k_Pddt_to_year_line_1771), 0, 1, 0, 0},
    {&__pyx_n_s_Pddt_to_yesterday, __pyx_k_Pddt_to_yesterday, sizeof(__pyx_k_Pddt_to_yesterday), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_today, __pyx_k_Pddt_today, sizeof(__pyx_k_Pddt_today), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_toordinal, __pyx_k_Pddt_toordinal, sizeof(__pyx_k_Pddt_toordinal), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_tz_available, __pyx_k_Pddt_tz_available, sizeof(__pyx_k_Pddt_tz_available), 0, 0, 1, 1},
    {&__pyx_kp_u_Pddt_tz_available_line_3574, __pyx_k_Pddt_tz_available_line_3574, sizeof(__pyx_k_Pddt_tz_available_line_3574), 0, 1, 0, 0},
    {&__pyx_n_s_Pddt_tz_convert, __pyx_k_Pddt_tz_convert, sizeof(__pyx_k_Pddt_tz_convert), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_tz_localize, __pyx_k_Pddt_tz_localize, sizeof(__pyx_k_Pddt_tz_localize), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_tz_switch, __pyx_k_Pddt_tz_switch, sizeof(__pyx_k_Pddt_tz_switch), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_tzname, __pyx_k_Pddt_tzname, sizeof(__pyx_k_Pddt_tzname), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_utcfromtimestamp, __pyx_k_Pddt_utcfromtimestamp, sizeof(__pyx_k_Pddt_utcfromtimestamp), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_utcnow, __pyx_k_Pddt_utcnow, sizeof(__pyx_k_Pddt_utcnow), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_utctimedf, __pyx_k_Pddt_utctimedf, sizeof(__pyx_k_Pddt_utctimedf), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_values_naive, __pyx_k_Pddt_values_naive, sizeof(__pyx_k_Pddt_values_naive), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_weekday, __pyx_k_Pddt_weekday, sizeof(__pyx_k_Pddt_weekday), 0, 0, 1, 1},
    {&__pyx_n_s_Pddt_year, __pyx_k_Pddt_year, sizeof(__pyx_k_Pddt_year), 0, 0, 1, 1},
    {&__pyx_n_u_Q, __pyx_k_Q, sizeof(__pyx_k_Q), 0, 1, 0, 1},
    {&__pyx_kp_u_Return_the_number_of_days_1_31_s, __pyx_k_Return_the_number_of_days_1_31_s, sizeof(__pyx_k_Return_the_number_of_days_1_31_s), 0, 1, 0, 0},
    {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
    {&__pyx_n_u_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 1, 0, 1},
    {&__pyx_n_u_Sat, __pyx_k_Sat, sizeof(__pyx_k_Sat), 0, 1, 0, 1},
    {&__pyx_n_s_Self, __pyx_k_Self, sizeof(__pyx_k_Self), 0, 0, 1, 1},
    {&__pyx_n_u_Sep, __pyx_k_Sep, sizeof(__pyx_k_Sep), 0, 1, 0, 1},
    {&__pyx_n_s_Series, __pyx_k_Series, sizeof(__pyx_k_Series), 0, 0, 1, 1},
    {&__pyx_kp_u_Snap_to_nearest_occurring_freque, __pyx_k_Snap_to_nearest_occurring_freque, sizeof(__pyx_k_Snap_to_nearest_occurring_freque), 0, 1, 0, 0},
    {&__pyx_n_u_Sun, __pyx_k_Sun, sizeof(__pyx_k_Sun), 0, 1, 0, 1},
    {&__pyx_n_u_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 1, 0, 1},
    {&__pyx_kp_u_The_available_timezone_names_set, __pyx_k_The_available_timezone_names_set, sizeof(__pyx_k_The_available_timezone_names_set), 0, 1, 0, 0},
    {&__pyx_n_u_Thu, __pyx_k_Thu, sizeof(__pyx_k_Thu), 0, 1, 0, 1},
    {&__pyx_kp_u_Time_zones_are_not_available_fro, __pyx_k_Time_zones_are_not_available_fro, sizeof(__pyx_k_Time_zones_are_not_available_fro), 0, 1, 0, 0},
    {&__pyx_n_s_Timestamp, __pyx_k_Timestamp, sizeof(__pyx_k_Timestamp), 0, 0, 1, 1},
    {&__pyx_kp_u_Timezone_aware, __pyx_k_Timezone_aware, sizeof(__pyx_k_Timezone_aware), 0, 1, 0, 0},
    {&__pyx_kp_u_Timezone_naive, __pyx_k_Timezone_naive, sizeof(__pyx_k_Timezone_naive), 0, 1, 0, 0},
    {&__pyx_n_u_Tue, __pyx_k_Tue, sizeof(__pyx_k_Tue), 0, 1, 0, 1},
    {&__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_n_u_W, __pyx_k_W, sizeof(__pyx_k_W), 0, 1, 0, 1},
    {&__pyx_n_u_Wed, __pyx_k_Wed, sizeof(__pyx_k_Wed), 0, 1, 0, 1},
    {&__pyx_n_u_Y, __pyx_k_Y, sizeof(__pyx_k_Y), 0, 1, 0, 1},
    {&__pyx_kp_u_Y_m_d, __pyx_k_Y_m_d, sizeof(__pyx_k_Y_m_d), 0, 1, 0, 0},
    {&__pyx_n_s_ZeroDivisionError, __pyx_k_ZeroDivisionError, sizeof(__pyx_k_ZeroDivisionError), 0, 0, 1, 1},
    {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0},
    {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0},
    {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0},
    {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0},
    {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0},
    {&__pyx_kp_u__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 1, 0, 0},
    {&__pyx_kp_u__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0, 0},
    {&__pyx_n_s__242, __pyx_k__242, sizeof(__pyx_k__242), 0, 0, 1, 1},
    {&__pyx_kp_u__43, __pyx_k__43, sizeof(__pyx_k__43), 0, 1, 0, 0},
    {&__pyx_n_s__44, __pyx_k__44, sizeof(__pyx_k__44), 0, 0, 1, 1},
    {&__pyx_n_s__79, __pyx_k__79, sizeof(__pyx_k__79), 0, 0, 1, 1},
    {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0},
    {&__pyx_kp_u_a_b_d_H_M_S_Y, __pyx_k_a_b_d_H_M_S_Y, sizeof(__pyx_k_a_b_d_H_M_S_Y), 0, 1, 0, 0},
    {&__pyx_n_s_absolute, __pyx_k_absolute, sizeof(__pyx_k_absolute), 0, 0, 1, 1},
    {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
    {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
    {&__pyx_n_s_ambiguous, __pyx_k_ambiguous, sizeof(__pyx_k_ambiguous), 0, 0, 1, 1},
    {&__pyx_kp_u_ambiguous_NaT_is_not_supported, __pyx_k_ambiguous_NaT_is_not_supported, sizeof(__pyx_k_ambiguous_NaT_is_not_supported), 0, 1, 0, 0},
    {&__pyx_n_s_arr, __pyx_k_arr, sizeof(__pyx_k_arr), 0, 0, 1, 1},
    {&__pyx_n_s_arr_ptr, __pyx_k_arr_ptr, sizeof(__pyx_k_arr_ptr), 0, 0, 1, 1},
    {&__pyx_n_s_arr_size, __pyx_k_arr_size, sizeof(__pyx_k_arr_size), 0, 0, 1, 1},
    {&__pyx_kp_u_array_size_must_be_and_integer_0, __pyx_k_array_size_must_be_and_integer_0, sizeof(__pyx_k_array_size_must_be_and_integer_0), 0, 1, 0, 0},
    {&__pyx_kp_u_array_size_must_be_greater_than, __pyx_k_array_size_must_be_greater_than, sizeof(__pyx_k_array_size_must_be_greater_than), 0, 1, 0, 0},
    {&__pyx_n_u_as, __pyx_k_as, sizeof(__pyx_k_as), 0, 1, 0, 1},
    {&__pyx_n_s_as_unit, __pyx_k_as_unit, sizeof(__pyx_k_as_unit), 0, 0, 1, 1},
    {&__pyx_n_s_astimezone, __pyx_k_astimezone, sizeof(__pyx_k_astimezone), 0, 0, 1, 1},
    {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1},
    {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
    {&__pyx_n_s_available_timezones, __pyx_k_available_timezones, sizeof(__pyx_k_available_timezones), 0, 0, 1, 1},
    {&__pyx_n_s_available_timezones_2, __pyx_k_available_timezones_2, sizeof(__pyx_k_available_timezones_2), 0, 0, 1, 1},
    {&__pyx_n_s_base_tz, __pyx_k_base_tz, sizeof(__pyx_k_base_tz), 0, 0, 1, 1},
    {&__pyx_kp_u_between_naive_aware_datetimes_T, __pyx_k_between_naive_aware_datetimes_T, sizeof(__pyx_k_between_naive_aware_datetimes_T), 0, 1, 0, 0},
    {&__pyx_kp_u_between_naive_aware_datetimes_T_2, __pyx_k_between_naive_aware_datetimes_T_2, sizeof(__pyx_k_between_naive_aware_datetimes_T_2), 0, 1, 0, 0},
    {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1},
    {&__pyx_kp_s_bool_None, __pyx_k_bool_None, sizeof(__pyx_k_bool_None), 0, 0, 1, 0},
    {&__pyx_n_u_both, __pyx_k_both, sizeof(__pyx_k_both), 0, 1, 0, 1},
    {&__pyx_kp_u_calcuate_average, __pyx_k_calcuate_average, sizeof(__pyx_k_calcuate_average), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot, __pyx_k_cannot, sizeof(__pyx_k_cannot), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_access_the_time_value_fro, __pyx_k_cannot_access_the_time_value_fro, sizeof(__pyx_k_cannot_access_the_time_value_fro), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_cast, __pyx_k_cannot_cast, sizeof(__pyx_k_cannot_cast), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_cast_ndarray, __pyx_k_cannot_cast_ndarray, sizeof(__pyx_k_cannot_cast_ndarray), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_cast_ndarray_2, __pyx_k_cannot_cast_ndarray_2, sizeof(__pyx_k_cannot_cast_ndarray_2), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_ceil_to_multiple_0, __pyx_k_cannot_ceil_to_multiple_0, sizeof(__pyx_k_cannot_ceil_to_multiple_0), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_check_if_ndarray_s_is_wit, __pyx_k_cannot_check_if_ndarray_s_is_wit, sizeof(__pyx_k_cannot_check_if_ndarray_s_is_wit), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_check_ndarray, __pyx_k_cannot_check_ndarray, sizeof(__pyx_k_cannot_check_ndarray), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_compare_between_arrays_wi, __pyx_k_cannot_compare_between_arrays_wi, sizeof(__pyx_k_cannot_compare_between_arrays_wi), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_compare_ndarrays_with_dif, __pyx_k_cannot_compare_ndarrays_with_dif, sizeof(__pyx_k_cannot_compare_ndarrays_with_dif), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_convert_ndarray, __pyx_k_cannot_convert_ndarray, sizeof(__pyx_k_cannot_convert_ndarray), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_convert_ndarray_from_date, __pyx_k_cannot_convert_ndarray_from_date, sizeof(__pyx_k_cannot_convert_ndarray_from_date), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_convert_s_to_an_integer_t, __pyx_k_cannot_convert_s_to_an_integer_t, sizeof(__pyx_k_cannot_convert_s_to_an_integer_t), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_convert_s_to_an_integer_t_2, __pyx_k_cannot_convert_s_to_an_integer_t_2, sizeof(__pyx_k_cannot_convert_s_to_an_integer_t_2), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_convert_s_to_float_to_rep, __pyx_k_cannot_convert_s_to_float_to_rep, sizeof(__pyx_k_cannot_convert_s_to_float_to_rep), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_covnert_s_to_an_integer_t, __pyx_k_cannot_covnert_s_to_an_integer_t, sizeof(__pyx_k_cannot_covnert_s_to_an_integer_t), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_covnert_s_to_float_to_rep, __pyx_k_cannot_covnert_s_to_float_to_rep, sizeof(__pyx_k_cannot_covnert_s_to_float_to_rep), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_floor_to_multiple_0, __pyx_k_cannot_floor_to_multiple_0, sizeof(__pyx_k_cannot_floor_to_multiple_0), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_get_the_length_of_s_to_re, __pyx_k_cannot_get_the_length_of_s_to_re, sizeof(__pyx_k_cannot_get_the_length_of_s_to_re), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_perform_addition_on_ndarr, __pyx_k_cannot_perform_addition_on_ndarr, sizeof(__pyx_k_cannot_perform_addition_on_ndarr), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_perform_comparison_on_nda, __pyx_k_cannot_perform_comparison_on_nda, sizeof(__pyx_k_cannot_perform_comparison_on_nda), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_perform_subtraction_on_nd, __pyx_k_cannot_perform_subtraction_on_nd, sizeof(__pyx_k_cannot_perform_subtraction_on_nd), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_round_to_multiple_0, __pyx_k_cannot_round_to_multiple_0, sizeof(__pyx_k_cannot_round_to_multiple_0), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_unpack_s_to_iso_calendar, __pyx_k_cannot_unpack_s_to_iso_calendar, sizeof(__pyx_k_cannot_unpack_s_to_iso_calendar), 0, 1, 0, 0},
    {&__pyx_n_s_ceil, __pyx_k_ceil, sizeof(__pyx_k_ceil), 0, 0, 1, 1},
    {&__pyx_n_u_ceil, __pyx_k_ceil, sizeof(__pyx_k_ceil), 0, 1, 0, 1},
    {&__pyx_n_s_cfg, __pyx_k_cfg, sizeof(__pyx_k_cfg), 0, 0, 1, 1},
    {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 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_closest, __pyx_k_closest, sizeof(__pyx_k_closest), 0, 0, 1, 1},
    {&__pyx_n_u_closest, __pyx_k_closest, sizeof(__pyx_k_closest), 0, 1, 0, 1},
    {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1},
    {&__pyx_n_s_columns, __pyx_k_columns, sizeof(__pyx_k_columns), 0, 0, 1, 1},
    {&__pyx_n_s_combine, __pyx_k_combine, sizeof(__pyx_k_combine), 0, 0, 1, 1},
    {&__pyx_n_u_compare, __pyx_k_compare, sizeof(__pyx_k_compare), 0, 1, 0, 1},
    {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
    {&__pyx_n_s_ctime, __pyx_k_ctime, sizeof(__pyx_k_ctime), 0, 0, 1, 1},
    {&__pyx_kp_s_cython_bint, __pyx_k_cython_bint, sizeof(__pyx_k_cython_bint), 0, 0, 1, 0},
    {&__pyx_kp_s_cython_int, __pyx_k_cython_int, sizeof(__pyx_k_cython_int), 0, 0, 1, 0},
    {&__pyx_n_s_cytimes, __pyx_k_cytimes, sizeof(__pyx_k_cytimes), 0, 0, 1, 1},
    {&__pyx_n_s_cytimes_parser, __pyx_k_cytimes_parser, sizeof(__pyx_k_cytimes_parser), 0, 0, 1, 1},
    {&__pyx_n_s_cytimes_pddt, __pyx_k_cytimes_pddt, sizeof(__pyx_k_cytimes_pddt), 0, 0, 1, 1},
    {&__pyx_n_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 1},
    {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
    {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1},
    {&__pyx_n_s_date_range, __pyx_k_date_range, sizeof(__pyx_k_date_range), 0, 0, 1, 1},
    {&__pyx_n_s_dates, __pyx_k_dates, sizeof(__pyx_k_dates), 0, 0, 1, 1},
    {&__pyx_n_s_datesD, __pyx_k_datesD, sizeof(__pyx_k_datesD), 0, 0, 1, 1},
    {&__pyx_n_s_datesD_1st, __pyx_k_datesD_1st, sizeof(__pyx_k_datesD_1st), 0, 0, 1, 1},
    {&__pyx_n_s_datesD_lst, __pyx_k_datesD_lst, sizeof(__pyx_k_datesD_lst), 0, 0, 1, 1},
    {&__pyx_n_s_datesM, __pyx_k_datesM, sizeof(__pyx_k_datesM), 0, 0, 1, 1},
    {&__pyx_n_s_datesQ, __pyx_k_datesQ, sizeof(__pyx_k_datesQ), 0, 0, 1, 1},
    {&__pyx_n_s_datesY, __pyx_k_datesY, sizeof(__pyx_k_datesY), 0, 0, 1, 1},
    {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1},
    {&__pyx_n_s_datetime64, __pyx_k_datetime64, sizeof(__pyx_k_datetime64), 0, 0, 1, 1},
    {&__pyx_n_u_datetime64, __pyx_k_datetime64, sizeof(__pyx_k_datetime64), 0, 1, 0, 1},
    {&__pyx_kp_u_datetime64_D, __pyx_k_datetime64_D, sizeof(__pyx_k_datetime64_D), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime64_M, __pyx_k_datetime64_M, sizeof(__pyx_k_datetime64_M), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime64_W, __pyx_k_datetime64_W, sizeof(__pyx_k_datetime64_W), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime64_Y, __pyx_k_datetime64_Y, sizeof(__pyx_k_datetime64_Y), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime64_h, __pyx_k_datetime64_h, sizeof(__pyx_k_datetime64_h), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime64_m, __pyx_k_datetime64_m, sizeof(__pyx_k_datetime64_m), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime64_ms, __pyx_k_datetime64_ms, sizeof(__pyx_k_datetime64_ms), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime64_ns, __pyx_k_datetime64_ns, sizeof(__pyx_k_datetime64_ns), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime64_s, __pyx_k_datetime64_s, sizeof(__pyx_k_datetime64_s), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime64_s_2, __pyx_k_datetime64_s_2, sizeof(__pyx_k_datetime64_s_2), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime64_us, __pyx_k_datetime64_us, sizeof(__pyx_k_datetime64_us), 0, 1, 0, 0},
    {&__pyx_kp_s_datetime_date_object, __pyx_k_datetime_date_object, sizeof(__pyx_k_datetime_date_object), 0, 0, 1, 0},
    {&__pyx_kp_s_datetime_date_str_None, __pyx_k_datetime_date_str_None, sizeof(__pyx_k_datetime_date_str_None), 0, 0, 1, 0},
    {&__pyx_kp_s_datetime_datetime_object, __pyx_k_datetime_datetime_object, sizeof(__pyx_k_datetime_datetime_object), 0, 0, 1, 0},
    {&__pyx_kp_u_datetime_s_is_ambiguous, __pyx_k_datetime_s_is_ambiguous, sizeof(__pyx_k_datetime_s_is_ambiguous), 0, 1, 0, 0},
    {&__pyx_kp_s_datetime_time_str_None, __pyx_k_datetime_time_str_None, sizeof(__pyx_k_datetime_time_str_None), 0, 0, 1, 0},
    {&__pyx_kp_s_datetime_tzinfo_str_None, __pyx_k_datetime_tzinfo_str_None, sizeof(__pyx_k_datetime_tzinfo_str_None), 0, 0, 1, 0},
    {&__pyx_n_s_day, __pyx_k_day, sizeof(__pyx_k_day), 0, 0, 1, 1},
    {&__pyx_n_u_day, __pyx_k_day, sizeof(__pyx_k_day), 0, 1, 0, 1},
    {&__pyx_n_s_day1st, __pyx_k_day1st, sizeof(__pyx_k_day1st), 0, 0, 1, 1},
    {&__pyx_n_s_dayfirst, __pyx_k_dayfirst, sizeof(__pyx_k_dayfirst), 0, 0, 1, 1},
    {&__pyx_n_s_days, __pyx_k_days, sizeof(__pyx_k_days), 0, 0, 1, 1},
    {&__pyx_n_s_days_bf_month, __pyx_k_days_bf_month, sizeof(__pyx_k_days_bf_month), 0, 0, 1, 1},
    {&__pyx_n_u_days_bf_month, __pyx_k_days_bf_month, sizeof(__pyx_k_days_bf_month), 0, 1, 0, 1},
    {&__pyx_n_s_days_bf_quarter, __pyx_k_days_bf_quarter, sizeof(__pyx_k_days_bf_quarter), 0, 0, 1, 1},
    {&__pyx_n_u_days_bf_quarter, __pyx_k_days_bf_quarter, sizeof(__pyx_k_days_bf_quarter), 0, 1, 0, 1},
    {&__pyx_n_s_days_bf_year, __pyx_k_days_bf_year, sizeof(__pyx_k_days_bf_year), 0, 0, 1, 1},
    {&__pyx_n_u_days_bf_year, __pyx_k_days_bf_year, sizeof(__pyx_k_days_bf_year), 0, 1, 0, 1},
    {&__pyx_n_s_days_in_month, __pyx_k_days_in_month, sizeof(__pyx_k_days_in_month), 0, 0, 1, 1},
    {&__pyx_n_u_days_in_month, __pyx_k_days_in_month, sizeof(__pyx_k_days_in_month), 0, 1, 0, 1},
    {&__pyx_n_s_days_in_quarter, __pyx_k_days_in_quarter, sizeof(__pyx_k_days_in_quarter), 0, 0, 1, 1},
    {&__pyx_n_u_days_in_quarter, __pyx_k_days_in_quarter, sizeof(__pyx_k_days_in_quarter), 0, 1, 0, 1},
    {&__pyx_n_s_days_in_year, __pyx_k_days_in_year, sizeof(__pyx_k_days_in_year), 0, 0, 1, 1},
    {&__pyx_n_u_days_in_year, __pyx_k_days_in_year, sizeof(__pyx_k_days_in_year), 0, 1, 0, 1},
    {&__pyx_n_s_days_of_month, __pyx_k_days_of_month, sizeof(__pyx_k_days_of_month), 0, 0, 1, 1},
    {&__pyx_n_u_days_of_month, __pyx_k_days_of_month, sizeof(__pyx_k_days_of_month), 0, 1, 0, 1},
    {&__pyx_n_s_days_of_quarter, __pyx_k_days_of_quarter, sizeof(__pyx_k_days_of_quarter), 0, 0, 1, 1},
    {&__pyx_n_u_days_of_quarter, __pyx_k_days_of_quarter, sizeof(__pyx_k_days_of_quarter), 0, 1, 0, 1},
    {&__pyx_n_s_days_of_year, __pyx_k_days_of_year, sizeof(__pyx_k_days_of_year), 0, 0, 1, 1},
    {&__pyx_n_u_days_of_year, __pyx_k_days_of_year, sizeof(__pyx_k_days_of_year), 0, 1, 0, 1},
    {&__pyx_n_s_dd, __pyx_k_dd, sizeof(__pyx_k_dd), 0, 0, 1, 1},
    {&__pyx_n_s_delta, __pyx_k_delta, sizeof(__pyx_k_delta), 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_u_diff, __pyx_k_diff, sizeof(__pyx_k_diff), 0, 1, 0, 1},
    {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
    {&__pyx_kp_u_division_by_zero_for_utils_arr_c, __pyx_k_division_by_zero_for_utils_arr_c, sizeof(__pyx_k_division_by_zero_for_utils_arr_c), 0, 1, 0, 0},
    {&__pyx_kp_u_division_by_zero_for_utils_arr_f, __pyx_k_division_by_zero_for_utils_arr_f, sizeof(__pyx_k_division_by_zero_for_utils_arr_f), 0, 1, 0, 0},
    {&__pyx_kp_u_division_by_zero_for_utils_arr_r, __pyx_k_division_by_zero_for_utils_arr_r, sizeof(__pyx_k_division_by_zero_for_utils_arr_r), 0, 1, 0, 0},
    {&__pyx_kp_u_division_by_zero_for_utils_math, __pyx_k_division_by_zero_for_utils_math, sizeof(__pyx_k_division_by_zero_for_utils_math), 0, 1, 0, 0},
    {&__pyx_kp_u_division_by_zero_for_utils_math_2, __pyx_k_division_by_zero_for_utils_math_2, sizeof(__pyx_k_division_by_zero_for_utils_math_2), 0, 1, 0, 0},
    {&__pyx_kp_u_division_by_zero_for_utils_math_3, __pyx_k_division_by_zero_for_utils_math_3, sizeof(__pyx_k_division_by_zero_for_utils_math_3), 0, 1, 0, 0},
    {&__pyx_kp_u_division_by_zero_for_utils_math_4, __pyx_k_division_by_zero_for_utils_math_4, sizeof(__pyx_k_division_by_zero_for_utils_math_4), 0, 1, 0, 0},
    {&__pyx_kp_u_division_by_zero_in_arr_mod, __pyx_k_division_by_zero_in_arr_mod, sizeof(__pyx_k_division_by_zero_in_arr_mod), 0, 1, 0, 0},
    {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
    {&__pyx_n_s_dst, __pyx_k_dst, sizeof(__pyx_k_dst), 0, 0, 1, 1},
    {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1},
    {&__pyx_n_s_dt64, __pyx_k_dt64, sizeof(__pyx_k_dt64), 0, 0, 1, 1},
    {&__pyx_n_s_dt_val, __pyx_k_dt_val, sizeof(__pyx_k_dt_val), 0, 0, 1, 1},
    {&__pyx_n_s_dtobjs, __pyx_k_dtobjs, sizeof(__pyx_k_dtobjs), 0, 0, 1, 1},
    {&__pyx_n_s_dts, __pyx_k_dts, sizeof(__pyx_k_dts), 0, 0, 1, 1},
    {&__pyx_n_s_dtstr, __pyx_k_dtstr, sizeof(__pyx_k_dtstr), 0, 0, 1, 1},
    {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
    {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
    {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
    {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1},
    {&__pyx_n_s_errors, __pyx_k_errors, sizeof(__pyx_k_errors), 0, 0, 1, 1},
    {&__pyx_n_s_exceptions, __pyx_k_exceptions, sizeof(__pyx_k_exceptions), 0, 0, 1, 1},
    {&__pyx_kp_u_expects_datetime_tzinfo_got_s, __pyx_k_expects_datetime_tzinfo_got_s, sizeof(__pyx_k_expects_datetime_tzinfo_got_s), 0, 1, 0, 0},
    {&__pyx_kp_u_expects_np_datetime64_got_s, __pyx_k_expects_np_datetime64_got_s, sizeof(__pyx_k_expects_np_datetime64_got_s), 0, 1, 0, 0},
    {&__pyx_kp_u_expects_np_ndarray_datetime64_go, __pyx_k_expects_np_ndarray_datetime64_go, sizeof(__pyx_k_expects_np_ndarray_datetime64_go), 0, 1, 0, 0},
    {&__pyx_kp_u_expects_np_ndarray_datetime64_ti, __pyx_k_expects_np_ndarray_datetime64_ti, sizeof(__pyx_k_expects_np_ndarray_datetime64_ti), 0, 1, 0, 0},
    {&__pyx_kp_u_expects_np_ndarray_datetime64_ti_2, __pyx_k_expects_np_ndarray_datetime64_ti_2, sizeof(__pyx_k_expects_np_ndarray_datetime64_ti_2), 0, 1, 0, 0},
    {&__pyx_kp_u_expects_np_ndarray_timedelta64_g, __pyx_k_expects_np_ndarray_timedelta64_g, sizeof(__pyx_k_expects_np_ndarray_timedelta64_g), 0, 1, 0, 0},
    {&__pyx_kp_u_expects_np_timedelta64_got_s, __pyx_k_expects_np_timedelta64_got_s, sizeof(__pyx_k_expects_np_timedelta64_got_s), 0, 1, 0, 0},
    {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
    {&__pyx_n_s_fac, __pyx_k_fac, sizeof(__pyx_k_fac), 0, 0, 1, 1},
    {&__pyx_kp_u_failed_to_allocate_memory_for_st, __pyx_k_failed_to_allocate_memory_for_st, sizeof(__pyx_k_failed_to_allocate_memory_for_st), 0, 1, 0, 0},
    {&__pyx_n_s_farthest, __pyx_k_farthest, sizeof(__pyx_k_farthest), 0, 0, 1, 1},
    {&__pyx_n_u_farthest, __pyx_k_farthest, sizeof(__pyx_k_farthest), 0, 1, 0, 1},
    {&__pyx_kp_u_find_closest, __pyx_k_find_closest, sizeof(__pyx_k_find_closest), 0, 1, 0, 0},
    {&__pyx_kp_u_find_farthest, __pyx_k_find_farthest, sizeof(__pyx_k_find_farthest), 0, 1, 0, 0},
    {&__pyx_n_s_floor, __pyx_k_floor, sizeof(__pyx_k_floor), 0, 0, 1, 1},
    {&__pyx_n_u_floor, __pyx_k_floor, sizeof(__pyx_k_floor), 0, 1, 0, 1},
    {&__pyx_n_s_fmt, __pyx_k_fmt, sizeof(__pyx_k_fmt), 0, 0, 1, 1},
    {&__pyx_n_s_freq, __pyx_k_freq, sizeof(__pyx_k_freq), 0, 0, 1, 1},
    {&__pyx_n_s_fromdate, __pyx_k_fromdate, sizeof(__pyx_k_fromdate), 0, 0, 1, 1},
    {&__pyx_n_s_fromdatetime, __pyx_k_fromdatetime, sizeof(__pyx_k_fromdatetime), 0, 0, 1, 1},
    {&__pyx_n_s_fromdatetime64, __pyx_k_fromdatetime64, sizeof(__pyx_k_fromdatetime64), 0, 0, 1, 1},
    {&__pyx_n_s_fromicroseconds, __pyx_k_fromicroseconds, sizeof(__pyx_k_fromicroseconds), 0, 0, 1, 1},
    {&__pyx_n_s_fromisocalendar, __pyx_k_fromisocalendar, sizeof(__pyx_k_fromisocalendar), 0, 0, 1, 1},
    {&__pyx_n_s_fromisoformat, __pyx_k_fromisoformat, sizeof(__pyx_k_fromisoformat), 0, 0, 1, 1},
    {&__pyx_n_s_fromordinal, __pyx_k_fromordinal, sizeof(__pyx_k_fromordinal), 0, 0, 1, 1},
    {&__pyx_n_s_fromseconds, __pyx_k_fromseconds, sizeof(__pyx_k_fromseconds), 0, 0, 1, 1},
    {&__pyx_n_s_fromtimestamp, __pyx_k_fromtimestamp, sizeof(__pyx_k_fromtimestamp), 0, 0, 1, 1},
    {&__pyx_n_s_fromutc, __pyx_k_fromutc, sizeof(__pyx_k_fromutc), 0, 0, 1, 1},
    {&__pyx_n_u_fs, __pyx_k_fs, sizeof(__pyx_k_fs), 0, 1, 0, 1},
    {&__pyx_n_s_fsp, __pyx_k_fsp, sizeof(__pyx_k_fsp), 0, 0, 1, 1},
    {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
    {&__pyx_n_s_generate_range, __pyx_k_generate_range, sizeof(__pyx_k_generate_range), 0, 0, 1, 1},
    {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
    {&__pyx_n_u_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 1, 0, 1},
    {&__pyx_n_s_hh_fac, __pyx_k_hh_fac, sizeof(__pyx_k_hh_fac), 0, 0, 1, 1},
    {&__pyx_n_s_hour, __pyx_k_hour, sizeof(__pyx_k_hour), 0, 0, 1, 1},
    {&__pyx_n_u_hour, __pyx_k_hour, sizeof(__pyx_k_hour), 0, 1, 0, 1},
    {&__pyx_n_s_hours, __pyx_k_hours, sizeof(__pyx_k_hours), 0, 0, 1, 1},
    {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
    {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
    {&__pyx_n_s_incl_off, __pyx_k_incl_off, sizeof(__pyx_k_incl_off), 0, 0, 1, 1},
    {&__pyx_n_s_inclusive, __pyx_k_inclusive, sizeof(__pyx_k_inclusive), 0, 0, 1, 1},
    {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
    {&__pyx_n_u_infer, __pyx_k_infer, sizeof(__pyx_k_infer), 0, 1, 0, 1},
    {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1},
    {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
    {&__pyx_kp_u_instance_is_already_timezone_awa, __pyx_k_instance_is_already_timezone_awa, sizeof(__pyx_k_instance_is_already_timezone_awa), 0, 1, 0, 0},
    {&__pyx_kp_u_instance_is_timezone_naive_Canno, __pyx_k_instance_is_timezone_naive_Canno, sizeof(__pyx_k_instance_is_timezone_naive_Canno), 0, 1, 0, 0},
    {&__pyx_kp_u_instance_is_timezone_naive_Use_t, __pyx_k_instance_is_timezone_naive_Use_t, sizeof(__pyx_k_instance_is_timezone_naive_Use_t), 0, 1, 0, 0},
    {&__pyx_n_u_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 1, 0, 1},
    {&__pyx_kp_u_int64_under_D_resolution, __pyx_k_int64_under_D_resolution, sizeof(__pyx_k_int64_under_D_resolution), 0, 1, 0, 0},
    {&__pyx_kp_u_int64_under_M_resolution, __pyx_k_int64_under_M_resolution, sizeof(__pyx_k_int64_under_M_resolution), 0, 1, 0, 0},
    {&__pyx_kp_u_int64_under_Y_resolution, __pyx_k_int64_under_Y_resolution, sizeof(__pyx_k_int64_under_Y_resolution), 0, 1, 0, 0},
    {&__pyx_kp_u_int64_under_h_resolution, __pyx_k_int64_under_h_resolution, sizeof(__pyx_k_int64_under_h_resolution), 0, 1, 0, 0},
    {&__pyx_kp_u_int64_under_m_resolution, __pyx_k_int64_under_m_resolution, sizeof(__pyx_k_int64_under_m_resolution), 0, 1, 0, 0},
    {&__pyx_kp_u_int64_under_ms_resolution, __pyx_k_int64_under_ms_resolution, sizeof(__pyx_k_int64_under_ms_resolution), 0, 1, 0, 0},
    {&__pyx_kp_u_int64_under_ns_resolution, __pyx_k_int64_under_ns_resolution, sizeof(__pyx_k_int64_under_ns_resolution), 0, 1, 0, 0},
    {&__pyx_kp_u_int64_under_s_resolution, __pyx_k_int64_under_s_resolution, sizeof(__pyx_k_int64_under_s_resolution), 0, 1, 0, 0},
    {&__pyx_kp_u_int64_under_us_resolution, __pyx_k_int64_under_us_resolution, sizeof(__pyx_k_int64_under_us_resolution), 0, 1, 0, 0},
    {&__pyx_kp_s_int_None, __pyx_k_int_None, sizeof(__pyx_k_int_None), 0, 0, 1, 0},
    {&__pyx_kp_s_int_float_object, __pyx_k_int_float_object, sizeof(__pyx_k_int_float_object), 0, 0, 1, 0},
    {&__pyx_kp_s_int_object, __pyx_k_int_object, sizeof(__pyx_k_int_object), 0, 0, 1, 0},
    {&__pyx_kp_s_int_str, __pyx_k_int_str, sizeof(__pyx_k_int_str), 0, 0, 1, 0},
    {&__pyx_kp_s_int_str_None, __pyx_k_int_str_None, sizeof(__pyx_k_int_str_None), 0, 0, 1, 0},
    {&__pyx_kp_u_invalid_character_s_as_an_intege, __pyx_k_invalid_character_s_as_an_intege, sizeof(__pyx_k_invalid_character_s_as_an_intege), 0, 1, 0, 0},
    {&__pyx_kp_u_invalid_end_of_datetime_unit_s_S, __pyx_k_invalid_end_of_datetime_unit_s_S, sizeof(__pyx_k_invalid_end_of_datetime_unit_s_S), 0, 1, 0, 0},
    {&__pyx_kp_u_invalid_first_of_datetime_unit_s, __pyx_k_invalid_first_of_datetime_unit_s, sizeof(__pyx_k_invalid_first_of_datetime_unit_s), 0, 1, 0, 0},
    {&__pyx_kp_u_invalid_fractional_seconds_preci, __pyx_k_invalid_fractional_seconds_preci, sizeof(__pyx_k_invalid_fractional_seconds_preci), 0, 1, 0, 0},
    {&__pyx_kp_u_invalid_input_s_for_inclusive_Su, __pyx_k_invalid_input_s_for_inclusive_Su, sizeof(__pyx_k_invalid_input_s_for_inclusive_Su), 0, 1, 0, 0},
    {&__pyx_kp_u_invalid_last_of_datetime_unit_s, __pyx_k_invalid_last_of_datetime_unit_s, sizeof(__pyx_k_invalid_last_of_datetime_unit_s), 0, 1, 0, 0},
    {&__pyx_kp_u_invalid_month_name_s, __pyx_k_invalid_month_name_s, sizeof(__pyx_k_invalid_month_name_s), 0, 1, 0, 0},
    {&__pyx_kp_u_invalid_month_number_d_must_betw, __pyx_k_invalid_month_number_d_must_betw, sizeof(__pyx_k_invalid_month_number_d_must_betw), 0, 1, 0, 0},
    {&__pyx_kp_u_invalid_start_of_time_unit_s_Sup, __pyx_k_invalid_start_of_time_unit_s_Sup, sizeof(__pyx_k_invalid_start_of_time_unit_s_Sup), 0, 1, 0, 0},
    {&__pyx_kp_u_invalid_weekday_name_s, __pyx_k_invalid_weekday_name_s, sizeof(__pyx_k_invalid_weekday_name_s), 0, 1, 0, 0},
    {&__pyx_kp_u_invalid_weekday_number_d_must_be, __pyx_k_invalid_weekday_number_d_must_be, sizeof(__pyx_k_invalid_weekday_number_d_must_be), 0, 1, 0, 0},
    {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
    {&__pyx_n_s_is_day, __pyx_k_is_day, sizeof(__pyx_k_is_day), 0, 0, 1, 1},
    {&__pyx_n_u_is_day, __pyx_k_is_day, sizeof(__pyx_k_is_day), 0, 1, 0, 1},
    {&__pyx_n_s_is_end_of, __pyx_k_is_end_of, sizeof(__pyx_k_is_end_of), 0, 0, 1, 1},
    {&__pyx_kp_u_is_end_of_s, __pyx_k_is_end_of_s, sizeof(__pyx_k_is_end_of_s), 0, 1, 0, 0},
    {&__pyx_n_s_is_first_of, __pyx_k_is_first_of, sizeof(__pyx_k_is_first_of), 0, 0, 1, 1},
    {&__pyx_kp_u_is_first_of_s, __pyx_k_is_first_of_s, sizeof(__pyx_k_is_first_of_s), 0, 1, 0, 0},
    {&__pyx_n_s_is_future, __pyx_k_is_future, sizeof(__pyx_k_is_future), 0, 0, 1, 1},
    {&__pyx_n_u_is_future, __pyx_k_is_future, sizeof(__pyx_k_is_future), 0, 1, 0, 1},
    {&__pyx_n_s_is_last_of, __pyx_k_is_last_of, sizeof(__pyx_k_is_last_of), 0, 0, 1, 1},
    {&__pyx_kp_u_is_last_of_s, __pyx_k_is_last_of_s, sizeof(__pyx_k_is_last_of_s), 0, 1, 0, 0},
    {&__pyx_n_s_is_leap_year, __pyx_k_is_leap_year, sizeof(__pyx_k_is_leap_year), 0, 0, 1, 1},
    {&__pyx_n_u_is_leap_year, __pyx_k_is_leap_year, sizeof(__pyx_k_is_leap_year), 0, 1, 0, 1},
    {&__pyx_n_s_is_local, __pyx_k_is_local, sizeof(__pyx_k_is_local), 0, 0, 1, 1},
    {&__pyx_n_s_is_long_year, __pyx_k_is_long_year, sizeof(__pyx_k_is_long_year), 0, 0, 1, 1},
    {&__pyx_n_u_is_long_year, __pyx_k_is_long_year, sizeof(__pyx_k_is_long_year), 0, 1, 0, 1},
    {&__pyx_n_s_is_month, __pyx_k_is_month, sizeof(__pyx_k_is_month), 0, 0, 1, 1},
    {&__pyx_n_u_is_month, __pyx_k_is_month, sizeof(__pyx_k_is_month), 0, 1, 0, 1},
    {&__pyx_kp_u_is_not_supported, __pyx_k_is_not_supported, sizeof(__pyx_k_is_not_supported), 0, 1, 0, 0},
    {&__pyx_kp_u_is_not_supported_2, __pyx_k_is_not_supported_2, sizeof(__pyx_k_is_not_supported_2), 0, 1, 0, 0},
    {&__pyx_kp_u_is_not_supported_3, __pyx_k_is_not_supported_3, sizeof(__pyx_k_is_not_supported_3), 0, 1, 0, 0},
    {&__pyx_n_s_is_past, __pyx_k_is_past, sizeof(__pyx_k_is_past), 0, 0, 1, 1},
    {&__pyx_n_u_is_past, __pyx_k_is_past, sizeof(__pyx_k_is_past), 0, 1, 0, 1},
    {&__pyx_n_s_is_quarter, __pyx_k_is_quarter, sizeof(__pyx_k_is_quarter), 0, 0, 1, 1},
    {&__pyx_n_u_is_quarter, __pyx_k_is_quarter, sizeof(__pyx_k_is_quarter), 0, 1, 0, 1},
    {&__pyx_n_s_is_start_of, __pyx_k_is_start_of, sizeof(__pyx_k_is_start_of), 0, 0, 1, 1},
    {&__pyx_kp_u_is_start_of_s, __pyx_k_is_start_of_s, sizeof(__pyx_k_is_start_of_s), 0, 1, 0, 0},
    {&__pyx_n_s_is_utc, __pyx_k_is_utc, sizeof(__pyx_k_is_utc), 0, 0, 1, 1},
    {&__pyx_n_s_is_weekday, __pyx_k_is_weekday, sizeof(__pyx_k_is_weekday), 0, 0, 1, 1},
    {&__pyx_n_u_is_weekday, __pyx_k_is_weekday, sizeof(__pyx_k_is_weekday), 0, 1, 0, 1},
    {&__pyx_n_s_is_year, __pyx_k_is_year, sizeof(__pyx_k_is_year), 0, 0, 1, 1},
    {&__pyx_n_u_is_year, __pyx_k_is_year, sizeof(__pyx_k_is_year), 0, 1, 0, 1},
    {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
    {&__pyx_n_s_iso, __pyx_k_iso, sizeof(__pyx_k_iso), 0, 0, 1, 1},
    {&__pyx_n_s_iso_2, __pyx_k_iso_2, sizeof(__pyx_k_iso_2), 0, 0, 1, 1},
    {&__pyx_n_s_isocalendar, __pyx_k_isocalendar, sizeof(__pyx_k_isocalendar), 0, 0, 1, 1},
    {&__pyx_n_s_isoformat, __pyx_k_isoformat, sizeof(__pyx_k_isoformat), 0, 0, 1, 1},
    {&__pyx_n_s_isoweek, __pyx_k_isoweek, sizeof(__pyx_k_isoweek), 0, 0, 1, 1},
    {&__pyx_n_u_isoweek, __pyx_k_isoweek, sizeof(__pyx_k_isoweek), 0, 1, 0, 1},
    {&__pyx_n_s_isoweekday, __pyx_k_isoweekday, sizeof(__pyx_k_isoweekday), 0, 0, 1, 1},
    {&__pyx_n_u_isoweekday, __pyx_k_isoweekday, sizeof(__pyx_k_isoweekday), 0, 1, 0, 1},
    {&__pyx_n_s_isoyear, __pyx_k_isoyear, sizeof(__pyx_k_isoyear), 0, 0, 1, 1},
    {&__pyx_n_u_isoyear, __pyx_k_isoyear, sizeof(__pyx_k_isoyear), 0, 1, 0, 1},
    {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1},
    {&__pyx_n_s_itertuples, __pyx_k_itertuples, sizeof(__pyx_k_itertuples), 0, 0, 1, 1},
    {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1},
    {&__pyx_n_s_leap_bt_year, __pyx_k_leap_bt_year, sizeof(__pyx_k_leap_bt_year), 0, 0, 1, 1},
    {&__pyx_n_u_leap_bt_year, __pyx_k_leap_bt_year, sizeof(__pyx_k_leap_bt_year), 0, 1, 0, 1},
    {&__pyx_n_s_lib, __pyx_k_lib, sizeof(__pyx_k_lib), 0, 0, 1, 1},
    {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1},
    {&__pyx_n_u_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 1, 0, 1},
    {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
    {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
    {&__pyx_n_s_mi_fac, __pyx_k_mi_fac, sizeof(__pyx_k_mi_fac), 0, 0, 1, 1},
    {&__pyx_n_s_microsecond, __pyx_k_microsecond, sizeof(__pyx_k_microsecond), 0, 0, 1, 1},
    {&__pyx_n_u_microsecond, __pyx_k_microsecond, sizeof(__pyx_k_microsecond), 0, 1, 0, 1},
    {&__pyx_n_s_microseconds, __pyx_k_microseconds, sizeof(__pyx_k_microseconds), 0, 0, 1, 1},
    {&__pyx_n_u_microseconds, __pyx_k_microseconds, sizeof(__pyx_k_microseconds), 0, 1, 0, 1},
    {&__pyx_n_s_millisecond, __pyx_k_millisecond, sizeof(__pyx_k_millisecond), 0, 0, 1, 1},
    {&__pyx_n_u_millisecond, __pyx_k_millisecond, sizeof(__pyx_k_millisecond), 0, 1, 0, 1},
    {&__pyx_n_s_milliseconds, __pyx_k_milliseconds, sizeof(__pyx_k_milliseconds), 0, 0, 1, 1},
    {&__pyx_n_u_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 1, 0, 1},
    {&__pyx_n_s_minute, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 0, 1, 1},
    {&__pyx_n_u_minute, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 1, 0, 1},
    {&__pyx_n_s_minutes, __pyx_k_minutes, sizeof(__pyx_k_minutes), 0, 0, 1, 1},
    {&__pyx_kp_u_mixed_timezones, __pyx_k_mixed_timezones, sizeof(__pyx_k_mixed_timezones), 0, 1, 0, 0},
    {&__pyx_n_s_mm, __pyx_k_mm, sizeof(__pyx_k_mm), 0, 0, 1, 1},
    {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
    {&__pyx_n_s_month, __pyx_k_month, sizeof(__pyx_k_month), 0, 0, 1, 1},
    {&__pyx_n_u_month, __pyx_k_month, sizeof(__pyx_k_month), 0, 1, 0, 1},
    {&__pyx_n_s_months, __pyx_k_months, sizeof(__pyx_k_months), 0, 0, 1, 1},
    {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1},
    {&__pyx_n_u_ms, __pyx_k_ms, sizeof(__pyx_k_ms), 0, 1, 0, 1},
    {&__pyx_n_s_mul, __pyx_k_mul, sizeof(__pyx_k_mul), 0, 0, 1, 1},
    {&__pyx_kp_u_must_be_an_1_dimensional_ndarray, __pyx_k_must_be_an_1_dimensional_ndarray, sizeof(__pyx_k_must_be_an_1_dimensional_ndarray), 0, 1, 0, 0},
    {&__pyx_n_s_my_arr, __pyx_k_my_arr, sizeof(__pyx_k_my_arr), 0, 0, 1, 1},
    {&__pyx_n_s_my_tz, __pyx_k_my_tz, sizeof(__pyx_k_my_tz), 0, 0, 1, 1},
    {&__pyx_n_s_my_unit, __pyx_k_my_unit, sizeof(__pyx_k_my_unit), 0, 0, 1, 1},
    {&__pyx_n_s_my_unit_adj, __pyx_k_my_unit_adj, sizeof(__pyx_k_my_unit_adj), 0, 0, 1, 1},
    {&__pyx_n_s_my_unit_ch, __pyx_k_my_unit_ch, sizeof(__pyx_k_my_unit_ch), 0, 0, 1, 1},
    {&__pyx_n_s_my_unit_int, __pyx_k_my_unit_int, sizeof(__pyx_k_my_unit_int), 0, 0, 1, 1},
    {&__pyx_n_s_my_unit_ns, __pyx_k_my_unit_ns, sizeof(__pyx_k_my_unit_ns), 0, 0, 1, 1},
    {&__pyx_n_s_naive, __pyx_k_naive, sizeof(__pyx_k_naive), 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_nanosecond, __pyx_k_nanosecond, sizeof(__pyx_k_nanosecond), 0, 0, 1, 1},
    {&__pyx_n_u_nanosecond, __pyx_k_nanosecond, sizeof(__pyx_k_nanosecond), 0, 1, 0, 1},
    {&__pyx_kp_u_nanosecond_conversion_range_dat, __pyx_k_nanosecond_conversion_range_dat, sizeof(__pyx_k_nanosecond_conversion_range_dat), 0, 1, 0, 0},
    {&__pyx_n_s_nanoseconds, __pyx_k_nanoseconds, sizeof(__pyx_k_nanoseconds), 0, 0, 1, 1},
    {&__pyx_kp_u_ndarray_size_must_be_an_integer, __pyx_k_ndarray_size_must_be_an_integer, sizeof(__pyx_k_ndarray_size_must_be_an_integer), 0, 1, 0, 0},
    {&__pyx_n_u_neither, __pyx_k_neither, sizeof(__pyx_k_neither), 0, 1, 0, 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_nonexistent, __pyx_k_nonexistent, sizeof(__pyx_k_nonexistent), 0, 0, 1, 1},
    {&__pyx_kp_u_nonexistent_NaT_is_not_supported, __pyx_k_nonexistent_NaT_is_not_supported, sizeof(__pyx_k_nonexistent_NaT_is_not_supported), 0, 1, 0, 0},
    {&__pyx_n_s_normalize, __pyx_k_normalize, sizeof(__pyx_k_normalize), 0, 0, 1, 1},
    {&__pyx_n_s_now, __pyx_k_now, sizeof(__pyx_k_now), 0, 0, 1, 1},
    {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
    {&__pyx_kp_s_np_datetime64_object, __pyx_k_np_datetime64_object, sizeof(__pyx_k_np_datetime64_object), 0, 0, 1, 0},
    {&__pyx_kp_s_np_ndarray_datetime_date, __pyx_k_np_ndarray_datetime_date, sizeof(__pyx_k_np_ndarray_datetime_date), 0, 0, 1, 0},
    {&__pyx_kp_s_np_ndarray_datetime_datetime, __pyx_k_np_ndarray_datetime_datetime, sizeof(__pyx_k_np_ndarray_datetime_datetime), 0, 0, 1, 0},
    {&__pyx_kp_s_np_ndarray_datetime_time, __pyx_k_np_ndarray_datetime_time, sizeof(__pyx_k_np_ndarray_datetime_time), 0, 0, 1, 0},
    {&__pyx_kp_s_np_ndarray_np_datetime64, __pyx_k_np_ndarray_np_datetime64, sizeof(__pyx_k_np_ndarray_np_datetime64), 0, 0, 1, 0},
    {&__pyx_kp_s_np_ndarray_np_int64, __pyx_k_np_ndarray_np_int64, sizeof(__pyx_k_np_ndarray_np_int64), 0, 0, 1, 0},
    {&__pyx_n_u_ns, __pyx_k_ns, sizeof(__pyx_k_ns), 0, 1, 0, 1},
    {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
    {&__pyx_kp_u_numpy__core_multiarray_failed_to, __pyx_k_numpy__core_multiarray_failed_to, sizeof(__pyx_k_numpy__core_multiarray_failed_to), 0, 1, 0, 0},
    {&__pyx_kp_u_numpy__core_umath_failed_to_impo, __pyx_k_numpy__core_umath_failed_to_impo, sizeof(__pyx_k_numpy__core_umath_failed_to_impo), 0, 1, 0, 0},
    {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
    {&__pyx_kp_s_object_None, __pyx_k_object_None, sizeof(__pyx_k_object_None), 0, 0, 1, 0},
    {&__pyx_n_s_off, __pyx_k_off, sizeof(__pyx_k_off), 0, 0, 1, 1},
    {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
    {&__pyx_n_u_one, __pyx_k_one, sizeof(__pyx_k_one), 0, 1, 0, 1},
    {&__pyx_kp_u_operation_on_ndarray_datetime64, __pyx_k_operation_on_ndarray_datetime64, sizeof(__pyx_k_operation_on_ndarray_datetime64), 0, 1, 0, 0},
    {&__pyx_n_s_ordinal, __pyx_k_ordinal, sizeof(__pyx_k_ordinal), 0, 0, 1, 1},
    {&__pyx_n_u_ordinal, __pyx_k_ordinal, sizeof(__pyx_k_ordinal), 0, 1, 0, 1},
    {&__pyx_n_s_pandas, __pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 0, 1, 1},
    {&__pyx_n_s_pandas__libs, __pyx_k_pandas__libs, sizeof(__pyx_k_pandas__libs), 0, 0, 1, 1},
    {&__pyx_n_s_pandas__libs_tslibs_parsing, __pyx_k_pandas__libs_tslibs_parsing, sizeof(__pyx_k_pandas__libs_tslibs_parsing), 0, 0, 1, 1},
    {&__pyx_n_s_pandas_core_arrays_datetimes, __pyx_k_pandas_core_arrays_datetimes, sizeof(__pyx_k_pandas_core_arrays_datetimes), 0, 0, 1, 1},
    {&__pyx_n_s_parse, __pyx_k_parse, sizeof(__pyx_k_parse), 0, 0, 1, 1},
    {&__pyx_n_s_parse_dict, __pyx_k_parse_dict, sizeof(__pyx_k_parse_dict), 0, 0, 1, 1},
    {&__pyx_n_s_parse_dtobj, __pyx_k_parse_dtobj, sizeof(__pyx_k_parse_dtobj), 0, 0, 1, 1},
    {&__pyx_n_s_parse_sequence, __pyx_k_parse_sequence, sizeof(__pyx_k_parse_sequence), 0, 0, 1, 1},
    {&__pyx_n_s_pd_err, __pyx_k_pd_err, sizeof(__pyx_k_pd_err), 0, 0, 1, 1},
    {&__pyx_n_s_periods, __pyx_k_periods, sizeof(__pyx_k_periods), 0, 0, 1, 1},
    {&__pyx_n_s_precision, __pyx_k_precision, sizeof(__pyx_k_precision), 0, 0, 1, 1},
    {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
    {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1},
    {&__pyx_n_u_ps, __pyx_k_ps, sizeof(__pyx_k_ps), 0, 1, 0, 1},
    {&__pyx_n_s_pt, __pyx_k_pt, sizeof(__pyx_k_pt), 0, 0, 1, 1},
    {&__pyx_n_s_pt_1st, __pyx_k_pt_1st, sizeof(__pyx_k_pt_1st), 0, 0, 1, 1},
    {&__pyx_n_s_pt_arr, __pyx_k_pt_arr, sizeof(__pyx_k_pt_arr), 0, 0, 1, 1},
    {&__pyx_n_s_pt_end, __pyx_k_pt_end, sizeof(__pyx_k_pt_end), 0, 0, 1, 1},
    {&__pyx_n_s_pt_end_unit, __pyx_k_pt_end_unit, sizeof(__pyx_k_pt_end_unit), 0, 0, 1, 1},
    {&__pyx_n_s_pt_lst, __pyx_k_pt_lst, sizeof(__pyx_k_pt_lst), 0, 0, 1, 1},
    {&__pyx_n_s_pt_stt, __pyx_k_pt_stt, sizeof(__pyx_k_pt_stt), 0, 0, 1, 1},
    {&__pyx_n_s_pt_stt_unit, __pyx_k_pt_stt_unit, sizeof(__pyx_k_pt_stt_unit), 0, 0, 1, 1},
    {&__pyx_n_s_pt_tz, __pyx_k_pt_tz, sizeof(__pyx_k_pt_tz), 0, 0, 1, 1},
    {&__pyx_n_s_pt_unit, __pyx_k_pt_unit, sizeof(__pyx_k_pt_unit), 0, 0, 1, 1},
    {&__pyx_n_s_pt_unit_int, __pyx_k_pt_unit_int, sizeof(__pyx_k_pt_unit_int), 0, 0, 1, 1},
    {&__pyx_n_s_pytz, __pyx_k_pytz, sizeof(__pyx_k_pytz), 0, 0, 1, 1},
    {&__pyx_n_s_pytz_err, __pyx_k_pytz_err, sizeof(__pyx_k_pytz_err), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
    {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
    {&__pyx_n_s_quarter, __pyx_k_quarter, sizeof(__pyx_k_quarter), 0, 0, 1, 1},
    {&__pyx_n_u_quarter, __pyx_k_quarter, sizeof(__pyx_k_quarter), 0, 1, 0, 1},
    {&__pyx_n_s_quarters, __pyx_k_quarters, sizeof(__pyx_k_quarters), 0, 0, 1, 1},
    {&__pyx_n_u_raise, __pyx_k_raise, sizeof(__pyx_k_raise), 0, 1, 0, 1},
    {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
    {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
    {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1},
    {&__pyx_kp_u_resolution, __pyx_k_resolution, sizeof(__pyx_k_resolution), 0, 1, 0, 0},
    {&__pyx_kp_u_resolution_Array_with_datetime, __pyx_k_resolution_Array_with_datetime, sizeof(__pyx_k_resolution_Array_with_datetime), 0, 1, 0, 0},
    {&__pyx_kp_u_resolution_Array_with_dtype_of, __pyx_k_resolution_Array_with_dtype_of, sizeof(__pyx_k_resolution_Array_with_dtype_of), 0, 1, 0, 0},
    {&__pyx_kp_u_resolution_Supported_resolution, __pyx_k_resolution_Supported_resolution, sizeof(__pyx_k_resolution_Supported_resolution), 0, 1, 0, 0},
    {&__pyx_kp_u_resolution_is_not_supported, __pyx_k_resolution_is_not_supported, sizeof(__pyx_k_resolution_is_not_supported), 0, 1, 0, 0},
    {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1},
    {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1},
    {&__pyx_n_u_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 1, 0, 1},
    {&__pyx_n_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 1},
    {&__pyx_n_s_sec, __pyx_k_sec, sizeof(__pyx_k_sec), 0, 0, 1, 1},
    {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1},
    {&__pyx_n_u_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 1, 0, 1},
    {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1},
    {&__pyx_n_u_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 1, 0, 1},
    {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
    {&__pyx_n_s_sep, __pyx_k_sep, sizeof(__pyx_k_sep), 0, 0, 1, 1},
    {&__pyx_kp_u_sequence_must_have_3_items, __pyx_k_sequence_must_have_3_items, sizeof(__pyx_k_sequence_must_have_3_items), 0, 1, 0, 0},
    {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1},
    {&__pyx_kp_s_set_str, __pyx_k_set_str, sizeof(__pyx_k_set_str), 0, 0, 1, 0},
    {&__pyx_n_u_shift_forward, __pyx_k_shift_forward, sizeof(__pyx_k_shift_forward), 0, 1, 0, 1},
    {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
    {&__pyx_n_s_snap, __pyx_k_snap, sizeof(__pyx_k_snap), 0, 0, 1, 1},
    {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
    {&__pyx_kp_s_src_cytimes_pddt_py, __pyx_k_src_cytimes_pddt_py, sizeof(__pyx_k_src_cytimes_pddt_py), 0, 0, 1, 0},
    {&__pyx_n_s_ss_fac, __pyx_k_ss_fac, sizeof(__pyx_k_ss_fac), 0, 0, 1, 1},
    {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
    {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
    {&__pyx_kp_s_str_int, __pyx_k_str_int, sizeof(__pyx_k_str_int), 0, 0, 1, 0},
    {&__pyx_kp_s_str_object, __pyx_k_str_object, sizeof(__pyx_k_str_object), 0, 0, 1, 0},
    {&__pyx_n_s_strftime, __pyx_k_strftime, sizeof(__pyx_k_strftime), 0, 0, 1, 1},
    {&__pyx_kp_u_strftime_format_is_too_long_s, __pyx_k_strftime_format_is_too_long_s, sizeof(__pyx_k_strftime_format_is_too_long_s), 0, 1, 0, 0},
    {&__pyx_n_s_strptime, __pyx_k_strptime, sizeof(__pyx_k_strptime), 0, 0, 1, 1},
    {&__pyx_n_s_sub, __pyx_k_sub, sizeof(__pyx_k_sub), 0, 0, 1, 1},
    {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
    {&__pyx_kp_u_support_ndarray_with_1_4_dimensi, __pyx_k_support_ndarray_with_1_4_dimensi, sizeof(__pyx_k_support_ndarray_with_1_4_dimensi), 0, 1, 0, 0},
    {&__pyx_n_s_targ_tz, __pyx_k_targ_tz, sizeof(__pyx_k_targ_tz), 0, 0, 1, 1},
    {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
    {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
    {&__pyx_n_u_timedelta64, __pyx_k_timedelta64, sizeof(__pyx_k_timedelta64), 0, 1, 0, 1},
    {&__pyx_n_s_timedf, __pyx_k_timedf, sizeof(__pyx_k_timedf), 0, 0, 1, 1},
    {&__pyx_n_s_times, __pyx_k_times, sizeof(__pyx_k_times), 0, 0, 1, 1},
    {&__pyx_n_s_timestamp, __pyx_k_timestamp, sizeof(__pyx_k_timestamp), 0, 0, 1, 1},
    {&__pyx_n_u_timestamp, __pyx_k_timestamp, sizeof(__pyx_k_timestamp), 0, 1, 0, 1},
    {&__pyx_n_s_timetz, __pyx_k_timetz, sizeof(__pyx_k_timetz), 0, 0, 1, 1},
    {&__pyx_kp_u_timezone_offset_s_seconds_out_of, __pyx_k_timezone_offset_s_seconds_out_of, sizeof(__pyx_k_timezone_offset_s_seconds_out_of), 0, 1, 0, 0},
    {&__pyx_n_s_tm_hour, __pyx_k_tm_hour, sizeof(__pyx_k_tm_hour), 0, 0, 1, 1},
    {&__pyx_n_u_tm_hour, __pyx_k_tm_hour, sizeof(__pyx_k_tm_hour), 0, 1, 0, 1},
    {&__pyx_n_s_tm_isdst, __pyx_k_tm_isdst, sizeof(__pyx_k_tm_isdst), 0, 0, 1, 1},
    {&__pyx_n_s_tm_mday, __pyx_k_tm_mday, sizeof(__pyx_k_tm_mday), 0, 0, 1, 1},
    {&__pyx_n_u_tm_mday, __pyx_k_tm_mday, sizeof(__pyx_k_tm_mday), 0, 1, 0, 1},
    {&__pyx_n_s_tm_min, __pyx_k_tm_min, sizeof(__pyx_k_tm_min), 0, 0, 1, 1},
    {&__pyx_n_u_tm_min, __pyx_k_tm_min, sizeof(__pyx_k_tm_min), 0, 1, 0, 1},
    {&__pyx_n_s_tm_mon, __pyx_k_tm_mon, sizeof(__pyx_k_tm_mon), 0, 0, 1, 1},
    {&__pyx_n_u_tm_mon, __pyx_k_tm_mon, sizeof(__pyx_k_tm_mon), 0, 1, 0, 1},
    {&__pyx_n_s_tm_sec, __pyx_k_tm_sec, sizeof(__pyx_k_tm_sec), 0, 0, 1, 1},
    {&__pyx_n_u_tm_sec, __pyx_k_tm_sec, sizeof(__pyx_k_tm_sec), 0, 1, 0, 1},
    {&__pyx_n_s_tm_wday, __pyx_k_tm_wday, sizeof(__pyx_k_tm_wday), 0, 0, 1, 1},
    {&__pyx_n_u_tm_wday, __pyx_k_tm_wday, sizeof(__pyx_k_tm_wday), 0, 1, 0, 1},
    {&__pyx_n_s_tm_yday, __pyx_k_tm_yday, sizeof(__pyx_k_tm_yday), 0, 0, 1, 1},
    {&__pyx_n_u_tm_yday, __pyx_k_tm_yday, sizeof(__pyx_k_tm_yday), 0, 1, 0, 1},
    {&__pyx_n_s_tm_year, __pyx_k_tm_year, sizeof(__pyx_k_tm_year), 0, 0, 1, 1},
    {&__pyx_n_u_tm_year, __pyx_k_tm_year, sizeof(__pyx_k_tm_year), 0, 1, 0, 1},
    {&__pyx_kp_u_to, __pyx_k_to, sizeof(__pyx_k_to), 0, 1, 0, 0},
    {&__pyx_kp_u_to_2, __pyx_k_to_2, sizeof(__pyx_k_to_2), 0, 1, 0, 0},
    {&__pyx_kp_u_to_an_integer_under, __pyx_k_to_an_integer_under, sizeof(__pyx_k_to_an_integer_under), 0, 1, 0, 0},
    {&__pyx_kp_u_to_an_integer_under_2, __pyx_k_to_an_integer_under_2, sizeof(__pyx_k_to_an_integer_under_2), 0, 1, 0, 0},
    {&__pyx_n_s_to_curr_month, __pyx_k_to_curr_month, sizeof(__pyx_k_to_curr_month), 0, 0, 1, 1},
    {&__pyx_n_s_to_curr_quarter, __pyx_k_to_curr_quarter, sizeof(__pyx_k_to_curr_quarter), 0, 0, 1, 1},
    {&__pyx_n_s_to_curr_weekday, __pyx_k_to_curr_weekday, sizeof(__pyx_k_to_curr_weekday), 0, 0, 1, 1},
    {&__pyx_n_s_to_curr_weekday_2, __pyx_k_to_curr_weekday_2, sizeof(__pyx_k_to_curr_weekday_2), 0, 0, 1, 1},
    {&__pyx_n_s_to_curr_year, __pyx_k_to_curr_year, sizeof(__pyx_k_to_curr_year), 0, 0, 1, 1},
    {&__pyx_n_s_to_date, __pyx_k_to_date, sizeof(__pyx_k_to_date), 0, 0, 1, 1},
    {&__pyx_n_s_to_datetime, __pyx_k_to_datetime, sizeof(__pyx_k_to_datetime), 0, 0, 1, 1},
    {&__pyx_kp_u_to_datetime64, __pyx_k_to_datetime64, sizeof(__pyx_k_to_datetime64), 0, 1, 0, 0},
    {&__pyx_n_s_to_day, __pyx_k_to_day, sizeof(__pyx_k_to_day), 0, 0, 1, 1},
    {&__pyx_n_s_to_end_of, __pyx_k_to_end_of, sizeof(__pyx_k_to_end_of), 0, 0, 1, 1},
    {&__pyx_n_s_to_first_of, __pyx_k_to_first_of, sizeof(__pyx_k_to_first_of), 0, 0, 1, 1},
    {&__pyx_n_s_to_friday, __pyx_k_to_friday, sizeof(__pyx_k_to_friday), 0, 0, 1, 1},
    {&__pyx_kp_u_to_int64_under, __pyx_k_to_int64_under, sizeof(__pyx_k_to_int64_under), 0, 1, 0, 0},
    {&__pyx_kp_u_to_int64_under_2, __pyx_k_to_int64_under_2, sizeof(__pyx_k_to_int64_under_2), 0, 1, 0, 0},
    {&__pyx_kp_u_to_int64_under_3, __pyx_k_to_int64_under_3, sizeof(__pyx_k_to_int64_under_3), 0, 1, 0, 0},
    {&__pyx_n_s_to_last_of, __pyx_k_to_last_of, sizeof(__pyx_k_to_last_of), 0, 0, 1, 1},
    {&__pyx_n_s_to_monday, __pyx_k_to_monday, sizeof(__pyx_k_to_monday), 0, 0, 1, 1},
    {&__pyx_n_s_to_month, __pyx_k_to_month, sizeof(__pyx_k_to_month), 0, 0, 1, 1},
    {&__pyx_n_s_to_next_month, __pyx_k_to_next_month, sizeof(__pyx_k_to_next_month), 0, 0, 1, 1},
    {&__pyx_n_s_to_next_quarter, __pyx_k_to_next_quarter, sizeof(__pyx_k_to_next_quarter), 0, 0, 1, 1},
    {&__pyx_n_s_to_next_weekday, __pyx_k_to_next_weekday, sizeof(__pyx_k_to_next_weekday), 0, 0, 1, 1},
    {&__pyx_n_s_to_next_year, __pyx_k_to_next_year, sizeof(__pyx_k_to_next_year), 0, 0, 1, 1},
    {&__pyx_n_s_to_prev_month, __pyx_k_to_prev_month, sizeof(__pyx_k_to_prev_month), 0, 0, 1, 1},
    {&__pyx_n_s_to_prev_quarter, __pyx_k_to_prev_quarter, sizeof(__pyx_k_to_prev_quarter), 0, 0, 1, 1},
    {&__pyx_n_s_to_prev_weekday, __pyx_k_to_prev_weekday, sizeof(__pyx_k_to_prev_weekday), 0, 0, 1, 1},
    {&__pyx_n_s_to_prev_year, __pyx_k_to_prev_year, sizeof(__pyx_k_to_prev_year), 0, 0, 1, 1},
    {&__pyx_n_s_to_pydatetime, __pyx_k_to_pydatetime, sizeof(__pyx_k_to_pydatetime), 0, 0, 1, 1},
    {&__pyx_n_s_to_quarter, __pyx_k_to_quarter, sizeof(__pyx_k_to_quarter), 0, 0, 1, 1},
    {&__pyx_n_s_to_saturday, __pyx_k_to_saturday, sizeof(__pyx_k_to_saturday), 0, 0, 1, 1},
    {&__pyx_n_s_to_start_of, __pyx_k_to_start_of, sizeof(__pyx_k_to_start_of), 0, 0, 1, 1},
    {&__pyx_n_s_to_sunday, __pyx_k_to_sunday, sizeof(__pyx_k_to_sunday), 0, 0, 1, 1},
    {&__pyx_n_s_to_thursday, __pyx_k_to_thursday, sizeof(__pyx_k_to_thursday), 0, 0, 1, 1},
    {&__pyx_n_s_to_time, __pyx_k_to_time, sizeof(__pyx_k_to_time), 0, 0, 1, 1},
    {&__pyx_n_s_to_tomorrow, __pyx_k_to_tomorrow, sizeof(__pyx_k_to_tomorrow), 0, 0, 1, 1},
    {&__pyx_n_s_to_tuesday, __pyx_k_to_tuesday, sizeof(__pyx_k_to_tuesday), 0, 0, 1, 1},
    {&__pyx_n_s_to_wednesday, __pyx_k_to_wednesday, sizeof(__pyx_k_to_wednesday), 0, 0, 1, 1},
    {&__pyx_n_s_to_weekday, __pyx_k_to_weekday, sizeof(__pyx_k_to_weekday), 0, 0, 1, 1},
    {&__pyx_n_s_to_year, __pyx_k_to_year, sizeof(__pyx_k_to_year), 0, 0, 1, 1},
    {&__pyx_n_s_to_yesterday, __pyx_k_to_yesterday, sizeof(__pyx_k_to_yesterday), 0, 0, 1, 1},
    {&__pyx_n_s_today, __pyx_k_today, sizeof(__pyx_k_today), 0, 0, 1, 1},
    {&__pyx_n_s_toordinal, __pyx_k_toordinal, sizeof(__pyx_k_toordinal), 0, 0, 1, 1},
    {&__pyx_n_s_ts, __pyx_k_ts, sizeof(__pyx_k_ts), 0, 0, 1, 1},
    {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1},
    {&__pyx_n_s_typing_extensions, __pyx_k_typing_extensions, sizeof(__pyx_k_typing_extensions), 0, 0, 1, 1},
    {&__pyx_n_s_tz, __pyx_k_tz, sizeof(__pyx_k_tz), 0, 0, 1, 1},
    {&__pyx_n_s_tz_available, __pyx_k_tz_available, sizeof(__pyx_k_tz_available), 0, 0, 1, 1},
    {&__pyx_n_s_tz_convert, __pyx_k_tz_convert, sizeof(__pyx_k_tz_convert), 0, 0, 1, 1},
    {&__pyx_n_s_tz_localize, __pyx_k_tz_localize, sizeof(__pyx_k_tz_localize), 0, 0, 1, 1},
    {&__pyx_n_s_tz_switch, __pyx_k_tz_switch, sizeof(__pyx_k_tz_switch), 0, 0, 1, 1},
    {&__pyx_n_s_tzinfo, __pyx_k_tzinfo, sizeof(__pyx_k_tzinfo), 0, 0, 1, 1},
    {&__pyx_n_s_tzname, __pyx_k_tzname, sizeof(__pyx_k_tzname), 0, 0, 1, 1},
    {&__pyx_kp_u_unable_to_parse_datetime_unit_fr, __pyx_k_unable_to_parse_datetime_unit_fr, sizeof(__pyx_k_unable_to_parse_datetime_unit_fr), 0, 1, 0, 0},
    {&__pyx_n_s_unit, __pyx_k_unit, sizeof(__pyx_k_unit), 0, 0, 1, 1},
    {&__pyx_kp_u_unknown_datetime_unit_d, __pyx_k_unknown_datetime_unit_d, sizeof(__pyx_k_unknown_datetime_unit_d), 0, 1, 0, 0},
    {&__pyx_kp_u_unknown_datetime_unit_s, __pyx_k_unknown_datetime_unit_s, sizeof(__pyx_k_unknown_datetime_unit_s), 0, 1, 0, 0},
    {&__pyx_kp_u_unless_utc_True, __pyx_k_unless_utc_True, sizeof(__pyx_k_unless_utc_True), 0, 1, 0, 0},
    {&__pyx_kp_u_unsupported_datetime_unit_s, __pyx_k_unsupported_datetime_unit_s, sizeof(__pyx_k_unsupported_datetime_unit_s), 0, 1, 0, 0},
    {&__pyx_kp_u_unsupported_factor_d_for_timedel, __pyx_k_unsupported_factor_d_for_timedel, sizeof(__pyx_k_unsupported_factor_d_for_timedel), 0, 1, 0, 0},
    {&__pyx_kp_u_unsupported_factor_d_for_timedel_2, __pyx_k_unsupported_factor_d_for_timedel_2, sizeof(__pyx_k_unsupported_factor_d_for_timedel_2), 0, 1, 0, 0},
    {&__pyx_kp_u_unsupported_month_value_type_s_e, __pyx_k_unsupported_month_value_type_s_e, sizeof(__pyx_k_unsupported_month_value_type_s_e), 0, 1, 0, 0},
    {&__pyx_kp_u_unsupported_type_s_for_argument, __pyx_k_unsupported_type_s_for_argument, sizeof(__pyx_k_unsupported_type_s_for_argument), 0, 1, 0, 0},
    {&__pyx_kp_u_unsupported_type_s_for_argument_2, __pyx_k_unsupported_type_s_for_argument_2, sizeof(__pyx_k_unsupported_type_s_for_argument_2), 0, 1, 0, 0},
    {&__pyx_kp_u_unsupported_type_s_for_argument_3, __pyx_k_unsupported_type_s_for_argument_3, sizeof(__pyx_k_unsupported_type_s_for_argument_3), 0, 1, 0, 0},
    {&__pyx_kp_u_unsupported_type_s_for_argument_4, __pyx_k_unsupported_type_s_for_argument_4, sizeof(__pyx_k_unsupported_type_s_for_argument_4), 0, 1, 0, 0},
    {&__pyx_kp_u_unsupported_type_s_for_argument_5, __pyx_k_unsupported_type_s_for_argument_5, sizeof(__pyx_k_unsupported_type_s_for_argument_5), 0, 1, 0, 0},
    {&__pyx_kp_u_unsupported_type_s_for_argument_6, __pyx_k_unsupported_type_s_for_argument_6, sizeof(__pyx_k_unsupported_type_s_for_argument_6), 0, 1, 0, 0},
    {&__pyx_kp_u_unsupported_weekday_value_type_s, __pyx_k_unsupported_weekday_value_type_s, sizeof(__pyx_k_unsupported_weekday_value_type_s), 0, 1, 0, 0},
    {&__pyx_n_s_us, __pyx_k_us, sizeof(__pyx_k_us), 0, 0, 1, 1},
    {&__pyx_n_u_us, __pyx_k_us, sizeof(__pyx_k_us), 0, 1, 0, 1},
    {&__pyx_n_s_us_fac, __pyx_k_us_fac, sizeof(__pyx_k_us_fac), 0, 0, 1, 1},
    {&__pyx_n_s_utc, __pyx_k_utc, sizeof(__pyx_k_utc), 0, 0, 1, 1},
    {&__pyx_n_s_utcfromtimestamp, __pyx_k_utcfromtimestamp, sizeof(__pyx_k_utcfromtimestamp), 0, 0, 1, 1},
    {&__pyx_n_s_utcnow, __pyx_k_utcnow, sizeof(__pyx_k_utcnow), 0, 0, 1, 1},
    {&__pyx_n_s_utcoffset, __pyx_k_utcoffset, sizeof(__pyx_k_utcoffset), 0, 0, 1, 1},
    {&__pyx_n_s_utctimedf, __pyx_k_utctimedf, sizeof(__pyx_k_utctimedf), 0, 0, 1, 1},
    {&__pyx_n_s_utils, __pyx_k_utils, sizeof(__pyx_k_utils), 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_values_naive, __pyx_k_values_naive, sizeof(__pyx_k_values_naive), 0, 0, 1, 1},
    {&__pyx_kp_u_vs, __pyx_k_vs, sizeof(__pyx_k_vs), 0, 1, 0, 0},
    {&__pyx_n_s_wd, __pyx_k_wd, sizeof(__pyx_k_wd), 0, 0, 1, 1},
    {&__pyx_n_s_week, __pyx_k_week, sizeof(__pyx_k_week), 0, 0, 1, 1},
    {&__pyx_n_u_week, __pyx_k_week, sizeof(__pyx_k_week), 0, 1, 0, 1},
    {&__pyx_n_s_weekday, __pyx_k_weekday, sizeof(__pyx_k_weekday), 0, 0, 1, 1},
    {&__pyx_n_u_weekday, __pyx_k_weekday, sizeof(__pyx_k_weekday), 0, 1, 0, 1},
    {&__pyx_n_s_weeks, __pyx_k_weeks, sizeof(__pyx_k_weeks), 0, 0, 1, 1},
    {&__pyx_kp_u_with_datetime_unit, __pyx_k_with_datetime_unit, sizeof(__pyx_k_with_datetime_unit), 0, 1, 0, 0},
    {&__pyx_kp_u_without_specifying_the_array_da, __pyx_k_without_specifying_the_array_da, sizeof(__pyx_k_without_specifying_the_array_da), 0, 1, 0, 0},
    {&__pyx_n_s_wkd, __pyx_k_wkd, sizeof(__pyx_k_wkd), 0, 0, 1, 1},
    {&__pyx_n_s_ww, __pyx_k_ww, sizeof(__pyx_k_ww), 0, 0, 1, 1},
    {&__pyx_n_s_year, __pyx_k_year, sizeof(__pyx_k_year), 0, 0, 1, 1},
    {&__pyx_n_u_year, __pyx_k_year, sizeof(__pyx_k_year), 0, 1, 0, 1},
    {&__pyx_n_s_year1st, __pyx_k_year1st, sizeof(__pyx_k_year1st), 0, 0, 1, 1},
    {&__pyx_n_s_yearfirst, __pyx_k_yearfirst, sizeof(__pyx_k_yearfirst), 0, 0, 1, 1},
    {&__pyx_n_s_years, __pyx_k_years, sizeof(__pyx_k_years), 0, 0, 1, 1},
    {&__pyx_n_s_ymd, __pyx_k_ymd, sizeof(__pyx_k_ymd), 0, 0, 1, 1},
    {&__pyx_n_s_yy, __pyx_k_yy, sizeof(__pyx_k_yy), 0, 0, 1, 1},
    {&__pyx_n_s_zoneinfo, __pyx_k_zoneinfo, sizeof(__pyx_k_zoneinfo), 0, 0, 1, 1},
    {0, 0, 0, 0, 0, 0, 0}
  };
  return __Pyx_InitStrings(__pyx_string_tab);
}
/* #### Code section: cached_builtins ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 3271, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 180, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 180, __pyx_L1_error)
  __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 462, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 1381, __pyx_L1_error)
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 1582, __pyx_L1_error)
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1043, __pyx_L1_error)
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(3, 308, __pyx_L1_error)
  __pyx_builtin_ZeroDivisionError = __Pyx_GetBuiltinName(__pyx_n_s_ZeroDivisionError); if (!__pyx_builtin_ZeroDivisionError) __PYX_ERR(5, 145, __pyx_L1_error)
  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(5, 646, __pyx_L1_error)
  __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(5, 754, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cached_constants ### */

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1043
 *         __pyx_import_array()
 *     except Exception:
 *         raise ImportError("numpy._core.multiarray failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_umath() except -1:
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_numpy__core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 1043, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "../../../../../tmp/build-env-ztvlb7l8/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1049
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy._core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_ufunc() except -1:
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_numpy__core_umath_failed_to_impo); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 1049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "datetime.pxd":308
 * cdef inline object timezone_new(object offset, object name=None):
 *     if PY_VERSION_HEX < 0x030700b1:
 *         raise RuntimeError('Time zones are not available from the C-API.')             # <<<<<<<<<<<<<<
 *     return __Pyx_TimeZone_FromOffsetAndName(offset, <PyObject*>name if name is not None else NULL)
 * 
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Time_zones_are_not_available_fro); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(3, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "utils.pxd":145
 *     """
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.math_mod()'.")             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_division_by_zero_for_utils_math); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(5, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "utils.pxd":171
 *     """
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.math_round_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_division_by_zero_for_utils_math_2); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(5, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "utils.pxd":198
 *     """
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.math_ceil_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     cdef long long q, r
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_division_by_zero_for_utils_math_3); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(5, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "utils.pxd":222
 *     """
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.math_floor_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     cdef long long q, r
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_division_by_zero_for_utils_math_4); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(5, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "utils.pxd":646
 *     cdef char* buffer = <char*> malloc(size + 1)
 *     if buffer == NULL:
 *         raise MemoryError("failed to allocate memory for string slice.")             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t i
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_failed_to_allocate_memory_for_st); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(5, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "utils.pxd":2520
 *         if arr.shape[1] == 0:
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0])             # <<<<<<<<<<<<<<
 *     if ndim == 3:
 *         if arr.shape[2] == 0:
 */
  __pyx_tuple__16 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(5, 2520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "utils.pxd":2524
 *         if arr.shape[2] == 0:
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0, 0])             # <<<<<<<<<<<<<<
 *     if ndim == 4:
 *         if arr.shape[3] == 0:
 */
  __pyx_tuple__17 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(5, 2524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "utils.pxd":2528
 *         if arr.shape[3] == 0:
 *             return parse_arr_nptime_unit(arr)
 *         return np.get_datetime64_unit(arr[0, 0, 0, 0])             # <<<<<<<<<<<<<<
 *     # Invalid
 *     raise ValueError("support <'ndarray'> with 1-4 dimensions, got ndim '%d'." % ndim)
 */
  __pyx_tuple__18 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(5, 2528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "utils.pxd":2820
 *     # Validate
 *     if size < 1:
 *         raise ValueError("ndarray size must be an integer greater than 0.")             # <<<<<<<<<<<<<<
 * 
 *     # New array
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_ndarray_size_must_be_an_integer); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(5, 2820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "utils.pxd":2939
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot compare ndarrays with different shapes.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_cannot_compare_ndarrays_with_dif); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(5, 2939, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "utils.pxd":3112
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero in 'arr_mod()'.")             # <<<<<<<<<<<<<<
 * 
 *     # Prepare for computation
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_division_by_zero_in_arr_mod); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(5, 3112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "utils.pxd":3154
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.arr_round_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_division_by_zero_for_utils_arr_r); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(5, 3154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "utils.pxd":3198
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.arr_ceil_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_division_by_zero_for_utils_arr_c); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(5, 3198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "utils.pxd":3242
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("division by zero for 'utils.arr_floor_div()'.")             # <<<<<<<<<<<<<<
 * 
 *     # Compute
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_u_division_by_zero_for_utils_arr_f); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(5, 3242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "utils.pxd":3288
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot round to multiple 0.")             # <<<<<<<<<<<<<<
 *     if multiple == 0:
 *         multiple = factor
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_u_cannot_round_to_multiple_0); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(5, 3288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "utils.pxd":3336
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot ceil to multiple 0.")             # <<<<<<<<<<<<<<
 *     if multiple == 0:
 *         multiple = factor
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_u_cannot_ceil_to_multiple_0); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(5, 3336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "utils.pxd":3384
 *     arr = arr_assure_int64_like(arr)
 *     if factor == 0:
 *         raise ZeroDivisionError("cannot floor to multiple 0.")             # <<<<<<<<<<<<<<
 *     if multiple == 0:
 *         multiple = factor
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_u_cannot_floor_to_multiple_0); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(5, 3384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "utils.pxd":3424
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform addition on ndarrays with different shapes.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_u_cannot_perform_addition_on_ndarr); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(5, 3424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "utils.pxd":3452
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform subtraction on ndarrays with different shapes.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_u_cannot_perform_subtraction_on_nd); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(5, 3452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "utils.pxd":3550
 *     cdef np.npy_int64 size = arr1.shape[0]
 *     if size != arr2.shape[0]:
 *         raise ValueError("cannot perform comparison on ndarrays with different shapes.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_u_cannot_perform_comparison_on_nda); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(5, 3550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "utils.pxd":4184
 *     # Validate
 *     if size < 1:
 *         raise ValueError("array size must be greater than 0.")             # <<<<<<<<<<<<<<
 *     unit = map_nptime_unit_int2str(map_nptime_unit_str2int(unit))
 * 
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_u_array_size_must_be_greater_than); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(5, 4184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "utils.pxd":5690
 *     cdef np.npy_int64 arr2_size = arr2.shape[0]
 *     if arr1_size <= 0 or arr2_size <= 0:
 *         raise ValueError("For comparision, array size must be > 0.")             # <<<<<<<<<<<<<<
 *     arr1 = arr_assure_int64_like(arr1)
 *     arr2 = arr_assure_int64_like(arr2)
 */
  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_u_For_comparision_array_size_must); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(5, 5690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "cytimes/pddt.py":1258
 *             try:
 *                 if len(item) != 3:
 *                     raise ValueError("sequence must have 3 items.")             # <<<<<<<<<<<<<<
 *                 _ymd = utils.ymd_fr_isocalendar(item[0], item[1], item[2])
 *             except Exception as err:
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_u_sequence_must_have_3_items); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "cytimes/pddt.py":1240
 *         """
 * 
 *         def _parse_dict(item: dict) -> object:             # <<<<<<<<<<<<<<
 *             yy = item.get("year", year)
 *             ww = item.get("week", week)
 */
  __pyx_tuple__35 = PyTuple_Pack(6, __pyx_n_s_item, __pyx_n_s_yy, __pyx_n_s_ww, __pyx_n_s_dd, __pyx_n_s_ymd, __pyx_n_s_err); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);
  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_parse_dict, 1240, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 1240, __pyx_L1_error)

  /* "cytimes/pddt.py":1255
 *             )
 * 
 *         def _parse_sequence(item: object) -> object:             # <<<<<<<<<<<<<<
 *             try:
 *                 if len(item) != 3:
 */
  __pyx_tuple__37 = PyTuple_Pack(3, __pyx_n_s_item, __pyx_n_s_ymd, __pyx_n_s_err); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 1255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);
  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_parse_sequence, 1255, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 1255, __pyx_L1_error)

  /* "cytimes/pddt.py":3258
 *         """Return the ISO calendar years `<'Index[int64]'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 *         return Index(_iso[:, 0], name="isoyear")             # <<<<<<<<<<<<<<
 * 
 *     def isoweek(self) -> Index[np.int64]:
 */
  __pyx_slice__39 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__39)) __PYX_ERR(0, 3258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__39);
  __Pyx_GIVEREF(__pyx_slice__39);
  __pyx_tuple__40 = PyTuple_Pack(2, __pyx_slice__39, __pyx_int_0); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 3258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "cytimes/pddt.py":3263
 *         """Return the ISO calendar week numbers (1-53) `<'Index[int64]'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 *         return Index(_iso[:, 1], name="isoweek")             # <<<<<<<<<<<<<<
 * 
 *     def isoweekday(self) -> Index[np.int64]:
 */
  __pyx_tuple__41 = PyTuple_Pack(2, __pyx_slice__39, __pyx_int_1); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 3263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "cytimes/pddt.py":3268
 *         """Return the ISO calendar weekdays (1=Mon...7=Sun) `<'Index[int64]'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 *         return Index(_iso[:, 2], name="isoweekday")             # <<<<<<<<<<<<<<
 * 
 *     # . year
 */
  __pyx_tuple__42 = PyTuple_Pack(2, __pyx_slice__39, __pyx_int_2); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 3268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "cytimes/pddt.py":484
 *     """
 * 
 *     def __new__(             # <<<<<<<<<<<<<<
 *         cls,
 *         data: object,
 */
  __pyx_tuple__45 = PyTuple_Pack(11, __pyx_n_s_cls, __pyx_n_s_data, __pyx_n_s_freq, __pyx_n_s_tz, __pyx_n_s_ambiguous, __pyx_n_s_year1st, __pyx_n_s_day1st, __pyx_n_s_cfg, __pyx_n_s_unit, __pyx_n_s_name, __pyx_n_s_copy); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);
  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(11, 0, 0, 11, 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_src_cytimes_pddt_py, __pyx_n_s_new, 484, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 484, __pyx_L1_error)
  __pyx_tuple__47 = PyTuple_Pack(9, Py_None, Py_None, ((PyObject*)__pyx_n_u_raise), Py_None, Py_None, Py_None, Py_None, Py_None, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

  /* "cytimes/pddt.py":541
 * 
 *     # Constructor --------------------------------------------------------------------------
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def date_range(
 *         cls,
 */
  __pyx_tuple__48 = PyTuple_Pack(12, __pyx_n_s_cls, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_periods, __pyx_n_s_freq, __pyx_n_s_tz, __pyx_n_s_normalize, __pyx_n_s_inclusive, __pyx_n_s_unit, __pyx_n_s_name, __pyx_n_s_arr, __pyx_n_s_err); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);
  __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(10, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_date_range, 541, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 541, __pyx_L1_error)
  __pyx_tuple__50 = PyTuple_Pack(9, Py_None, Py_None, Py_None, ((PyObject*)__pyx_n_u_D), Py_None, ((PyObject *)Py_False), ((PyObject*)__pyx_n_u_both), Py_None, Py_None); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

  /* "cytimes/pddt.py":609
 *         return pddt_new_simple(arr, None, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def parse(
 *         cls,
 */
  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(11, 0, 0, 11, 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_src_cytimes_pddt_py, __pyx_n_s_parse, 609, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 609, __pyx_L1_error)

  /* "cytimes/pddt.py":664
 *         # fmt: on
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def now(
 *         cls,
 */
  __pyx_tuple__52 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_tz, __pyx_n_s_size, __pyx_n_s_unit, __pyx_n_s_name, __pyx_n_s_arr_size); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);
  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 6, 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_src_cytimes_pddt_py, __pyx_n_s_now, 664, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 664, __pyx_L1_error)
  __pyx_tuple__54 = PyTuple_Pack(4, Py_None, ((PyObject *)__pyx_int_1), Py_None, Py_None); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "cytimes/pddt.py":691
 *         return _pddt_fr_dt(utils.dt_now(tz), arr_size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def utcnow(
 *         cls,
 */
  __pyx_tuple__55 = PyTuple_Pack(5, __pyx_n_s_cls, __pyx_n_s_size, __pyx_n_s_unit, __pyx_n_s_name, __pyx_n_s_arr_size); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);
  __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_utcnow, 691, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 691, __pyx_L1_error)
  __pyx_tuple__57 = PyTuple_Pack(3, ((PyObject *)__pyx_int_1), Py_None, Py_None); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);

  /* "cytimes/pddt.py":712
 *         return _pddt_fr_dt(utils.dt_now(utils.UTC), arr_size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def today(
 *         cls,
 */
  __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_today, 712, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 712, __pyx_L1_error)

  /* "cytimes/pddt.py":733
 *         return _pddt_fr_dt(utils.dt_now(None), arr_size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def combine(
 *         cls,
 */
  __pyx_tuple__59 = PyTuple_Pack(8, __pyx_n_s_cls, __pyx_n_s_date, __pyx_n_s_time, __pyx_n_s_tz, __pyx_n_s_size, __pyx_n_s_unit, __pyx_n_s_name, __pyx_n_s_arr_size); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);
  __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_combine, 733, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 733, __pyx_L1_error)
  __pyx_tuple__61 = PyTuple_Pack(6, Py_None, Py_None, Py_None, ((PyObject *)__pyx_int_1), Py_None, Py_None); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "cytimes/pddt.py":776
 *         return _pddt_fr_dt(utils.dt_combine(date, time, tz), arr_size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromordinal(
 *         cls,
 */
  __pyx_tuple__62 = PyTuple_Pack(13, __pyx_n_s_cls, __pyx_n_s_ordinal, __pyx_n_s_tz, __pyx_n_s_size, __pyx_n_s_unit, __pyx_n_s_name, __pyx_n_s_arr, __pyx_n_s_arr_size, __pyx_n_s_val, __pyx_n_s_err, __pyx_n_s_arr_ptr, __pyx_n_s_i, __pyx_n_s_item); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);
  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 13, 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_src_cytimes_pddt_py, __pyx_n_s_fromordinal, 776, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 776, __pyx_L1_error)

  /* "cytimes/pddt.py":875
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromseconds(
 *         cls,
 */
  __pyx_tuple__64 = PyTuple_Pack(15, __pyx_n_s_cls, __pyx_n_s_seconds, __pyx_n_s_tz, __pyx_n_s_size, __pyx_n_s_unit, __pyx_n_s_name, __pyx_n_s_arr, __pyx_n_s_arr_size, __pyx_n_s_sec, __pyx_n_s_val, __pyx_n_s_err, __pyx_n_s_arr_ptr, __pyx_n_s_i, __pyx_n_s_item, __pyx_n_s_kind); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);
  __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 15, 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_src_cytimes_pddt_py, __pyx_n_s_fromseconds, 875, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 875, __pyx_L1_error)

  /* "cytimes/pddt.py":977
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromicroseconds(
 *         cls,
 */
  __pyx_tuple__66 = PyTuple_Pack(13, __pyx_n_s_cls, __pyx_n_s_us, __pyx_n_s_tz, __pyx_n_s_size, __pyx_n_s_unit, __pyx_n_s_name, __pyx_n_s_arr, __pyx_n_s_arr_size, __pyx_n_s_val, __pyx_n_s_err, __pyx_n_s_arr_ptr, __pyx_n_s_i, __pyx_n_s_item); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);
  __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 13, 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_src_cytimes_pddt_py, __pyx_n_s_fromicroseconds, 977, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 977, __pyx_L1_error)

  /* "cytimes/pddt.py":1070
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromtimestamp(
 *         cls,
 */
  __pyx_tuple__68 = PyTuple_Pack(14, __pyx_n_s_cls, __pyx_n_s_ts, __pyx_n_s_tz, __pyx_n_s_size, __pyx_n_s_unit, __pyx_n_s_name, __pyx_n_s_arr, __pyx_n_s_arr_size, __pyx_n_s_sec, __pyx_n_s_err, __pyx_n_s_dt, __pyx_n_s_arr_ptr, __pyx_n_s_i, __pyx_n_s_item); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 1070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);
  __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 14, 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_src_cytimes_pddt_py, __pyx_n_s_fromtimestamp, 1070, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 1070, __pyx_L1_error)

  /* "cytimes/pddt.py":1148
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def utcfromtimestamp(
 *         cls,
 */
  __pyx_tuple__70 = PyTuple_Pack(5, __pyx_n_s_cls, __pyx_n_s_ts, __pyx_n_s_size, __pyx_n_s_unit, __pyx_n_s_name); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 1148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);
  __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_utcfromtimestamp, 1148, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 1148, __pyx_L1_error)

  /* "cytimes/pddt.py":1174
 *         return cls.fromtimestamp(ts, utils.UTC, size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromisoformat(
 *         cls,
 */
  __pyx_tuple__72 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_dtstr, __pyx_n_s_size, __pyx_n_s_unit, __pyx_n_s_name, __pyx_n_s_arr_size); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 1174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);
  __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_fromisoformat, 1174, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 1174, __pyx_L1_error)

  /* "cytimes/pddt.py":1206
 *         return pddt_new_simple(dtstr, None, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromisocalendar(
 *         cls,
 */
  __pyx_tuple__74 = PyTuple_Pack(16, __pyx_n_s_cls, __pyx_n_s_iso, __pyx_n_s_year, __pyx_n_s_week, __pyx_n_s_weekday, __pyx_n_s_tz, __pyx_n_s_size, __pyx_n_s_unit, __pyx_n_s_name, __pyx_n_s_parse_dict, __pyx_n_s_parse_dict, __pyx_n_s_parse_sequence, __pyx_n_s_parse_sequence, __pyx_n_s_dts, __pyx_n_s_item, __pyx_n_s_arr_size); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);
  __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(9, 0, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_fromisocalendar, 1206, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 1206, __pyx_L1_error)
  __pyx_tuple__76 = PyTuple_Pack(7, Py_None, Py_None, Py_None, Py_None, ((PyObject *)__pyx_int_1), Py_None, Py_None); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);

  /* "cytimes/pddt.py":1314
 *             return pddt_new_simple(dts, None, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromdate(
 *         cls,
 */
  __pyx_tuple__77 = PyTuple_Pack(7, __pyx_n_s_cls, __pyx_n_s_date, __pyx_n_s_tz, __pyx_n_s_size, __pyx_n_s_unit, __pyx_n_s_name, __pyx_n_s_arr_size); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 1314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);
  __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_fromdate, 1314, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 1314, __pyx_L1_error)

  /* "cytimes/pddt.py":1354
 *         return pddt_new_simple(date, tz, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromdatetime(
 *         cls,
 */
  __pyx_tuple__80 = PyTuple_Pack(8, __pyx_n_s_cls, __pyx_n_s_dt, __pyx_n_s_size, __pyx_n_s_unit, __pyx_n_s_name, __pyx_n_s_arr_size, __pyx_n_s_dts, __pyx_n_s__79); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);
  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_fromdatetime, 1354, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 1354, __pyx_L1_error)

  /* "cytimes/pddt.py":1392
 *         return pddt_new_simple(dt, None, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromdatetime64(
 *         cls,
 */
  __pyx_tuple__82 = PyTuple_Pack(9, __pyx_n_s_cls, __pyx_n_s_dt64, __pyx_n_s_tz, __pyx_n_s_size, __pyx_n_s_unit, __pyx_n_s_name, __pyx_n_s_arr_size, __pyx_n_s_dts, __pyx_n_s__79); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 1392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);
  __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_fromdatetime64, 1392, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 1392, __pyx_L1_error)

  /* "cytimes/pddt.py":1431
 *         return pddt_new_simple(dt64, tz, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def strptime(
 *         cls,
 */
  __pyx_tuple__84 = PyTuple_Pack(11, __pyx_n_s_cls, __pyx_n_s_dtstr, __pyx_n_s_fmt, __pyx_n_s_size, __pyx_n_s_unit, __pyx_n_s_name, __pyx_n_s_arr_size, __pyx_n_s_dt, __pyx_n_s_err, __pyx_n_s_dts, __pyx_n_s_item); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 1431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);
  __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_strptime, 1431, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 1431, __pyx_L1_error)

  /* "cytimes/pddt.py":1483
 * 
 *     # Convertor ----------------------------------------------------------------------------
 *     def ctime(self) -> Index[str]:             # <<<<<<<<<<<<<<
 *         """Convert to index of strings in C time format `<'Index[str]'>`.
 * 
 */
  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 1483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);
  __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_ctime, 1483, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 1483, __pyx_L1_error)

  /* "cytimes/pddt.py":1490
 *         return self.strftime("%a %b %d %H:%M:%S %Y")
 * 
 *     def isoformat(self, sep: str = "T") -> Index[str]:             # <<<<<<<<<<<<<<
 *         """Convert to index of strings in ISO format `<'Index[str]'>`.
 * 
 */
  __pyx_tuple__88 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_sep); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 1490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);
  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_isoformat, 1490, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 1490, __pyx_L1_error)
  __pyx_tuple__90 = PyTuple_Pack(1, ((PyObject*)__pyx_n_u_T)); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 1490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);

  /* "cytimes/pddt.py":1497
 *         return self.strftime(f"%Y-%m-%d{sep}%H:%M:%S.%f%z")
 * 
 *     def timedf(self) -> DataFrame:             # <<<<<<<<<<<<<<
 *         """Convert to DataFrame of time components `<'DataFrame'>`."""
 *         arr: np.ndarray = self.values_naive
 */
  __pyx_tuple__91 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 1497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__91);
  __Pyx_GIVEREF(__pyx_tuple__91);
  __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(1, 0, 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_src_cytimes_pddt_py, __pyx_n_s_timedf, 1497, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(0, 1497, __pyx_L1_error)

  /* "cytimes/pddt.py":1513
 *         )
 * 
 *     def utctimedf(self) -> DataFrame:             # <<<<<<<<<<<<<<
 *         """Convert to DataFrame of time components representing the UTC time `<'DataFrame'>`."""
 *         my_tz = self.tzinfo
 */
  __pyx_tuple__93 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_my_tz); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 1513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);
  __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(1, 0, 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_src_cytimes_pddt_py, __pyx_n_s_utctimedf, 1513, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 1513, __pyx_L1_error)

  /* "cytimes/pddt.py":1520
 *         return self.tz_convert(utils.UTC).timedf()
 * 
 *     def toordinal(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Convert to index of proleptic Gregorian ordinal days `<'Index[int64]'>`.
 * 
 */
  __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_toordinal, 1520, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 1520, __pyx_L1_error)

  /* "cytimes/pddt.py":1527
 *         return Index(utils.dt64arr_to_ordinal(self.values), name="ordinal")
 * 
 *     def seconds(self, utc: cython.bint = False) -> Index[np.float64]:             # <<<<<<<<<<<<<<
 *         """Convert to index of seconds since Unix Epoch `<'Index[float64]'>`.
 * 
 */
  __pyx_tuple__96 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_utc, __pyx_n_s_my_tz, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 1527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);
  __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_seconds, 1527, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 1527, __pyx_L1_error)

  /* "cytimes/pddt.py":1545
 *         return Index(utils.dt64arr_to_ts(arr), name="seconds")
 * 
 *     def microseconds(self, utc: cython.bint = False) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Convert to index of microseconds since Unix Epoch `<'Index[int64]'>`.
 * 
 */
  __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_microseconds, 1545, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 1545, __pyx_L1_error)

  /* "cytimes/pddt.py":1563
 *         return Index(utils.dt64arr_as_int64_us(arr), name="microseconds")
 * 
 *     def timestamp(self) -> Index[np.float64]:             # <<<<<<<<<<<<<<
 *         """Convert to index of POSIX timestamps `<'Index[float64]'>`."""
 *         # fmt: off
 */
  __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(1, 0, 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_src_cytimes_pddt_py, __pyx_n_s_timestamp, 1563, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 1563, __pyx_L1_error)

  /* "cytimes/pddt.py":1573
 *         return Index(utils.dt64arr_to_ts(arr), name="timestamp")
 * 
 *     def datetime(self) -> np.ndarray[datetime.datetime]:             # <<<<<<<<<<<<<<
 *         """Convert to array of datetime.datetime `<'ndarray[datetime]'>`.
 * 
 */
  __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_datetime, 1573, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 1573, __pyx_L1_error)

  /* "cytimes/pddt.py":1580
 *         return DatetimeIndex.to_pydatetime(self)
 * 
 *     def date(self) -> np.ndarray[datetime.date]:             # <<<<<<<<<<<<<<
 *         """Convert to array of datetime.date `<'ndarray[date]'>`."""
 *         return super(Pddt, self).date
 */
  __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_date, 1580, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 1580, __pyx_L1_error)

  /* "cytimes/pddt.py":1584
 *         return super(Pddt, self).date
 * 
 *     def time(self) -> np.ndarray[datetime.time]:             # <<<<<<<<<<<<<<
 *         """Convert to array of datetime.time (`WITHOUT` timezone) `<'ndarray[time]'>`."""
 *         return super(Pddt, self).time
 */
  __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_time, 1584, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 1584, __pyx_L1_error)

  /* "cytimes/pddt.py":1588
 *         return super(Pddt, self).time
 * 
 *     def timetz(self) -> np.ndarray[datetime.time]:             # <<<<<<<<<<<<<<
 *         """Convert to array of datetime.time (`WITH` timezone) `<'ndarray[time]'>`."""
 *         return super(Pddt, self).timetz
 */
  __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_timetz, 1588, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 1588, __pyx_L1_error)

  /* "cytimes/pddt.py":1593
 * 
 *     # Manipulator --------------------------------------------------------------------------
 *     def replace(             # <<<<<<<<<<<<<<
 *         self,
 *         year: cython.int = -1,
 */
  __pyx_tuple__104 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_year, __pyx_n_s_month, __pyx_n_s_day, __pyx_n_s_hour, __pyx_n_s_minute, __pyx_n_s_second, __pyx_n_s_microsecond, __pyx_n_s_nanosecond, __pyx_n_s_tzinfo, __pyx_n_s_my_tz, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 1593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);
  __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(10, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_replace, 1593, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 1593, __pyx_L1_error)

  /* "cytimes/pddt.py":1652
 * 
 *     # . year
 *     def to_curr_year(             # <<<<<<<<<<<<<<
 *         self,
 *         month: int | str | None = None,
 */
  __pyx_tuple__106 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_month, __pyx_n_s_day, __pyx_n_s_mm, __pyx_n_s_arr, __pyx_n_s_my_unit, __pyx_n_s_delta, __pyx_n_s_times, __pyx_n_s_datesY, __pyx_n_s_datesM, __pyx_n_s_datesD, __pyx_n_s_my_unit_ns, __pyx_n_s_dates, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 1652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);
  __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_to_curr_year, 1652, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 1652, __pyx_L1_error)

  /* "cytimes/pddt.py":1725
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_prev_year(             # <<<<<<<<<<<<<<
 *         self,
 *         month: int | str | None = None,
 */
  __pyx_tuple__108 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_month, __pyx_n_s_day); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 1725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);
  __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_to_prev_year, 1725, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 1725, __pyx_L1_error)

  /* "cytimes/pddt.py":1748
 *         return self.to_year(-1, month, day)
 * 
 *     def to_next_year(             # <<<<<<<<<<<<<<
 *         self,
 *         month: int | str | None = None,
 */
  __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_to_next_year, 1748, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(0, 1748, __pyx_L1_error)

  /* "cytimes/pddt.py":1771
 *         return self.to_year(1, month, day)
 * 
 *     def to_year(             # <<<<<<<<<<<<<<
 *         self,
 *         offset: cython.int,
 */
  __pyx_tuple__111 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_offset, __pyx_n_s_month, __pyx_n_s_day, __pyx_n_s_mm, __pyx_n_s_arr, __pyx_n_s_my_unit, __pyx_n_s_delta, __pyx_n_s_times, __pyx_n_s_datesY, __pyx_n_s_datesM, __pyx_n_s_datesD, __pyx_n_s_my_unit_ns, __pyx_n_s_dates, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 1771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);
  __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 15, 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_src_cytimes_pddt_py, __pyx_n_s_to_year, 1771, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 1771, __pyx_L1_error)

  /* "cytimes/pddt.py":1853
 * 
 *     # . quarter
 *     def to_curr_quarter(self, month: cython.int = -1, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified month and day in the current quarter. `<'Pddt'>`.
 * 
 */
  __pyx_tuple__113 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_month, __pyx_n_s_day, __pyx_n_s_arr, __pyx_n_s_my_unit, __pyx_n_s_times, __pyx_n_s_datesQ, __pyx_n_s_datesM, __pyx_n_s_datesD, __pyx_n_s_delta, __pyx_n_s_my_unit_ns, __pyx_n_s_dates, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 1853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);
  __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 13, 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_src_cytimes_pddt_py, __pyx_n_s_to_curr_quarter, 1853, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 1853, __pyx_L1_error)

  /* "cytimes/pddt.py":1918
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_prev_quarter(self, month: cython.int = -1, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified month and day in the previous quarter. `<'Pddt'>`.
 * 
 */
  __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_to_prev_quarter, 1918, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 1918, __pyx_L1_error)

  /* "cytimes/pddt.py":1935
 *         return self.to_quarter(-1, month, day)
 * 
 *     def to_next_quarter(self, month: cython.int = -1, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified month and day in the next quarter. `<'Pddt'>`.
 * 
 */
  __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_to_next_quarter, 1935, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 1935, __pyx_L1_error)

  /* "cytimes/pddt.py":1952
 *         return self.to_quarter(1, month, day)
 * 
 *     def to_quarter(             # <<<<<<<<<<<<<<
 *         self,
 *         offset: cython.int,
 */
  __pyx_tuple__117 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_offset, __pyx_n_s_month, __pyx_n_s_day, __pyx_n_s_arr, __pyx_n_s_my_unit, __pyx_n_s_times, __pyx_n_s_datesM, __pyx_n_s_datesQ, __pyx_n_s_datesD, __pyx_n_s_delta, __pyx_n_s_my_unit_ns, __pyx_n_s_dates, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(0, 1952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__117);
  __Pyx_GIVEREF(__pyx_tuple__117);
  __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 14, 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_src_cytimes_pddt_py, __pyx_n_s_to_quarter, 1952, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(0, 1952, __pyx_L1_error)

  /* "cytimes/pddt.py":2028
 * 
 *     # . month
 *     def to_curr_month(self, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified day of the current month `<'Pddt'>`.
 * 
 */
  __pyx_tuple__119 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_day, __pyx_n_s_arr, __pyx_n_s_my_unit, __pyx_n_s_delta, __pyx_n_s_times, __pyx_n_s_datesM, __pyx_n_s_datesD, __pyx_n_s_my_unit_ns, __pyx_n_s_dates, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(0, 2028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);
  __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 11, 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_src_cytimes_pddt_py, __pyx_n_s_to_curr_month, 2028, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(0, 2028, __pyx_L1_error)

  /* "cytimes/pddt.py":2083
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_prev_month(self, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified day of the previous month `<'Pddt'>`.
 * 
 */
  __pyx_tuple__121 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_day); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 2083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);
  __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 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_src_cytimes_pddt_py, __pyx_n_s_to_prev_month, 2083, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(0, 2083, __pyx_L1_error)

  /* "cytimes/pddt.py":2096
 *         return self.to_month(-1, day)
 * 
 *     def to_next_month(self, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified day of the next month `<'Pddt'>`.
 * 
 */
  __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 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_src_cytimes_pddt_py, __pyx_n_s_to_next_month, 2096, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(0, 2096, __pyx_L1_error)

  /* "cytimes/pddt.py":2109
 *         return self.to_month(1, day)
 * 
 *     def to_month(self, offset: cython.int, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified day of the month (+/-) offest `<'Pddt'>`.
 * 
 */
  __pyx_tuple__124 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_offset, __pyx_n_s_day, __pyx_n_s_arr, __pyx_n_s_my_unit, __pyx_n_s_delta, __pyx_n_s_times, __pyx_n_s_datesM, __pyx_n_s_datesD, __pyx_n_s_my_unit_ns, __pyx_n_s_dates, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 2109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);
  __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_to_month, 2109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(0, 2109, __pyx_L1_error)

  /* "cytimes/pddt.py":2172
 * 
 *     # . weekday
 *     def to_monday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Monday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(0)
 */
  __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_to_monday, 2172, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(0, 2172, __pyx_L1_error)

  /* "cytimes/pddt.py":2176
 *         return self._to_curr_weekday(0)
 * 
 *     def to_tuesday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Tuesday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(1)
 */
  __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_to_tuesday, 2176, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(0, 2176, __pyx_L1_error)

  /* "cytimes/pddt.py":2180
 *         return self._to_curr_weekday(1)
 * 
 *     def to_wednesday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Wednesday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(2)
 */
  __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_to_wednesday, 2180, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(0, 2180, __pyx_L1_error)

  /* "cytimes/pddt.py":2184
 *         return self._to_curr_weekday(2)
 * 
 *     def to_thursday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Thursday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(3)
 */
  __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_to_thursday, 2184, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) __PYX_ERR(0, 2184, __pyx_L1_error)

  /* "cytimes/pddt.py":2188
 *         return self._to_curr_weekday(3)
 * 
 *     def to_friday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Friday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(4)
 */
  __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_to_friday, 2188, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) __PYX_ERR(0, 2188, __pyx_L1_error)

  /* "cytimes/pddt.py":2192
 *         return self._to_curr_weekday(4)
 * 
 *     def to_saturday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Saturday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(5)
 */
  __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_to_saturday, 2192, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 2192, __pyx_L1_error)

  /* "cytimes/pddt.py":2196
 *         return self._to_curr_weekday(5)
 * 
 *     def to_sunday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Sunday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(6)
 */
  __pyx_codeobj__132 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_to_sunday, 2196, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__132)) __PYX_ERR(0, 2196, __pyx_L1_error)

  /* "cytimes/pddt.py":2200
 *         return self._to_curr_weekday(6)
 * 
 *     def to_curr_weekday(self, weekday: int | str | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specific weekday of the current week `<'Pddt'>`.
 * 
 */
  __pyx_tuple__133 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_weekday); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(0, 2200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__133);
  __Pyx_GIVEREF(__pyx_tuple__133);
  __pyx_codeobj__134 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 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_src_cytimes_pddt_py, __pyx_n_s_to_curr_weekday_2, 2200, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__134)) __PYX_ERR(0, 2200, __pyx_L1_error)
  __pyx_tuple__135 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 2200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__135);
  __Pyx_GIVEREF(__pyx_tuple__135);

  /* "cytimes/pddt.py":2214
 *         return self._to_curr_weekday(_parse_weekday(weekday, True))
 * 
 *     def to_prev_weekday(self, weekday: int | str | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specific weekday of the previous week `<'Pddt'>`.
 * 
 */
  __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 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_src_cytimes_pddt_py, __pyx_n_s_to_prev_weekday, 2214, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(0, 2214, __pyx_L1_error)

  /* "cytimes/pddt.py":2228
 *         return self.to_weekday(-1, weekday)
 * 
 *     def to_next_weekday(self, weekday: int | str | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specific weekday of the next week `<'Pddt'>`.
 * 
 */
  __pyx_codeobj__137 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 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_src_cytimes_pddt_py, __pyx_n_s_to_next_weekday, 2228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) __PYX_ERR(0, 2228, __pyx_L1_error)

  /* "cytimes/pddt.py":2242
 *         return self.to_weekday(1, weekday)
 * 
 *     def to_weekday(self, offset: cython.int, weekday: int | str | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specific weekday of the week (+/-) offset `<'Pddt'>`.
 * 
 */
  __pyx_tuple__138 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_offset, __pyx_n_s_weekday, __pyx_n_s_wkd, __pyx_n_s_arr, __pyx_n_s_my_unit, __pyx_n_s_delta, __pyx_n_s_times, __pyx_n_s_datesD, __pyx_n_s_my_unit_ns, __pyx_n_s_dates, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(0, 2242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);
  __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_to_weekday, 2242, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) __PYX_ERR(0, 2242, __pyx_L1_error)

  /* "cytimes/pddt.py":2289
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def _to_curr_weekday(self, weekday: cython.int) -> Self:             # <<<<<<<<<<<<<<
 *         """(internal) Adjust the date to the specific weekday of the current week `<'Pddt'>`.
 * 
 */
  __pyx_tuple__140 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_weekday, __pyx_n_s_arr, __pyx_n_s_my_unit, __pyx_n_s_delta, __pyx_n_s_times, __pyx_n_s_datesD, __pyx_n_s_my_unit_ns, __pyx_n_s_dates, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(0, 2289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__140);
  __Pyx_GIVEREF(__pyx_tuple__140);
  __pyx_codeobj__141 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_to_curr_weekday, 2289, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__141)) __PYX_ERR(0, 2289, __pyx_L1_error)

  /* "cytimes/pddt.py":2327
 * 
 *     # . day
 *     def to_yesterday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to Yesterday `<'Pddt'>`."""
 *         return self.to_day(-1)
 */
  __pyx_codeobj__142 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_to_yesterday, 2327, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__142)) __PYX_ERR(0, 2327, __pyx_L1_error)

  /* "cytimes/pddt.py":2331
 *         return self.to_day(-1)
 * 
 *     def to_tomorrow(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to Tomorrow `<'Pddt'>`."""
 *         return self.to_day(1)
 */
  __pyx_codeobj__143 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_to_tomorrow, 2331, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__143)) __PYX_ERR(0, 2331, __pyx_L1_error)

  /* "cytimes/pddt.py":2335
 *         return self.to_day(1)
 * 
 *     def to_day(self, offset: cython.int) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to day (+/-) offset `<'Pddt'>`.
 * 
 */
  __pyx_tuple__144 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_offset, __pyx_n_s_arr, __pyx_n_s_my_unit, __pyx_n_s_times, __pyx_n_s_datesD, __pyx_n_s_my_unit_ns, __pyx_n_s_dates, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(0, 2335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__144);
  __Pyx_GIVEREF(__pyx_tuple__144);
  __pyx_codeobj__145 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__144, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_to_day, 2335, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__145)) __PYX_ERR(0, 2335, __pyx_L1_error)

  /* "cytimes/pddt.py":2367
 * 
 *     # . date&time
 *     def snap(self, freq: object = "S") -> Self:             # <<<<<<<<<<<<<<
 *         """Snap to nearest occurring frequency `<'Pddt'>`.
 * 
 */
  __pyx_tuple__146 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_freq); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(0, 2367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__146);
  __Pyx_GIVEREF(__pyx_tuple__146);
  __pyx_codeobj__147 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__146, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_snap, 2367, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__147)) __PYX_ERR(0, 2367, __pyx_L1_error)
  __pyx_tuple__148 = PyTuple_Pack(1, ((PyObject*)__pyx_n_u_S)); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(0, 2367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__148);
  __Pyx_GIVEREF(__pyx_tuple__148);

  /* "cytimes/pddt.py":2383
 *         return pddt_new_simple(DatetimeIndex.snap(self, freq))
 * 
 *     def to_datetime(             # <<<<<<<<<<<<<<
 *         self,
 *         year: cython.int = -1,
 */
  __pyx_tuple__149 = PyTuple_Pack(25, __pyx_n_s_self, __pyx_n_s_year, __pyx_n_s_month, __pyx_n_s_day, __pyx_n_s_hour, __pyx_n_s_minute, __pyx_n_s_second, __pyx_n_s_microsecond, __pyx_n_s_nanosecond, __pyx_n_s_arr, __pyx_n_s_my_unit, __pyx_n_s_my_unit_ch, __pyx_n_s_delta, __pyx_n_s_hh_fac, __pyx_n_s_mi_fac, __pyx_n_s_ss_fac, __pyx_n_s_us_fac, __pyx_n_s_months, __pyx_n_s_datesM, __pyx_n_s_datesY, __pyx_n_s_datesD, __pyx_n_s_times, __pyx_n_s_my_unit_adj, __pyx_n_s_dtype, __pyx_n_s_dates); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(0, 2383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__149);
  __Pyx_GIVEREF(__pyx_tuple__149);
  __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(9, 0, 0, 25, 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_src_cytimes_pddt_py, __pyx_n_s_to_datetime, 2383, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) __PYX_ERR(0, 2383, __pyx_L1_error)

  /* "cytimes/pddt.py":2527
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_date(             # <<<<<<<<<<<<<<
 *         self,
 *         year: cython.int = -1,
 */
  __pyx_tuple__151 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_year, __pyx_n_s_month, __pyx_n_s_day, __pyx_n_s_arr, __pyx_n_s_my_unit, __pyx_n_s_delta, __pyx_n_s_times, __pyx_n_s_months, __pyx_n_s_datesM, __pyx_n_s_datesD, __pyx_n_s_my_unit_ns, __pyx_n_s_dates, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(0, 2527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__151);
  __Pyx_GIVEREF(__pyx_tuple__151);
  __pyx_codeobj__152 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 14, 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_src_cytimes_pddt_py, __pyx_n_s_to_date, 2527, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) __PYX_ERR(0, 2527, __pyx_L1_error)

  /* "cytimes/pddt.py":2588
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_time(             # <<<<<<<<<<<<<<
 *         self,
 *         hour: cython.int = -1,
 */
  __pyx_tuple__153 = PyTuple_Pack(19, __pyx_n_s_self, __pyx_n_s_hour, __pyx_n_s_minute, __pyx_n_s_second, __pyx_n_s_microsecond, __pyx_n_s_nanosecond, __pyx_n_s_arr, __pyx_n_s_my_unit, __pyx_n_s_my_unit_ch, __pyx_n_s_delta, __pyx_n_s_hh_fac, __pyx_n_s_mi_fac, __pyx_n_s_ss_fac, __pyx_n_s_us_fac, __pyx_n_s_datesD, __pyx_n_s_my_unit_adj, __pyx_n_s_times, __pyx_n_s_dtype, __pyx_n_s_dates); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(0, 2588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__153);
  __Pyx_GIVEREF(__pyx_tuple__153);
  __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 19, 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_src_cytimes_pddt_py, __pyx_n_s_to_time, 2588, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) __PYX_ERR(0, 2588, __pyx_L1_error)

  /* "cytimes/pddt.py":2706
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_first_of(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the first day of the specified datetime unit `<'Pddt'>`.
 * 
 */
  __pyx_tuple__155 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_unit, __pyx_n_s_arr, __pyx_n_s_my_unit, __pyx_n_s_times, __pyx_n_s_datesD, __pyx_n_s_delta, __pyx_n_s_datesM, __pyx_n_s_datesQ, __pyx_n_s_datesY, __pyx_n_s_val, __pyx_n_s_my_unit_ns, __pyx_n_s_dates, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(0, 2706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__155);
  __Pyx_GIVEREF(__pyx_tuple__155);
  __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 14, 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_src_cytimes_pddt_py, __pyx_n_s_to_first_of, 2706, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) __PYX_ERR(0, 2706, __pyx_L1_error)

  /* "cytimes/pddt.py":2773
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_last_of(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the last day of the specified datetime unit `<'Pddt'>`.
 * 
 */
  __pyx_codeobj__157 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 14, 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_src_cytimes_pddt_py, __pyx_n_s_to_last_of, 2773, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__157)) __PYX_ERR(0, 2773, __pyx_L1_error)

  /* "cytimes/pddt.py":2840
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_start_of(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the datetime to the start of the specified datetime unit `<'Pddt'>`.
 * 
 */
  __pyx_tuple__158 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_unit, __pyx_n_s_arr, __pyx_n_s_my_unit, __pyx_n_s_datesD, __pyx_n_s_delta, __pyx_n_s_datesM, __pyx_n_s_datesQ, __pyx_n_s_datesY, __pyx_n_s_val); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(0, 2840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__158);
  __Pyx_GIVEREF(__pyx_tuple__158);
  __pyx_codeobj__159 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_to_start_of, 2840, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__159)) __PYX_ERR(0, 2840, __pyx_L1_error)

  /* "cytimes/pddt.py":2919
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_end_of(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the datetime to the end of the specified datetime unit `<'Pddt'>`.
 * 
 */
  __pyx_tuple__160 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_unit, __pyx_n_s_my_unit, __pyx_n_s_arr, __pyx_n_s_my_unit_ch, __pyx_n_s_fac, __pyx_n_s_mul, __pyx_n_s_off, __pyx_n_s_dtype, __pyx_n_s_datesD, __pyx_n_s_delta, __pyx_n_s_datesM, __pyx_n_s_datesQ, __pyx_n_s_datesY, __pyx_n_s_val); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(0, 2919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__160);
  __Pyx_GIVEREF(__pyx_tuple__160);
  __pyx_codeobj__161 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__160, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_to_end_of, 2919, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__161)) __PYX_ERR(0, 2919, __pyx_L1_error)

  /* "cytimes/pddt.py":3131
 * 
 *     # . round / ceil / floor
 *     def round(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Perform round operation to the specified datetime unit `<'Pddt'>`.
 * 
 */
  __pyx_tuple__162 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_unit, __pyx_n_s_my_unit, __pyx_n_s_arr, __pyx_n_s_res, __pyx_n_s_err); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(0, 3131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__162);
  __Pyx_GIVEREF(__pyx_tuple__162);
  __pyx_codeobj__163 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_round, 3131, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__163)) __PYX_ERR(0, 3131, __pyx_L1_error)

  /* "cytimes/pddt.py":3156
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)
 * 
 *     def ceil(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Perform ceil operation to the specified datetime unit `<'Pddt'>`.
 * 
 */
  __pyx_codeobj__164 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_ceil, 3156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) __PYX_ERR(0, 3156, __pyx_L1_error)

  /* "cytimes/pddt.py":3181
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)
 * 
 *     def floor(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Perform floor operation to the specified datetime unit `<'Pddt'>`.
 * 
 */
  __pyx_codeobj__165 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_floor, 3181, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__165)) __PYX_ERR(0, 3181, __pyx_L1_error)

  /* "cytimes/pddt.py":3207
 * 
 *     # . fsp (fractional seconds precision)
 *     def fsp(self, precision: cython.int) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust to the specified fractional seconds precision `<'Pddt'>`.
 * 
 */
  __pyx_tuple__166 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_precision, __pyx_n_s_my_unit, __pyx_n_s_my_unit_ch, __pyx_n_s_f, __pyx_n_s_arr, __pyx_n_s_res); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(0, 3207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__166);
  __Pyx_GIVEREF(__pyx_tuple__166);
  __pyx_codeobj__167 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__166, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_fsp, 3207, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__167)) __PYX_ERR(0, 3207, __pyx_L1_error)

  /* "cytimes/pddt.py":3250
 *     # Calendar -----------------------------------------------------------------------------
 *     # . iso
 *     def isocalendar(self) -> DataFrame:             # <<<<<<<<<<<<<<
 *         """Return the ISO calendar `<'DateFrame'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 */
  __pyx_tuple__168 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_iso_2); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(0, 3250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__168);
  __Pyx_GIVEREF(__pyx_tuple__168);
  __pyx_codeobj__169 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__168, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_isocalendar, 3250, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__169)) __PYX_ERR(0, 3250, __pyx_L1_error)

  /* "cytimes/pddt.py":3255
 *         return DataFrame(_iso, columns=["year", "week", "weekday"], index=self)
 * 
 *     def isoyear(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the ISO calendar years `<'Index[int64]'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 */
  __pyx_codeobj__170 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__168, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_isoyear, 3255, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__170)) __PYX_ERR(0, 3255, __pyx_L1_error)

  /* "cytimes/pddt.py":3260
 *         return Index(_iso[:, 0], name="isoyear")
 * 
 *     def isoweek(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the ISO calendar week numbers (1-53) `<'Index[int64]'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 */
  __pyx_codeobj__171 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__168, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_isoweek, 3260, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__171)) __PYX_ERR(0, 3260, __pyx_L1_error)

  /* "cytimes/pddt.py":3265
 *         return Index(_iso[:, 1], name="isoweek")
 * 
 *     def isoweekday(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the ISO calendar weekdays (1=Mon...7=Sun) `<'Index[int64]'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 */
  __pyx_codeobj__172 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__168, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_isoweekday, 3265, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) __PYX_ERR(0, 3265, __pyx_L1_error)

  /* "cytimes/pddt.py":3271
 * 
 *     # . year
 *     @property             # <<<<<<<<<<<<<<
 *     def year(self) -> Index[np.int64]:
 *         """The years `<'Index[int64]'>`."""
 */
  __pyx_codeobj__173 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_year, 3271, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__173)) __PYX_ERR(0, 3271, __pyx_L1_error)

  /* "cytimes/pddt.py":3276
 *         return Index(utils.dt64arr_year(self.values_naive), name="year")
 * 
 *     def is_leap_year(self) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's years are in a leap year `<'Index[bool]'>`."""
 *         return Index(utils.dt64arr_is_leap_year(self.values_naive), name="is_leap_year")
 */
  __pyx_codeobj__174 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_is_leap_year, 3276, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__174)) __PYX_ERR(0, 3276, __pyx_L1_error)

  /* "cytimes/pddt.py":3280
 *         return Index(utils.dt64arr_is_leap_year(self.values_naive), name="is_leap_year")
 * 
 *     def is_long_year(self) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's years are in a long year `<'Index[bool]'>`.
 * 
 */
  __pyx_codeobj__175 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_is_long_year, 3280, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__175)) __PYX_ERR(0, 3280, __pyx_L1_error)

  /* "cytimes/pddt.py":3287
 *         return Index(utils.dt64arr_is_long_year(self.values_naive), name="is_long_year")
 * 
 *     def leap_bt_year(self, year: cython.int) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Compute the number of leap years between the instance's
 *         years and the passed-in 'year' `<'Index[int64]'>`.
 */
  __pyx_tuple__176 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_year); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(0, 3287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__176);
  __Pyx_GIVEREF(__pyx_tuple__176);
  __pyx_codeobj__177 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_leap_bt_year, 3287, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__177)) __PYX_ERR(0, 3287, __pyx_L1_error)

  /* "cytimes/pddt.py":3296
 *         )
 * 
 *     def days_in_year(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the maximum number of days (365, 366)
 *         in the instance's years `<'Index[int64]'>`.
 */
  __pyx_codeobj__178 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_days_in_year, 3296, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) __PYX_ERR(0, 3296, __pyx_L1_error)

  /* "cytimes/pddt.py":3302
 *         return Index(utils.dt64arr_days_in_year(self.values_naive), name="days_in_year")
 * 
 *     def days_bf_year(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days from January 1st, 1st AD,
 *         to the start of the instance's years `<'Index[int64]'>`.
 */
  __pyx_codeobj__179 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_days_bf_year, 3302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__179)) __PYX_ERR(0, 3302, __pyx_L1_error)

  /* "cytimes/pddt.py":3308
 *         return Index(utils.dt64arr_days_bf_year(self.values_naive), name="days_bf_year")
 * 
 *     def days_of_year(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days since the start
 *         of the instance's years `<'Index[int64]'>`.
 */
  __pyx_codeobj__180 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_days_of_year, 3308, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) __PYX_ERR(0, 3308, __pyx_L1_error)

  /* "cytimes/pddt.py":3314
 *         return Index(utils.dt64arr_days_of_year(self.values_naive), name="days_of_year")
 * 
 *     def is_year(self, year: cython.int) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's years match
 *         the passed-in 'year' `<'Index[bool]'>`.
 */
  __pyx_codeobj__181 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_is_year, 3314, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__181)) __PYX_ERR(0, 3314, __pyx_L1_error)

  /* "cytimes/pddt.py":3324
 * 
 *     # . quarter
 *     @property             # <<<<<<<<<<<<<<
 *     def quarter(self) -> Index[np.int64]:
 *         """The quarters (1-4) `<'Index[int64]'>`."""
 */
  __pyx_codeobj__182 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_quarter, 3324, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__182)) __PYX_ERR(0, 3324, __pyx_L1_error)

  /* "cytimes/pddt.py":3329
 *         return Index(utils.dt64arr_quarter(self.values_naive), name="quarter")
 * 
 *     def days_in_quarter(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the maximum number of days (90-92)
 *         in the instance's quarters `<'Index[int64]'>`.
 */
  __pyx_codeobj__183 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_days_in_quarter, 3329, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__183)) __PYX_ERR(0, 3329, __pyx_L1_error)

  /* "cytimes/pddt.py":3338
 *         )
 * 
 *     def days_bf_quarter(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days from the start of the instance's years
 *         to the start of the instance's quarters `<'Index[int64]'>`.
 */
  __pyx_codeobj__184 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_days_bf_quarter, 3338, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) __PYX_ERR(0, 3338, __pyx_L1_error)

  /* "cytimes/pddt.py":3347
 *         )
 * 
 *     def days_of_quarter(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days since the start
 *         of the instance's quarters `<'Index[int64]'>`.
 */
  __pyx_codeobj__185 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_days_of_quarter, 3347, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__185)) __PYX_ERR(0, 3347, __pyx_L1_error)

  /* "cytimes/pddt.py":3356
 *         )
 * 
 *     def is_quarter(self, quarter: cython.int) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's quarters match
 *         the passed-in 'quarter' `<'Index[bool]'>`.
 */
  __pyx_tuple__186 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_quarter); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(0, 3356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__186);
  __Pyx_GIVEREF(__pyx_tuple__186);
  __pyx_codeobj__187 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__186, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_is_quarter, 3356, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__187)) __PYX_ERR(0, 3356, __pyx_L1_error)

  /* "cytimes/pddt.py":3366
 * 
 *     # . month
 *     @property             # <<<<<<<<<<<<<<
 *     def month(self) -> Index[np.int64]:
 *         """The months (1-12) `<'Index[int64]'>`."""
 */
  __pyx_codeobj__188 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_month, 3366, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) __PYX_ERR(0, 3366, __pyx_L1_error)

  /* "cytimes/pddt.py":3371
 *         return Index(utils.dt64arr_month(self.values_naive), name="month")
 * 
 *     def days_in_month(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the maximum number of days (28-31)
 *         in the instance's months `<'Index[int64]'>`.
 */
  __pyx_codeobj__189 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_days_in_month, 3371, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__189)) __PYX_ERR(0, 3371, __pyx_L1_error)

  /* "cytimes/pddt.py":3380
 *         )
 * 
 *     def days_bf_month(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days from the start of the instance's
 *         years to the start of the instance's months `<'Index[int64]'>`.
 */
  __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_days_bf_month, 3380, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) __PYX_ERR(0, 3380, __pyx_L1_error)

  /* "cytimes/pddt.py":3389
 *         )
 * 
 *     def days_of_month(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days (1-31) since the start
 *         of the instance's months `<'Index[int64]'>`.
 */
  __pyx_codeobj__191 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_days_of_month, 3389, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__191)) __PYX_ERR(0, 3389, __pyx_L1_error)

  /* "cytimes/pddt.py":3398
 *         return Index(utils.dt64arr_day(self.values_naive), name="days_of_month")
 * 
 *     def is_month(self, month: str | int) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's months match
 *         the passed-in 'month' `<'Index[bool]'>`.
 */
  __pyx_tuple__192 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_month, __pyx_n_s_mm); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(0, 3398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__192);
  __Pyx_GIVEREF(__pyx_tuple__192);
  __pyx_codeobj__193 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__192, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_is_month, 3398, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__193)) __PYX_ERR(0, 3398, __pyx_L1_error)

  /* "cytimes/pddt.py":3409
 * 
 *     # . weekday
 *     @property             # <<<<<<<<<<<<<<
 *     def weekday(self) -> Index[np.int64]:
 *         """The weekdays (0=Mon...6=Sun) `<'Index[int64]'>`."""
 */
  __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_weekday, 3409, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) __PYX_ERR(0, 3409, __pyx_L1_error)

  /* "cytimes/pddt.py":3414
 *         return Index(utils.dt64arr_weekday(self.values_naive), name="weekday")
 * 
 *     def is_weekday(self, weekday: int | str) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's weekdays match
 *         the passed-in 'weekday' `<'Index[bool]'>`.
 */
  __pyx_tuple__195 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_weekday, __pyx_n_s_wd); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(0, 3414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__195);
  __Pyx_GIVEREF(__pyx_tuple__195);
  __pyx_codeobj__196 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 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_src_cytimes_pddt_py, __pyx_n_s_is_weekday, 3414, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__196)) __PYX_ERR(0, 3414, __pyx_L1_error)

  /* "cytimes/pddt.py":3425
 * 
 *     # . day
 *     @property             # <<<<<<<<<<<<<<
 *     def day(self) -> Index[np.int64]:
 *         """The days (1-31) `<'Index[int64]'>`."""
 */
  __pyx_codeobj__197 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_day, 3425, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__197)) __PYX_ERR(0, 3425, __pyx_L1_error)

  /* "cytimes/pddt.py":3430
 *         return Index(utils.dt64arr_day(self.values_naive), name="day")
 * 
 *     def is_day(self, day: cython.int) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's days match
 *         the passed-in 'day' `<'Index[bool]'>`.
 */
  __pyx_codeobj__198 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 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_src_cytimes_pddt_py, __pyx_n_s_is_day, 3430, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__198)) __PYX_ERR(0, 3430, __pyx_L1_error)

  /* "cytimes/pddt.py":3440
 * 
 *     # . time
 *     @property             # <<<<<<<<<<<<<<
 *     def hour(self) -> Index[np.int64]:
 *         """The hours (0-23) `<'Index[int64]'>`."""
 */
  __pyx_codeobj__199 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_hour, 3440, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__199)) __PYX_ERR(0, 3440, __pyx_L1_error)

  /* "cytimes/pddt.py":3445
 *         return Index(utils.dt64arr_hour(self.values_naive), name="hour")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def minute(self) -> Index[np.int64]:
 *         """The minutes (0-59) `<'Index[int64]'>`."""
 */
  __pyx_codeobj__200 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_minute, 3445, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__200)) __PYX_ERR(0, 3445, __pyx_L1_error)

  /* "cytimes/pddt.py":3450
 *         return Index(utils.dt64arr_minute(self.values_naive), name="minute")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def second(self) -> Index[np.int64]:
 *         """The seconds (0-59) `<'Index[int64]'>`."""
 */
  __pyx_codeobj__201 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_second, 3450, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__201)) __PYX_ERR(0, 3450, __pyx_L1_error)

  /* "cytimes/pddt.py":3455
 *         return Index(utils.dt64arr_second(self.values_naive), name="second")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def millisecond(self) -> Index[np.int64]:
 *         """The milliseconds (0-999) `<'Index[int64]'>`."""
 */
  __pyx_codeobj__202 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_millisecond, 3455, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) __PYX_ERR(0, 3455, __pyx_L1_error)

  /* "cytimes/pddt.py":3460
 *         return Index(utils.dt64arr_millisecond(self.values_naive), name="millisecond")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def microsecond(self) -> Index[np.int64]:
 *         """The microseconds (0-999999) `<'Index[int64]'>`."""
 */
  __pyx_codeobj__203 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_microsecond, 3460, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__203)) __PYX_ERR(0, 3460, __pyx_L1_error)

  /* "cytimes/pddt.py":3465
 *         return Index(utils.dt64arr_microsecond(self.values_naive), name="microsecond")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nanosecond(self) -> Index[np.int64]:
 *         """The nanoseconds (0-999) `<'Index[int64]'>`."""
 */
  __pyx_codeobj__204 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_nanosecond, 3465, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__204)) __PYX_ERR(0, 3465, __pyx_L1_error)

  /* "cytimes/pddt.py":3471
 * 
 *     # . date&time
 *     def is_first_of(self, unit: str) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the dates are on the first day of
 *         the specified datetime unit `<'Index[bool]'>`.
 */
  __pyx_tuple__205 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_unit, __pyx_n_s_pt_1st, __pyx_n_s_datesD_1st, __pyx_n_s_datesD, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__205)) __PYX_ERR(0, 3471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__205);
  __Pyx_GIVEREF(__pyx_tuple__205);
  __pyx_codeobj__206 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 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_src_cytimes_pddt_py, __pyx_n_s_is_first_of, 3471, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__206)) __PYX_ERR(0, 3471, __pyx_L1_error)

  /* "cytimes/pddt.py":3491
 *         return Index(arr, name="is_first_of[%s]" % unit)
 * 
 *     def is_last_of(self, unit: str) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the dates are on the last day of
 *         the specified datetime unit `<'Index[bool]'>`.
 */
  __pyx_tuple__207 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_unit, __pyx_n_s_pt_lst, __pyx_n_s_datesD_lst, __pyx_n_s_datesD, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__207)) __PYX_ERR(0, 3491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__207);
  __Pyx_GIVEREF(__pyx_tuple__207);
  __pyx_codeobj__208 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 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_src_cytimes_pddt_py, __pyx_n_s_is_last_of, 3491, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__208)) __PYX_ERR(0, 3491, __pyx_L1_error)

  /* "cytimes/pddt.py":3511
 *         return Index(arr, name="is_last_of[%s]" % unit)
 * 
 *     def is_start_of(self, unit: str) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the datetimes are at the start of
 *         the specified datetime unit `<'Index[bool]'>`.
 */
  __pyx_tuple__209 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_unit, __pyx_n_s_pt_stt, __pyx_n_s_pt_stt_unit, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__209)) __PYX_ERR(0, 3511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__209);
  __Pyx_GIVEREF(__pyx_tuple__209);
  __pyx_codeobj__210 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 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_src_cytimes_pddt_py, __pyx_n_s_is_start_of, 3511, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__210)) __PYX_ERR(0, 3511, __pyx_L1_error)

  /* "cytimes/pddt.py":3542
 *         return Index(arr, name="is_start_of[%s]" % unit)
 * 
 *     def is_end_of(self, unit: str) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the datetimes are at the end of
 *         the specified datetime unit `<'Index[bool]'>`.
 */
  __pyx_tuple__211 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_unit, __pyx_n_s_pt_end, __pyx_n_s_pt_end_unit, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__211)) __PYX_ERR(0, 3542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__211);
  __Pyx_GIVEREF(__pyx_tuple__211);
  __pyx_codeobj__212 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 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_src_cytimes_pddt_py, __pyx_n_s_is_end_of, 3542, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__212)) __PYX_ERR(0, 3542, __pyx_L1_error)

  /* "cytimes/pddt.py":3574
 * 
 *     # Timezone -----------------------------------------------------------------------------
 *     @property             # <<<<<<<<<<<<<<
 *     def tz_available(self) -> set[str]:
 *         """The available timezone names `<'set[str]'>`.
 */
  __pyx_codeobj__213 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_tz_available, 3574, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__213)) __PYX_ERR(0, 3574, __pyx_L1_error)

  /* "cytimes/pddt.py":3583
 *         return _available_timezones()
 * 
 *     def is_local(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Determine if the instance is in the local timezone `<'bool'>`.
 * 
 */
  __pyx_codeobj__214 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_is_local, 3583, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__214)) __PYX_ERR(0, 3583, __pyx_L1_error)

  /* "cytimes/pddt.py":3590
 *         return self.tzinfo is utils.tz_local(None)
 * 
 *     def is_utc(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Determine if the instance is in the UTC timezone `<'bool'>`.
 * 
 */
  __pyx_codeobj__215 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_is_utc, 3590, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__215)) __PYX_ERR(0, 3590, __pyx_L1_error)

  /* "cytimes/pddt.py":3597
 *         return self.tzinfo is utils.UTC
 * 
 *     def tzname(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the timezone name of the instance `<'str/None'>`.
 * 
 */
  __pyx_codeobj__216 = (PyObject*)__Pyx_PyCode_New(1, 0, 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_src_cytimes_pddt_py, __pyx_n_s_tzname, 3597, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__216)) __PYX_ERR(0, 3597, __pyx_L1_error)

  /* "cytimes/pddt.py":3605
 *         return None if my_tz is None else my_tz.tzname(self[0])
 * 
 *     def astimezone(             # <<<<<<<<<<<<<<
 *         self,
 *         tz: datetime.tzinfo | str | None = None,
 */
  __pyx_tuple__217 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_tz, __pyx_n_s_ambiguous, __pyx_n_s_nonexistent, __pyx_n_s_my_tz, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(0, 3605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__217);
  __Pyx_GIVEREF(__pyx_tuple__217);
  __pyx_codeobj__218 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 6, 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_src_cytimes_pddt_py, __pyx_n_s_astimezone, 3605, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__218)) __PYX_ERR(0, 3605, __pyx_L1_error)
  __pyx_tuple__219 = PyTuple_Pack(3, Py_None, ((PyObject*)__pyx_n_u_raise), ((PyObject*)__pyx_n_u_raise)); if (unlikely(!__pyx_tuple__219)) __PYX_ERR(0, 3605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__219);
  __Pyx_GIVEREF(__pyx_tuple__219);

  /* "cytimes/pddt.py":3658
 *         return pt.tz_convert(tz)
 * 
 *     def tz_localize(             # <<<<<<<<<<<<<<
 *         self,
 *         tz: datetime.tzinfo | str | None,
 */
  __pyx_tuple__220 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_tz, __pyx_n_s_ambiguous, __pyx_n_s_nonexistent, __pyx_n_s_my_tz, __pyx_n_s_pt, __pyx_n_s_err); if (unlikely(!__pyx_tuple__220)) __PYX_ERR(0, 3658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__220);
  __Pyx_GIVEREF(__pyx_tuple__220);
  __pyx_codeobj__221 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__220, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_tz_localize, 3658, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__221)) __PYX_ERR(0, 3658, __pyx_L1_error)
  __pyx_tuple__222 = PyTuple_Pack(2, ((PyObject*)__pyx_n_u_raise), ((PyObject*)__pyx_n_u_raise)); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(0, 3658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__222);
  __Pyx_GIVEREF(__pyx_tuple__222);

  /* "cytimes/pddt.py":3716
 *             raise errors.InvalidArgumentError(err) from err
 * 
 *     def tz_convert(self, tz: datetime.tzinfo | str | None) -> Self:             # <<<<<<<<<<<<<<
 *         """Convert timezone-aware instance to another timezone `<'Pddt'>`.
 * 
 */
  __pyx_tuple__223 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_tz, __pyx_n_s_my_tz, __pyx_n_s_pt, __pyx_n_s_err); if (unlikely(!__pyx_tuple__223)) __PYX_ERR(0, 3716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__223);
  __Pyx_GIVEREF(__pyx_tuple__223);
  __pyx_codeobj__224 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 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_src_cytimes_pddt_py, __pyx_n_s_tz_convert, 3716, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__224)) __PYX_ERR(0, 3716, __pyx_L1_error)

  /* "cytimes/pddt.py":3754
 *             raise errors.InvalidArgumentError(err) from err
 * 
 *     def tz_switch(             # <<<<<<<<<<<<<<
 *         self,
 *         targ_tz: datetime.tzinfo | str | None,
 */
  __pyx_tuple__225 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_targ_tz, __pyx_n_s_base_tz, __pyx_n_s_naive, __pyx_n_s_ambiguous, __pyx_n_s_nonexistent, __pyx_n_s_my_tz, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__225)) __PYX_ERR(0, 3754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__225);
  __Pyx_GIVEREF(__pyx_tuple__225);
  __pyx_codeobj__226 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 8, 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_src_cytimes_pddt_py, __pyx_n_s_tz_switch, 3754, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__226)) __PYX_ERR(0, 3754, __pyx_L1_error)

  /* "cytimes/pddt.py":3821
 * 
 *     # Values -------------------------------------------------------------------------------
 *     @property             # <<<<<<<<<<<<<<
 *     def values_naive(self) -> np.ndarray[np.datetime64]:
 *         """Return an array of the timezone-naive datetime values `<'ndarray[datetime64]'>`.
 */
  __pyx_codeobj__227 = (PyObject*)__Pyx_PyCode_New(1, 0, 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_src_cytimes_pddt_py, __pyx_n_s_values_naive, 3821, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__227)) __PYX_ERR(0, 3821, __pyx_L1_error)

  /* "cytimes/pddt.py":3833
 *         return super(Pddt, self).tz_localize(None).values
 * 
 *     def as_unit(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Set the datetime unit resolution of the instance `<'Pddt'>`.
 * 
 */
  __pyx_codeobj__228 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_as_unit, 3833, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__228)) __PYX_ERR(0, 3833, __pyx_L1_error)

  /* "cytimes/pddt.py":3861
 * 
 *     # Arithmetic ---------------------------------------------------------------------------
 *     def add(             # <<<<<<<<<<<<<<
 *         self,
 *         years: cython.int = 0,
 */
  __pyx_tuple__229 = PyTuple_Pack(21, __pyx_n_s_self, __pyx_n_s_years, __pyx_n_s_quarters, __pyx_n_s_months, __pyx_n_s_weeks, __pyx_n_s_days, __pyx_n_s_hours, __pyx_n_s_minutes, __pyx_n_s_seconds, __pyx_n_s_milliseconds, __pyx_n_s_microseconds, __pyx_n_s_nanoseconds, __pyx_n_s_arr, __pyx_n_s_my_unit, __pyx_n_s_my_unit_ch, __pyx_n_s_delta, __pyx_n_s_datesM, __pyx_n_s_datesD, __pyx_n_s_times, __pyx_n_s_dtype, __pyx_n_s_dates); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(0, 3861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__229);
  __Pyx_GIVEREF(__pyx_tuple__229);
  __pyx_codeobj__230 = (PyObject*)__Pyx_PyCode_New(12, 0, 0, 21, 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_src_cytimes_pddt_py, __pyx_n_s_add, 3861, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__230)) __PYX_ERR(0, 3861, __pyx_L1_error)

  /* "cytimes/pddt.py":3983
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def sub(             # <<<<<<<<<<<<<<
 *         self,
 *         years: cython.int = 0,
 */
  __pyx_tuple__231 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_years, __pyx_n_s_quarters, __pyx_n_s_months, __pyx_n_s_weeks, __pyx_n_s_days, __pyx_n_s_hours, __pyx_n_s_minutes, __pyx_n_s_seconds, __pyx_n_s_milliseconds, __pyx_n_s_microseconds, __pyx_n_s_nanoseconds); if (unlikely(!__pyx_tuple__231)) __PYX_ERR(0, 3983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__231);
  __Pyx_GIVEREF(__pyx_tuple__231);
  __pyx_codeobj__232 = (PyObject*)__Pyx_PyCode_New(12, 0, 0, 12, 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_src_cytimes_pddt_py, __pyx_n_s_sub, 3983, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__232)) __PYX_ERR(0, 3983, __pyx_L1_error)

  /* "cytimes/pddt.py":4019
 *         # fmt: on
 * 
 *     def diff(             # <<<<<<<<<<<<<<
 *         self,
 *         data: object,
 */
  __pyx_tuple__233 = PyTuple_Pack(20, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_unit, __pyx_n_s_absolute, __pyx_n_s_inclusive, __pyx_n_s_my_arr, __pyx_n_s_my_unit, __pyx_n_s_my_tz, __pyx_n_s_arr_size, __pyx_n_s_pt, __pyx_n_s_pt_arr, __pyx_n_s_pt_unit, __pyx_n_s_pt_tz, __pyx_n_s_my_unit_int, __pyx_n_s_pt_unit_int, __pyx_n_s_incl_off, __pyx_n_s_arr, __pyx_n_s_i, __pyx_n_s_arr_ptr, __pyx_n_s_val); if (unlikely(!__pyx_tuple__233)) __PYX_ERR(0, 4019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__233);
  __Pyx_GIVEREF(__pyx_tuple__233);
  __pyx_codeobj__234 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 20, 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_src_cytimes_pddt_py, __pyx_n_s_diff, 4019, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__234)) __PYX_ERR(0, 4019, __pyx_L1_error)

  /* "cytimes/pddt.py":4127
 * 
 *     # Comparison ---------------------------------------------------------------------------
 *     def is_past(self) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the datetimes are in the past `<'Index[bool]'>`."""
 *         # Access datetime array & info
 */
  __pyx_tuple__235 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_arr, __pyx_n_s_my_tz, __pyx_n_s_my_unit, __pyx_n_s_my_unit_ch, __pyx_n_s_dt, __pyx_n_s_dt_val); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(0, 4127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__235);
  __Pyx_GIVEREF(__pyx_tuple__235);
  __pyx_codeobj__236 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 7, 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_src_cytimes_pddt_py, __pyx_n_s_is_past, 4127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__236)) __PYX_ERR(0, 4127, __pyx_L1_error)

  /* "cytimes/pddt.py":4149
 *         return Index(arr, name="is_past")
 * 
 *     def is_future(self) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the datetimes are in the future `<'Index[bool]'>`."""
 *         # Access datetime array & info
 */
  __pyx_codeobj__237 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 7, 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_src_cytimes_pddt_py, __pyx_n_s_is_future, 4149, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__237)) __PYX_ERR(0, 4149, __pyx_L1_error)

  /* "cytimes/pddt.py":4171
 *         return Index(arr, name="is_future")
 * 
 *     def closest(self, data: object) -> Self:             # <<<<<<<<<<<<<<
 *         """Find the closest datetime to each of the instance values `<'Pddt'>`.
 * 
 */
  __pyx_tuple__238 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_my_arr, __pyx_n_s_my_unit, __pyx_n_s_my_tz, __pyx_n_s_arr_size, __pyx_n_s_pt, __pyx_n_s_pt_arr, __pyx_n_s_pt_unit, __pyx_n_s_pt_tz, __pyx_n_s_my_unit_int, __pyx_n_s_pt_unit_int, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__238)) __PYX_ERR(0, 4171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__238);
  __Pyx_GIVEREF(__pyx_tuple__238);
  __pyx_codeobj__239 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__238, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_closest, 4171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__239)) __PYX_ERR(0, 4171, __pyx_L1_error)

  /* "cytimes/pddt.py":4227
 *         return pddt_new_simple(arr, pt_tz, None, "closest")
 * 
 *     def farthest(self, dtobjs: object) -> Self:             # <<<<<<<<<<<<<<
 *         """Find the farthest datetime to each of the instance values `<'Pddt'>`.
 * 
 */
  __pyx_tuple__240 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_dtobjs, __pyx_n_s_my_arr, __pyx_n_s_my_unit, __pyx_n_s_my_tz, __pyx_n_s_arr_size, __pyx_n_s_pt, __pyx_n_s_pt_arr, __pyx_n_s_pt_unit, __pyx_n_s_pt_tz, __pyx_n_s_my_unit_int, __pyx_n_s_pt_unit_int, __pyx_n_s_arr); if (unlikely(!__pyx_tuple__240)) __PYX_ERR(0, 4227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__240);
  __Pyx_GIVEREF(__pyx_tuple__240);
  __pyx_codeobj__241 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__240, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cytimes_pddt_py, __pyx_n_s_farthest, 4227, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__241)) __PYX_ERR(0, 4227, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### Code section: init_constants ### */

static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
  __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_get.method_name = &__pyx_n_s_get;
  __pyx_umethod_PyUnicode_Type_lower.type = (PyObject*)&PyUnicode_Type;
  __pyx_umethod_PyUnicode_Type_lower.method_name = &__pyx_n_s_lower;
  if (__Pyx_CreateStringTabAndInitStrings() < 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_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_globals ### */

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  /* AssertionsEnabled.init */
  if (likely(__Pyx_init_assertions_enabled() == 0)); else

if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_module ### */

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 ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_7cytimes_4pddt___pyx_scope_struct__fromisocalendar = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7cytimes_4pddt___pyx_scope_struct__fromisocalendar_spec, NULL); if (unlikely(!__pyx_ptype_7cytimes_4pddt___pyx_scope_struct__fromisocalendar)) __PYX_ERR(0, 1206, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7cytimes_4pddt___pyx_scope_struct__fromisocalendar_spec, __pyx_ptype_7cytimes_4pddt___pyx_scope_struct__fromisocalendar) < 0) __PYX_ERR(0, 1206, __pyx_L1_error)
  #else
  __pyx_ptype_7cytimes_4pddt___pyx_scope_struct__fromisocalendar = &__pyx_type_7cytimes_4pddt___pyx_scope_struct__fromisocalendar;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_7cytimes_4pddt___pyx_scope_struct__fromisocalendar) < 0) __PYX_ERR(0, 1206, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_7cytimes_4pddt___pyx_scope_struct__fromisocalendar->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_7cytimes_4pddt___pyx_scope_struct__fromisocalendar->tp_dictoffset && __pyx_ptype_7cytimes_4pddt___pyx_scope_struct__fromisocalendar->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_7cytimes_4pddt___pyx_scope_struct__fromisocalendar->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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(6, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", 
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyTypeObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(6, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyBoolObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(7, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyComplexObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(8, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_12); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 272, __pyx_L1_error)
  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_12); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 317, __pyx_L1_error)
  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_12); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 321, __pyx_L1_error)
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_12); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 360, __pyx_L1_error)
  __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 865, __pyx_L1_error)
  __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 867, __pyx_L1_error)
  __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 869, __pyx_L1_error)
  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 871, __pyx_L1_error)
  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 873, __pyx_L1_error)
  __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 875, __pyx_L1_error)
  __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 877, __pyx_L1_error)
  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 879, __pyx_L1_error)
  __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 881, __pyx_L1_error)
  __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 883, __pyx_L1_error)
  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_12(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_12); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 947, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("datetime"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_8datetime_date = __Pyx_ImportType_3_0_12(__pyx_t_1, "datetime", "date", sizeof(PyDateTime_Date), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyDateTime_Date),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_8datetime_date) __PYX_ERR(3, 70, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_time = __Pyx_ImportType_3_0_12(__pyx_t_1, "datetime", "time", sizeof(PyDateTime_Time), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyDateTime_Time),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_8datetime_time) __PYX_ERR(3, 83, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_datetime = __Pyx_ImportType_3_0_12(__pyx_t_1, "datetime", "datetime", sizeof(PyDateTime_DateTime), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyDateTime_DateTime),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_8datetime_datetime) __PYX_ERR(3, 109, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_timedelta = __Pyx_ImportType_3_0_12(__pyx_t_1, "datetime", "timedelta", sizeof(PyDateTime_Delta), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyDateTime_Delta),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_8datetime_timedelta) __PYX_ERR(3, 147, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_tzinfo = __Pyx_ImportType_3_0_12(__pyx_t_1, "datetime", "tzinfo", sizeof(PyDateTime_TZInfo), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyDateTime_TZInfo),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_8datetime_tzinfo) __PYX_ERR(3, 160, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("cytimes.parser"); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cytimes_6parser_Configs = __Pyx_ImportType_3_0_12(__pyx_t_1, "cytimes.parser", "Configs", sizeof(struct __pyx_obj_7cytimes_6parser_Configs), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_7cytimes_6parser_Configs),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cytimes_6parser_Configs) __PYX_ERR(9, 21, __pyx_L1_error)
  __pyx_vtabptr_7cytimes_6parser_Configs = (struct __pyx_vtabstruct_7cytimes_6parser_Configs*)__Pyx_GetVtable(__pyx_ptype_7cytimes_6parser_Configs); if (unlikely(!__pyx_vtabptr_7cytimes_6parser_Configs)) __PYX_ERR(9, 21, __pyx_L1_error)
  __pyx_ptype_7cytimes_6parser_Result = __Pyx_ImportType_3_0_12(__pyx_t_1, "cytimes.parser", "Result", sizeof(struct __pyx_obj_7cytimes_6parser_Result), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_7cytimes_6parser_Result),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cytimes_6parser_Result) __PYX_ERR(9, 47, __pyx_L1_error)
  __pyx_vtabptr_7cytimes_6parser_Result = (struct __pyx_vtabstruct_7cytimes_6parser_Result*)__Pyx_GetVtable(__pyx_ptype_7cytimes_6parser_Result); if (unlikely(!__pyx_vtabptr_7cytimes_6parser_Result)) __PYX_ERR(9, 47, __pyx_L1_error)
  __pyx_ptype_7cytimes_6parser_Parser = __Pyx_ImportType_3_0_12(__pyx_t_1, "cytimes.parser", "Parser", sizeof(struct __pyx_obj_7cytimes_6parser_Parser), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_7cytimes_6parser_Parser),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cytimes_6parser_Parser) __PYX_ERR(9, 79, __pyx_L1_error)
  __pyx_vtabptr_7cytimes_6parser_Parser = (struct __pyx_vtabstruct_7cytimes_6parser_Parser*)__Pyx_GetVtable(__pyx_ptype_7cytimes_6parser_Parser); if (unlikely(!__pyx_vtabptr_7cytimes_6parser_Parser)) __PYX_ERR(9, 79, __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
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __pyx_t_1 = PyImport_ImportModule("cytimes.parser"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "CONFIG_PERTAIN", (void **)&__pyx_vp_7cytimes_6parser_CONFIG_PERTAIN, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "CONFIG_JUMP", (void **)&__pyx_vp_7cytimes_6parser_CONFIG_JUMP, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "CONFIG_UTC", (void **)&__pyx_vp_7cytimes_6parser_CONFIG_UTC, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "CONFIG_TZ", (void **)&__pyx_vp_7cytimes_6parser_CONFIG_TZ, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "CONFIG_MONTH", (void **)&__pyx_vp_7cytimes_6parser_CONFIG_MONTH, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "CONFIG_WEEKDAY", (void **)&__pyx_vp_7cytimes_6parser_CONFIG_WEEKDAY, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "CONFIG_HMS_FLAG", (void **)&__pyx_vp_7cytimes_6parser_CONFIG_HMS_FLAG, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "CONFIG_AMPM_FLAG", (void **)&__pyx_vp_7cytimes_6parser_CONFIG_AMPM_FLAG, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "_default_parser", (void **)&__pyx_vp_7cytimes_6parser__default_parser, "struct __pyx_obj_7cytimes_6parser_Parser *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("cytimes.utils"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DAYS_BR_MONTH", (void **)&__pyx_vp_7cytimes_5utils_DAYS_BR_MONTH, "int [13]") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DAYS_IN_MONTH", (void **)&__pyx_vp_7cytimes_5utils_DAYS_IN_MONTH, "int [13]") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DAYS_BR_QUARTER", (void **)&__pyx_vp_7cytimes_5utils_DAYS_BR_QUARTER, "int [5]") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DAYS_IN_QUARTER", (void **)&__pyx_vp_7cytimes_5utils_DAYS_IN_QUARTER, "int [5]") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "ORDINAL_MAX", (void **)&__pyx_vp_7cytimes_5utils_ORDINAL_MAX, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "EPOCH_DT", (void **)&__pyx_vp_7cytimes_5utils_EPOCH_DT, "PyDateTime_DateTime *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "EPOCH_YEAR", (void **)&__pyx_vp_7cytimes_5utils_EPOCH_YEAR, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "EPOCH_MONTH", (void **)&__pyx_vp_7cytimes_5utils_EPOCH_MONTH, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "EPOCH_DAY", (void **)&__pyx_vp_7cytimes_5utils_EPOCH_DAY, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "EPOCH_HOUR", (void **)&__pyx_vp_7cytimes_5utils_EPOCH_HOUR, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "EPOCH_MINUTE", (void **)&__pyx_vp_7cytimes_5utils_EPOCH_MINUTE, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "EPOCH_SECOND", (void **)&__pyx_vp_7cytimes_5utils_EPOCH_SECOND, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "EPOCH_MILLISECOND", (void **)&__pyx_vp_7cytimes_5utils_EPOCH_MILLISECOND, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "EPOCH_MICROSECOND", (void **)&__pyx_vp_7cytimes_5utils_EPOCH_MICROSECOND, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "UTC", (void **)&__pyx_vp_7cytimes_5utils_UTC, "PyDateTime_TZInfo *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "_LOCAL_TZ", (void **)&__pyx_vp_7cytimes_5utils__LOCAL_TZ, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "_TIMEZONE_MAP", (void **)&__pyx_vp_7cytimes_5utils__TIMEZONE_MAP, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "SS_MINUTE", (void **)&__pyx_vp_7cytimes_5utils_SS_MINUTE, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "SS_HOUR", (void **)&__pyx_vp_7cytimes_5utils_SS_HOUR, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "SS_DAY", (void **)&__pyx_vp_7cytimes_5utils_SS_DAY, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "MS_SECOND", (void **)&__pyx_vp_7cytimes_5utils_MS_SECOND, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "MS_MINUTE", (void **)&__pyx_vp_7cytimes_5utils_MS_MINUTE, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "MS_HOUR", (void **)&__pyx_vp_7cytimes_5utils_MS_HOUR, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "MS_DAY", (void **)&__pyx_vp_7cytimes_5utils_MS_DAY, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "US_MILLISECOND", (void **)&__pyx_vp_7cytimes_5utils_US_MILLISECOND, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "US_SECOND", (void **)&__pyx_vp_7cytimes_5utils_US_SECOND, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "US_MINUTE", (void **)&__pyx_vp_7cytimes_5utils_US_MINUTE, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "US_HOUR", (void **)&__pyx_vp_7cytimes_5utils_US_HOUR, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "US_DAY", (void **)&__pyx_vp_7cytimes_5utils_US_DAY, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "NS_MICROSECOND", (void **)&__pyx_vp_7cytimes_5utils_NS_MICROSECOND, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "NS_MILLISECOND", (void **)&__pyx_vp_7cytimes_5utils_NS_MILLISECOND, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "NS_SECOND", (void **)&__pyx_vp_7cytimes_5utils_NS_SECOND, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "NS_MINUTE", (void **)&__pyx_vp_7cytimes_5utils_NS_MINUTE, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "NS_HOUR", (void **)&__pyx_vp_7cytimes_5utils_NS_HOUR, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "NS_DAY", (void **)&__pyx_vp_7cytimes_5utils_NS_DAY, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "TD64_YY_DAY", (void **)&__pyx_vp_7cytimes_5utils_TD64_YY_DAY, "double") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "TD64_YY_SECOND", (void **)&__pyx_vp_7cytimes_5utils_TD64_YY_SECOND, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "TD64_YY_MILLISECOND", (void **)&__pyx_vp_7cytimes_5utils_TD64_YY_MILLISECOND, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "TD64_YY_MICROSECOND", (void **)&__pyx_vp_7cytimes_5utils_TD64_YY_MICROSECOND, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "TD64_YY_NANOSECOND", (void **)&__pyx_vp_7cytimes_5utils_TD64_YY_NANOSECOND, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "TD64_MM_DAY", (void **)&__pyx_vp_7cytimes_5utils_TD64_MM_DAY, "double") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "TD64_MM_SECOND", (void **)&__pyx_vp_7cytimes_5utils_TD64_MM_SECOND, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "TD64_MM_MILLISECOND", (void **)&__pyx_vp_7cytimes_5utils_TD64_MM_MILLISECOND, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "TD64_MM_MICROSECOND", (void **)&__pyx_vp_7cytimes_5utils_TD64_MM_MICROSECOND, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "TD64_MM_NANOSECOND", (void **)&__pyx_vp_7cytimes_5utils_TD64_MM_NANOSECOND, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DT64_NS_YY_MIN", (void **)&__pyx_vp_7cytimes_5utils_DT64_NS_YY_MIN, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DT64_NS_MM_MIN", (void **)&__pyx_vp_7cytimes_5utils_DT64_NS_MM_MIN, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DT64_NS_WW_MIN", (void **)&__pyx_vp_7cytimes_5utils_DT64_NS_WW_MIN, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DT64_NS_DD_MIN", (void **)&__pyx_vp_7cytimes_5utils_DT64_NS_DD_MIN, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DT64_NS_HH_MIN", (void **)&__pyx_vp_7cytimes_5utils_DT64_NS_HH_MIN, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DT64_NS_MI_MIN", (void **)&__pyx_vp_7cytimes_5utils_DT64_NS_MI_MIN, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DT64_NS_SS_MIN", (void **)&__pyx_vp_7cytimes_5utils_DT64_NS_SS_MIN, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DT64_NS_MS_MIN", (void **)&__pyx_vp_7cytimes_5utils_DT64_NS_MS_MIN, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DT64_NS_US_MIN", (void **)&__pyx_vp_7cytimes_5utils_DT64_NS_US_MIN, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DT64_NS_NS_MIN", (void **)&__pyx_vp_7cytimes_5utils_DT64_NS_NS_MIN, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DT64_NS_YY_MAX", (void **)&__pyx_vp_7cytimes_5utils_DT64_NS_YY_MAX, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DT64_NS_MM_MAX", (void **)&__pyx_vp_7cytimes_5utils_DT64_NS_MM_MAX, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DT64_NS_WW_MAX", (void **)&__pyx_vp_7cytimes_5utils_DT64_NS_WW_MAX, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DT64_NS_DD_MAX", (void **)&__pyx_vp_7cytimes_5utils_DT64_NS_DD_MAX, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DT64_NS_HH_MAX", (void **)&__pyx_vp_7cytimes_5utils_DT64_NS_HH_MAX, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DT64_NS_MI_MAX", (void **)&__pyx_vp_7cytimes_5utils_DT64_NS_MI_MAX, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DT64_NS_SS_MAX", (void **)&__pyx_vp_7cytimes_5utils_DT64_NS_SS_MAX, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DT64_NS_MS_MAX", (void **)&__pyx_vp_7cytimes_5utils_DT64_NS_MS_MAX, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DT64_NS_US_MAX", (void **)&__pyx_vp_7cytimes_5utils_DT64_NS_US_MAX, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_12(__pyx_t_1, "DT64_NS_NS_MAX", (void **)&__pyx_vp_7cytimes_5utils_DT64_NS_NS_MAX, "PY_LONG_LONG") < 0) __PYX_ERR(0, 1, __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_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __pyx_t_1 = PyImport_ImportModule("cytimes.parser"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "parse_dtobj", (void (**)(void))&__pyx_f_7cytimes_6parser_parse_dtobj, "PyDateTime_DateTime *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytimes_6parser_parse_dtobj *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("cytimes.utils"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "tz_parse", (void (**)(void))&__pyx_f_7cytimes_5utils_tz_parse, "PyObject *(PyObject *)") < 0) __PYX_ERR(0, 1, __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;
}


#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_pddt(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_pddt},
  {0, NULL}
};
#endif

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "pddt",
      0, /* m_doc */
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      0, /* m_size */
    #elif CYTHON_USE_MODULE_STATE
      sizeof(__pyx_mstate), /* 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
    #if CYTHON_USE_MODULE_STATE
      __pyx_m_traverse, /* m_traverse */
      __pyx_m_clear, /* m_clear */
      NULL /* m_free */
    #else
      NULL, /* m_traverse */
      NULL, /* m_clear */
      NULL /* m_free */
    #endif
  };
  #ifdef __cplusplus
} /* anonymous namespace */
#endif
#endif

#ifndef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#elif PY_MAJOR_VERSION < 3
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" void
#else
#define __Pyx_PyMODINIT_FUNC void
#endif
#else
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyObject *
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC initpddt(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initpddt(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_pddt(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_pddt(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;
}
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
#else
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)
#endif
{
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
#if CYTHON_COMPILING_IN_LIMITED_API
            result = PyModule_AddObject(module, to_name, value);
#else
            result = PyDict_SetItemString(moddict, to_name, value);
#endif
        }
        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, PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    CYTHON_UNUSED_VAR(def);
    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;
#if CYTHON_COMPILING_IN_LIMITED_API
    moddict = module;
#else
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
#endif
    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_pddt(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  int stringtab_initialized = 0;
  #if CYTHON_USE_MODULE_STATE
  int pystate_addmodule_run = 0;
  #endif
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'pddt' 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
  /*--- 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("pddt", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #elif CYTHON_USE_MODULE_STATE
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  {
    int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
    __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "pddt" pseudovariable */
    if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    pystate_addmodule_run = 1;
  }
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #endif
  CYTHON_UNUSED_VAR(__pyx_t_1);
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #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_pddt(void)", 0);
  if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 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(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  PyEval_InitThreads();
  #endif
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  stringtab_initialized = 1;
  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_cytimes__pddt) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __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, "cytimes.pddt")) {
      if (unlikely((PyDict_SetItemString(modules, "cytimes.pddt", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  (void)__Pyx_modinit_function_export_code();
  if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_variable_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "cytimes/pddt.py":16
 * from cython.cimports.cytimes import utils  # type: ignore
 * 
 * np.import_array()             # <<<<<<<<<<<<<<
 * np.import_umath()
 * datetime.import_datetime()
 */
  __pyx_t_2 = __pyx_f_5numpy_import_array(); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 16, __pyx_L1_error)

  /* "cytimes/pddt.py":17
 * 
 * np.import_array()
 * np.import_umath()             # <<<<<<<<<<<<<<
 * datetime.import_datetime()
 * 
 */
  __pyx_t_2 = __pyx_f_5numpy_import_umath(); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 17, __pyx_L1_error)

  /* "cytimes/pddt.py":18
 * np.import_array()
 * np.import_umath()
 * datetime.import_datetime()             # <<<<<<<<<<<<<<
 * 
 * # Python imports
 */
  __pyx_f_7cpython_8datetime_import_datetime();

  /* "cytimes/pddt.py":21
 * 
 * # Python imports
 * import datetime, numpy as np             # <<<<<<<<<<<<<<
 * from typing_extensions import Self
 * from typing import Literal, Hashable
 */
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_3) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_3) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":22
 * # Python imports
 * import datetime, numpy as np
 * from typing_extensions import Self             # <<<<<<<<<<<<<<
 * from typing import Literal, Hashable
 * from pandas._libs import lib
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_Self);
  __Pyx_GIVEREF(__pyx_n_s_Self);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Self)) __PYX_ERR(0, 22, __pyx_L1_error);
  __pyx_t_4 = __Pyx_Import(__pyx_n_s_typing_extensions, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Self, __pyx_t_3) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/pddt.py":23
 * import datetime, numpy as np
 * from typing_extensions import Self
 * from typing import Literal, Hashable             # <<<<<<<<<<<<<<
 * from pandas._libs import lib
 * from pandas.core.arrays.datetimes import DatetimeArray
 */
  __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_n_s_Literal);
  __Pyx_GIVEREF(__pyx_n_s_Literal);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_Literal)) __PYX_ERR(0, 23, __pyx_L1_error);
  __Pyx_INCREF(__pyx_n_s_Hashable);
  __Pyx_GIVEREF(__pyx_n_s_Hashable);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_Hashable)) __PYX_ERR(0, 23, __pyx_L1_error);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Literal); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Literal, __pyx_t_4) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Hashable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Hashable, __pyx_t_4) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":24
 * from typing_extensions import Self
 * from typing import Literal, Hashable
 * from pandas._libs import lib             # <<<<<<<<<<<<<<
 * from pandas.core.arrays.datetimes import DatetimeArray
 * from pandas import Index, DatetimeIndex, Series, DataFrame, Timestamp
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_lib);
  __Pyx_GIVEREF(__pyx_n_s_lib);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_lib)) __PYX_ERR(0, 24, __pyx_L1_error);
  __pyx_t_4 = __Pyx_Import(__pyx_n_s_pandas__libs, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib, __pyx_t_3) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/pddt.py":25
 * from typing import Literal, Hashable
 * from pandas._libs import lib
 * from pandas.core.arrays.datetimes import DatetimeArray             # <<<<<<<<<<<<<<
 * from pandas import Index, DatetimeIndex, Series, DataFrame, Timestamp
 * from pandas import errors as pd_err
 */
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_n_s_DatetimeArray);
  __Pyx_GIVEREF(__pyx_n_s_DatetimeArray);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_DatetimeArray)) __PYX_ERR(0, 25, __pyx_L1_error);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pandas_core_arrays_datetimes, __pyx_t_4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_DatetimeArray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DatetimeArray, __pyx_t_4) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":26
 * from pandas._libs import lib
 * from pandas.core.arrays.datetimes import DatetimeArray
 * from pandas import Index, DatetimeIndex, Series, DataFrame, Timestamp             # <<<<<<<<<<<<<<
 * from pandas import errors as pd_err
 * from pandas._libs.tslibs.parsing import DateParseError
 */
  __pyx_t_3 = PyList_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_Index);
  __Pyx_GIVEREF(__pyx_n_s_Index);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Index)) __PYX_ERR(0, 26, __pyx_L1_error);
  __Pyx_INCREF(__pyx_n_s_DatetimeIndex);
  __Pyx_GIVEREF(__pyx_n_s_DatetimeIndex);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_DatetimeIndex)) __PYX_ERR(0, 26, __pyx_L1_error);
  __Pyx_INCREF(__pyx_n_s_Series);
  __Pyx_GIVEREF(__pyx_n_s_Series);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_Series)) __PYX_ERR(0, 26, __pyx_L1_error);
  __Pyx_INCREF(__pyx_n_s_DataFrame);
  __Pyx_GIVEREF(__pyx_n_s_DataFrame);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_DataFrame)) __PYX_ERR(0, 26, __pyx_L1_error);
  __Pyx_INCREF(__pyx_n_s_Timestamp);
  __Pyx_GIVEREF(__pyx_n_s_Timestamp);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 4, __pyx_n_s_Timestamp)) __PYX_ERR(0, 26, __pyx_L1_error);
  __pyx_t_4 = __Pyx_Import(__pyx_n_s_pandas, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Index, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_DatetimeIndex); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DatetimeIndex, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Series); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Series, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DataFrame, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Timestamp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Timestamp, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/pddt.py":27
 * from pandas.core.arrays.datetimes import DatetimeArray
 * from pandas import Index, DatetimeIndex, Series, DataFrame, Timestamp
 * from pandas import errors as pd_err             # <<<<<<<<<<<<<<
 * from pandas._libs.tslibs.parsing import DateParseError
 * from pytz import exceptions as pytz_err
 */
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_n_s_errors);
  __Pyx_GIVEREF(__pyx_n_s_errors);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_errors)) __PYX_ERR(0, 27, __pyx_L1_error);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pandas, __pyx_t_4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pd_err, __pyx_t_4) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":28
 * from pandas import Index, DatetimeIndex, Series, DataFrame, Timestamp
 * from pandas import errors as pd_err
 * from pandas._libs.tslibs.parsing import DateParseError             # <<<<<<<<<<<<<<
 * from pytz import exceptions as pytz_err
 * from zoneinfo import available_timezones as _available_timezones
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_DateParseError);
  __Pyx_GIVEREF(__pyx_n_s_DateParseError);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_DateParseError)) __PYX_ERR(0, 28, __pyx_L1_error);
  __pyx_t_4 = __Pyx_Import(__pyx_n_s_pandas__libs_tslibs_parsing, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_DateParseError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DateParseError, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/pddt.py":29
 * from pandas import errors as pd_err
 * from pandas._libs.tslibs.parsing import DateParseError
 * from pytz import exceptions as pytz_err             # <<<<<<<<<<<<<<
 * from zoneinfo import available_timezones as _available_timezones
 * from cytimes.parser import Configs, parse_dtobj as _parse
 */
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_n_s_exceptions);
  __Pyx_GIVEREF(__pyx_n_s_exceptions);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_exceptions)) __PYX_ERR(0, 29, __pyx_L1_error);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pytz, __pyx_t_4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pytz_err, __pyx_t_4) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":30
 * from pandas._libs.tslibs.parsing import DateParseError
 * from pytz import exceptions as pytz_err
 * from zoneinfo import available_timezones as _available_timezones             # <<<<<<<<<<<<<<
 * from cytimes.parser import Configs, parse_dtobj as _parse
 * from cytimes import utils, errors
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_available_timezones_2);
  __Pyx_GIVEREF(__pyx_n_s_available_timezones_2);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_available_timezones_2)) __PYX_ERR(0, 30, __pyx_L1_error);
  __pyx_t_4 = __Pyx_Import(__pyx_n_s_zoneinfo, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_available_timezones_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_available_timezones, __pyx_t_3) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/pddt.py":31
 * from pytz import exceptions as pytz_err
 * from zoneinfo import available_timezones as _available_timezones
 * from cytimes.parser import Configs, parse_dtobj as _parse             # <<<<<<<<<<<<<<
 * from cytimes import utils, errors
 * 
 */
  __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_n_s_Configs);
  __Pyx_GIVEREF(__pyx_n_s_Configs);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_Configs)) __PYX_ERR(0, 31, __pyx_L1_error);
  __Pyx_INCREF(__pyx_n_s_parse_dtobj);
  __Pyx_GIVEREF(__pyx_n_s_parse_dtobj);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_parse_dtobj)) __PYX_ERR(0, 31, __pyx_L1_error);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_cytimes_parser, __pyx_t_4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_parse_dtobj); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_dtobj, __pyx_t_4) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":32
 * from zoneinfo import available_timezones as _available_timezones
 * from cytimes.parser import Configs, parse_dtobj as _parse
 * from cytimes import utils, errors             # <<<<<<<<<<<<<<
 * 
 * __all__ = ["Pddt"]
 */
  __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_utils);
  __Pyx_GIVEREF(__pyx_n_s_utils);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_utils)) __PYX_ERR(0, 32, __pyx_L1_error);
  __Pyx_INCREF(__pyx_n_s_errors);
  __Pyx_GIVEREF(__pyx_n_s_errors);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_errors)) __PYX_ERR(0, 32, __pyx_L1_error);
  __pyx_t_4 = __Pyx_Import(__pyx_n_s_cytimes, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_utils); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_utils, __pyx_t_3) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_errors, __pyx_t_3) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/pddt.py":34
 * from cytimes import utils, errors
 * 
 * __all__ = ["Pddt"]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_n_u_Pddt);
  __Pyx_GIVEREF(__pyx_n_u_Pddt);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_Pddt)) __PYX_ERR(0, 34, __pyx_L1_error);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_4) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/pddt.py":478
 * 
 * # Pddt (Pandas Datetime) ----------------------------------------------------------------------
 * class Pddt(DatetimeIndex):             # <<<<<<<<<<<<<<
 *     """A drop-in replacement for Pandas `<'DatetimeIndex'>`
 *     class, providing additional functionalities for more
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DatetimeIndex); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 478, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_n_s_Pddt, __pyx_n_s_Pddt, (PyObject *) NULL, __pyx_n_s_cytimes_pddt, __pyx_kp_s_A_drop_in_replacement_for_Pandas); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_4 != __pyx_t_3) {
    if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 478, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":484
 *     """
 * 
 *     def __new__(             # <<<<<<<<<<<<<<
 *         cls,
 *         data: object,
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_data, __pyx_n_s_object) < 0) __PYX_ERR(0, 484, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_freq, __pyx_kp_s_object_None) < 0) __PYX_ERR(0, 484, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tz, __pyx_kp_s_datetime_tzinfo_str_None) < 0) __PYX_ERR(0, 484, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ambiguous, __pyx_n_s_object) < 0) __PYX_ERR(0, 484, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_year1st, __pyx_kp_s_bool_None) < 0) __PYX_ERR(0, 484, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_day1st, __pyx_kp_s_bool_None) < 0) __PYX_ERR(0, 484, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_cfg, __pyx_n_s_Configs) < 0) __PYX_ERR(0, 484, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 484, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_kp_s_Hashable_None) < 0) __PYX_ERR(0, 484, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, __pyx_n_s_bool) < 0) __PYX_ERR(0, 484, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 484, __pyx_L1_error)
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Pddt___new, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__47);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNewInClass(__pyx_t_6, __pyx_n_s_new, __pyx_t_7) < 0) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":541
 * 
 *     # Constructor --------------------------------------------------------------------------
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def date_range(
 *         cls,
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_start, __pyx_kp_s_object_None) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_end, __pyx_kp_s_object_None) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_periods, __pyx_kp_s_int_None) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_freq, __pyx_kp_s_object_None) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_tz, __pyx_kp_s_datetime_tzinfo_str_None) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_normalize, __pyx_n_s_bool) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_inclusive, __pyx_n_s_str) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_name, __pyx_kp_s_Hashable_None) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_3date_range, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Pddt_date_range, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__50);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_date_range, __pyx_t_7) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":609
 *         return pddt_new_simple(arr, None, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def parse(
 *         cls,
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_data, __pyx_n_s_object) < 0) __PYX_ERR(0, 609, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_freq, __pyx_kp_s_object_None) < 0) __PYX_ERR(0, 609, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_tz, __pyx_kp_s_datetime_tzinfo_str_None) < 0) __PYX_ERR(0, 609, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ambiguous, __pyx_n_s_object) < 0) __PYX_ERR(0, 609, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_year1st, __pyx_kp_s_bool_None) < 0) __PYX_ERR(0, 609, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_day1st, __pyx_kp_s_bool_None) < 0) __PYX_ERR(0, 609, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_cfg, __pyx_n_s_Configs) < 0) __PYX_ERR(0, 609, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 609, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_name, __pyx_kp_s_Hashable_None) < 0) __PYX_ERR(0, 609, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_copy, __pyx_n_s_bool) < 0) __PYX_ERR(0, 609, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 609, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_5parse, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Pddt_parse, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__47);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_parse, __pyx_t_7) < 0) __PYX_ERR(0, 609, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":664
 *         # fmt: on
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def now(
 *         cls,
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_tz, __pyx_kp_s_datetime_tzinfo_str_None) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_size, __pyx_n_s_object) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_name, __pyx_kp_s_Hashable_None) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_7now, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Pddt_now, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__54);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_now, __pyx_t_7) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":691
 *         return _pddt_fr_dt(utils.dt_now(tz), arr_size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def utcnow(
 *         cls,
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_size, __pyx_n_s_object) < 0) __PYX_ERR(0, 691, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 691, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_name, __pyx_kp_s_Hashable_None) < 0) __PYX_ERR(0, 691, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 691, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_9utcnow, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Pddt_utcnow, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__57);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_utcnow, __pyx_t_7) < 0) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":712
 *         return _pddt_fr_dt(utils.dt_now(utils.UTC), arr_size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def today(
 *         cls,
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_size, __pyx_n_s_object) < 0) __PYX_ERR(0, 712, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 712, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_name, __pyx_kp_s_Hashable_None) < 0) __PYX_ERR(0, 712, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 712, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_11today, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Pddt_today, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__57);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_today, __pyx_t_7) < 0) __PYX_ERR(0, 712, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":733
 *         return _pddt_fr_dt(utils.dt_now(None), arr_size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def combine(
 *         cls,
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_date, __pyx_kp_s_datetime_date_str_None) < 0) __PYX_ERR(0, 733, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_time, __pyx_kp_s_datetime_time_str_None) < 0) __PYX_ERR(0, 733, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_tz, __pyx_kp_s_datetime_tzinfo_str_None) < 0) __PYX_ERR(0, 733, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_size, __pyx_n_s_object) < 0) __PYX_ERR(0, 733, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 733, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_name, __pyx_kp_s_Hashable_None) < 0) __PYX_ERR(0, 733, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 733, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_13combine, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Pddt_combine, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__61);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_combine, __pyx_t_7) < 0) __PYX_ERR(0, 733, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":776
 *         return _pddt_fr_dt(utils.dt_combine(date, time, tz), arr_size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromordinal(
 *         cls,
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ordinal, __pyx_kp_s_int_object) < 0) __PYX_ERR(0, 776, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_tz, __pyx_kp_s_datetime_tzinfo_str_None) < 0) __PYX_ERR(0, 776, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_size, __pyx_n_s_object) < 0) __PYX_ERR(0, 776, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 776, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_name, __pyx_kp_s_Hashable_None) < 0) __PYX_ERR(0, 776, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 776, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_15fromordinal, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Pddt_fromordinal, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__54);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_fromordinal, __pyx_t_7) < 0) __PYX_ERR(0, 776, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":875
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromseconds(
 *         cls,
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_seconds, __pyx_kp_s_int_float_object) < 0) __PYX_ERR(0, 875, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_tz, __pyx_kp_s_datetime_tzinfo_str_None) < 0) __PYX_ERR(0, 875, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_size, __pyx_n_s_object) < 0) __PYX_ERR(0, 875, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 875, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_name, __pyx_kp_s_Hashable_None) < 0) __PYX_ERR(0, 875, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 875, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_17fromseconds, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Pddt_fromseconds, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__54);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_fromseconds, __pyx_t_7) < 0) __PYX_ERR(0, 875, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":977
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromicroseconds(
 *         cls,
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_us, __pyx_kp_s_int_object) < 0) __PYX_ERR(0, 977, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_tz, __pyx_kp_s_datetime_tzinfo_str_None) < 0) __PYX_ERR(0, 977, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_size, __pyx_n_s_object) < 0) __PYX_ERR(0, 977, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 977, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_name, __pyx_kp_s_Hashable_None) < 0) __PYX_ERR(0, 977, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 977, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_19fromicroseconds, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Pddt_fromicroseconds, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__54);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_fromicroseconds, __pyx_t_7) < 0) __PYX_ERR(0, 977, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":1070
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromtimestamp(
 *         cls,
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ts, __pyx_kp_s_int_float_object) < 0) __PYX_ERR(0, 1070, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_tz, __pyx_kp_s_datetime_tzinfo_str_None) < 0) __PYX_ERR(0, 1070, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_size, __pyx_n_s_object) < 0) __PYX_ERR(0, 1070, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 1070, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_name, __pyx_kp_s_Hashable_None) < 0) __PYX_ERR(0, 1070, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 1070, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_21fromtimestamp, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Pddt_fromtimestamp, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__54);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_fromtimestamp, __pyx_t_7) < 0) __PYX_ERR(0, 1070, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":1148
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def utcfromtimestamp(
 *         cls,
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ts, __pyx_kp_s_int_float_object) < 0) __PYX_ERR(0, 1148, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_size, __pyx_n_s_object) < 0) __PYX_ERR(0, 1148, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 1148, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_name, __pyx_kp_s_Hashable_None) < 0) __PYX_ERR(0, 1148, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 1148, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_23utcfromtimestamp, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Pddt_utcfromtimestamp, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__57);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_utcfromtimestamp, __pyx_t_7) < 0) __PYX_ERR(0, 1148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":1174
 *         return cls.fromtimestamp(ts, utils.UTC, size, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromisoformat(
 *         cls,
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtstr, __pyx_kp_s_str_object) < 0) __PYX_ERR(0, 1174, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_size, __pyx_n_s_object) < 0) __PYX_ERR(0, 1174, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 1174, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_name, __pyx_kp_s_Hashable_None) < 0) __PYX_ERR(0, 1174, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 1174, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_25fromisoformat, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Pddt_fromisoformat, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__57);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_fromisoformat, __pyx_t_7) < 0) __PYX_ERR(0, 1174, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":1206
 *         return pddt_new_simple(dtstr, None, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromisocalendar(
 *         cls,
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_iso, __pyx_n_s_object) < 0) __PYX_ERR(0, 1206, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_year, __pyx_kp_s_int_None) < 0) __PYX_ERR(0, 1206, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_week, __pyx_kp_s_int_None) < 0) __PYX_ERR(0, 1206, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_weekday, __pyx_kp_s_int_None) < 0) __PYX_ERR(0, 1206, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_tz, __pyx_kp_s_datetime_tzinfo_str_None) < 0) __PYX_ERR(0, 1206, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_size, __pyx_n_s_object) < 0) __PYX_ERR(0, 1206, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 1206, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_name, __pyx_kp_s_Hashable_None) < 0) __PYX_ERR(0, 1206, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 1206, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_27fromisocalendar, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Pddt_fromisocalendar, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__76);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_fromisocalendar, __pyx_t_7) < 0) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":1314
 *             return pddt_new_simple(dts, None, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromdate(
 *         cls,
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_date, __pyx_kp_s_datetime_date_object) < 0) __PYX_ERR(0, 1314, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_tz, __pyx_kp_s_datetime_tzinfo_str_None) < 0) __PYX_ERR(0, 1314, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_size, __pyx_n_s_object) < 0) __PYX_ERR(0, 1314, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 1314, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_name, __pyx_kp_s_Hashable_None) < 0) __PYX_ERR(0, 1314, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 1314, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_29fromdate, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Pddt_fromdate, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__54);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_fromdate, __pyx_t_7) < 0) __PYX_ERR(0, 1314, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":1354
 *         return pddt_new_simple(date, tz, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromdatetime(
 *         cls,
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dt, __pyx_kp_s_datetime_datetime_object) < 0) __PYX_ERR(0, 1354, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_size, __pyx_n_s_object) < 0) __PYX_ERR(0, 1354, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 1354, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_name, __pyx_kp_s_Hashable_None) < 0) __PYX_ERR(0, 1354, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 1354, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_31fromdatetime, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Pddt_fromdatetime, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__57);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_fromdatetime, __pyx_t_7) < 0) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":1392
 *         return pddt_new_simple(dt, None, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def fromdatetime64(
 *         cls,
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dt64, __pyx_kp_s_np_datetime64_object) < 0) __PYX_ERR(0, 1392, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_tz, __pyx_kp_s_datetime_tzinfo_str_None) < 0) __PYX_ERR(0, 1392, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_size, __pyx_n_s_object) < 0) __PYX_ERR(0, 1392, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 1392, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_name, __pyx_kp_s_Hashable_None) < 0) __PYX_ERR(0, 1392, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 1392, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_33fromdatetime64, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Pddt_fromdatetime64, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__54);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_fromdatetime64, __pyx_t_7) < 0) __PYX_ERR(0, 1392, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":1431
 *         return pddt_new_simple(dt64, tz, unit, name)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def strptime(
 *         cls,
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtstr, __pyx_kp_s_str_object) < 0) __PYX_ERR(0, 1431, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_fmt, __pyx_n_s_str) < 0) __PYX_ERR(0, 1431, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_size, __pyx_n_s_object) < 0) __PYX_ERR(0, 1431, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 1431, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_name, __pyx_kp_s_Hashable_None) < 0) __PYX_ERR(0, 1431, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 1431, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_35strptime, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Pddt_strptime, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__57);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_strptime, __pyx_t_7) < 0) __PYX_ERR(0, 1431, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":1483
 * 
 *     # Convertor ----------------------------------------------------------------------------
 *     def ctime(self) -> Index[str]:             # <<<<<<<<<<<<<<
 *         """Convert to index of strings in C time format `<'Index[str]'>`.
 * 
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Index_str) < 0) __PYX_ERR(0, 1483, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_37ctime, 0, __pyx_n_s_Pddt_ctime, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_ctime, __pyx_t_3) < 0) __PYX_ERR(0, 1483, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":1490
 *         return self.strftime("%a %b %d %H:%M:%S %Y")
 * 
 *     def isoformat(self, sep: str = "T") -> Index[str]:             # <<<<<<<<<<<<<<
 *         """Convert to index of strings in ISO format `<'Index[str]'>`.
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_sep, __pyx_n_s_str) < 0) __PYX_ERR(0, 1490, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Index_str) < 0) __PYX_ERR(0, 1490, __pyx_L1_error)
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_39isoformat, 0, __pyx_n_s_Pddt_isoformat, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__90);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_isoformat, __pyx_t_7) < 0) __PYX_ERR(0, 1490, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":1497
 *         return self.strftime(f"%Y-%m-%d{sep}%H:%M:%S.%f%z")
 * 
 *     def timedf(self) -> DataFrame:             # <<<<<<<<<<<<<<
 *         """Convert to DataFrame of time components `<'DataFrame'>`."""
 *         arr: np.ndarray = self.values_naive
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_DataFrame) < 0) __PYX_ERR(0, 1497, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_41timedf, 0, __pyx_n_s_Pddt_timedf, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_timedf, __pyx_t_3) < 0) __PYX_ERR(0, 1497, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":1513
 *         )
 * 
 *     def utctimedf(self) -> DataFrame:             # <<<<<<<<<<<<<<
 *         """Convert to DataFrame of time components representing the UTC time `<'DataFrame'>`."""
 *         my_tz = self.tzinfo
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_DataFrame) < 0) __PYX_ERR(0, 1513, __pyx_L1_error)
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_43utctimedf, 0, __pyx_n_s_Pddt_utctimedf, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__94)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_utctimedf, __pyx_t_7) < 0) __PYX_ERR(0, 1513, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":1520
 *         return self.tz_convert(utils.UTC).timedf()
 * 
 *     def toordinal(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Convert to index of proleptic Gregorian ordinal days `<'Index[int64]'>`.
 * 
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 1520, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_45toordinal, 0, __pyx_n_s_Pddt_toordinal, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_toordinal, __pyx_t_3) < 0) __PYX_ERR(0, 1520, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":1527
 *         return Index(utils.dt64arr_to_ordinal(self.values), name="ordinal")
 * 
 *     def seconds(self, utc: cython.bint = False) -> Index[np.float64]:             # <<<<<<<<<<<<<<
 *         """Convert to index of seconds since Unix Epoch `<'Index[float64]'>`.
 * 
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(((int)0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3)) __PYX_ERR(0, 1527, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_utc, __pyx_kp_s_cython_bint) < 0) __PYX_ERR(0, 1527, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Index_np_float64) < 0) __PYX_ERR(0, 1527, __pyx_L1_error)
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_47seconds, 0, __pyx_n_s_Pddt_seconds, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_t_7);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_seconds, __pyx_t_8) < 0) __PYX_ERR(0, 1527, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cytimes/pddt.py":1545
 *         return Index(utils.dt64arr_to_ts(arr), name="seconds")
 * 
 *     def microseconds(self, utc: cython.bint = False) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Convert to index of microseconds since Unix Epoch `<'Index[int64]'>`.
 * 
 */
  __pyx_t_8 = __Pyx_PyBool_FromLong(((int)0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8)) __PYX_ERR(0, 1545, __pyx_L1_error);
  __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_utc, __pyx_kp_s_cython_bint) < 0) __PYX_ERR(0, 1545, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 1545, __pyx_L1_error)
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_49microseconds, 0, __pyx_n_s_Pddt_microseconds, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_microseconds, __pyx_t_7) < 0) __PYX_ERR(0, 1545, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":1563
 *         return Index(utils.dt64arr_as_int64_us(arr), name="microseconds")
 * 
 *     def timestamp(self) -> Index[np.float64]:             # <<<<<<<<<<<<<<
 *         """Convert to index of POSIX timestamps `<'Index[float64]'>`."""
 *         # fmt: off
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Index_np_float64) < 0) __PYX_ERR(0, 1563, __pyx_L1_error)
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_51timestamp, 0, __pyx_n_s_Pddt_timestamp, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_timestamp, __pyx_t_8) < 0) __PYX_ERR(0, 1563, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cytimes/pddt.py":1573
 *         return Index(utils.dt64arr_to_ts(arr), name="timestamp")
 * 
 *     def datetime(self) -> np.ndarray[datetime.datetime]:             # <<<<<<<<<<<<<<
 *         """Convert to array of datetime.datetime `<'ndarray[datetime]'>`.
 * 
 */
  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_np_ndarray_datetime_datetime) < 0) __PYX_ERR(0, 1573, __pyx_L1_error)
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_53datetime, 0, __pyx_n_s_Pddt_datetime, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_datetime, __pyx_t_7) < 0) __PYX_ERR(0, 1573, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":1580
 *         return DatetimeIndex.to_pydatetime(self)
 * 
 *     def date(self) -> np.ndarray[datetime.date]:             # <<<<<<<<<<<<<<
 *         """Convert to array of datetime.date `<'ndarray[date]'>`."""
 *         return super(Pddt, self).date
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_np_ndarray_datetime_date) < 0) __PYX_ERR(0, 1580, __pyx_L1_error)
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_55date, 0, __pyx_n_s_Pddt_date, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_date, __pyx_t_8) < 0) __PYX_ERR(0, 1580, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cytimes/pddt.py":1584
 *         return super(Pddt, self).date
 * 
 *     def time(self) -> np.ndarray[datetime.time]:             # <<<<<<<<<<<<<<
 *         """Convert to array of datetime.time (`WITHOUT` timezone) `<'ndarray[time]'>`."""
 *         return super(Pddt, self).time
 */
  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_np_ndarray_datetime_time) < 0) __PYX_ERR(0, 1584, __pyx_L1_error)
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_57time, 0, __pyx_n_s_Pddt_time, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_time, __pyx_t_7) < 0) __PYX_ERR(0, 1584, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":1588
 *         return super(Pddt, self).time
 * 
 *     def timetz(self) -> np.ndarray[datetime.time]:             # <<<<<<<<<<<<<<
 *         """Convert to array of datetime.time (`WITH` timezone) `<'ndarray[time]'>`."""
 *         return super(Pddt, self).timetz
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_np_ndarray_datetime_time) < 0) __PYX_ERR(0, 1588, __pyx_L1_error)
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_59timetz, 0, __pyx_n_s_Pddt_timetz, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_timetz, __pyx_t_8) < 0) __PYX_ERR(0, 1588, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cytimes/pddt.py":1595
 *     def replace(
 *         self,
 *         year: cython.int = -1,             # <<<<<<<<<<<<<<
 *         month: cython.int = -1,
 *         day: cython.int = -1,
 */
  __pyx_t_8 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "cytimes/pddt.py":1596
 *         self,
 *         year: cython.int = -1,
 *         month: cython.int = -1,             # <<<<<<<<<<<<<<
 *         day: cython.int = -1,
 *         hour: cython.int = -1,
 */
  __pyx_t_7 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "cytimes/pddt.py":1597
 *         year: cython.int = -1,
 *         month: cython.int = -1,
 *         day: cython.int = -1,             # <<<<<<<<<<<<<<
 *         hour: cython.int = -1,
 *         minute: cython.int = -1,
 */
  __pyx_t_3 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cytimes/pddt.py":1598
 *         month: cython.int = -1,
 *         day: cython.int = -1,
 *         hour: cython.int = -1,             # <<<<<<<<<<<<<<
 *         minute: cython.int = -1,
 *         second: cython.int = -1,
 */
  __pyx_t_9 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "cytimes/pddt.py":1599
 *         day: cython.int = -1,
 *         hour: cython.int = -1,
 *         minute: cython.int = -1,             # <<<<<<<<<<<<<<
 *         second: cython.int = -1,
 *         microsecond: cython.int = -1,
 */
  __pyx_t_10 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "cytimes/pddt.py":1600
 *         hour: cython.int = -1,
 *         minute: cython.int = -1,
 *         second: cython.int = -1,             # <<<<<<<<<<<<<<
 *         microsecond: cython.int = -1,
 *         nanosecond: cython.int = -1,
 */
  __pyx_t_11 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);

  /* "cytimes/pddt.py":1601
 *         minute: cython.int = -1,
 *         second: cython.int = -1,
 *         microsecond: cython.int = -1,             # <<<<<<<<<<<<<<
 *         nanosecond: cython.int = -1,
 *         tzinfo: datetime.tzinfo | str | None = -1,
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);

  /* "cytimes/pddt.py":1602
 *         second: cython.int = -1,
 *         microsecond: cython.int = -1,
 *         nanosecond: cython.int = -1,             # <<<<<<<<<<<<<<
 *         tzinfo: datetime.tzinfo | str | None = -1,
 *     ) -> Self:
 */
  __pyx_t_13 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);

  /* "cytimes/pddt.py":1593
 * 
 *     # Manipulator --------------------------------------------------------------------------
 *     def replace(             # <<<<<<<<<<<<<<
 *         self,
 *         year: cython.int = -1,
 */
  __pyx_t_14 = PyTuple_New(9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_8)) __PYX_ERR(0, 1593, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_7)) __PYX_ERR(0, 1593, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_3)) __PYX_ERR(0, 1593, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_9)) __PYX_ERR(0, 1593, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_t_10)) __PYX_ERR(0, 1593, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_11);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_t_11)) __PYX_ERR(0, 1593, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_12);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 6, __pyx_t_12)) __PYX_ERR(0, 1593, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_13);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 7, __pyx_t_13)) __PYX_ERR(0, 1593, __pyx_L1_error);
  __Pyx_INCREF(((PyObject *)__pyx_int_neg_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_neg_1));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 8, ((PyObject *)__pyx_int_neg_1))) __PYX_ERR(0, 1593, __pyx_L1_error);
  __pyx_t_8 = 0;
  __pyx_t_7 = 0;
  __pyx_t_3 = 0;
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_year, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 1593, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_month, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 1593, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_day, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 1593, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_hour, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 1593, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_minute, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 1593, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_second, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 1593, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_microsecond, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 1593, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_nanosecond, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 1593, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_tzinfo, __pyx_kp_s_datetime_tzinfo_str_None) < 0) __PYX_ERR(0, 1593, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 1593, __pyx_L1_error)
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_61replace, 0, __pyx_n_s_Pddt_replace, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_t_14);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_replace, __pyx_t_12) < 0) __PYX_ERR(0, 1593, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "cytimes/pddt.py":1655
 *         self,
 *         month: int | str | None = None,
 *         day: cython.int = -1,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Adjust the date to the specified month and day in the current year `<'Pddt'>`.
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);

  /* "cytimes/pddt.py":1652
 * 
 *     # . year
 *     def to_curr_year(             # <<<<<<<<<<<<<<
 *         self,
 *         month: int | str | None = None,
 */
  __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, Py_None)) __PYX_ERR(0, 1652, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_12);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_12)) __PYX_ERR(0, 1652, __pyx_L1_error);
  __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_month, __pyx_kp_s_int_str_None) < 0) __PYX_ERR(0, 1652, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_day, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 1652, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 1652, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_63to_curr_year, 0, __pyx_n_s_Pddt_to_curr_year, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_t_13);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_12);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_curr_year, __pyx_t_14) < 0) __PYX_ERR(0, 1652, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cytimes/pddt.py":1728
 *         self,
 *         month: int | str | None = None,
 *         day: cython.int = -1,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Adjust the date to the specified month and day in the previous year `<'Pddt'>`.
 */
  __pyx_t_14 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);

  /* "cytimes/pddt.py":1725
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_prev_year(             # <<<<<<<<<<<<<<
 *         self,
 *         month: int | str | None = None,
 */
  __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, Py_None)) __PYX_ERR(0, 1725, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_14);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_14)) __PYX_ERR(0, 1725, __pyx_L1_error);
  __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_month, __pyx_kp_s_int_str_None) < 0) __PYX_ERR(0, 1725, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_day, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 1725, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 1725, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_65to_prev_year, 0, __pyx_n_s_Pddt_to_prev_year, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_t_12);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_prev_year, __pyx_t_13) < 0) __PYX_ERR(0, 1725, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "cytimes/pddt.py":1751
 *         self,
 *         month: int | str | None = None,
 *         day: cython.int = -1,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Adjust the date to the specified month and day in the next year `<'Pddt'>`.
 */
  __pyx_t_13 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);

  /* "cytimes/pddt.py":1748
 *         return self.to_year(-1, month, day)
 * 
 *     def to_next_year(             # <<<<<<<<<<<<<<
 *         self,
 *         month: int | str | None = None,
 */
  __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, Py_None)) __PYX_ERR(0, 1748, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_13);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_13)) __PYX_ERR(0, 1748, __pyx_L1_error);
  __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_month, __pyx_kp_s_int_str_None) < 0) __PYX_ERR(0, 1748, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_day, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 1748, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 1748, __pyx_L1_error)
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_67to_next_year, 0, __pyx_n_s_Pddt_to_next_year, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_t_14);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_next_year, __pyx_t_12) < 0) __PYX_ERR(0, 1748, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "cytimes/pddt.py":1775
 *         offset: cython.int,
 *         month: int | str | None = None,
 *         day: cython.int = -1,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Adjust the date to the specified month and day in the year (+/-) offset `<'Pddt'>`.
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);

  /* "cytimes/pddt.py":1771
 *         return self.to_year(1, month, day)
 * 
 *     def to_year(             # <<<<<<<<<<<<<<
 *         self,
 *         offset: cython.int,
 */
  __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, Py_None)) __PYX_ERR(0, 1771, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_12);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_12)) __PYX_ERR(0, 1771, __pyx_L1_error);
  __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_offset, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 1771, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_month, __pyx_kp_s_int_str_None) < 0) __PYX_ERR(0, 1771, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_day, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 1771, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 1771, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_69to_year, 0, __pyx_n_s_Pddt_to_year, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_t_13);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_12);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_year, __pyx_t_14) < 0) __PYX_ERR(0, 1771, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cytimes/pddt.py":1853
 * 
 *     # . quarter
 *     def to_curr_quarter(self, month: cython.int = -1, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified month and day in the current quarter. `<'Pddt'>`.
 * 
 */
  __pyx_t_14 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_12 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_14);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14)) __PYX_ERR(0, 1853, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_12);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_12)) __PYX_ERR(0, 1853, __pyx_L1_error);
  __pyx_t_14 = 0;
  __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_month, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 1853, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_day, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 1853, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 1853, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_71to_curr_quarter, 0, __pyx_n_s_Pddt_to_curr_quarter, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_t_13);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_12);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_curr_quarter, __pyx_t_14) < 0) __PYX_ERR(0, 1853, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cytimes/pddt.py":1918
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_prev_quarter(self, month: cython.int = -1, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified month and day in the previous quarter. `<'Pddt'>`.
 * 
 */
  __pyx_t_14 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_12 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_14);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14)) __PYX_ERR(0, 1918, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_12);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_12)) __PYX_ERR(0, 1918, __pyx_L1_error);
  __pyx_t_14 = 0;
  __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_month, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 1918, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_day, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 1918, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 1918, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_73to_prev_quarter, 0, __pyx_n_s_Pddt_to_prev_quarter, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_t_13);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_12);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_prev_quarter, __pyx_t_14) < 0) __PYX_ERR(0, 1918, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cytimes/pddt.py":1935
 *         return self.to_quarter(-1, month, day)
 * 
 *     def to_next_quarter(self, month: cython.int = -1, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified month and day in the next quarter. `<'Pddt'>`.
 * 
 */
  __pyx_t_14 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_12 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_14);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14)) __PYX_ERR(0, 1935, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_12);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_12)) __PYX_ERR(0, 1935, __pyx_L1_error);
  __pyx_t_14 = 0;
  __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_month, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 1935, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_day, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 1935, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 1935, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_75to_next_quarter, 0, __pyx_n_s_Pddt_to_next_quarter, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_t_13);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_12);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_next_quarter, __pyx_t_14) < 0) __PYX_ERR(0, 1935, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cytimes/pddt.py":1955
 *         self,
 *         offset: cython.int,
 *         month: cython.int = -1,             # <<<<<<<<<<<<<<
 *         day: cython.int = -1,
 *     ) -> Self:
 */
  __pyx_t_14 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);

  /* "cytimes/pddt.py":1956
 *         offset: cython.int,
 *         month: cython.int = -1,
 *         day: cython.int = -1,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Adjust the date to the specified month and day in the quarter (+/-) 'offset'. `<'Pddt'>`.
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);

  /* "cytimes/pddt.py":1952
 *         return self.to_quarter(1, month, day)
 * 
 *     def to_quarter(             # <<<<<<<<<<<<<<
 *         self,
 *         offset: cython.int,
 */
  __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_14);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14)) __PYX_ERR(0, 1952, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_12);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_12)) __PYX_ERR(0, 1952, __pyx_L1_error);
  __pyx_t_14 = 0;
  __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_offset, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 1952, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_month, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 1952, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_day, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 1952, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 1952, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_77to_quarter, 0, __pyx_n_s_Pddt_to_quarter, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_t_13);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_12);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_quarter, __pyx_t_14) < 0) __PYX_ERR(0, 1952, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cytimes/pddt.py":2028
 * 
 *     # . month
 *     def to_curr_month(self, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified day of the current month `<'Pddt'>`.
 * 
 */
  __pyx_t_14 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_14);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_14)) __PYX_ERR(0, 2028, __pyx_L1_error);
  __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_day, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2028, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2028, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_79to_curr_month, 0, __pyx_n_s_Pddt_to_curr_month, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_t_12);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_curr_month, __pyx_t_13) < 0) __PYX_ERR(0, 2028, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "cytimes/pddt.py":2083
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_prev_month(self, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified day of the previous month `<'Pddt'>`.
 * 
 */
  __pyx_t_13 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_GIVEREF(__pyx_t_13);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13)) __PYX_ERR(0, 2083, __pyx_L1_error);
  __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_day, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2083, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2083, __pyx_L1_error)
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_81to_prev_month, 0, __pyx_n_s_Pddt_to_prev_month, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_t_14);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_prev_month, __pyx_t_12) < 0) __PYX_ERR(0, 2083, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "cytimes/pddt.py":2096
 *         return self.to_month(-1, day)
 * 
 *     def to_next_month(self, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified day of the next month `<'Pddt'>`.
 * 
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_12);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12)) __PYX_ERR(0, 2096, __pyx_L1_error);
  __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_day, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2096, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2096, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_83to_next_month, 0, __pyx_n_s_Pddt_to_next_month, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_t_13);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_12);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_next_month, __pyx_t_14) < 0) __PYX_ERR(0, 2096, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cytimes/pddt.py":2109
 *         return self.to_month(1, day)
 * 
 *     def to_month(self, offset: cython.int, day: cython.int = -1) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specified day of the month (+/-) offest `<'Pddt'>`.
 * 
 */
  __pyx_t_14 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_14);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_14)) __PYX_ERR(0, 2109, __pyx_L1_error);
  __pyx_t_14 = 0;
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_offset, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_day, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2109, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_85to_month, 0, __pyx_n_s_Pddt_to_month, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_t_12);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_month, __pyx_t_13) < 0) __PYX_ERR(0, 2109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "cytimes/pddt.py":2172
 * 
 *     # . weekday
 *     def to_monday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Monday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(0)
 */
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2172, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_87to_monday, 0, __pyx_n_s_Pddt_to_monday, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_monday, __pyx_t_14) < 0) __PYX_ERR(0, 2172, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cytimes/pddt.py":2176
 *         return self._to_curr_weekday(0)
 * 
 *     def to_tuesday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Tuesday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(1)
 */
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2176, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_89to_tuesday, 0, __pyx_n_s_Pddt_to_tuesday, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__127)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_tuesday, __pyx_t_13) < 0) __PYX_ERR(0, 2176, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "cytimes/pddt.py":2180
 *         return self._to_curr_weekday(1)
 * 
 *     def to_wednesday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Wednesday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(2)
 */
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2180, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_91to_wednesday, 0, __pyx_n_s_Pddt_to_wednesday, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_wednesday, __pyx_t_14) < 0) __PYX_ERR(0, 2180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cytimes/pddt.py":2184
 *         return self._to_curr_weekday(2)
 * 
 *     def to_thursday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Thursday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(3)
 */
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2184, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_93to_thursday, 0, __pyx_n_s_Pddt_to_thursday, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__129)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_thursday, __pyx_t_13) < 0) __PYX_ERR(0, 2184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "cytimes/pddt.py":2188
 *         return self._to_curr_weekday(3)
 * 
 *     def to_friday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Friday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(4)
 */
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2188, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_95to_friday, 0, __pyx_n_s_Pddt_to_friday, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_friday, __pyx_t_14) < 0) __PYX_ERR(0, 2188, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cytimes/pddt.py":2192
 *         return self._to_curr_weekday(4)
 * 
 *     def to_saturday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Saturday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(5)
 */
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2192, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_97to_saturday, 0, __pyx_n_s_Pddt_to_saturday, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_saturday, __pyx_t_13) < 0) __PYX_ERR(0, 2192, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "cytimes/pddt.py":2196
 *         return self._to_curr_weekday(5)
 * 
 *     def to_sunday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the Sunday of the current week `<'Pddt'>`."""
 *         return self._to_curr_weekday(6)
 */
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2196, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_99to_sunday, 0, __pyx_n_s_Pddt_to_sunday, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_sunday, __pyx_t_14) < 0) __PYX_ERR(0, 2196, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cytimes/pddt.py":2200
 *         return self._to_curr_weekday(6)
 * 
 *     def to_curr_weekday(self, weekday: int | str | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specific weekday of the current week `<'Pddt'>`.
 * 
 */
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_weekday, __pyx_kp_s_int_str_None) < 0) __PYX_ERR(0, 2200, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2200, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_101to_curr_weekday, 0, __pyx_n_s_Pddt_to_curr_weekday, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_tuple__135);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_curr_weekday_2, __pyx_t_13) < 0) __PYX_ERR(0, 2200, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "cytimes/pddt.py":2214
 *         return self._to_curr_weekday(_parse_weekday(weekday, True))
 * 
 *     def to_prev_weekday(self, weekday: int | str | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specific weekday of the previous week `<'Pddt'>`.
 * 
 */
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_weekday, __pyx_kp_s_int_str_None) < 0) __PYX_ERR(0, 2214, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2214, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_103to_prev_weekday, 0, __pyx_n_s_Pddt_to_prev_weekday, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_tuple__135);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_prev_weekday, __pyx_t_14) < 0) __PYX_ERR(0, 2214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cytimes/pddt.py":2228
 *         return self.to_weekday(-1, weekday)
 * 
 *     def to_next_weekday(self, weekday: int | str | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specific weekday of the next week `<'Pddt'>`.
 * 
 */
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_weekday, __pyx_kp_s_int_str_None) < 0) __PYX_ERR(0, 2228, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2228, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_105to_next_weekday, 0, __pyx_n_s_Pddt_to_next_weekday, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__137)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_tuple__135);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_next_weekday, __pyx_t_13) < 0) __PYX_ERR(0, 2228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "cytimes/pddt.py":2242
 *         return self.to_weekday(1, weekday)
 * 
 *     def to_weekday(self, offset: cython.int, weekday: int | str | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the specific weekday of the week (+/-) offset `<'Pddt'>`.
 * 
 */
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_offset, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2242, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_weekday, __pyx_kp_s_int_str_None) < 0) __PYX_ERR(0, 2242, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2242, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_107to_weekday, 0, __pyx_n_s_Pddt_to_weekday, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__139)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_tuple__135);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_weekday, __pyx_t_14) < 0) __PYX_ERR(0, 2242, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cytimes/pddt.py":2289
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def _to_curr_weekday(self, weekday: cython.int) -> Self:             # <<<<<<<<<<<<<<
 *         """(internal) Adjust the date to the specific weekday of the current week `<'Pddt'>`.
 * 
 */
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_weekday, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2289, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2289, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_109_to_curr_weekday, 0, __pyx_n_s_Pddt__to_curr_weekday, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__141)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_curr_weekday, __pyx_t_13) < 0) __PYX_ERR(0, 2289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "cytimes/pddt.py":2327
 * 
 *     # . day
 *     def to_yesterday(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to Yesterday `<'Pddt'>`."""
 *         return self.to_day(-1)
 */
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2327, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_111to_yesterday, 0, __pyx_n_s_Pddt_to_yesterday, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__142)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_yesterday, __pyx_t_14) < 0) __PYX_ERR(0, 2327, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cytimes/pddt.py":2331
 *         return self.to_day(-1)
 * 
 *     def to_tomorrow(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to Tomorrow `<'Pddt'>`."""
 *         return self.to_day(1)
 */
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2331, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_113to_tomorrow, 0, __pyx_n_s_Pddt_to_tomorrow, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__143)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_tomorrow, __pyx_t_13) < 0) __PYX_ERR(0, 2331, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "cytimes/pddt.py":2335
 *         return self.to_day(1)
 * 
 *     def to_day(self, offset: cython.int) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to day (+/-) offset `<'Pddt'>`.
 * 
 */
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_offset, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2335, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2335, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_115to_day, 0, __pyx_n_s_Pddt_to_day, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__145)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_day, __pyx_t_14) < 0) __PYX_ERR(0, 2335, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "cytimes/pddt.py":2367
 * 
 *     # . date&time
 *     def snap(self, freq: object = "S") -> Self:             # <<<<<<<<<<<<<<
 *         """Snap to nearest occurring frequency `<'Pddt'>`.
 * 
 */
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_freq, __pyx_n_s_object) < 0) __PYX_ERR(0, 2367, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2367, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_117snap, 0, __pyx_n_s_Pddt_snap, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__147)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_tuple__148);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_snap, __pyx_t_13) < 0) __PYX_ERR(0, 2367, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "cytimes/pddt.py":2385
 *     def to_datetime(
 *         self,
 *         year: cython.int = -1,             # <<<<<<<<<<<<<<
 *         month: cython.int = -1,
 *         day: cython.int = -1,
 */
  __pyx_t_13 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);

  /* "cytimes/pddt.py":2386
 *         self,
 *         year: cython.int = -1,
 *         month: cython.int = -1,             # <<<<<<<<<<<<<<
 *         day: cython.int = -1,
 *         hour: cython.int = -1,
 */
  __pyx_t_14 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);

  /* "cytimes/pddt.py":2387
 *         year: cython.int = -1,
 *         month: cython.int = -1,
 *         day: cython.int = -1,             # <<<<<<<<<<<<<<
 *         hour: cython.int = -1,
 *         minute: cython.int = -1,
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);

  /* "cytimes/pddt.py":2388
 *         month: cython.int = -1,
 *         day: cython.int = -1,
 *         hour: cython.int = -1,             # <<<<<<<<<<<<<<
 *         minute: cython.int = -1,
 *         second: cython.int = -1,
 */
  __pyx_t_11 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);

  /* "cytimes/pddt.py":2389
 *         day: cython.int = -1,
 *         hour: cython.int = -1,
 *         minute: cython.int = -1,             # <<<<<<<<<<<<<<
 *         second: cython.int = -1,
 *         microsecond: cython.int = -1,
 */
  __pyx_t_10 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "cytimes/pddt.py":2390
 *         hour: cython.int = -1,
 *         minute: cython.int = -1,
 *         second: cython.int = -1,             # <<<<<<<<<<<<<<
 *         microsecond: cython.int = -1,
 *         nanosecond: cython.int = -1,
 */
  __pyx_t_9 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "cytimes/pddt.py":2391
 *         minute: cython.int = -1,
 *         second: cython.int = -1,
 *         microsecond: cython.int = -1,             # <<<<<<<<<<<<<<
 *         nanosecond: cython.int = -1,
 *     ) -> Self:
 */
  __pyx_t_3 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cytimes/pddt.py":2392
 *         second: cython.int = -1,
 *         microsecond: cython.int = -1,
 *         nanosecond: cython.int = -1,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Adjust the date and time fields with new values `<'Pddt'>`.
 */
  __pyx_t_7 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "cytimes/pddt.py":2383
 *         return pddt_new_simple(DatetimeIndex.snap(self, freq))
 * 
 *     def to_datetime(             # <<<<<<<<<<<<<<
 *         self,
 *         year: cython.int = -1,
 */
  __pyx_t_8 = PyTuple_New(8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_13);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_13)) __PYX_ERR(0, 2383, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_14);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_14)) __PYX_ERR(0, 2383, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_12);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_12)) __PYX_ERR(0, 2383, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_11);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_11)) __PYX_ERR(0, 2383, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_10)) __PYX_ERR(0, 2383, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_t_9)) __PYX_ERR(0, 2383, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 6, __pyx_t_3)) __PYX_ERR(0, 2383, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 7, __pyx_t_7)) __PYX_ERR(0, 2383, __pyx_L1_error);
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_t_12 = 0;
  __pyx_t_11 = 0;
  __pyx_t_10 = 0;
  __pyx_t_9 = 0;
  __pyx_t_3 = 0;
  __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_year, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2383, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_month, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2383, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_day, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2383, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_hour, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2383, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_minute, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2383, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_second, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2383, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_microsecond, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2383, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_nanosecond, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2383, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2383, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_119to_datetime, 0, __pyx_n_s_Pddt_to_datetime, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__150)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_8);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_datetime, __pyx_t_3) < 0) __PYX_ERR(0, 2383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2529
 *     def to_date(
 *         self,
 *         year: cython.int = -1,             # <<<<<<<<<<<<<<
 *         month: cython.int = -1,
 *         day: cython.int = -1,
 */
  __pyx_t_3 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cytimes/pddt.py":2530
 *         self,
 *         year: cython.int = -1,
 *         month: cython.int = -1,             # <<<<<<<<<<<<<<
 *         day: cython.int = -1,
 *     ) -> Self:
 */
  __pyx_t_7 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "cytimes/pddt.py":2531
 *         year: cython.int = -1,
 *         month: cython.int = -1,
 *         day: cython.int = -1,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Adjust the date with new values `<'Pddt'>`.
 */
  __pyx_t_8 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "cytimes/pddt.py":2527
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_date(             # <<<<<<<<<<<<<<
 *         self,
 *         year: cython.int = -1,
 */
  __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3)) __PYX_ERR(0, 2527, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7)) __PYX_ERR(0, 2527, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_8)) __PYX_ERR(0, 2527, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_year, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2527, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_month, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2527, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_day, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2527, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2527, __pyx_L1_error)
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_121to_date, 0, __pyx_n_s_Pddt_to_date, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__152)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_t_9);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_date, __pyx_t_7) < 0) __PYX_ERR(0, 2527, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cytimes/pddt.py":2590
 *     def to_time(
 *         self,
 *         hour: cython.int = -1,             # <<<<<<<<<<<<<<
 *         minute: cython.int = -1,
 *         second: cython.int = -1,
 */
  __pyx_t_7 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "cytimes/pddt.py":2591
 *         self,
 *         hour: cython.int = -1,
 *         minute: cython.int = -1,             # <<<<<<<<<<<<<<
 *         second: cython.int = -1,
 *         microsecond: cython.int = -1,
 */
  __pyx_t_8 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "cytimes/pddt.py":2592
 *         hour: cython.int = -1,
 *         minute: cython.int = -1,
 *         second: cython.int = -1,             # <<<<<<<<<<<<<<
 *         microsecond: cython.int = -1,
 *         nanosecond: cython.int = -1,
 */
  __pyx_t_9 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "cytimes/pddt.py":2593
 *         minute: cython.int = -1,
 *         second: cython.int = -1,
 *         microsecond: cython.int = -1,             # <<<<<<<<<<<<<<
 *         nanosecond: cython.int = -1,
 *     ) -> Self:
 */
  __pyx_t_3 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cytimes/pddt.py":2594
 *         second: cython.int = -1,
 *         microsecond: cython.int = -1,
 *         nanosecond: cython.int = -1,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Adjust the time fields with new values `<'Pddt'>`.
 */
  __pyx_t_10 = __Pyx_PyInt_From_int(((int)-1)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "cytimes/pddt.py":2588
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_time(             # <<<<<<<<<<<<<<
 *         self,
 *         hour: cython.int = -1,
 */
  __pyx_t_11 = PyTuple_New(5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7)) __PYX_ERR(0, 2588, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_8)) __PYX_ERR(0, 2588, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_9)) __PYX_ERR(0, 2588, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_3)) __PYX_ERR(0, 2588, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_10)) __PYX_ERR(0, 2588, __pyx_L1_error);
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_3 = 0;
  __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_hour, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2588, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_minute, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2588, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_second, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2588, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_microsecond, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2588, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_nanosecond, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 2588, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2588, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_123to_time, 0, __pyx_n_s_Pddt_to_time, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__154)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_11);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_time, __pyx_t_3) < 0) __PYX_ERR(0, 2588, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2706
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_first_of(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the first day of the specified datetime unit `<'Pddt'>`.
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 2706, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2706, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_125to_first_of, 0, __pyx_n_s_Pddt_to_first_of, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__156)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_first_of, __pyx_t_10) < 0) __PYX_ERR(0, 2706, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":2773
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_last_of(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the date to the last day of the specified datetime unit `<'Pddt'>`.
 * 
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 2773, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2773, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_127to_last_of, 0, __pyx_n_s_Pddt_to_last_of, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__157)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_last_of, __pyx_t_3) < 0) __PYX_ERR(0, 2773, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":2840
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_start_of(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the datetime to the start of the specified datetime unit `<'Pddt'>`.
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 2840, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2840, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_129to_start_of, 0, __pyx_n_s_Pddt_to_start_of, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__159)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_start_of, __pyx_t_10) < 0) __PYX_ERR(0, 2840, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":2919
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def to_end_of(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust the datetime to the end of the specified datetime unit `<'Pddt'>`.
 * 
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 2919, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 2919, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_131to_end_of, 0, __pyx_n_s_Pddt_to_end_of, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__161)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_to_end_of, __pyx_t_3) < 0) __PYX_ERR(0, 2919, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3131
 * 
 *     # . round / ceil / floor
 *     def round(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Perform round operation to the specified datetime unit `<'Pddt'>`.
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 3131, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 3131, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_133round, 0, __pyx_n_s_Pddt_round, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__163)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_round, __pyx_t_10) < 0) __PYX_ERR(0, 3131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3156
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)
 * 
 *     def ceil(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Perform ceil operation to the specified datetime unit `<'Pddt'>`.
 * 
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 3156, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 3156, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_135ceil, 0, __pyx_n_s_Pddt_ceil, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_ceil, __pyx_t_3) < 0) __PYX_ERR(0, 3156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3181
 *         return pddt_new_simple(res, self.tzinfo, None, self.name)
 * 
 *     def floor(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Perform floor operation to the specified datetime unit `<'Pddt'>`.
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 3181, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 3181, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_137floor, 0, __pyx_n_s_Pddt_floor, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__165)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_floor, __pyx_t_10) < 0) __PYX_ERR(0, 3181, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3207
 * 
 *     # . fsp (fractional seconds precision)
 *     def fsp(self, precision: cython.int) -> Self:             # <<<<<<<<<<<<<<
 *         """Adjust to the specified fractional seconds precision `<'Pddt'>`.
 * 
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_precision, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3207, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 3207, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_139fsp, 0, __pyx_n_s_Pddt_fsp, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__167)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_fsp, __pyx_t_3) < 0) __PYX_ERR(0, 3207, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3250
 *     # Calendar -----------------------------------------------------------------------------
 *     # . iso
 *     def isocalendar(self) -> DataFrame:             # <<<<<<<<<<<<<<
 *         """Return the ISO calendar `<'DateFrame'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_DataFrame) < 0) __PYX_ERR(0, 3250, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_141isocalendar, 0, __pyx_n_s_Pddt_isocalendar, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__169)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_isocalendar, __pyx_t_10) < 0) __PYX_ERR(0, 3250, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3255
 *         return DataFrame(_iso, columns=["year", "week", "weekday"], index=self)
 * 
 *     def isoyear(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the ISO calendar years `<'Index[int64]'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3255, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_143isoyear, 0, __pyx_n_s_Pddt_isoyear, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__170)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_isoyear, __pyx_t_3) < 0) __PYX_ERR(0, 3255, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3260
 *         return Index(_iso[:, 0], name="isoyear")
 * 
 *     def isoweek(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the ISO calendar week numbers (1-53) `<'Index[int64]'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3260, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_145isoweek, 0, __pyx_n_s_Pddt_isoweek, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__171)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_isoweek, __pyx_t_10) < 0) __PYX_ERR(0, 3260, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3265
 *         return Index(_iso[:, 1], name="isoweek")
 * 
 *     def isoweekday(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the ISO calendar weekdays (1=Mon...7=Sun) `<'Index[int64]'>`."""
 *         _iso = utils.dt64arr_isocalendar(self.values_naive)
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3265, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_147isoweekday, 0, __pyx_n_s_Pddt_isoweekday, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__172)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_isoweekday, __pyx_t_3) < 0) __PYX_ERR(0, 3265, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3271
 * 
 *     # . year
 *     @property             # <<<<<<<<<<<<<<
 *     def year(self) -> Index[np.int64]:
 *         """The years `<'Index[int64]'>`."""
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3271, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_149year, 0, __pyx_n_s_Pddt_year, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__173)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_year, __pyx_t_3) < 0) __PYX_ERR(0, 3271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3276
 *         return Index(utils.dt64arr_year(self.values_naive), name="year")
 * 
 *     def is_leap_year(self) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's years are in a leap year `<'Index[bool]'>`."""
 *         return Index(utils.dt64arr_is_leap_year(self.values_naive), name="is_leap_year")
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Index_bool) < 0) __PYX_ERR(0, 3276, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_151is_leap_year, 0, __pyx_n_s_Pddt_is_leap_year, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__174)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_is_leap_year, __pyx_t_10) < 0) __PYX_ERR(0, 3276, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3280
 *         return Index(utils.dt64arr_is_leap_year(self.values_naive), name="is_leap_year")
 * 
 *     def is_long_year(self) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's years are in a long year `<'Index[bool]'>`.
 * 
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Index_bool) < 0) __PYX_ERR(0, 3280, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_153is_long_year, 0, __pyx_n_s_Pddt_is_long_year, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__175)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_is_long_year, __pyx_t_3) < 0) __PYX_ERR(0, 3280, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3287
 *         return Index(utils.dt64arr_is_long_year(self.values_naive), name="is_long_year")
 * 
 *     def leap_bt_year(self, year: cython.int) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Compute the number of leap years between the instance's
 *         years and the passed-in 'year' `<'Index[int64]'>`.
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_year, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3287, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3287, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_155leap_bt_year, 0, __pyx_n_s_Pddt_leap_bt_year, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__177)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_leap_bt_year, __pyx_t_10) < 0) __PYX_ERR(0, 3287, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3296
 *         )
 * 
 *     def days_in_year(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the maximum number of days (365, 366)
 *         in the instance's years `<'Index[int64]'>`.
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3296, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_157days_in_year, 0, __pyx_n_s_Pddt_days_in_year, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__178)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_days_in_year, __pyx_t_3) < 0) __PYX_ERR(0, 3296, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3302
 *         return Index(utils.dt64arr_days_in_year(self.values_naive), name="days_in_year")
 * 
 *     def days_bf_year(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days from January 1st, 1st AD,
 *         to the start of the instance's years `<'Index[int64]'>`.
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3302, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_159days_bf_year, 0, __pyx_n_s_Pddt_days_bf_year, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__179)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_days_bf_year, __pyx_t_10) < 0) __PYX_ERR(0, 3302, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3308
 *         return Index(utils.dt64arr_days_bf_year(self.values_naive), name="days_bf_year")
 * 
 *     def days_of_year(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days since the start
 *         of the instance's years `<'Index[int64]'>`.
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3308, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_161days_of_year, 0, __pyx_n_s_Pddt_days_of_year, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_days_of_year, __pyx_t_3) < 0) __PYX_ERR(0, 3308, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3314
 *         return Index(utils.dt64arr_days_of_year(self.values_naive), name="days_of_year")
 * 
 *     def is_year(self, year: cython.int) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's years match
 *         the passed-in 'year' `<'Index[bool]'>`.
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_year, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3314, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Index_bool) < 0) __PYX_ERR(0, 3314, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_163is_year, 0, __pyx_n_s_Pddt_is_year, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__181)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_is_year, __pyx_t_10) < 0) __PYX_ERR(0, 3314, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3324
 * 
 *     # . quarter
 *     @property             # <<<<<<<<<<<<<<
 *     def quarter(self) -> Index[np.int64]:
 *         """The quarters (1-4) `<'Index[int64]'>`."""
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3324, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_165quarter, 0, __pyx_n_s_Pddt_quarter, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__182)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_quarter, __pyx_t_10) < 0) __PYX_ERR(0, 3324, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3329
 *         return Index(utils.dt64arr_quarter(self.values_naive), name="quarter")
 * 
 *     def days_in_quarter(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the maximum number of days (90-92)
 *         in the instance's quarters `<'Index[int64]'>`.
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3329, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_167days_in_quarter, 0, __pyx_n_s_Pddt_days_in_quarter, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__183)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_days_in_quarter, __pyx_t_3) < 0) __PYX_ERR(0, 3329, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3338
 *         )
 * 
 *     def days_bf_quarter(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days from the start of the instance's years
 *         to the start of the instance's quarters `<'Index[int64]'>`.
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3338, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_169days_bf_quarter, 0, __pyx_n_s_Pddt_days_bf_quarter, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__184)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_days_bf_quarter, __pyx_t_10) < 0) __PYX_ERR(0, 3338, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3347
 *         )
 * 
 *     def days_of_quarter(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days since the start
 *         of the instance's quarters `<'Index[int64]'>`.
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3347, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_171days_of_quarter, 0, __pyx_n_s_Pddt_days_of_quarter, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__185)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_days_of_quarter, __pyx_t_3) < 0) __PYX_ERR(0, 3347, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3356
 *         )
 * 
 *     def is_quarter(self, quarter: cython.int) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's quarters match
 *         the passed-in 'quarter' `<'Index[bool]'>`.
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_quarter, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3356, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Index_bool) < 0) __PYX_ERR(0, 3356, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_173is_quarter, 0, __pyx_n_s_Pddt_is_quarter, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__187)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_is_quarter, __pyx_t_10) < 0) __PYX_ERR(0, 3356, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3366
 * 
 *     # . month
 *     @property             # <<<<<<<<<<<<<<
 *     def month(self) -> Index[np.int64]:
 *         """The months (1-12) `<'Index[int64]'>`."""
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3366, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_175month, 0, __pyx_n_s_Pddt_month, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__188)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_month, __pyx_t_10) < 0) __PYX_ERR(0, 3366, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3371
 *         return Index(utils.dt64arr_month(self.values_naive), name="month")
 * 
 *     def days_in_month(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the maximum number of days (28-31)
 *         in the instance's months `<'Index[int64]'>`.
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3371, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_177days_in_month, 0, __pyx_n_s_Pddt_days_in_month, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__189)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_days_in_month, __pyx_t_3) < 0) __PYX_ERR(0, 3371, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3380
 *         )
 * 
 *     def days_bf_month(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days from the start of the instance's
 *         years to the start of the instance's months `<'Index[int64]'>`.
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3380, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_179days_bf_month, 0, __pyx_n_s_Pddt_days_bf_month, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_days_bf_month, __pyx_t_10) < 0) __PYX_ERR(0, 3380, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3389
 *         )
 * 
 *     def days_of_month(self) -> Index[np.int64]:             # <<<<<<<<<<<<<<
 *         """Return the number of days (1-31) since the start
 *         of the instance's months `<'Index[int64]'>`.
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3389, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_181days_of_month, 0, __pyx_n_s_Pddt_days_of_month, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__191)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_days_of_month, __pyx_t_3) < 0) __PYX_ERR(0, 3389, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3398
 *         return Index(utils.dt64arr_day(self.values_naive), name="days_of_month")
 * 
 *     def is_month(self, month: str | int) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's months match
 *         the passed-in 'month' `<'Index[bool]'>`.
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_month, __pyx_kp_s_str_int) < 0) __PYX_ERR(0, 3398, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Index_bool) < 0) __PYX_ERR(0, 3398, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_183is_month, 0, __pyx_n_s_Pddt_is_month, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__193)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_is_month, __pyx_t_10) < 0) __PYX_ERR(0, 3398, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3409
 * 
 *     # . weekday
 *     @property             # <<<<<<<<<<<<<<
 *     def weekday(self) -> Index[np.int64]:
 *         """The weekdays (0=Mon...6=Sun) `<'Index[int64]'>`."""
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3409, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_185weekday, 0, __pyx_n_s_Pddt_weekday, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_weekday, __pyx_t_10) < 0) __PYX_ERR(0, 3409, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3414
 *         return Index(utils.dt64arr_weekday(self.values_naive), name="weekday")
 * 
 *     def is_weekday(self, weekday: int | str) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's weekdays match
 *         the passed-in 'weekday' `<'Index[bool]'>`.
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_weekday, __pyx_kp_s_int_str) < 0) __PYX_ERR(0, 3414, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Index_bool) < 0) __PYX_ERR(0, 3414, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_187is_weekday, 0, __pyx_n_s_Pddt_is_weekday, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__196)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_is_weekday, __pyx_t_3) < 0) __PYX_ERR(0, 3414, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3425
 * 
 *     # . day
 *     @property             # <<<<<<<<<<<<<<
 *     def day(self) -> Index[np.int64]:
 *         """The days (1-31) `<'Index[int64]'>`."""
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3425, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_189day, 0, __pyx_n_s_Pddt_day, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__197)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_day, __pyx_t_3) < 0) __PYX_ERR(0, 3425, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3430
 *         return Index(utils.dt64arr_day(self.values_naive), name="day")
 * 
 *     def is_day(self, day: cython.int) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the instance's days match
 *         the passed-in 'day' `<'Index[bool]'>`.
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_day, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3430, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Index_bool) < 0) __PYX_ERR(0, 3430, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_191is_day, 0, __pyx_n_s_Pddt_is_day, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__198)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_is_day, __pyx_t_10) < 0) __PYX_ERR(0, 3430, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3440
 * 
 *     # . time
 *     @property             # <<<<<<<<<<<<<<
 *     def hour(self) -> Index[np.int64]:
 *         """The hours (0-23) `<'Index[int64]'>`."""
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3440, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_193hour, 0, __pyx_n_s_Pddt_hour, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__199)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_hour, __pyx_t_10) < 0) __PYX_ERR(0, 3440, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3445
 *         return Index(utils.dt64arr_hour(self.values_naive), name="hour")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def minute(self) -> Index[np.int64]:
 *         """The minutes (0-59) `<'Index[int64]'>`."""
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3445, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_195minute, 0, __pyx_n_s_Pddt_minute, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__200)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_minute, __pyx_t_10) < 0) __PYX_ERR(0, 3445, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3450
 *         return Index(utils.dt64arr_minute(self.values_naive), name="minute")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def second(self) -> Index[np.int64]:
 *         """The seconds (0-59) `<'Index[int64]'>`."""
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3450, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_197second, 0, __pyx_n_s_Pddt_second, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__201)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_second, __pyx_t_10) < 0) __PYX_ERR(0, 3450, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3455
 *         return Index(utils.dt64arr_second(self.values_naive), name="second")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def millisecond(self) -> Index[np.int64]:
 *         """The milliseconds (0-999) `<'Index[int64]'>`."""
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3455, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_199millisecond, 0, __pyx_n_s_Pddt_millisecond, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__202)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_millisecond, __pyx_t_10) < 0) __PYX_ERR(0, 3455, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3460
 *         return Index(utils.dt64arr_millisecond(self.values_naive), name="millisecond")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def microsecond(self) -> Index[np.int64]:
 *         """The microseconds (0-999999) `<'Index[int64]'>`."""
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3460, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_201microsecond, 0, __pyx_n_s_Pddt_microsecond, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__203)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_microsecond, __pyx_t_10) < 0) __PYX_ERR(0, 3460, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3465
 *         return Index(utils.dt64arr_microsecond(self.values_naive), name="microsecond")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nanosecond(self) -> Index[np.int64]:
 *         """The nanoseconds (0-999) `<'Index[int64]'>`."""
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Index_np_int64) < 0) __PYX_ERR(0, 3465, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_203nanosecond, 0, __pyx_n_s_Pddt_nanosecond, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__204)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_nanosecond, __pyx_t_10) < 0) __PYX_ERR(0, 3465, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3471
 * 
 *     # . date&time
 *     def is_first_of(self, unit: str) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the dates are on the first day of
 *         the specified datetime unit `<'Index[bool]'>`.
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 3471, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Index_bool) < 0) __PYX_ERR(0, 3471, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_205is_first_of, 0, __pyx_n_s_Pddt_is_first_of, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__206)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_is_first_of, __pyx_t_3) < 0) __PYX_ERR(0, 3471, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3491
 *         return Index(arr, name="is_first_of[%s]" % unit)
 * 
 *     def is_last_of(self, unit: str) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the dates are on the last day of
 *         the specified datetime unit `<'Index[bool]'>`.
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 3491, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Index_bool) < 0) __PYX_ERR(0, 3491, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_207is_last_of, 0, __pyx_n_s_Pddt_is_last_of, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__208)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_is_last_of, __pyx_t_10) < 0) __PYX_ERR(0, 3491, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3511
 *         return Index(arr, name="is_last_of[%s]" % unit)
 * 
 *     def is_start_of(self, unit: str) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the datetimes are at the start of
 *         the specified datetime unit `<'Index[bool]'>`.
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 3511, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Index_bool) < 0) __PYX_ERR(0, 3511, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_209is_start_of, 0, __pyx_n_s_Pddt_is_start_of, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__210)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_is_start_of, __pyx_t_3) < 0) __PYX_ERR(0, 3511, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3542
 *         return Index(arr, name="is_start_of[%s]" % unit)
 * 
 *     def is_end_of(self, unit: str) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the datetimes are at the end of
 *         the specified datetime unit `<'Index[bool]'>`.
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 3542, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Index_bool) < 0) __PYX_ERR(0, 3542, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_211is_end_of, 0, __pyx_n_s_Pddt_is_end_of, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__212)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_is_end_of, __pyx_t_10) < 0) __PYX_ERR(0, 3542, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3574
 * 
 *     # Timezone -----------------------------------------------------------------------------
 *     @property             # <<<<<<<<<<<<<<
 *     def tz_available(self) -> set[str]:
 *         """The available timezone names `<'set[str]'>`.
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_set_str) < 0) __PYX_ERR(0, 3574, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_213tz_available, 0, __pyx_n_s_Pddt_tz_available, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__213)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_tz_available, __pyx_t_10) < 0) __PYX_ERR(0, 3574, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3583
 *         return _available_timezones()
 * 
 *     def is_local(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Determine if the instance is in the local timezone `<'bool'>`.
 * 
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 3583, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_215is_local, 0, __pyx_n_s_Pddt_is_local, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__214)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_is_local, __pyx_t_3) < 0) __PYX_ERR(0, 3583, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3590
 *         return self.tzinfo is utils.tz_local(None)
 * 
 *     def is_utc(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Determine if the instance is in the UTC timezone `<'bool'>`.
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 3590, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_217is_utc, 0, __pyx_n_s_Pddt_is_utc, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__215)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_is_utc, __pyx_t_10) < 0) __PYX_ERR(0, 3590, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3597
 *         return self.tzinfo is utils.UTC
 * 
 *     def tzname(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the timezone name of the instance `<'str/None'>`.
 * 
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 3597, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_219tzname, 0, __pyx_n_s_Pddt_tzname, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__216)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_tzname, __pyx_t_3) < 0) __PYX_ERR(0, 3597, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3605
 *         return None if my_tz is None else my_tz.tzname(self[0])
 * 
 *     def astimezone(             # <<<<<<<<<<<<<<
 *         self,
 *         tz: datetime.tzinfo | str | None = None,
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tz, __pyx_kp_s_datetime_tzinfo_str_None) < 0) __PYX_ERR(0, 3605, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ambiguous, __pyx_n_s_object) < 0) __PYX_ERR(0, 3605, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_nonexistent, __pyx_n_s_object) < 0) __PYX_ERR(0, 3605, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 3605, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_221astimezone, 0, __pyx_n_s_Pddt_astimezone, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__218)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_tuple__219);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_astimezone, __pyx_t_10) < 0) __PYX_ERR(0, 3605, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3658
 *         return pt.tz_convert(tz)
 * 
 *     def tz_localize(             # <<<<<<<<<<<<<<
 *         self,
 *         tz: datetime.tzinfo | str | None,
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_tz, __pyx_kp_s_datetime_tzinfo_str_None) < 0) __PYX_ERR(0, 3658, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_ambiguous, __pyx_n_s_object) < 0) __PYX_ERR(0, 3658, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_nonexistent, __pyx_n_s_object) < 0) __PYX_ERR(0, 3658, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 3658, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_223tz_localize, 0, __pyx_n_s_Pddt_tz_localize, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__221)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__222);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_tz_localize, __pyx_t_3) < 0) __PYX_ERR(0, 3658, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":3716
 *             raise errors.InvalidArgumentError(err) from err
 * 
 *     def tz_convert(self, tz: datetime.tzinfo | str | None) -> Self:             # <<<<<<<<<<<<<<
 *         """Convert timezone-aware instance to another timezone `<'Pddt'>`.
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tz, __pyx_kp_s_datetime_tzinfo_str_None) < 0) __PYX_ERR(0, 3716, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 3716, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_225tz_convert, 0, __pyx_n_s_Pddt_tz_convert, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__224)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_tz_convert, __pyx_t_10) < 0) __PYX_ERR(0, 3716, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3758
 *         targ_tz: datetime.tzinfo | str | None,
 *         base_tz: datetime.tzinfo | str | None = None,
 *         naive: cython.bint = False,             # <<<<<<<<<<<<<<
 *         ambiguous: object = "raise",
 *         nonexistent: object = "raise",
 */
  __pyx_t_10 = __Pyx_PyBool_FromLong(((int)0)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "cytimes/pddt.py":3754
 *             raise errors.InvalidArgumentError(err) from err
 * 
 *     def tz_switch(             # <<<<<<<<<<<<<<
 *         self,
 *         targ_tz: datetime.tzinfo | str | None,
 */
  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None)) __PYX_ERR(0, 3754, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_10)) __PYX_ERR(0, 3754, __pyx_L1_error);
  __Pyx_INCREF(((PyObject*)__pyx_n_u_raise));
  __Pyx_GIVEREF(((PyObject*)__pyx_n_u_raise));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject*)__pyx_n_u_raise))) __PYX_ERR(0, 3754, __pyx_L1_error);
  __Pyx_INCREF(((PyObject*)__pyx_n_u_raise));
  __Pyx_GIVEREF(((PyObject*)__pyx_n_u_raise));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject*)__pyx_n_u_raise))) __PYX_ERR(0, 3754, __pyx_L1_error);
  __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_targ_tz, __pyx_kp_s_datetime_tzinfo_str_None) < 0) __PYX_ERR(0, 3754, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_base_tz, __pyx_kp_s_datetime_tzinfo_str_None) < 0) __PYX_ERR(0, 3754, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_naive, __pyx_kp_s_cython_bint) < 0) __PYX_ERR(0, 3754, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_ambiguous, __pyx_n_s_object) < 0) __PYX_ERR(0, 3754, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_nonexistent, __pyx_n_s_object) < 0) __PYX_ERR(0, 3754, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 3754, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_227tz_switch, 0, __pyx_n_s_Pddt_tz_switch, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__226)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_tz_switch, __pyx_t_11) < 0) __PYX_ERR(0, 3754, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cytimes/pddt.py":3821
 * 
 *     # Values -------------------------------------------------------------------------------
 *     @property             # <<<<<<<<<<<<<<
 *     def values_naive(self) -> np.ndarray[np.datetime64]:
 *         """Return an array of the timezone-naive datetime values `<'ndarray[datetime64]'>`.
 */
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_kp_s_np_ndarray_np_datetime64) < 0) __PYX_ERR(0, 3821, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_229values_naive, 0, __pyx_n_s_Pddt_values_naive, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__227)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_values_naive, __pyx_t_11) < 0) __PYX_ERR(0, 3821, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cytimes/pddt.py":3833
 *         return super(Pddt, self).tz_localize(None).values
 * 
 *     def as_unit(self, unit: str) -> Self:             # <<<<<<<<<<<<<<
 *         """Set the datetime unit resolution of the instance `<'Pddt'>`.
 * 
 */
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 3833, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 3833, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_231as_unit, 0, __pyx_n_s_Pddt_as_unit, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__228)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_as_unit, __pyx_t_10) < 0) __PYX_ERR(0, 3833, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":3863
 *     def add(
 *         self,
 *         years: cython.int = 0,             # <<<<<<<<<<<<<<
 *         quarters: cython.int = 0,
 *         months: cython.int = 0,
 */
  __pyx_t_10 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "cytimes/pddt.py":3864
 *         self,
 *         years: cython.int = 0,
 *         quarters: cython.int = 0,             # <<<<<<<<<<<<<<
 *         months: cython.int = 0,
 *         weeks: cython.int = 0,
 */
  __pyx_t_11 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);

  /* "cytimes/pddt.py":3865
 *         years: cython.int = 0,
 *         quarters: cython.int = 0,
 *         months: cython.int = 0,             # <<<<<<<<<<<<<<
 *         weeks: cython.int = 0,
 *         days: cython.int = 0,
 */
  __pyx_t_3 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cytimes/pddt.py":3866
 *         quarters: cython.int = 0,
 *         months: cython.int = 0,
 *         weeks: cython.int = 0,             # <<<<<<<<<<<<<<
 *         days: cython.int = 0,
 *         hours: cython.int = 0,
 */
  __pyx_t_9 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "cytimes/pddt.py":3867
 *         months: cython.int = 0,
 *         weeks: cython.int = 0,
 *         days: cython.int = 0,             # <<<<<<<<<<<<<<
 *         hours: cython.int = 0,
 *         minutes: cython.int = 0,
 */
  __pyx_t_8 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "cytimes/pddt.py":3868
 *         weeks: cython.int = 0,
 *         days: cython.int = 0,
 *         hours: cython.int = 0,             # <<<<<<<<<<<<<<
 *         minutes: cython.int = 0,
 *         seconds: cython.int = 0,
 */
  __pyx_t_7 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "cytimes/pddt.py":3869
 *         days: cython.int = 0,
 *         hours: cython.int = 0,
 *         minutes: cython.int = 0,             # <<<<<<<<<<<<<<
 *         seconds: cython.int = 0,
 *         milliseconds: cython.int = 0,
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);

  /* "cytimes/pddt.py":3870
 *         hours: cython.int = 0,
 *         minutes: cython.int = 0,
 *         seconds: cython.int = 0,             # <<<<<<<<<<<<<<
 *         milliseconds: cython.int = 0,
 *         microseconds: cython.int = 0,
 */
  __pyx_t_14 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);

  /* "cytimes/pddt.py":3871
 *         minutes: cython.int = 0,
 *         seconds: cython.int = 0,
 *         milliseconds: cython.int = 0,             # <<<<<<<<<<<<<<
 *         microseconds: cython.int = 0,
 *         nanoseconds: cython.int = 0,
 */
  __pyx_t_13 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);

  /* "cytimes/pddt.py":3872
 *         seconds: cython.int = 0,
 *         milliseconds: cython.int = 0,
 *         microseconds: cython.int = 0,             # <<<<<<<<<<<<<<
 *         nanoseconds: cython.int = 0,
 *     ) -> Self:
 */
  __pyx_t_15 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);

  /* "cytimes/pddt.py":3873
 *         milliseconds: cython.int = 0,
 *         microseconds: cython.int = 0,
 *         nanoseconds: cython.int = 0,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Add relative delta to the instance `<'Pddt'>`.
 */
  __pyx_t_16 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);

  /* "cytimes/pddt.py":3861
 * 
 *     # Arithmetic ---------------------------------------------------------------------------
 *     def add(             # <<<<<<<<<<<<<<
 *         self,
 *         years: cython.int = 0,
 */
  __pyx_t_17 = PyTuple_New(11); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_10)) __PYX_ERR(0, 3861, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_11);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_11)) __PYX_ERR(0, 3861, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_t_3)) __PYX_ERR(0, 3861, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 3, __pyx_t_9)) __PYX_ERR(0, 3861, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 4, __pyx_t_8)) __PYX_ERR(0, 3861, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 5, __pyx_t_7)) __PYX_ERR(0, 3861, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_12);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 6, __pyx_t_12)) __PYX_ERR(0, 3861, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_14);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 7, __pyx_t_14)) __PYX_ERR(0, 3861, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_13);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 8, __pyx_t_13)) __PYX_ERR(0, 3861, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_15);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 9, __pyx_t_15)) __PYX_ERR(0, 3861, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_16);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 10, __pyx_t_16)) __PYX_ERR(0, 3861, __pyx_L1_error);
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_3 = 0;
  __pyx_t_9 = 0;
  __pyx_t_8 = 0;
  __pyx_t_7 = 0;
  __pyx_t_12 = 0;
  __pyx_t_14 = 0;
  __pyx_t_13 = 0;
  __pyx_t_15 = 0;
  __pyx_t_16 = 0;
  __pyx_t_16 = __Pyx_PyDict_NewPresized(12); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_years, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3861, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_quarters, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3861, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_months, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3861, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_weeks, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3861, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_days, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3861, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_hours, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3861, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_minutes, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3861, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_seconds, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3861, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_milliseconds, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3861, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_microseconds, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3861, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_nanoseconds, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3861, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 3861, __pyx_L1_error)
  __pyx_t_15 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_233add, 0, __pyx_n_s_Pddt_add, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__230)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_15, __pyx_t_17);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_15, __pyx_t_16);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_add, __pyx_t_15) < 0) __PYX_ERR(0, 3861, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "cytimes/pddt.py":3985
 *     def sub(
 *         self,
 *         years: cython.int = 0,             # <<<<<<<<<<<<<<
 *         quarters: cython.int = 0,
 *         months: cython.int = 0,
 */
  __pyx_t_15 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);

  /* "cytimes/pddt.py":3986
 *         self,
 *         years: cython.int = 0,
 *         quarters: cython.int = 0,             # <<<<<<<<<<<<<<
 *         months: cython.int = 0,
 *         weeks: cython.int = 0,
 */
  __pyx_t_16 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);

  /* "cytimes/pddt.py":3987
 *         years: cython.int = 0,
 *         quarters: cython.int = 0,
 *         months: cython.int = 0,             # <<<<<<<<<<<<<<
 *         weeks: cython.int = 0,
 *         days: cython.int = 0,
 */
  __pyx_t_17 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 3987, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);

  /* "cytimes/pddt.py":3988
 *         quarters: cython.int = 0,
 *         months: cython.int = 0,
 *         weeks: cython.int = 0,             # <<<<<<<<<<<<<<
 *         days: cython.int = 0,
 *         hours: cython.int = 0,
 */
  __pyx_t_13 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);

  /* "cytimes/pddt.py":3989
 *         months: cython.int = 0,
 *         weeks: cython.int = 0,
 *         days: cython.int = 0,             # <<<<<<<<<<<<<<
 *         hours: cython.int = 0,
 *         minutes: cython.int = 0,
 */
  __pyx_t_14 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 3989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);

  /* "cytimes/pddt.py":3990
 *         weeks: cython.int = 0,
 *         days: cython.int = 0,
 *         hours: cython.int = 0,             # <<<<<<<<<<<<<<
 *         minutes: cython.int = 0,
 *         seconds: cython.int = 0,
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);

  /* "cytimes/pddt.py":3991
 *         days: cython.int = 0,
 *         hours: cython.int = 0,
 *         minutes: cython.int = 0,             # <<<<<<<<<<<<<<
 *         seconds: cython.int = 0,
 *         milliseconds: cython.int = 0,
 */
  __pyx_t_7 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "cytimes/pddt.py":3992
 *         hours: cython.int = 0,
 *         minutes: cython.int = 0,
 *         seconds: cython.int = 0,             # <<<<<<<<<<<<<<
 *         milliseconds: cython.int = 0,
 *         microseconds: cython.int = 0,
 */
  __pyx_t_8 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "cytimes/pddt.py":3993
 *         minutes: cython.int = 0,
 *         seconds: cython.int = 0,
 *         milliseconds: cython.int = 0,             # <<<<<<<<<<<<<<
 *         microseconds: cython.int = 0,
 *         nanoseconds: cython.int = 0,
 */
  __pyx_t_9 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "cytimes/pddt.py":3994
 *         seconds: cython.int = 0,
 *         milliseconds: cython.int = 0,
 *         microseconds: cython.int = 0,             # <<<<<<<<<<<<<<
 *         nanoseconds: cython.int = 0,
 *     ) -> Self:
 */
  __pyx_t_3 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cytimes/pddt.py":3995
 *         milliseconds: cython.int = 0,
 *         microseconds: cython.int = 0,
 *         nanoseconds: cython.int = 0,             # <<<<<<<<<<<<<<
 *     ) -> Self:
 *         """Substract relative delta from the instance `<'Pddt'>`.
 */
  __pyx_t_11 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);

  /* "cytimes/pddt.py":3983
 *         return pddt_new_simple(arr, self.tzinfo, None, self.name)
 * 
 *     def sub(             # <<<<<<<<<<<<<<
 *         self,
 *         years: cython.int = 0,
 */
  __pyx_t_10 = PyTuple_New(11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_15);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_15)) __PYX_ERR(0, 3983, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_16);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_16)) __PYX_ERR(0, 3983, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_17);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_17)) __PYX_ERR(0, 3983, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_13);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_13)) __PYX_ERR(0, 3983, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_14);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_14)) __PYX_ERR(0, 3983, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_12);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_12)) __PYX_ERR(0, 3983, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_7)) __PYX_ERR(0, 3983, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_t_8)) __PYX_ERR(0, 3983, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 8, __pyx_t_9)) __PYX_ERR(0, 3983, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 9, __pyx_t_3)) __PYX_ERR(0, 3983, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_11);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 10, __pyx_t_11)) __PYX_ERR(0, 3983, __pyx_L1_error);
  __pyx_t_15 = 0;
  __pyx_t_16 = 0;
  __pyx_t_17 = 0;
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_t_12 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_3 = 0;
  __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyDict_NewPresized(12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_years, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3983, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_quarters, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3983, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_months, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3983, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_weeks, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3983, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_days, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3983, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_hours, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3983, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_minutes, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3983, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_seconds, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3983, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_milliseconds, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3983, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_microseconds, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3983, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_nanoseconds, __pyx_kp_s_cython_int) < 0) __PYX_ERR(0, 3983, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 3983, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_235sub, 0, __pyx_n_s_Pddt_sub, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__232)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_sub, __pyx_t_3) < 0) __PYX_ERR(0, 3983, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":4023
 *         data: object,
 *         unit: str,
 *         absolute: cython.bint = False,             # <<<<<<<<<<<<<<
 *         inclusive: str = "both",
 *     ) -> np.ndarray[np.int64]:
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(((int)0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cytimes/pddt.py":4019
 *         # fmt: on
 * 
 *     def diff(             # <<<<<<<<<<<<<<
 *         self,
 *         data: object,
 */
  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3)) __PYX_ERR(0, 4019, __pyx_L1_error);
  __Pyx_INCREF(((PyObject*)__pyx_n_u_both));
  __Pyx_GIVEREF(((PyObject*)__pyx_n_u_both));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, ((PyObject*)__pyx_n_u_both))) __PYX_ERR(0, 4019, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_data, __pyx_n_s_object) < 0) __PYX_ERR(0, 4019, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_unit, __pyx_n_s_str) < 0) __PYX_ERR(0, 4019, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_absolute, __pyx_kp_s_cython_bint) < 0) __PYX_ERR(0, 4019, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_inclusive, __pyx_n_s_str) < 0) __PYX_ERR(0, 4019, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_np_ndarray_np_int64) < 0) __PYX_ERR(0, 4019, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_237diff, 0, __pyx_n_s_Pddt_diff, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__234)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_t_11);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_diff, __pyx_t_10) < 0) __PYX_ERR(0, 4019, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":4127
 * 
 *     # Comparison ---------------------------------------------------------------------------
 *     def is_past(self) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the datetimes are in the past `<'Index[bool]'>`."""
 *         # Access datetime array & info
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Index_bool) < 0) __PYX_ERR(0, 4127, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_239is_past, 0, __pyx_n_s_Pddt_is_past, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__236)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_is_past, __pyx_t_3) < 0) __PYX_ERR(0, 4127, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":4149
 *         return Index(arr, name="is_past")
 * 
 *     def is_future(self) -> Index[bool]:             # <<<<<<<<<<<<<<
 *         """Determine if the datetimes are in the future `<'Index[bool]'>`."""
 *         # Access datetime array & info
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Index_bool) < 0) __PYX_ERR(0, 4149, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_241is_future, 0, __pyx_n_s_Pddt_is_future, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__237)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_is_future, __pyx_t_10) < 0) __PYX_ERR(0, 4149, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":4171
 *         return Index(arr, name="is_future")
 * 
 *     def closest(self, data: object) -> Self:             # <<<<<<<<<<<<<<
 *         """Find the closest datetime to each of the instance values `<'Pddt'>`.
 * 
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_data, __pyx_n_s_object) < 0) __PYX_ERR(0, 4171, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 4171, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_243closest, 0, __pyx_n_s_Pddt_closest, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__239)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_closest, __pyx_t_3) < 0) __PYX_ERR(0, 4171, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/pddt.py":4227
 *         return pddt_new_simple(arr, pt_tz, None, "closest")
 * 
 *     def farthest(self, dtobjs: object) -> Self:             # <<<<<<<<<<<<<<
 *         """Find the farthest datetime to each of the instance values `<'Pddt'>`.
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtobjs, __pyx_n_s_object) < 0) __PYX_ERR(0, 4227, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Self) < 0) __PYX_ERR(0, 4227, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7cytimes_4pddt_4Pddt_245farthest, 0, __pyx_n_s_Pddt_farthest, NULL, __pyx_n_s_cytimes_pddt, __pyx_d, ((PyObject *)__pyx_codeobj__241)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_farthest, __pyx_t_10) < 0) __PYX_ERR(0, 4227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cytimes/pddt.py":478
 * 
 * # Pddt (Pandas Datetime) ----------------------------------------------------------------------
 * class Pddt(DatetimeIndex):             # <<<<<<<<<<<<<<
 *     """A drop-in replacement for Pandas `<'DatetimeIndex'>`
 *     class, providing additional functionalities for more
 */
  __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_Pddt, __pyx_t_4, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Pddt, __pyx_t_10) < 0) __PYX_ERR(0, 478, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/pddt.py":1
 * # cython: language_level=3             # <<<<<<<<<<<<<<
 * # cython: wraparound=False
 * # cython: boundscheck=False
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(22); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Pddt_to_curr_year_line_1652, __pyx_kp_u_Adjust_the_date_to_the_specified) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Pddt_to_prev_year_line_1725, __pyx_kp_u_Adjust_the_date_to_the_specified_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Pddt_to_next_year_line_1748, __pyx_kp_u_Adjust_the_date_to_the_specified_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Pddt_to_year_line_1771, __pyx_kp_u_Adjust_the_date_to_the_specified_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Pddt_to_curr_quarter_line_1853, __pyx_kp_u_Adjust_the_date_to_the_specified_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Pddt_to_prev_quarter_line_1918, __pyx_kp_u_Adjust_the_date_to_the_specified_6) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Pddt_to_next_quarter_line_1935, __pyx_kp_u_Adjust_the_date_to_the_specified_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Pddt_to_quarter_line_1952, __pyx_kp_u_Adjust_the_date_to_the_specified_8) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Pddt_to_curr_month_line_2028, __pyx_kp_u_Adjust_the_date_to_the_specified_9) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Pddt_to_prev_month_line_2083, __pyx_kp_u_Adjust_the_date_to_the_specified_10) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Pddt_to_next_month_line_2096, __pyx_kp_u_Adjust_the_date_to_the_specified_11) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Pddt_to_month_line_2109, __pyx_kp_u_Adjust_the_date_to_the_specified_12) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Pddt_to_curr_weekday_line_2200, __pyx_kp_u_Adjust_the_date_to_the_specific) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Pddt_to_prev_weekday_line_2214, __pyx_kp_u_Adjust_the_date_to_the_specific_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Pddt_to_next_weekday_line_2228, __pyx_kp_u_Adjust_the_date_to_the_specific_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Pddt_to_weekday_line_2242, __pyx_kp_u_Adjust_the_date_to_the_specific_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Pddt_snap_line_2367, __pyx_kp_u_Snap_to_nearest_occurring_freque) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Pddt_to_datetime_line_2383, __pyx_kp_u_Adjust_the_date_and_time_fields) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Pddt_to_date_line_2527, __pyx_kp_u_Adjust_the_date_with_new_values) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Pddt_to_time_line_2588, __pyx_kp_u_Adjust_the_time_fields_with_new) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Pddt_days_of_month_line_3389, __pyx_kp_u_Return_the_number_of_days_1_31_s) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_Pddt_tz_available_line_3574, __pyx_kp_u_The_available_timezone_names_set) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  if (__pyx_m) {
    if (__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init cytimes.pddt", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    #if !CYTHON_USE_MODULE_STATE
    Py_CLEAR(__pyx_m);
    #else
    Py_DECREF(__pyx_m);
    if (pystate_addmodule_run) {
      PyObject *tp, *value, *tb;
      PyErr_Fetch(&tp, &value, &tb);
      PyState_RemoveModule(&__pyx_moduledef);
      PyErr_Restore(tp, value, tb);
    }
    #endif
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init cytimes.pddt");
  }
  __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
}
/* #### Code section: cleanup_globals ### */
/* #### Code section: cleanup_module ### */
/* #### Code section: main_method ### */
/* #### Code section: utility_code_pragmas ### */
#ifdef _MSC_VER
#pragma warning( push )
/* Warning 4127: conditional expression is constant
 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
 * compile-time, so this warning is not useful
 */
#pragma warning( disable : 4127 )
#endif



/* #### Code section: utility_code_def ### */

/* --- 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

/* 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; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    int result;
    PyObject *exc_type;
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *current_exception = tstate->current_exception;
    if (unlikely(!current_exception)) return 0;
    exc_type = (PyObject*) Py_TYPE(current_exception);
    if (exc_type == err) return 1;
#else
    exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
#endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(exc_type);
    #endif
    if (unlikely(PyTuple_Check(err))) {
        result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    } else {
        result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
    }
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(exc_type);
    #endif
    return result;
}
#endif

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *tmp_value;
    assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
    if (value) {
        #if CYTHON_COMPILING_IN_CPYTHON
        if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
        #endif
            PyException_SetTraceback(value, tb);
    }
    tmp_value = tstate->current_exception;
    tstate->current_exception = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
#else
    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);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject* exc_value;
    exc_value = tstate->current_exception;
    tstate->current_exception = 0;
    *value = exc_value;
    *type = NULL;
    *tb = NULL;
    if (exc_value) {
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        #if CYTHON_COMPILING_IN_CPYTHON
        *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
        Py_XINCREF(*tb);
        #else
        *tb = PyException_GetTraceback(exc_value);
        #endif
    }
#else
    *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
}
#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

/* PyObjectGetAttrStrNoError */
#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
    (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
    return result;
#else
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
#endif
}

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        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;
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_value == NULL || exc_info->exc_value == 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 && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    PyObject *exc_value = exc_info->exc_value;
    if (exc_value == NULL || exc_value == Py_None) {
        *value = NULL;
        *type = NULL;
        *tb = NULL;
    } else {
        *value = exc_value;
        Py_INCREF(*value);
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        *tb = PyException_GetTraceback(exc_value);
    }
  #elif 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;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #endif
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    PyObject *tmp_value = exc_info->exc_value;
    exc_info->exc_value = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
  #else
    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
}
#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 = NULL, *local_value, *local_tb = NULL;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if PY_VERSION_HEX >= 0x030C00A6
    local_value = tstate->current_exception;
    tstate->current_exception = 0;
    if (likely(local_value)) {
        local_type = (PyObject*) Py_TYPE(local_value);
        Py_INCREF(local_type);
        local_tb = PyException_GetTraceback(local_value);
    }
  #else
    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;
  #endif
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
    if (unlikely(tstate->current_exception))
#elif 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;
      #if PY_VERSION_HEX >= 0x030B00a4
        tmp_value = exc_info->exc_value;
        exc_info->exc_value = local_value;
        tmp_type = NULL;
        tmp_tb = NULL;
        Py_XDECREF(local_type);
        Py_XDECREF(local_tb);
      #else
        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;
      #endif
    }
    #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;
}

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    #if PY_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    #endif
    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, PyObject *cause) {
    __Pyx_PyThreadState_declare
    CYTHON_UNUSED_VAR(cause);
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (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 PY_VERSION_HEX >= 0x030C00A6
        PyException_SetTraceback(value, tb);
      #elif CYTHON_FAST_THREAD_STATE
        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);
        }
#else
        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);
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    __Pyx_TypeName obj_type_name;
    __Pyx_TypeName type_name;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    type_name = __Pyx_PyType_GetName(type);
    PyErr_Format(PyExc_TypeError,
                 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
                 obj_type_name, type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
}

/* ModInt[long] */
static CYTHON_INLINE long __Pyx_mod_long(long a, long b) {
    long r = a % b;
    r += ((r != 0) & ((r ^ b) < 0)) * b;
    return r;
}

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
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;
}
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_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
        return NULL;
    }
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
        return NULL;
    }
    #endif
    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

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
    self = __Pyx_CyOrPyCFunction_GET_SELF(func);
    #if PY_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    #endif
    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

/* PyObjectFastCall */
#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
    PyObject *argstuple;
    PyObject *result = 0;
    size_t i;
    argstuple = PyTuple_New((Py_ssize_t)nargs);
    if (unlikely(!argstuple)) return NULL;
    for (i = 0; i < nargs; i++) {
        Py_INCREF(args[i]);
        if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
    }
    result = __Pyx_PyObject_Call(func, argstuple, kwargs);
  bad:
    Py_DECREF(argstuple);
    return result;
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
#if CYTHON_COMPILING_IN_CPYTHON
    if (nargs == 0 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
            return __Pyx_PyObject_CallMethO(func, NULL);
    }
    else if (nargs == 1 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
            return __Pyx_PyObject_CallMethO(func, args[0]);
    }
#endif
    #if PY_VERSION_HEX < 0x030800B1
    #if CYTHON_FAST_PYCCALL
    if (PyCFunction_Check(func)) {
        if (kwargs) {
            return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
        } else {
            return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
        }
    }
    #if PY_VERSION_HEX >= 0x030700A1
    if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
        return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
    }
    #endif
    #endif
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
    }
    #endif
    #endif
    if (kwargs == NULL) {
        #if CYTHON_VECTORCALL
        #if PY_VERSION_HEX < 0x03090000
        vectorcallfunc f = _PyVectorcall_Function(func);
        #else
        vectorcallfunc f = PyVectorcall_Function(func);
        #endif
        if (f) {
            return f(func, args, (size_t)nargs, NULL);
        }
        #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
        if (__Pyx_CyFunction_CheckExact(func)) {
            __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
            if (f) return f(func, args, (size_t)nargs, NULL);
        }
        #endif
    }
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
    }
    #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
    #else
    return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
    #endif
}

/* PyObjectCallOneArg */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *args[2] = {NULL, arg};
    return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* SwapException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_value = exc_info->exc_value;
    exc_info->exc_value = *value;
    if (tmp_value == NULL || tmp_value == Py_None) {
        Py_XDECREF(tmp_value);
        tmp_value = NULL;
        tmp_type = NULL;
        tmp_tb = NULL;
    } else {
        tmp_type = (PyObject*) Py_TYPE(tmp_value);
        Py_INCREF(tmp_type);
        #if CYTHON_COMPILING_IN_CPYTHON
        tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
        Py_XINCREF(tmp_tb);
        #else
        tmp_tb = PyException_GetTraceback(tmp_value);
        #endif
    }
  #elif 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
    *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

/* DivInt[long] */
static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
    long q = a / b;
    long r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* CIntToDigits */
static const char DIGIT_PAIRS_10[2*10*10+1] = {
    "00010203040506070809"
    "10111213141516171819"
    "20212223242526272829"
    "30313233343536373839"
    "40414243444546474849"
    "50515253545556575859"
    "60616263646566676869"
    "70717273747576777879"
    "80818283848586878889"
    "90919293949596979899"
};
static const char DIGIT_PAIRS_8[2*8*8+1] = {
    "0001020304050607"
    "1011121314151617"
    "2021222324252627"
    "3031323334353637"
    "4041424344454647"
    "5051525354555657"
    "6061626364656667"
    "7071727374757677"
};
static const char DIGITS_HEX[2*16+1] = {
    "0123456789abcdef"
    "0123456789ABCDEF"
};

/* BuildPyUnicode */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
                                                int prepend_sign, char padding_char) {
    PyObject *uval;
    Py_ssize_t uoffset = ulength - clength;
#if CYTHON_USE_UNICODE_INTERNALS
    Py_ssize_t i;
#if CYTHON_PEP393_ENABLED
    void *udata;
    uval = PyUnicode_New(ulength, 127);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_DATA(uval);
#else
    Py_UNICODE *udata;
    uval = PyUnicode_FromUnicode(NULL, ulength);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_AS_UNICODE(uval);
#endif
    if (uoffset > 0) {
        i = 0;
        if (prepend_sign) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
            i++;
        }
        for (; i < uoffset; i++) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
        }
    }
    for (i=0; i < clength; i++) {
        __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
    }
#else
    {
        PyObject *sign = NULL, *padding = NULL;
        uval = NULL;
        if (uoffset > 0) {
            prepend_sign = !!prepend_sign;
            if (uoffset > prepend_sign) {
                padding = PyUnicode_FromOrdinal(padding_char);
                if (likely(padding) && uoffset > prepend_sign + 1) {
                    PyObject *tmp;
                    PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign);
                    if (unlikely(!repeat)) goto done_or_error;
                    tmp = PyNumber_Multiply(padding, repeat);
                    Py_DECREF(repeat);
                    Py_DECREF(padding);
                    padding = tmp;
                }
                if (unlikely(!padding)) goto done_or_error;
            }
            if (prepend_sign) {
                sign = PyUnicode_FromOrdinal('-');
                if (unlikely(!sign)) goto done_or_error;
            }
        }
        uval = PyUnicode_DecodeASCII(chars, clength, NULL);
        if (likely(uval) && padding) {
            PyObject *tmp = PyNumber_Add(padding, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
        if (likely(uval) && sign) {
            PyObject *tmp = PyNumber_Add(sign, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
done_or_error:
        Py_XDECREF(padding);
        Py_XDECREF(sign);
    }
#endif
    return uval;
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(int)*3+2];
    char *dpos, *end = digits + sizeof(int)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    int remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (int) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (int) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (int) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind, kind_shift;
    Py_ssize_t i, char_pos;
    void *result_udata;
    CYTHON_MAYBE_UNUSED_VAR(max_char);
#if CYTHON_PEP393_ENABLED
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_DATA(result_uval);
#else
    result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = sizeof(Py_UNICODE);
    kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_AS_UNICODE(result_uval);
#endif
    assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
        if (unlikely(__Pyx_PyUnicode_READY(uval)))
            goto bad;
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        if (unlikely(!ulength))
            continue;
        if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
            memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
        } else {
            #if PY_VERSION_HEX >= 0x030d0000
            if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
            #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    CYTHON_UNUSED_VAR(max_char);
    CYTHON_UNUSED_VAR(result_ulength);
    CYTHON_UNUSED_VAR(value_count);
    return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
#endif
}

/* DivInt[PY_LONG_LONG] */
static CYTHON_INLINE PY_LONG_LONG __Pyx_div_PY_LONG_LONG(PY_LONG_LONG a, PY_LONG_LONG b) {
    PY_LONG_LONG q = a / b;
    PY_LONG_LONG r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* ModInt[PY_LONG_LONG] */
static CYTHON_INLINE PY_LONG_LONG __Pyx_mod_PY_LONG_LONG(PY_LONG_LONG a, PY_LONG_LONG b) {
    PY_LONG_LONG r = a % b;
    r += ((r != 0) & ((r ^ b) < 0)) * b;
    return r;
}

/* RaiseUnexpectedTypeError */
static int
__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
{
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
                 expected, obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* PyUnicode_Unicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj) {
    if (unlikely(obj == Py_None))
        obj = __pyx_kp_u_None;
    return __Pyx_NewRef(obj);
}

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    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_VERSION_HEX < 0x030B0000)
            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 || CYTHON_COMPILING_IN_LIMITED_API
    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
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_PY_LONG_LONG(PY_LONG_LONG value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(PY_LONG_LONG)*3+2];
    char *dpos, *end = digits + sizeof(PY_LONG_LONG)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    PY_LONG_LONG remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (PY_LONG_LONG) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (PY_LONG_LONG) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (PY_LONG_LONG) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (unlikely(!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 {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (mm && mm->mp_subscript) {
            PyObject *r, *key = PyInt_FromSsize_t(i);
            if (unlikely(!key)) return NULL;
            r = mm->mp_subscript(o, key);
            Py_DECREF(key);
            return r;
        }
        if (likely(sm && sm->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return sm->sq_item(o, i);
        }
    }
#else
    if (is_list || !PyMapping_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 = NULL;
    Py_ssize_t key_value;
    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)) {
        __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index));
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError,
            "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
        __Pyx_DECREF_TypeName(index_type_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
    __Pyx_TypeName obj_type_name;
    if (likely(PyType_Check(obj))) {
        PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem);
        if (!meth) {
            PyErr_Clear();
        } else {
            PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
            Py_DECREF(meth);
            return result;
        }
    }
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
    PyTypeObject *tp = Py_TYPE(obj);
    PyMappingMethods *mm = tp->tp_as_mapping;
    PySequenceMethods *sm = tp->tp_as_sequence;
    if (likely(mm && mm->mp_subscript)) {
        return mm->mp_subscript(obj, key);
    }
    if (likely(sm && sm->sq_item)) {
        return __Pyx_PyObject_GetIndex(obj, key);
    }
    return __Pyx_PyObject_GetItem_Slow(obj, key);
}
#endif

/* DivInt[npy_int64] */
static CYTHON_INLINE npy_int64 __Pyx_div_npy_int64(npy_int64 a, npy_int64 b) {
    npy_int64 q = a / b;
    npy_int64 r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* ModInt[npy_int64] */
static CYTHON_INLINE npy_int64 __Pyx_mod_npy_int64(npy_int64 a, npy_int64 b) {
    npy_int64 r = a % b;
    r += ((r != 0) & ((r ^ b) < 0)) * b;
    return r;
}

/* PyObjectFormatAndDecref */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyString_CheckExact(s))) {
        PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
        Py_DECREF(s);
        return result;
    }
    #endif
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result;
    if (unlikely(!s)) return NULL;
    result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* RaiseUnboundLocalError */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* 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 && PY_VERSION_HEX < 0x030d0000
    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;
    }
#elif CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(!__pyx_m)) {
        return NULL;
    }
    result = PyObject_GetAttr(__pyx_m, name);
    if (likely(result)) {
        return result;
    }
#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);
}

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
        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);
}
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (cls == a || cls == b) return 1;
    mro = cls->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            PyObject *base = PyTuple_GET_ITEM(mro, i);
            if (base == (PyObject *)a || base == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, 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) {
    if (exc_type1) {
        return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
    } else {
        return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
}
#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<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* UnpackUnboundCMethod */
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
    PyObject *result;
    PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
    if (unlikely(!selfless_args)) return NULL;
    result = PyObject_Call(method, selfless_args, kwargs);
    Py_DECREF(selfless_args);
    return result;
}
static PyMethodDef __Pyx_UnboundCMethod_Def = {
     "CythonUnboundCMethod",
     __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
     METH_VARARGS | METH_KEYWORDS,
     NULL
};
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)))
    #else
    if (likely(!__Pyx_CyOrPyCFunction_Check(method)))
    #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);
    } else
#endif
#if CYTHON_COMPILING_IN_PYPY
#else
    if (PyCFunction_Check(method))
#endif
    {
        PyObject *self;
        int self_found;
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        self = PyObject_GetAttrString(method, "__self__");
        if (!self) {
            PyErr_Clear();
        }
#else
        self = PyCFunction_GET_SELF(method);
#endif
        self_found = (self && self != Py_None);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        Py_XDECREF(self);
#endif
        if (self_found) {
            PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
            if (unlikely(!unbound_method)) return -1;
            Py_DECREF(method);
            target->method = unbound_method;
        }
    }
    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;
}

/* TupleAndListFromArray */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *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_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        Py_INCREF(__pyx_empty_tuple);
        return __pyx_empty_tuple;
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
    return res;
}
static CYTHON_INLINE PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return PyList_New(0);
    }
    res = PyList_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
    return res;
}
#endif

/* fastcall */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
{
    Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
    for (i = 0; i < n; i++)
    {
        if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
        if (unlikely(eq != 0)) {
            if (unlikely(eq < 0)) return NULL;
            return kwvalues[i];
        }
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
    Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
    PyObject *dict;
    dict = PyDict_New();
    if (unlikely(!dict))
        return NULL;
    for (i=0; i<nkwargs; i++) {
        PyObject *key = PyTuple_GET_ITEM(kwnames, i);
        if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
            goto bad;
    }
    return dict;
bad:
    Py_DECREF(dict);
    return NULL;
}
#endif
#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 *const *kwvalues,
    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;
    int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds));
    while (1) {
        Py_XDECREF(key); key = NULL;
        Py_XDECREF(value); value = NULL;
        if (kwds_is_tuple) {
            Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(kwds);
#else
            size = PyTuple_Size(kwds);
            if (size < 0) goto bad;
#endif
            if (pos >= size) break;
#if CYTHON_AVOID_BORROWED_REFS
            key = __Pyx_PySequence_ITEM(kwds, pos);
            if (!key) goto bad;
#elif CYTHON_ASSUME_SAFE_MACROS
            key = PyTuple_GET_ITEM(kwds, pos);
#else
            key = PyTuple_GetItem(kwds, pos);
            if (!key) goto bad;
#endif
            value = kwvalues[pos];
            pos++;
        }
        else
        {
            if (!PyDict_Next(kwds, &pos, &key, &value)) break;
#if CYTHON_AVOID_BORROWED_REFS
            Py_INCREF(key);
#endif
        }
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
#if CYTHON_AVOID_BORROWED_REFS
            Py_INCREF(value);
            Py_DECREF(key);
#endif
            key = NULL;
            value = NULL;
            continue;
        }
#if !CYTHON_AVOID_BORROWED_REFS
        Py_INCREF(key);
#endif
        Py_INCREF(value);
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (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;
#if CYTHON_AVOID_BORROWED_REFS
                    value = NULL;
#endif
                    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 = (
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key)
                );
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
#if CYTHON_AVOID_BORROWED_REFS
                    value = NULL;
#endif
                    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
                        (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(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;
        }
    }
    Py_XDECREF(key);
    Py_XDECREF(value);
    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:
    #if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_TypeError,
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    Py_XDECREF(key);
    Py_XDECREF(value);
    return -1;
}

/* ArgTypeTest */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    __Pyx_TypeName type_name;
    __Pyx_TypeName obj_type_name;
    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;
    }
    type_name = __Pyx_PyType_GetName(type);
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
        ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name);
    __Pyx_DECREF_TypeName(type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* pybytes_as_double */
static double __Pyx_SlowPyString_AsDouble(PyObject *obj) {
    PyObject *float_value;
#if PY_MAJOR_VERSION >= 3
    float_value = PyFloat_FromString(obj);
#else
    float_value = PyFloat_FromString(obj, 0);
#endif
    if (likely(float_value)) {
#if CYTHON_ASSUME_SAFE_MACROS
        double value = PyFloat_AS_DOUBLE(float_value);
#else
        double value = PyFloat_AsDouble(float_value);
#endif
        Py_DECREF(float_value);
        return value;
    }
    return (double)-1;
}
static const char* __Pyx__PyBytes_AsDouble_Copy(const char* start, char* buffer, Py_ssize_t length) {
    int last_was_punctuation = 1;
    Py_ssize_t i;
    for (i=0; i < length; i++) {
        char chr = start[i];
        int is_punctuation = (chr == '_') | (chr == '.') | (chr == 'e') | (chr == 'E');
        *buffer = chr;
        buffer += (chr != '_');
        if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure;
        last_was_punctuation = is_punctuation;
    }
    if (unlikely(last_was_punctuation)) goto parse_failure;
    *buffer = '\0';
    return buffer;
parse_failure:
    return NULL;
}
static double __Pyx__PyBytes_AsDouble_inf_nan(const char* start, Py_ssize_t length) {
    int matches = 1;
    char sign = start[0];
    int is_signed = (sign == '+') | (sign == '-');
    start += is_signed;
    length -= is_signed;
    switch (start[0]) {
        #ifdef Py_NAN
        case 'n':
        case 'N':
            if (unlikely(length != 3)) goto parse_failure;
            matches &= (start[1] == 'a' || start[1] == 'A');
            matches &= (start[2] == 'n' || start[2] == 'N');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_NAN : Py_NAN;
        #endif
        case 'i':
        case 'I':
            if (unlikely(length < 3)) goto parse_failure;
            matches &= (start[1] == 'n' || start[1] == 'N');
            matches &= (start[2] == 'f' || start[2] == 'F');
            if (likely(length == 3 && matches))
                return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
            if (unlikely(length != 8)) goto parse_failure;
            matches &= (start[3] == 'i' || start[3] == 'I');
            matches &= (start[4] == 'n' || start[4] == 'N');
            matches &= (start[5] == 'i' || start[5] == 'I');
            matches &= (start[6] == 't' || start[6] == 'T');
            matches &= (start[7] == 'y' || start[7] == 'Y');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
        case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
            break;
        default:
            goto parse_failure;
    }
    return 0.0;
parse_failure:
    return -1.0;
}
static CYTHON_INLINE int __Pyx__PyBytes_AsDouble_IsSpace(char ch) {
    return (ch == 0x20) | !((ch < 0x9) | (ch > 0xd));
}
CYTHON_UNUSED static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length) {
    double value;
    Py_ssize_t i, digits;
    const char *last = start + length;
    char *end;
    while (__Pyx__PyBytes_AsDouble_IsSpace(*start))
        start++;
    while (start < last - 1 && __Pyx__PyBytes_AsDouble_IsSpace(last[-1]))
        last--;
    length = last - start;
    if (unlikely(length <= 0)) goto fallback;
    value = __Pyx__PyBytes_AsDouble_inf_nan(start, length);
    if (unlikely(value == -1.0)) goto fallback;
    if (value != 0.0) return value;
    digits = 0;
    for (i=0; i < length; digits += start[i++] != '_');
    if (likely(digits == length)) {
        value = PyOS_string_to_double(start, &end, NULL);
    } else if (digits < 40) {
        char number[40];
        last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
        if (unlikely(!last)) goto fallback;
        value = PyOS_string_to_double(number, &end, NULL);
    } else {
        char *number = (char*) PyMem_Malloc((digits + 1) * sizeof(char));
        if (unlikely(!number)) goto fallback;
        last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
        if (unlikely(!last)) {
            PyMem_Free(number);
            goto fallback;
        }
        value = PyOS_string_to_double(number, &end, NULL);
        PyMem_Free(number);
    }
    if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) {
        return value;
    }
fallback:
    return __Pyx_SlowPyString_AsDouble(obj);
}

/* pyobject_as_double */
static double __Pyx__PyObject_AsDouble(PyObject* obj) {
    if (PyUnicode_CheckExact(obj)) {
        return __Pyx_PyUnicode_AsDouble(obj);
    } else if (PyBytes_CheckExact(obj)) {
        return __Pyx_PyBytes_AsDouble(obj);
    } else if (PyByteArray_CheckExact(obj)) {
        return __Pyx_PyByteArray_AsDouble(obj);
    } else {
        PyObject* float_value;
#if !CYTHON_USE_TYPE_SLOTS
        float_value = PyNumber_Float(obj);  if ((0)) goto bad;
        (void)__Pyx_PyObject_CallOneArg;
#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))) {
                __Pyx_TypeName float_value_type_name = __Pyx_PyType_GetName(Py_TYPE(float_value));
                PyErr_Format(PyExc_TypeError,
                    "__float__ returned non-float (type " __Pyx_FMT_TYPENAME ")",
                    float_value_type_name);
                __Pyx_DECREF_TypeName(float_value_type_name);
                Py_DECREF(float_value);
                goto bad;
            }
        } else {
            float_value = __Pyx_PyObject_CallOneArg((PyObject*)&PyFloat_Type, obj);
        }
#endif
        if (likely(float_value)) {
            double value = PyFloat_AS_DOUBLE(float_value);
            Py_DECREF(float_value);
            return value;
        }
    }
bad:
    return (double)-1;
}

/* 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);
            #endif
        } 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 || PYPY_VERSION_NUM >= 0x07020000)
    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;
}

/* RaiseClosureNameError */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* FixUpExtensionType */
#if CYTHON_USE_TYPE_SPECS
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED_VAR(spec);
    CYTHON_UNUSED_VAR(type);
#else
    const PyType_Slot *slot = spec->slots;
    while (slot && slot->slot && slot->slot != Py_tp_members)
        slot++;
    if (slot && slot->slot == Py_tp_members) {
        int changed = 0;
#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
        const
#endif
            PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
        while (memb && memb->name) {
            if (memb->name[0] == '_' && memb->name[1] == '_') {
#if PY_VERSION_HEX < 0x030900b1
                if (strcmp(memb->name, "__weaklistoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_weaklistoffset = memb->offset;
                    changed = 1;
                }
                else if (strcmp(memb->name, "__dictoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_dictoffset = memb->offset;
                    changed = 1;
                }
#if CYTHON_METH_FASTCALL
                else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
#if PY_VERSION_HEX >= 0x030800b4
                    type->tp_vectorcall_offset = memb->offset;
#else
                    type->tp_print = (printfunc) memb->offset;
#endif
                    changed = 1;
                }
#endif
#else
                if ((0));
#endif
#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
                else if (strcmp(memb->name, "__module__") == 0) {
                    PyObject *descr;
                    assert(memb->type == T_OBJECT);
                    assert(memb->flags == 0 || memb->flags == READONLY);
                    descr = PyDescr_NewMember(type, memb);
                    if (unlikely(!descr))
                        return -1;
                    if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
                        Py_DECREF(descr);
                        return -1;
                    }
                    Py_DECREF(descr);
                    changed = 1;
                }
#endif
            }
            memb++;
        }
        if (changed)
            PyType_Modified(type);
    }
#endif
    return 0;
}
#endif

/* FetchSharedCythonModule */
static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
}

/* FetchCommonType */
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t basicsize,
                               Py_ssize_t expected_basicsize) {
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
    if (basicsize != expected_basicsize) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}
#if !CYTHON_USE_TYPE_SPECS
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* abi_module;
    const char* object_name;
    PyTypeObject *cached_type = NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) return NULL;
    object_name = strrchr(type->tp_name, '.');
    object_name = object_name ? object_name+1 : type->tp_name;
    cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name);
    if (cached_type) {
        if (__Pyx_VerifyCachedType(
              (PyObject *)cached_type,
              object_name,
              cached_type->tp_basicsize,
              type->tp_basicsize) < 0) {
            goto bad;
        }
        goto done;
    }
    if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
    PyErr_Clear();
    if (PyType_Ready(type) < 0) goto bad;
    if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0)
        goto bad;
    Py_INCREF(type);
    cached_type = type;
done:
    Py_DECREF(abi_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}
#else
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module, *cached_type = NULL;
    const char* object_name = strrchr(spec->name, '.');
    object_name = object_name ? object_name+1 : spec->name;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) return NULL;
    cached_type = PyObject_GetAttrString(abi_module, object_name);
    if (cached_type) {
        Py_ssize_t basicsize;
#if CYTHON_COMPILING_IN_LIMITED_API
        PyObject *py_basicsize;
        py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
        if (unlikely(!py_basicsize)) goto bad;
        basicsize = PyLong_AsSsize_t(py_basicsize);
        Py_DECREF(py_basicsize);
        py_basicsize = 0;
        if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
#else
        basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1;
#endif
        if (__Pyx_VerifyCachedType(
              cached_type,
              object_name,
              basicsize,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    }
    if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
    PyErr_Clear();
    CYTHON_UNUSED_VAR(module);
    cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
    if (unlikely(!cached_type)) goto bad;
    if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
    if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad;
done:
    Py_DECREF(abi_module);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}
#endif

/* PyVectorcallFastCallDict */
#if CYTHON_METH_FASTCALL
static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    PyObject *res = NULL;
    PyObject *kwnames;
    PyObject **newargs;
    PyObject **kwvalues;
    Py_ssize_t i, pos;
    size_t j;
    PyObject *key, *value;
    unsigned long keys_are_strings;
    Py_ssize_t nkw = PyDict_GET_SIZE(kw);
    newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
    if (unlikely(newargs == NULL)) {
        PyErr_NoMemory();
        return NULL;
    }
    for (j = 0; j < nargs; j++) newargs[j] = args[j];
    kwnames = PyTuple_New(nkw);
    if (unlikely(kwnames == NULL)) {
        PyMem_Free(newargs);
        return NULL;
    }
    kwvalues = newargs + nargs;
    pos = i = 0;
    keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
    while (PyDict_Next(kw, &pos, &key, &value)) {
        keys_are_strings &= Py_TYPE(key)->tp_flags;
        Py_INCREF(key);
        Py_INCREF(value);
        PyTuple_SET_ITEM(kwnames, i, key);
        kwvalues[i] = value;
        i++;
    }
    if (unlikely(!keys_are_strings)) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        goto cleanup;
    }
    res = vc(func, newargs, nargs, kwnames);
cleanup:
    Py_DECREF(kwnames);
    for (i = 0; i < nkw; i++)
        Py_DECREF(kwvalues[i]);
    PyMem_Free(newargs);
    return res;
}
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
        return vc(func, args, nargs, NULL);
    }
    return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
}
#endif

/* CythonFunctionShared */
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
    if (__Pyx_CyFunction_Check(func)) {
        return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
    } else if (PyCFunction_Check(func)) {
        return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
    }
    return 0;
}
#else
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
    return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
}
#endif
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    __Pyx_Py_XDECREF_SET(
        __Pyx_CyFunction_GetClassObj(f),
            ((classobj) ? __Pyx_NewRef(classobj) : NULL));
#else
    __Pyx_Py_XDECREF_SET(
        ((PyCMethodObject *) (f))->mm_class,
        (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
#endif
}
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
{
    CYTHON_UNUSED_VAR(closure);
    if (unlikely(op->func_doc == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
        if (unlikely(!op->func_doc)) return NULL;
#else
        if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
#endif
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_doc, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(op->func_name == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_name = PyObject_GetAttrString(op->func, "__name__");
#elif PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->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, void *context)
{
    CYTHON_UNUSED_VAR(context);
#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;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_name, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#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;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_qualname, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(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, void *context)
{
    CYTHON_UNUSED_VAR(context);
    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;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_dict, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(op);
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    CYTHON_UNUSED_VAR(context);
    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 = __Pyx_PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = __Pyx_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, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->defaults_tuple;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__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, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->defaults_kwdict;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__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, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value || value == Py_None) {
        value = NULL;
    } else if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_annotations, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->func_annotations;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
    int is_coroutine;
    CYTHON_UNUSED_VAR(context);
    if (op->func_is_coroutine) {
        return __Pyx_NewRef(op->func_is_coroutine);
    }
    is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
#if PY_VERSION_HEX >= 0x03050000
    if (is_coroutine) {
        PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
        fromlist = PyList_New(1);
        if (unlikely(!fromlist)) return NULL;
        Py_INCREF(marker);
#if CYTHON_ASSUME_SAFE_MACROS
        PyList_SET_ITEM(fromlist, 0, marker);
#else
        if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
            Py_DECREF(marker);
            Py_DECREF(fromlist);
            return NULL;
        }
#endif
        module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
        if (unlikely(!module)) goto ignore;
        op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
        Py_DECREF(module);
        if (likely(op->func_is_coroutine)) {
            return __Pyx_NewRef(op->func_is_coroutine);
        }
ignore:
        PyErr_Clear();
    }
#endif
    op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
    return __Pyx_NewRef(op->func_is_coroutine);
}
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *
__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_GetAttrString(op->func, "__module__");
}
static int
__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_SetAttrString(op->func, "__module__", value);
}
#endif
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 *) "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},
    {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
#if !CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
#endif
#if CYTHON_USE_TYPE_SPECS
    {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
#if CYTHON_METH_FASTCALL
#if CYTHON_BACKPORT_VECTORCALL
    {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
#else
#if !CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
#endif
#endif
#endif
#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
#else
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
#endif
#endif
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
{
    CYTHON_UNUSED_VAR(args);
#if PY_MAJOR_VERSION >= 3
    Py_INCREF(m->func_qualname);
    return m->func_qualname;
#else
    return PyString_FromString(((PyCFunctionObject*)m)->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 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyCFunctionObject *cf = (PyCFunctionObject*) op;
#endif
    if (unlikely(op == NULL))
        return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
    if (unlikely(!op->func)) return NULL;
#endif
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
#if !CYTHON_COMPILING_IN_LIMITED_API
    cf->m_ml = ml;
    cf->m_self = (PyObject *) op;
#endif
    Py_XINCREF(closure);
    op->func_closure = closure;
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_XINCREF(module);
    cf->m_module = module;
#endif
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_classobj = NULL;
#else
    ((PyCMethodObject*)op)->mm_class = NULL;
#endif
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults_size = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    op->func_is_coroutine = NULL;
#if CYTHON_METH_FASTCALL
    switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
    case METH_NOARGS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
        break;
    case METH_O:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
        break;
    case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
        break;
    case METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
        break;
    case METH_VARARGS | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = NULL;
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        Py_DECREF(op);
        return NULL;
    }
#endif
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func);
#else
    Py_CLEAR(((PyCFunctionObject*)m)->m_module);
#endif
    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);
#if !CYTHON_COMPILING_IN_LIMITED_API
#if PY_VERSION_HEX < 0x030900B1
    Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
#else
    {
        PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
        ((PyCMethodObject *) (m))->mm_class = NULL;
        Py_XDECREF(cls);
    }
#endif
#endif
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    Py_CLEAR(m->func_is_coroutine);
    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);
    __Pyx_PyHeapTypeObject_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);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func);
#else
    Py_VISIT(((PyCFunctionObject*)m)->m_module);
#endif
    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);
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
#endif
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    Py_VISIT(m->func_is_coroutine);
    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_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
    PyObject *py_name = NULL;
    PyCFunction meth;
    int flags;
    meth = PyCFunction_GetFunction(f);
    if (unlikely(!meth)) return NULL;
    flags = PyCFunction_GetFlags(f);
    if (unlikely(flags < 0)) return NULL;
#else
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    int flags = f->m_ml->ml_flags;
#endif
    Py_ssize_t size;
    switch (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)) {
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 0))
                return (*meth)(self, NULL);
#if CYTHON_COMPILING_IN_LIMITED_API
            py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
            if (!py_name) return NULL;
            PyErr_Format(PyExc_TypeError,
                "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                py_name, size);
            Py_DECREF(py_name);
#else
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
#endif
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = __Pyx_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;
            }
#if CYTHON_COMPILING_IN_LIMITED_API
            py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
            if (!py_name) return NULL;
            PyErr_Format(PyExc_TypeError,
                "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                py_name, size);
            Py_DECREF(py_name);
#else
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
#endif
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        return NULL;
    }
#if CYTHON_COMPILING_IN_LIMITED_API
    py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
    if (!py_name) return NULL;
    PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments",
                 py_name);
    Py_DECREF(py_name);
#else
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
#endif
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *self, *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
    if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
    self = ((PyCFunctionObject*)func)->m_self;
#endif
    result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
    return result;
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
#if CYTHON_METH_FASTCALL
     __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
    if (vc) {
#if CYTHON_ASSUME_SAFE_MACROS
        return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
#else
        (void) &__Pyx_PyVectorcall_FastCallDict;
        return PyVectorcall_Call(func, args, kw);
#endif
    }
#endif
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
#if CYTHON_ASSUME_SAFE_MACROS
        argc = PyTuple_GET_SIZE(args);
#else
        argc = PyTuple_Size(args);
        if (unlikely(!argc) < 0) return NULL;
#endif
        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);
#if PY_MAJOR_VERSION > 2
            PyErr_Format(PyExc_TypeError,
                         "unbound method %.200S() needs an argument",
                         cyfunc->func_qualname);
#else
            PyErr_SetString(PyExc_TypeError,
                            "unbound method needs an argument");
#endif
            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;
}
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
{
    int ret = 0;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        if (unlikely(nargs < 1)) {
            PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
                         ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
            return -1;
        }
        ret = 1;
    }
    if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
        PyErr_Format(PyExc_TypeError,
                     "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
        return -1;
    }
    return ret;
}
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 0)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
            def->ml_name, nargs);
        return NULL;
    }
    return def->ml_meth(self, NULL);
}
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 1)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
            def->ml_name, nargs);
        return NULL;
    }
    return def->ml_meth(self, args[0]);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
    PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames);
}
#endif
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_CyFunctionType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
    {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
    {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
    {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
    {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
    {Py_tp_methods, (void *)__pyx_CyFunction_methods},
    {Py_tp_members, (void *)__pyx_CyFunction_members},
    {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
    {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
    {0, 0},
};
static PyType_Spec __pyx_CyFunctionType_spec = {
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL)
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    __pyx_CyFunctionType_slots
};
#else
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
#if !CYTHON_METH_FASTCALL
    0,
#elif CYTHON_BACKPORT_VECTORCALL
    (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
#else
    offsetof(PyCFunctionObject, vectorcall),
#endif
    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,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    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_PyMethod_New,
    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 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
    0,
#endif
#if __PYX_NEED_TP_PRINT_SLOT
    0,
#endif
#if PY_VERSION_HEX >= 0x030C0000
    0,
#endif
#if PY_VERSION_HEX >= 0x030d00A4
    0,
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
    0,
#endif
};
#endif
static int __pyx_CyFunction_init(PyObject *module) {
#if CYTHON_USE_TYPE_SPECS
    __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
#else
    CYTHON_UNUSED_VAR(module);
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
#endif
    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;
    m->defaults_size = size;
    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);
}

/* CythonFunction */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(Py_ssize_t)*3+2];
    char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    Py_ssize_t remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (Py_ssize_t) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (Py_ssize_t) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (Py_ssize_t) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* PyObjectCallNoArg */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
    PyObject *arg[2] = {NULL, NULL};
    return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* 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
    __Pyx_TypeName type_name;
    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 defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
        if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
#elif PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || __Pyx_IS_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 (likely(descr != NULL)) {
        *method = descr;
        return 0;
    }
    type_name = __Pyx_PyType_GetName(tp);
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, name);
#else
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
                 type_name, PyString_AS_STRING(name));
#endif
    __Pyx_DECREF_TypeName(type_name);
    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;
}

/* PyObjectCallMethod0 */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* ValidateBasesTuple */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
    Py_ssize_t i, n;
#if CYTHON_ASSUME_SAFE_MACROS
    n = PyTuple_GET_SIZE(bases);
#else
    n = PyTuple_Size(bases);
    if (n < 0) return -1;
#endif
    for (i = 1; i < n; i++)
    {
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *b0 = PySequence_GetItem(bases, i);
        if (!b0) return -1;
#elif CYTHON_ASSUME_SAFE_MACROS
        PyObject *b0 = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *b0 = PyTuple_GetItem(bases, i);
        if (!b0) return -1;
#endif
        PyTypeObject *b;
#if PY_MAJOR_VERSION < 3
        if (PyClass_Check(b0))
        {
            PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class",
                         PyString_AS_STRING(((PyClassObject*)b0)->cl_name));
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
#endif
        b = (PyTypeObject*) b0;
        if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
        {
            __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
            PyErr_Format(PyExc_TypeError,
                "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
            __Pyx_DECREF_TypeName(b_name);
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
        if (dictoffset == 0)
        {
            Py_ssize_t b_dictoffset = 0;
#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
            b_dictoffset = b->tp_dictoffset;
#else
            PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
            if (!py_b_dictoffset) goto dictoffset_return;
            b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
            Py_DECREF(py_b_dictoffset);
            if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
#endif
            if (b_dictoffset) {
                {
                    __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
                    PyErr_Format(PyExc_TypeError,
                        "extension type '%.200s' has no __dict__ slot, "
                        "but base type '" __Pyx_FMT_TYPENAME "' has: "
                        "either add 'cdef dict __dict__' to the extension type "
                        "or add '__slots__ = [...]' to the base type",
                        type_name, b_name);
                    __Pyx_DECREF_TypeName(b_name);
                }
#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY)
              dictoffset_return:
#endif
#if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(b0);
#endif
                return -1;
            }
        }
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(b0);
#endif
    }
    return 0;
}
#endif

/* PyType_Ready */
static int __Pyx_PyType_Ready(PyTypeObject *t) {
#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION)
    (void)__Pyx_PyObject_CallMethod0;
#if CYTHON_USE_TYPE_SPECS
    (void)__Pyx_validate_bases_tuple;
#endif
    return PyType_Ready(t);
#else
    int r;
    PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
    if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
        return -1;
#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
    {
        int gc_was_enabled;
    #if PY_VERSION_HEX >= 0x030A00b1
        gc_was_enabled = PyGC_Disable();
        (void)__Pyx_PyObject_CallMethod0;
    #else
        PyObject *ret, *py_status;
        PyObject *gc = NULL;
        #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400)
        gc = PyImport_GetModule(__pyx_kp_u_gc);
        #endif
        if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc);
        if (unlikely(!gc)) return -1;
        py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled);
        if (unlikely(!py_status)) {
            Py_DECREF(gc);
            return -1;
        }
        gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
        Py_DECREF(py_status);
        if (gc_was_enabled > 0) {
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable);
            if (unlikely(!ret)) {
                Py_DECREF(gc);
                return -1;
            }
            Py_DECREF(ret);
        } else if (unlikely(gc_was_enabled == -1)) {
            Py_DECREF(gc);
            return -1;
        }
    #endif
        t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
#if PY_VERSION_HEX >= 0x030A0000
        t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
#endif
#else
        (void)__Pyx_PyObject_CallMethod0;
#endif
    r = PyType_Ready(t);
#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
        t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
    #if PY_VERSION_HEX >= 0x030A00b1
        if (gc_was_enabled)
            PyGC_Enable();
    #else
        if (gc_was_enabled) {
            PyObject *tp, *v, *tb;
            PyErr_Fetch(&tp, &v, &tb);
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable);
            if (likely(ret || r == -1)) {
                Py_XDECREF(ret);
                PyErr_Restore(tp, v, tb);
            } else {
                Py_XDECREF(tp);
                Py_XDECREF(v);
                Py_XDECREF(tb);
                r = -1;
            }
        }
        Py_DECREF(gc);
    #endif
    }
#endif
    return r;
#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) {
    __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp);
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, attr_name);
#else
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
                 type_name, PyString_AS_STRING(attr_name));
#endif
    __Pyx_DECREF_TypeName(type_name);
    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

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType_3_0_12
#define __PYX_HAVE_RT_ImportType_3_0_12
static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *module_name, const char *class_name,
    size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size)
{
    PyObject *result = 0;
    char warning[200];
    Py_ssize_t basicsize;
    Py_ssize_t itemsize;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_basicsize;
    PyObject *py_itemsize;
#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;
    }
#if !CYTHON_COMPILING_IN_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
    itemsize = ((PyTypeObject *)result)->tp_itemsize;
#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;
    py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
    if (!py_itemsize)
        goto bad;
    itemsize = PyLong_AsSsize_t(py_itemsize);
    Py_DECREF(py_itemsize);
    py_itemsize = 0;
    if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (itemsize) {
        if (size % alignment) {
            alignment = size % alignment;
        }
        if (itemsize < (Py_ssize_t)alignment)
            itemsize = (Py_ssize_t)alignment;
    }
    if ((size_t)(basicsize + itemsize) < 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+itemsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_12 &&
            ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd-%zd from PyObject",
            module_name, class_name, size, basicsize, basicsize+itemsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_12 && (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(PyTypeObject *type) {
    void* ptr;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable);
#else
    PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable);
#endif
    if (!ob)
        goto bad;
    ptr = PyCapsule_GetPointer(ob, 0);
    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 *module = 0;
    PyObject *empty_dict = 0;
    PyObject *empty_list = 0;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (unlikely(!py_import))
        goto bad;
    if (!from_list) {
        empty_list = PyList_New(0);
        if (unlikely(!empty_list))
            goto bad;
        from_list = empty_list;
    }
    #endif
    empty_dict = PyDict_New();
    if (unlikely(!empty_dict))
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.') != NULL) {
                module = PyImport_ImportModuleLevelObject(
                    name, __pyx_d, empty_dict, from_list, 1);
                if (unlikely(!module)) {
                    if (unlikely(!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 (unlikely(!py_level))
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, __pyx_d, empty_dict, from_list, level);
            #endif
        }
    }
bad:
    Py_XDECREF(empty_dict);
    Py_XDECREF(empty_list);
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    return module;
}

/* ImportDottedModule */
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
    PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
    if (unlikely(PyErr_Occurred())) {
        PyErr_Clear();
    }
    if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) {
        partial_name = name;
    } else {
        slice = PySequence_GetSlice(parts_tuple, 0, count);
        if (unlikely(!slice))
            goto bad;
        sep = PyUnicode_FromStringAndSize(".", 1);
        if (unlikely(!sep))
            goto bad;
        partial_name = PyUnicode_Join(sep, slice);
    }
    PyErr_Format(
#if PY_MAJOR_VERSION < 3
        PyExc_ImportError,
        "No module named '%s'", PyString_AS_STRING(partial_name));
#else
#if PY_VERSION_HEX >= 0x030600B1
        PyExc_ModuleNotFoundError,
#else
        PyExc_ImportError,
#endif
        "No module named '%U'", partial_name);
#endif
bad:
    Py_XDECREF(sep);
    Py_XDECREF(slice);
    Py_XDECREF(partial_name);
    return NULL;
}
#endif
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
    PyObject *imported_module;
#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400)
    PyObject *modules = PyImport_GetModuleDict();
    if (unlikely(!modules))
        return NULL;
    imported_module = __Pyx_PyDict_GetItemStr(modules, name);
    Py_XINCREF(imported_module);
#else
    imported_module = PyImport_GetModule(name);
#endif
    return imported_module;
}
#endif
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
    Py_ssize_t i, nparts;
    nparts = PyTuple_GET_SIZE(parts_tuple);
    for (i=1; i < nparts && module; i++) {
        PyObject *part, *submodule;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        part = PyTuple_GET_ITEM(parts_tuple, i);
#else
        part = PySequence_ITEM(parts_tuple, i);
#endif
        submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
        Py_DECREF(part);
#endif
        Py_DECREF(module);
        module = submodule;
    }
    if (unlikely(!module)) {
        return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
    }
    return module;
}
#endif
static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
#if PY_MAJOR_VERSION < 3
    PyObject *module, *from_list, *star = __pyx_n_s__44;
    CYTHON_UNUSED_VAR(parts_tuple);
    from_list = PyList_New(1);
    if (unlikely(!from_list))
        return NULL;
    Py_INCREF(star);
    PyList_SET_ITEM(from_list, 0, star);
    module = __Pyx_Import(name, from_list, 0);
    Py_DECREF(from_list);
    return module;
#else
    PyObject *imported_module;
    PyObject *module = __Pyx_Import(name, NULL, 0);
    if (!parts_tuple || unlikely(!module))
        return module;
    imported_module = __Pyx__ImportDottedModule_Lookup(name);
    if (likely(imported_module)) {
        Py_DECREF(module);
        return imported_module;
    }
    PyErr_Clear();
    return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple);
#endif
}
static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1
    PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
    if (likely(module)) {
        PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec);
        if (likely(spec)) {
            PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing);
            if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
                Py_DECREF(spec);
                spec = NULL;
            }
            Py_XDECREF(unsafe);
        }
        if (likely(!spec)) {
            PyErr_Clear();
            return module;
        }
        Py_DECREF(spec);
        Py_DECREF(module);
    } else if (PyErr_Occurred()) {
        PyErr_Clear();
    }
#endif
    return __Pyx__ImportDottedModule(name, parts_tuple);
}

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        const char* module_name_str = 0;
        PyObject* module_name = 0;
        PyObject* module_dot = 0;
        PyObject* full_name = 0;
        PyErr_Clear();
        module_name_str = PyModule_GetName(module);
        if (unlikely(!module_name_str)) { goto modbad; }
        module_name = PyUnicode_FromString(module_name_str);
        if (unlikely(!module_name)) { goto modbad; }
        module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__14);
        if (unlikely(!module_dot)) { goto modbad; }
        full_name = PyUnicode_Concat(module_dot, name);
        if (unlikely(!full_name)) { goto modbad; }
        #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400)
        {
            PyObject *modules = PyImport_GetModuleDict();
            if (unlikely(!modules))
                goto modbad;
            value = PyObject_GetItem(modules, full_name);
        }
        #else
        value = PyImport_GetModule(full_name);
        #endif
      modbad:
        Py_XDECREF(full_name);
        Py_XDECREF(module_dot);
        Py_XDECREF(module_name);
    }
    if (unlikely(!value)) {
        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;
}

/* Py3UpdateBases */
static PyObject*
__Pyx_PEP560_update_bases(PyObject *bases)
{
    Py_ssize_t i, j, size_bases;
    PyObject *base, *meth, *new_base, *result, *new_bases = NULL;
    size_bases = PyTuple_GET_SIZE(bases);
    for (i = 0; i < size_bases; i++) {
        base  = PyTuple_GET_ITEM(bases, i);
        if (PyType_Check(base)) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries);
        if (!meth && PyErr_Occurred()) {
            goto error;
        }
        if (!meth) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        new_base = __Pyx_PyObject_CallOneArg(meth, bases);
        Py_DECREF(meth);
        if (!new_base) {
            goto error;
        }
        if (!PyTuple_Check(new_base)) {
            PyErr_SetString(PyExc_TypeError,
                            "__mro_entries__ must return a tuple");
            Py_DECREF(new_base);
            goto error;
        }
        if (!new_bases) {
            if (!(new_bases = PyList_New(i))) {
                goto error;
            }
            for (j = 0; j < i; j++) {
                base = PyTuple_GET_ITEM(bases, j);
                PyList_SET_ITEM(new_bases, j, base);
                Py_INCREF(base);
            }
        }
        j = PyList_GET_SIZE(new_bases);
        if (PyList_SetSlice(new_bases, j, j, new_base) < 0) {
            goto error;
        }
        Py_DECREF(new_base);
    }
    if (!new_bases) {
        Py_INCREF(bases);
        return bases;
    }
    result = PyList_AsTuple(new_bases);
    Py_DECREF(new_bases);
    return result;
error:
    Py_XDECREF(new_bases);
    return NULL;
}

/* CalculateMetaclass */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases;
#if CYTHON_ASSUME_SAFE_MACROS
    nbases = PyTuple_GET_SIZE(bases);
#else
    nbases = PyTuple_Size(bases);
    if (nbases < 0) return NULL;
#endif
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
#if CYTHON_ASSUME_SAFE_MACROS
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *tmp = PyTuple_GetItem(bases, i);
        if (!tmp) return NULL;
#endif
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* SetNewInClass */
static int __Pyx_SetNewInClass(PyObject *ns, PyObject *name, PyObject *value) {
#ifdef __Pyx_CyFunction_USED
    int ret;
    if (__Pyx_CyFunction_Check(value)) {
        PyObject *staticnew = PyStaticMethod_New(value);
        if (unlikely(!staticnew)) return -1;
        ret = __Pyx_SetNameInClass(ns, name, staticnew);
        Py_DECREF(staticnew);
        return ret;
    }
#endif
    return __Pyx_SetNameInClass(ns, name, value);
}

/* ClassMethod */
static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000
    if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
        return PyClassMethod_New(method);
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (PyMethodDescr_Check(method))
#else
    #if PY_MAJOR_VERSION == 2
    static PyTypeObject *methoddescr_type = NULL;
    if (unlikely(methoddescr_type == NULL)) {
       PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append");
       if (unlikely(!meth)) return NULL;
       methoddescr_type = Py_TYPE(meth);
       Py_DECREF(meth);
    }
    #else
    PyTypeObject *methoddescr_type = &PyMethodDescr_Type;
    #endif
    if (__Pyx_TypeCheck(method, methoddescr_type))
#endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
        #if PY_VERSION_HEX < 0x03020000
        PyTypeObject *d_type = descr->d_type;
        #else
        PyTypeObject *d_type = descr->d_common.d_type;
        #endif
        return PyDescr_NewClassMethod(d_type, descr->d_method);
    }
#endif
    else if (PyMethod_Check(method)) {
        return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
    }
    else {
        return PyClassMethod_New(method);
    }
}

/* PyObjectCall2Args */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args[3] = {NULL, arg1, arg2};
    return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectLookupSpecial */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
#if PY_MAJOR_VERSION < 3
    if (unlikely(PyInstance_Check(obj)))
        return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name);
#endif
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else if (with_error) {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#endif

/* Py3ClassCreate */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs[3] = {NULL, name, bases};
            ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
            Py_DECREF(prep);
        } else {
            if (unlikely(PyErr_Occurred()))
                return NULL;
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
#if PY_VERSION_HEX >= 0x03030000
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
#else
    CYTHON_MAYBE_UNUSED_VAR(qualname);
#endif
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
static int __Pyx_SetNamesPEP487(PyObject *type_obj) {
    PyTypeObject *type = (PyTypeObject*) type_obj;
    PyObject *names_to_set, *key, *value, *set_name, *tmp;
    Py_ssize_t i = 0;
#if CYTHON_USE_TYPE_SLOTS
    names_to_set = PyDict_Copy(type->tp_dict);
#else
    {
        PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict_2);
        names_to_set = NULL;
        if (likely(d)) {
            PyObject *names_to_set = PyDict_New();
            int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1;
            Py_DECREF(d);
            if (unlikely(ret < 0))
                Py_CLEAR(names_to_set);
        }
    }
#endif
    if (unlikely(names_to_set == NULL))
        goto bad;
    while (PyDict_Next(names_to_set, &i, &key, &value)) {
        set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name);
        if (unlikely(set_name != NULL)) {
            tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key);
            Py_DECREF(set_name);
            if (unlikely(tmp == NULL)) {
                __Pyx_TypeName value_type_name =
                    __Pyx_PyType_GetName(Py_TYPE(value));
                __Pyx_TypeName type_name = __Pyx_PyType_GetName(type);
                PyErr_Format(PyExc_RuntimeError,
#if PY_MAJOR_VERSION >= 3
                    "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'",
                    value_type_name, key, type_name);
#else
                    "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'",
                    value_type_name,
                    PyString_Check(key) ? PyString_AS_STRING(key) : "?",
                    type_name);
#endif
                goto bad;
            } else {
                Py_DECREF(tmp);
            }
        }
        else if (unlikely(PyErr_Occurred())) {
            goto bad;
        }
    }
    Py_DECREF(names_to_set);
    return 0;
bad:
    Py_XDECREF(names_to_set);
    return -1;
}
static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) {
#if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyTypeObject *type = (PyTypeObject*) type_obj;
    PyObject *mro = type->tp_mro;
    Py_ssize_t i, nbases;
    if (unlikely(!mro)) goto done;
    (void) &__Pyx_GetBuiltinName;
    Py_INCREF(mro);
    nbases = PyTuple_GET_SIZE(mro);
    assert(PyTuple_GET_ITEM(mro, 0) == type_obj);
    for (i = 1; i < nbases-1; i++) {
        PyObject *base, *dict, *meth;
        base = PyTuple_GET_ITEM(mro, i);
        dict = ((PyTypeObject *)base)->tp_dict;
        meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass);
        if (unlikely(meth)) {
            descrgetfunc f = Py_TYPE(meth)->tp_descr_get;
            PyObject *res;
            Py_INCREF(meth);
            if (likely(f)) {
                res = f(meth, NULL, type_obj);
                Py_DECREF(meth);
                if (unlikely(!res)) goto bad;
                meth = res;
            }
            res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw);
            Py_DECREF(meth);
            if (unlikely(!res)) goto bad;
            Py_DECREF(res);
            goto done;
        } else if (unlikely(PyErr_Occurred())) {
            goto bad;
        }
    }
done:
    Py_XDECREF(mro);
    return type_obj;
bad:
    Py_XDECREF(mro);
    Py_DECREF(type_obj);
    return NULL;
#else
    PyObject *super_type, *super, *func, *res;
#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
    super_type = __Pyx_GetBuiltinName(__pyx_n_s_super);
#else
    super_type = (PyObject*) &PySuper_Type;
    (void) &__Pyx_GetBuiltinName;
#endif
    super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL;
#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
    Py_XDECREF(super_type);
#endif
    if (unlikely(!super)) {
        Py_CLEAR(type_obj);
        goto done;
    }
    func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass);
    Py_DECREF(super);
    if (likely(!func)) {
        if (unlikely(PyErr_Occurred()))
            Py_CLEAR(type_obj);
        goto done;
    }
    res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw);
    Py_DECREF(func);
    if (unlikely(!res))
        Py_CLEAR(type_obj);
    Py_XDECREF(res);
done:
    return type_obj;
#endif
}
#endif
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result;
    PyObject *owned_metaclass = NULL;
    PyObject *margs[4] = {NULL, name, bases, dict};
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET,
#if PY_VERSION_HEX < 0x030600A4
        (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw
#else
        mkw
#endif
    );
    Py_XDECREF(owned_metaclass);
#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
    if (likely(result) && likely(PyType_Check(result))) {
        if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) {
            Py_CLEAR(result);
        } else {
            result = __Pyx_InitSubclassPEP487(result, mkw);
        }
    }
#else
    (void) &__Pyx_GetBuiltinName;
#endif
    return result;
}

/* 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
    CYTHON_MAYBE_UNUSED_VAR(tstate);
    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_GetAttrStrNoError(__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;
        (void) 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 */
#if !CYTHON_COMPILING_IN_LIMITED_API
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);
}
#endif

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
                                                       PyObject *firstlineno, PyObject *name) {
    PyObject *replace = NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
    replace = PyObject_GetAttrString(code, "replace");
    if (likely(replace)) {
        PyObject *result;
        result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
        Py_DECREF(replace);
        return result;
    }
    PyErr_Clear();
    #if __PYX_LIMITED_VERSION_HEX < 0x030780000
    {
        PyObject *compiled = NULL, *result = NULL;
        if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
        if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL;
        compiled = Py_CompileString(
            "out = type(code)(\n"
            "  code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
            "  code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
            "  code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
            "  code.co_lnotab)\n", "<dummy>", Py_file_input);
        if (!compiled) return NULL;
        result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
        Py_DECREF(compiled);
        if (!result) PyErr_Print();
        Py_DECREF(result);
        result = PyDict_GetItemString(scratch_dict, "out");
        if (result) Py_INCREF(result);
        return result;
    }
    #else
    return NULL;
    #endif
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
    PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
    PyObject *exc_type, *exc_value, *exc_traceback;
    int success = 0;
    if (c_line) {
        (void) __pyx_cfilenm;
        (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
    }
    PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
    code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
    if (unlikely(!code_object)) goto bad;
    py_py_line = PyLong_FromLong(py_line);
    if (unlikely(!py_py_line)) goto bad;
    py_funcname = PyUnicode_FromString(funcname);
    if (unlikely(!py_funcname)) goto bad;
    dict = PyDict_New();
    if (unlikely(!dict)) goto bad;
    {
        PyObject *old_code_object = code_object;
        code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
        Py_DECREF(old_code_object);
    }
    if (unlikely(!code_object)) goto bad;
    getframe = PySys_GetObject("_getframe");
    if (unlikely(!getframe)) goto bad;
    if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
    frame = PyEval_EvalCode(code_object, dict, dict);
    if (unlikely(!frame) || frame == Py_None) goto bad;
    success = 1;
  bad:
    PyErr_Restore(exc_type, exc_value, exc_traceback);
    Py_XDECREF(code_object);
    Py_XDECREF(py_py_line);
    Py_XDECREF(py_funcname);
    Py_XDECREF(dict);
    Py_XDECREF(replace);
    if (success) {
        PyTraceBack_Here(
            (struct _frame*)frame);
    }
    Py_XDECREF(frame);
}
#else
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = NULL;
    PyObject *py_funcname = NULL;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_srcfile = NULL;
    py_srcfile = PyString_FromString(filename);
    if (!py_srcfile) goto bad;
    #endif
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        funcname = PyUnicode_AsUTF8(py_funcname);
        if (!funcname) goto bad;
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        if (!py_funcname) goto bad;
        #endif
    }
    #if PY_MAJOR_VERSION < 3
    py_code = __Pyx_PyCode_New(
        0,
        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);
    #else
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    #endif
    Py_XDECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_funcname);
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_srcfile);
    #endif
    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;
    PyObject *ptype, *pvalue, *ptraceback;
    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) {
        __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) {
            /* If the code object creation fails, then we should clear the
               fetched exception references and propagate the new exception */
            Py_XDECREF(ptype);
            Py_XDECREF(pvalue);
            Py_XDECREF(ptraceback);
            goto bad;
        }
        __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
        __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);
}
#endif

/* 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;\
    }

/* Declarations */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return ::std::complex< float >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return x + y*(__pyx_t_float_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      __pyx_t_float_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
#else
    static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        if (b.imag == 0) {
            return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabsf(b.real) >= fabsf(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                float r = b.imag / b.real;
                float s = (float)(1.0) / (b.real + b.imag * r);
                return __pyx_t_float_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            float r = b.real / b.imag;
            float s = (float)(1.0) / (b.imag + b.real * r);
            return __pyx_t_float_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        if (b.imag == 0) {
            return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            float denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_float_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrtf(z.real*z.real + z.imag*z.imag);
          #else
            return hypotf(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
            __pyx_t_float_complex z;
            float r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    float denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        return __Pyx_c_prod_float(a, a);
                    case 3:
                        z = __Pyx_c_prod_float(a, a);
                        return __Pyx_c_prod_float(z, a);
                    case 4:
                        z = __Pyx_c_prod_float(a, a);
                        return __Pyx_c_prod_float(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if ((b.imag == 0) && (a.real >= 0)) {
                    z.real = powf(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2f(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_float(a);
                theta = atan2f(a.imag, a.real);
            }
            lnr = logf(r);
            z_r = expf(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cosf(z_theta);
            z.imag = z_r * sinf(z_theta);
            return z;
        }
    #endif
#endif

/* Declarations */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return ::std::complex< double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      __pyx_t_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabs(b.real) >= fabs(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                double r = b.imag / b.real;
                double s = (double)(1.0) / (b.real + b.imag * r);
                return __pyx_t_double_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            double r = b.real / b.imag;
            double s = (double)(1.0) / (b.imag + b.real * r);
            return __pyx_t_double_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            double denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_double_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrt(z.real*z.real + z.imag*z.imag);
          #else
            return hypot(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
            __pyx_t_double_complex z;
            double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        return __Pyx_c_prod_double(a, a);
                    case 3:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, a);
                    case 4:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if ((b.imag == 0) && (a.real >= 0)) {
                    z.real = pow(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_double(a);
                theta = atan2(a.imag, a.real);
            }
            lnr = log(r);
            z_r = exp(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cos(z_theta);
            z.imag = z_r * sin(z_theta);
            return z;
        }
    #endif
#endif

/* Declarations */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
      return ::std::complex< long double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
      return x + y*(__pyx_t_long_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
      __pyx_t_long_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
#else
    static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
        __pyx_t_long_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
        __pyx_t_long_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
        __pyx_t_long_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabsl(b.real) >= fabsl(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                long double r = b.imag / b.real;
                long double s = (long double)(1.0) / (b.real + b.imag * r);
                return __pyx_t_long_double_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            long double r = b.real / b.imag;
            long double s = (long double)(1.0) / (b.imag + b.real * r);
            return __pyx_t_long_double_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            long double denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_long_double_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
        __pyx_t_long_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
        __pyx_t_long_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrtl(z.real*z.real + z.imag*z.imag);
          #else
            return hypotl(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
            __pyx_t_long_double_complex z;
            long double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    long double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        return __Pyx_c_prod_long__double(a, a);
                    case 3:
                        z = __Pyx_c_prod_long__double(a, a);
                        return __Pyx_c_prod_long__double(z, a);
                    case 4:
                        z = __Pyx_c_prod_long__double(a, a);
                        return __Pyx_c_prod_long__double(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if ((b.imag == 0) && (a.real >= 0)) {
                    z.real = powl(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2l(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_long__double(a);
                theta = atan2l(a.imag, a.real);
            }
            lnr = logl(r);
            z_r = expl(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cosl(z_theta);
            z.imag = z_r * sinl(z_theta);
            return z;
        }
    #endif
#endif

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    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;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                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 && PY_VERSION_HEX < 0x030C00A7
        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
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                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
        }
    }
    {
        int val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int) -1;
        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;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(PY_LONG_LONG) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (PY_LONG_LONG) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (PY_LONG_LONG) -1;
        val = __Pyx_PyInt_As_PY_LONG_LONG(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(PY_LONG_LONG) >= 2 * PyLong_SHIFT)) {
                            return (PY_LONG_LONG) (((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(PY_LONG_LONG) >= 3 * PyLong_SHIFT)) {
                            return (PY_LONG_LONG) (((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_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(PY_LONG_LONG) >= 4 * PyLong_SHIFT)) {
                            return (PY_LONG_LONG) (((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        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 (PY_LONG_LONG) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(PY_LONG_LONG) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(PY_LONG_LONG) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT)) {
                            return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT)) {
                            return (PY_LONG_LONG) ((((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT)) {
                            return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT)) {
                            return (PY_LONG_LONG) ((((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_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(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT)) {
                            return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_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(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT)) {
                            return (PY_LONG_LONG) ((((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(PY_LONG_LONG) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        PY_LONG_LONG val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (PY_LONG_LONG) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (PY_LONG_LONG) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (PY_LONG_LONG) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (PY_LONG_LONG) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(PY_LONG_LONG) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((PY_LONG_LONG) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(PY_LONG_LONG) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((PY_LONG_LONG) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((PY_LONG_LONG) 1) << (sizeof(PY_LONG_LONG) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (PY_LONG_LONG) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to PY_LONG_LONG");
    return (PY_LONG_LONG) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to PY_LONG_LONG");
    return (PY_LONG_LONG) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(PY_LONG_LONG) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(PY_LONG_LONG) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(PY_LONG_LONG),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PY_LONG_LONG));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    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
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_intp(npy_intp value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const npy_intp neg_one = (npy_intp) -1, const_zero = (npy_intp) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(npy_intp) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_intp) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(npy_intp) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(npy_intp) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(npy_intp) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(npy_intp),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_intp));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const npy_int64 neg_one = (npy_int64) -1, const_zero = (npy_int64) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(npy_int64) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (npy_int64) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        npy_int64 val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (npy_int64) -1;
        val = __Pyx_PyInt_As_npy_int64(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(npy_int64, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(npy_int64) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(npy_int64) >= 2 * PyLong_SHIFT)) {
                            return (npy_int64) (((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(npy_int64) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(npy_int64) >= 3 * PyLong_SHIFT)) {
                            return (npy_int64) (((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(npy_int64) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, 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(npy_int64) >= 4 * PyLong_SHIFT)) {
                            return (npy_int64) (((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        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 (npy_int64) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(npy_int64) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(npy_int64, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(npy_int64) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT)) {
                            return (npy_int64) (((npy_int64)-1)*(((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(npy_int64) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT)) {
                            return (npy_int64) ((((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT)) {
                            return (npy_int64) (((npy_int64)-1)*(((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(npy_int64) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT)) {
                            return (npy_int64) ((((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, 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(npy_int64) - 1 > 4 * PyLong_SHIFT)) {
                            return (npy_int64) (((npy_int64)-1)*(((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(npy_int64) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(npy_int64, 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(npy_int64) - 1 > 4 * PyLong_SHIFT)) {
                            return (npy_int64) ((((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(npy_int64) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(npy_int64, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(npy_int64) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(npy_int64, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        npy_int64 val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (npy_int64) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (npy_int64) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (npy_int64) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (npy_int64) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(npy_int64) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((npy_int64) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(npy_int64) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((npy_int64) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((npy_int64) 1) << (sizeof(npy_int64) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (npy_int64) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to npy_int64");
    return (npy_int64) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to npy_int64");
    return (npy_int64) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const npy_int64 neg_one = (npy_int64) -1, const_zero = (npy_int64) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(npy_int64) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(npy_int64) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(npy_int64) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(npy_int64),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_int64));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* FormatTypeName */
#if CYTHON_COMPILING_IN_LIMITED_API
static __Pyx_TypeName
__Pyx_PyType_GetName(PyTypeObject* tp)
{
    PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_n_s_name_2);
    if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
        PyErr_Clear();
        Py_XDECREF(name);
        name = __Pyx_NewRef(__pyx_n_s__242);
    }
    return name;
}
#endif

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    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;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                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 && PY_VERSION_HEX < 0x030C00A7
        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
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                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
        }
    }
    {
        long val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (long) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (long) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (long) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (long) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((long) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((long) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (long) -1;
        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;
}

/* CheckBinaryVersion */
static unsigned long __Pyx_get_runtime_version(void) {
#if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
    return Py_Version & ~0xFFUL;
#else
    const char* rt_version = Py_GetVersion();
    unsigned long version = 0;
    unsigned long factor = 0x01000000UL;
    unsigned int digit = 0;
    int i = 0;
    while (factor) {
        while ('0' <= rt_version[i] && rt_version[i] <= '9') {
            digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
            ++i;
        }
        version += factor * digit;
        if (rt_version[i] != '.')
            break;
        digit = 0;
        factor >>= 8;
        ++i;
    }
    return version;
#endif
}
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
    const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
    if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
        return 0;
    if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
        return 1;
    {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compile time Python version %d.%d "
                      "of module '%.100s' "
                      "%s "
                      "runtime version %d.%d",
                       (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
                       __Pyx_MODULE_NAME,
                       (allow_newer) ? "was newer than" : "does not match",
                       (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
       );
        return PyErr_WarnEx(NULL, message, 1);
    }
}

/* VoidPtrImport */
#ifndef __PYX_HAVE_RT_ImportVoidPtr_3_0_12
#define __PYX_HAVE_RT_ImportVoidPtr_3_0_12
static int __Pyx_ImportVoidPtr_3_0_12(PyObject *module, const char *name, void **p, const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
    if (!d)
        goto bad;
    cobj = PyDict_GetItemString(d, name);
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%.200s does not export expected C variable %.200s",
                PyModule_GetName(module), name);
        goto bad;
    }
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    *p = PyCapsule_GetPointer(cobj, sig);
    if (!(*p))
        goto bad;
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(d);
    return -1;
}
#endif

/* FunctionImport */
#ifndef __PYX_HAVE_RT_ImportFunction_3_0_12
#define __PYX_HAVE_RT_ImportFunction_3_0_12
static int __Pyx_ImportFunction_3_0_12(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 (!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);
    *f = tmp.fp;
    if (!(*f))
        goto bad;
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(d);
    return -1;
}
#endif

/* InitStrings */
#if PY_MAJOR_VERSION >= 3
static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
    if (t.is_unicode | t.is_str) {
        if (t.intern) {
            *str = PyUnicode_InternFromString(t.s);
        } else if (t.encoding) {
            *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
        } else {
            *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
        }
    } else {
        *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
    }
    if (!*str)
        return -1;
    if (PyObject_Hash(*str) == -1)
        return -1;
    return 0;
}
#endif
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION >= 3
        __Pyx_InitString(*t, t->p);
        #else
        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);
        }
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        #endif
        ++t;
    }
    return 0;
}

#include <string.h>
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
    size_t len = strlen(s);
    if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
        PyErr_SetString(PyExc_OverflowError, "byte string is too long");
        return -1;
    }
    return (Py_ssize_t) len;
}
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return PyByteArray_FromStringAndSize(c_str, len);
}
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 && !CYTHON_COMPILING_IN_LIMITED_API) || (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) {
    __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ").  "
                "The ability to return an instance of a strict subclass of int is deprecated, "
                "and may be removed in a future version of Python.",
                result_type_name)) {
            __Pyx_DECREF_TypeName(result_type_name);
            Py_DECREF(result);
            return NULL;
        }
        __Pyx_DECREF_TypeName(result_type_name);
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
                 type_name, type_name, result_type_name);
    __Pyx_DECREF_TypeName(result_type_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
    if (likely(__Pyx_PyLong_IsCompact(b))) {
        return __Pyx_PyLong_CompactValue(b);
    } else {
      const digit* digits = __Pyx_PyLong_Digits(b);
      const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
      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 Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
#if PY_MAJOR_VERSION < 3
  } else if (likely(PyInt_CheckExact(o))) {
    return PyInt_AS_LONG(o);
#endif
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyInt_AsLong(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);
}


/* #### Code section: utility_code_pragmas_end ### */
#ifdef _MSC_VER
#pragma warning( pop )
#endif



/* #### Code section: end ### */
#endif /* Py_PYTHON_H */
