/* Generated by Cython 3.0.10 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "define_macros": [
            [
                "NPY_NO_DEPRECATED_API",
                "NPY_1_7_API_VERSION"
            ]
        ],
        "depends": [
            "/tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/_core/include/numpy/arrayobject.h",
            "/tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/_core/include/numpy/arrayscalars.h",
            "/tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarrayobject.h",
            "/tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/_core/include/numpy/ndarraytypes.h",
            "/tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/_core/include/numpy/ufuncobject.h"
        ],
        "extra_compile_args": [
            "-Wno-unreachable-code",
            "-Wno-sign-compare"
        ],
        "include_dirs": [
            "/tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/_core/include"
        ],
        "name": "cytimes.cydatetime",
        "sources": [
            "src/cytimes/cydatetime.py"
        ]
    },
    "module_name": "cytimes.cydatetime"
}
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_10" __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 0x03000AF0
#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__cydatetime
#define __PYX_HAVE_API__cytimes__cydatetime
/* 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 <time.h>
#include <stdint.h>
#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/cydatetime.pxd",
  "src/cytimes/cydatetime.py",
  "__init__.cython-30.pxd",
  "contextvars.pxd",
  "datetime.pxd",
  "time.pxd",
  "type.pxd",
  "bool.pxd",
  "complex.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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":770
 * # 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":771
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":772
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":773
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":777
 * #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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":778
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":779
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":780
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":784
 * #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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":785
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":792
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":793
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":795
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":796
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":798
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":799
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":800
 * 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_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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1096
 * 
 * # 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1097
 * # 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_t_7cytimes_10cydatetime_ymd;
typedef struct __pyx_t_7cytimes_10cydatetime_ymd __pyx_t_7cytimes_10cydatetime_ymd;
struct __pyx_t_7cytimes_10cydatetime_hms;
typedef struct __pyx_t_7cytimes_10cydatetime_hms __pyx_t_7cytimes_10cydatetime_hms;
struct __pyx_t_7cytimes_10cydatetime_iso;
typedef struct __pyx_t_7cytimes_10cydatetime_iso __pyx_t_7cytimes_10cydatetime_iso;
struct __pyx_opt_args_7cytimes_10cydatetime_gen_date;
struct __pyx_opt_args_7cytimes_10cydatetime_date_add;
struct __pyx_opt_args_7cytimes_10cydatetime_date_replace;
struct __pyx_opt_args_7cytimes_10cydatetime_gen_dt;
struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_date;
struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_ordinal;
struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_seconds;
struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_microseconds;
struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_timestamp;
struct __pyx_opt_args_7cytimes_10cydatetime_dt_add;
struct __pyx_opt_args_7cytimes_10cydatetime_dt_replace;
struct __pyx_opt_args_7cytimes_10cydatetime_gen_time;
struct __pyx_opt_args_7cytimes_10cydatetime_time_fr_seconds;
struct __pyx_opt_args_7cytimes_10cydatetime_time_fr_microseconds;
struct __pyx_opt_args_7cytimes_10cydatetime_time_replace;
struct __pyx_opt_args_7cytimes_10cydatetime_gen_td;
struct __pyx_opt_args_7cytimes_10cydatetime_td_add;
struct __pyx_opt_args_7cytimes_10cydatetime_gen_tzinfo_local;

/* "cytimes/cydatetime.pxd":36
 * 
 * # Struct
 * ctypedef struct ymd:             # <<<<<<<<<<<<<<
 *     unsigned int year
 *     unsigned int month
 */
struct __pyx_t_7cytimes_10cydatetime_ymd {
  unsigned int year;
  unsigned int month;
  unsigned int day;
};

/* "cytimes/cydatetime.pxd":41
 *     unsigned int day
 * 
 * ctypedef struct hms:             # <<<<<<<<<<<<<<
 *     unsigned int hour
 *     unsigned int minute
 */
struct __pyx_t_7cytimes_10cydatetime_hms {
  unsigned int hour;
  unsigned int minute;
  unsigned int second;
  unsigned int microsecond;
};

/* "cytimes/cydatetime.pxd":47
 *     unsigned int microsecond
 * 
 * ctypedef struct iso:             # <<<<<<<<<<<<<<
 *     unsigned int year
 *     unsigned int week
 */
struct __pyx_t_7cytimes_10cydatetime_iso {
  unsigned int year;
  unsigned int week;
  unsigned int weekday;
};

/* "cytimes/cydatetime.pxd":147
 * 
 * # Datetime.date: generate
 * cdef datetime.date gen_date(unsigned int year=?, unsigned int month=?, unsigned int day=?)             # <<<<<<<<<<<<<<
 * cdef datetime.date gen_date_now()
 * cdef datetime.date gen_date_now_utc()
 */
struct __pyx_opt_args_7cytimes_10cydatetime_gen_date {
  int __pyx_n;
  unsigned int year;
  unsigned int month;
  unsigned int day;
};

/* "cytimes/cydatetime.pxd":190
 * cdef datetime.date date_fr_timestamp(double timestamp)
 * # Datetime.date: arithmetic
 * cdef datetime.date date_add(datetime.date date, int days=?, long long seconds=?, long long microseconds=?)             # <<<<<<<<<<<<<<
 * cdef datetime.date date_add_td(datetime.date date, datetime.timedelta td)
 * cdef datetime.date date_sub_td(datetime.date date, datetime.timedelta td)
 */
struct __pyx_opt_args_7cytimes_10cydatetime_date_add {
  int __pyx_n;
  int days;
  PY_LONG_LONG seconds;
  PY_LONG_LONG microseconds;
};

/* "cytimes/cydatetime.pxd":196
 * cdef int date_sub_date_days(datetime.date date_l, datetime.date date_r)
 * # Datetime.date: manipulation
 * cdef datetime.date date_replace(datetime.date date, int year=?, int month=?, int day=?)             # <<<<<<<<<<<<<<
 * cdef datetime.date date_adj_weekday(datetime.date date, unsigned int weekday)
 * 
 */
struct __pyx_opt_args_7cytimes_10cydatetime_date_replace {
  int __pyx_n;
  int year;
  int month;
  int day;
};

/* "cytimes/cydatetime.pxd":200
 * 
 * # Datetime.datetime: generate
 * cdef datetime.datetime gen_dt(             # <<<<<<<<<<<<<<
 *     unsigned int year=?, unsigned int month=?, unsigned int day=?,
 *     unsigned int hour=?, unsigned int minute=?, unsigned int second=?,
 */
struct __pyx_opt_args_7cytimes_10cydatetime_gen_dt {
  int __pyx_n;
  unsigned int year;
  unsigned int month;
  unsigned int day;
  unsigned int hour;
  unsigned int minute;
  unsigned int second;
  unsigned int microsecond;
  PyDateTime_TZInfo *tzinfo;
  unsigned int fold;
};

/* "cytimes/cydatetime.pxd":252
 * cdef tm dt_to_stime_utc(datetime.datetime dt) except *
 * cdef datetime.datetime dt_fr_dt(datetime.datetime dt)
 * cdef datetime.datetime dt_fr_date(datetime.date date, datetime.tzinfo tzinfo=?, unsigned int fold=?)             # <<<<<<<<<<<<<<
 * cdef datetime.datetime dt_fr_time(datetime.time time)
 * cdef datetime.datetime dt_fr_date_n_time(datetime.date date, datetime.time time)
 */
struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_date {
  int __pyx_n;
  PyDateTime_TZInfo *tzinfo;
  unsigned int fold;
};

/* "cytimes/cydatetime.pxd":255
 * cdef datetime.datetime dt_fr_time(datetime.time time)
 * cdef datetime.datetime dt_fr_date_n_time(datetime.date date, datetime.time time)
 * cdef datetime.datetime dt_fr_ordinal(int ordinal, datetime.tzinfo tzinfo=?, unsigned int fold=?)             # <<<<<<<<<<<<<<
 * cdef datetime.datetime dt_fr_seconds(double seconds, datetime.tzinfo tzinfo=?, unsigned int fold=?)
 * cdef datetime.datetime dt_fr_microseconds(long long microseconds, datetime.tzinfo tzinfo=?, unsigned int fold=?)
 */
struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_ordinal {
  int __pyx_n;
  PyDateTime_TZInfo *tzinfo;
  unsigned int fold;
};

/* "cytimes/cydatetime.pxd":256
 * cdef datetime.datetime dt_fr_date_n_time(datetime.date date, datetime.time time)
 * cdef datetime.datetime dt_fr_ordinal(int ordinal, datetime.tzinfo tzinfo=?, unsigned int fold=?)
 * cdef datetime.datetime dt_fr_seconds(double seconds, datetime.tzinfo tzinfo=?, unsigned int fold=?)             # <<<<<<<<<<<<<<
 * cdef datetime.datetime dt_fr_microseconds(long long microseconds, datetime.tzinfo tzinfo=?, unsigned int fold=?)
 * cdef datetime.datetime dt_fr_timestamp(double timestamp, datetime.tzinfo tzinfo=?)
 */
struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_seconds {
  int __pyx_n;
  PyDateTime_TZInfo *tzinfo;
  unsigned int fold;
};

/* "cytimes/cydatetime.pxd":257
 * cdef datetime.datetime dt_fr_ordinal(int ordinal, datetime.tzinfo tzinfo=?, unsigned int fold=?)
 * cdef datetime.datetime dt_fr_seconds(double seconds, datetime.tzinfo tzinfo=?, unsigned int fold=?)
 * cdef datetime.datetime dt_fr_microseconds(long long microseconds, datetime.tzinfo tzinfo=?, unsigned int fold=?)             # <<<<<<<<<<<<<<
 * cdef datetime.datetime dt_fr_timestamp(double timestamp, datetime.tzinfo tzinfo=?)
 * # Datetime.datetime: arithmetic
 */
struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_microseconds {
  int __pyx_n;
  PyDateTime_TZInfo *tzinfo;
  unsigned int fold;
};

/* "cytimes/cydatetime.pxd":258
 * cdef datetime.datetime dt_fr_seconds(double seconds, datetime.tzinfo tzinfo=?, unsigned int fold=?)
 * cdef datetime.datetime dt_fr_microseconds(long long microseconds, datetime.tzinfo tzinfo=?, unsigned int fold=?)
 * cdef datetime.datetime dt_fr_timestamp(double timestamp, datetime.tzinfo tzinfo=?)             # <<<<<<<<<<<<<<
 * # Datetime.datetime: arithmetic
 * cdef datetime.datetime dt_add(datetime.datetime dt, int days=?, long long seconds=?, long long microseconds=?)
 */
struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_timestamp {
  int __pyx_n;
  PyDateTime_TZInfo *tzinfo;
};

/* "cytimes/cydatetime.pxd":260
 * cdef datetime.datetime dt_fr_timestamp(double timestamp, datetime.tzinfo tzinfo=?)
 * # Datetime.datetime: arithmetic
 * cdef datetime.datetime dt_add(datetime.datetime dt, int days=?, long long seconds=?, long long microseconds=?)             # <<<<<<<<<<<<<<
 * cdef datetime.datetime dt_add_td(datetime.datetime dt, datetime.timedelta td)
 * cdef datetime.datetime dt_sub_td(datetime.datetime dt, datetime.timedelta td)
 */
struct __pyx_opt_args_7cytimes_10cydatetime_dt_add {
  int __pyx_n;
  int days;
  PY_LONG_LONG seconds;
  PY_LONG_LONG microseconds;
};

/* "cytimes/cydatetime.pxd":266
 * cdef long long dt_sub_dt_us(datetime.datetime dt_l, datetime.datetime dt_r)
 * # Datetime.datetime: manipulation
 * cdef datetime.datetime dt_replace(             # <<<<<<<<<<<<<<
 *     datetime.datetime dt, int year=?, int month=?, int day=?, int hour=?,
 *     int minute=?, int second=?, int microsecond=?, object tzinfo=?, int fold=?)
 */
struct __pyx_opt_args_7cytimes_10cydatetime_dt_replace {
  int __pyx_n;
  int year;
  int month;
  int day;
  int hour;
  int minute;
  int second;
  int microsecond;
  PyObject *tzinfo;
  int fold;
};

/* "cytimes/cydatetime.pxd":275
 * 
 * # Datetime.time: generate
 * cdef datetime.time gen_time(             # <<<<<<<<<<<<<<
 *     unsigned int hour=?, unsigned int minute=?, unsigned int second=?,
 *     unsigned int microsecond=?, datetime.tzinfo tzinfo=?, unsigned int fold=?)
 */
struct __pyx_opt_args_7cytimes_10cydatetime_gen_time {
  int __pyx_n;
  unsigned int hour;
  unsigned int minute;
  unsigned int second;
  unsigned int microsecond;
  PyDateTime_TZInfo *tzinfo;
  unsigned int fold;
};

/* "cytimes/cydatetime.pxd":294
 * cdef long long time_to_microseconds(datetime.time time) noexcept
 * cdef datetime.time time_fr_dt(datetime.datetime dt)
 * cdef datetime.time time_fr_seconds(double seconds, datetime.tzinfo tzinfo=?, unsigned int fold=?)             # <<<<<<<<<<<<<<
 * cdef datetime.time time_fr_microseconds(long long microseconds, datetime.tzinfo tzinfo=?, unsigned int fold=?)
 * # Datetime.time: manipulation
 */
struct __pyx_opt_args_7cytimes_10cydatetime_time_fr_seconds {
  int __pyx_n;
  PyDateTime_TZInfo *tzinfo;
  unsigned int fold;
};

/* "cytimes/cydatetime.pxd":295
 * cdef datetime.time time_fr_dt(datetime.datetime dt)
 * cdef datetime.time time_fr_seconds(double seconds, datetime.tzinfo tzinfo=?, unsigned int fold=?)
 * cdef datetime.time time_fr_microseconds(long long microseconds, datetime.tzinfo tzinfo=?, unsigned int fold=?)             # <<<<<<<<<<<<<<
 * # Datetime.time: manipulation
 * cdef datetime.time time_replace(
 */
struct __pyx_opt_args_7cytimes_10cydatetime_time_fr_microseconds {
  int __pyx_n;
  PyDateTime_TZInfo *tzinfo;
  unsigned int fold;
};

/* "cytimes/cydatetime.pxd":297
 * cdef datetime.time time_fr_microseconds(long long microseconds, datetime.tzinfo tzinfo=?, unsigned int fold=?)
 * # Datetime.time: manipulation
 * cdef datetime.time time_replace(             # <<<<<<<<<<<<<<
 *     datetime.time time, int hour=?, int minute=?, int second=?,
 *     int microsecond=?, object tzinfo=?, int fold=?)
 */
struct __pyx_opt_args_7cytimes_10cydatetime_time_replace {
  int __pyx_n;
  int hour;
  int minute;
  int second;
  int microsecond;
  PyObject *tzinfo;
  int fold;
};

/* "cytimes/cydatetime.pxd":304
 * 
 * # Datetime.timedelta: generate
 * cdef datetime.timedelta gen_td(int days=?, int seconds=?, int microseconds=?)             # <<<<<<<<<<<<<<
 * # Datetime.timedelta: check types
 * cdef bint is_td(object obj) except -1
 */
struct __pyx_opt_args_7cytimes_10cydatetime_gen_td {
  int __pyx_n;
  int days;
  int seconds;
  int microseconds;
};

/* "cytimes/cydatetime.pxd":317
 * cdef datetime.timedelta td_fr_microseconds(long long microseconds)
 * # Datetime.timedelta: arithmetic
 * cdef datetime.timedelta td_add(datetime.timedelta td, int days=?, int seconds=?, int microseconds=?)             # <<<<<<<<<<<<<<
 * cdef datetime.timedelta td_add_td(datetime.timedelta td_l, datetime.timedelta td_r)
 * cdef datetime.timedelta td_sub_td(datetime.timedelta td_l, datetime.timedelta td_r)
 */
struct __pyx_opt_args_7cytimes_10cydatetime_td_add {
  int __pyx_n;
  int days;
  int seconds;
  int microseconds;
};

/* "cytimes/cydatetime.pxd":323
 * # Datetime.tzinfo: generate
 * cdef datetime.tzinfo gen_tzinfo(int offset)
 * cdef datetime.tzinfo gen_tzinfo_local(datetime.datetime dt=?)             # <<<<<<<<<<<<<<
 * # Datetime.tzinfo: check types
 * cdef bint is_tzinfo(object obj) except -1
 */
struct __pyx_opt_args_7cytimes_10cydatetime_gen_tzinfo_local {
  int __pyx_n;
  PyDateTime_DateTime *dt;
};
/* #### 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
  #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);

/* DivInt[Py_ssize_t].proto */
static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);

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

/* ModInt[Py_ssize_t].proto */
static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t, Py_ssize_t);

/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil);

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

/* ModFloat[double].proto */
static CYTHON_INLINE double __Pyx_mod_double(double, double);

/* UnicodeConcatInPlace.proto */
# if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
    #if CYTHON_REFNANNY
        #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, __pyx_refnanny)
    #else
        #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right)
    #endif
    static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right
        #if CYTHON_REFNANNY
        , void* __pyx_refnanny
        #endif
    );
#else
#define __Pyx_PyUnicode_ConcatInPlace __Pyx_PyUnicode_Concat
#endif
#define __Pyx_PyUnicode_ConcatInPlaceSafe(left, right) ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\
    PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_ConcatInPlace(left, right))

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

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

/* UnaryNegOverflows.proto */
#define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\
        (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))

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

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

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

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

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

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

/* DivInt[npy_datetime].proto */
static CYTHON_INLINE npy_datetime __Pyx_div_npy_datetime(npy_datetime, npy_datetime);

/* abs_longlong.proto */
static CYTHON_INLINE PY_LONG_LONG __Pyx_abs_longlong(PY_LONG_LONG x) {
#if defined (__cplusplus) && __cplusplus >= 201103L
    return std::abs(x);
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    return llabs(x);
#elif defined (_MSC_VER)
    return _abs64(x);
#elif defined (__GNUC__)
    return __builtin_llabs(x);
#else
    if (sizeof(PY_LONG_LONG) <= sizeof(Py_ssize_t))
        return __Pyx_sst_abs(x);
    return (x<0) ? -x : x;
#endif
}

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

/* DivInt[npy_timedelta].proto */
static CYTHON_INLINE npy_timedelta __Pyx_div_npy_timedelta(npy_timedelta, npy_timedelta);

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

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_10
#define __PYX_HAVE_RT_ImportType_proto_3_0_10
#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_10(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_0_10(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_0_10 {
   __Pyx_ImportType_CheckSize_Error_3_0_10 = 0,
   __Pyx_ImportType_CheckSize_Warn_3_0_10 = 1,
   __Pyx_ImportType_CheckSize_Ignore_3_0_10 = 2
};
static PyTypeObject *__Pyx_ImportType_3_0_10(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_10 check_size);
#endif

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

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

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

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

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

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

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

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

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

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

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_NPY_DATETIMEUNIT(NPY_DATETIMEUNIT 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

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

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

/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

/* VoidPtrExport.proto */
static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig);

/* FunctionExport.proto */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);

/* VoidPtrImport.proto */
static int __Pyx_ImportVoidPtr_3_0_10(PyObject *module, const char *name, void **p, 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 "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 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_get_utc(void); /*proto*/

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

/* Module declarations from "cython" */

/* 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*/
static CYTHON_INLINE struct tm __pyx_f_7cpython_4time_localtime(void); /*proto*/

/* Module declarations from "cytimes" */

/* Module declarations from "cytimes.typeref" */
static PyObject **__pyx_vp_7cytimes_7typeref_ZONEINFO = 0;
#define __pyx_v_7cytimes_7typeref_ZONEINFO (*__pyx_vp_7cytimes_7typeref_ZONEINFO)
static PyObject **__pyx_vp_7cytimes_7typeref_STRUCT_TIME = 0;
#define __pyx_v_7cytimes_7typeref_STRUCT_TIME (*__pyx_vp_7cytimes_7typeref_STRUCT_TIME)
static PyObject **__pyx_vp_7cytimes_7typeref_DATETIME64 = 0;
#define __pyx_v_7cytimes_7typeref_DATETIME64 (*__pyx_vp_7cytimes_7typeref_DATETIME64)
static PyObject **__pyx_vp_7cytimes_7typeref_DT64_ARRAY = 0;
#define __pyx_v_7cytimes_7typeref_DT64_ARRAY (*__pyx_vp_7cytimes_7typeref_DT64_ARRAY)
static PyObject **__pyx_vp_7cytimes_7typeref_TIMEDELTA64 = 0;
#define __pyx_v_7cytimes_7typeref_TIMEDELTA64 (*__pyx_vp_7cytimes_7typeref_TIMEDELTA64)
static PyObject **__pyx_vp_7cytimes_7typeref_TD64_ARRAY = 0;
#define __pyx_v_7cytimes_7typeref_TD64_ARRAY (*__pyx_vp_7cytimes_7typeref_TD64_ARRAY)
static PyObject **__pyx_vp_7cytimes_7typeref_SERIES = 0;
#define __pyx_v_7cytimes_7typeref_SERIES (*__pyx_vp_7cytimes_7typeref_SERIES)
static PyObject **__pyx_vp_7cytimes_7typeref_DATETIMEINDEX = 0;
#define __pyx_v_7cytimes_7typeref_DATETIMEINDEX (*__pyx_vp_7cytimes_7typeref_DATETIMEINDEX)
static PyObject **__pyx_vp_7cytimes_7typeref_TIMESTAMP = 0;
#define __pyx_v_7cytimes_7typeref_TIMESTAMP (*__pyx_vp_7cytimes_7typeref_TIMESTAMP)
static PyObject **__pyx_vp_7cytimes_7typeref_DT64TZ_ARRAY = 0;
#define __pyx_v_7cytimes_7typeref_DT64TZ_ARRAY (*__pyx_vp_7cytimes_7typeref_DT64TZ_ARRAY)
static PyObject **__pyx_vp_7cytimes_7typeref_TIMEDELTAINDEX = 0;
#define __pyx_v_7cytimes_7typeref_TIMEDELTAINDEX (*__pyx_vp_7cytimes_7typeref_TIMEDELTAINDEX)
static PyObject **__pyx_vp_7cytimes_7typeref_TIMEDELTA = 0;
#define __pyx_v_7cytimes_7typeref_TIMEDELTA (*__pyx_vp_7cytimes_7typeref_TIMEDELTA)
static PyObject **__pyx_vp_7cytimes_7typeref_BASEOFFSET = 0;
#define __pyx_v_7cytimes_7typeref_BASEOFFSET (*__pyx_vp_7cytimes_7typeref_BASEOFFSET)
static PyObject **__pyx_vp_7cytimes_7typeref_OFST_DATEOFFSET = 0;
#define __pyx_v_7cytimes_7typeref_OFST_DATEOFFSET (*__pyx_vp_7cytimes_7typeref_OFST_DATEOFFSET)
static PyObject **__pyx_vp_7cytimes_7typeref_OFST_MICRO = 0;
#define __pyx_v_7cytimes_7typeref_OFST_MICRO (*__pyx_vp_7cytimes_7typeref_OFST_MICRO)
static PyObject **__pyx_vp_7cytimes_7typeref_OFST_DAY = 0;
#define __pyx_v_7cytimes_7typeref_OFST_DAY (*__pyx_vp_7cytimes_7typeref_OFST_DAY)
static PyObject **__pyx_vp_7cytimes_7typeref_OFST_MONTHBEGIN = 0;
#define __pyx_v_7cytimes_7typeref_OFST_MONTHBEGIN (*__pyx_vp_7cytimes_7typeref_OFST_MONTHBEGIN)
static PyObject **__pyx_vp_7cytimes_7typeref_OFST_MONTHEND = 0;
#define __pyx_v_7cytimes_7typeref_OFST_MONTHEND (*__pyx_vp_7cytimes_7typeref_OFST_MONTHEND)
static PyObject **__pyx_vp_7cytimes_7typeref_OFST_QUARTERBEGIN = 0;
#define __pyx_v_7cytimes_7typeref_OFST_QUARTERBEGIN (*__pyx_vp_7cytimes_7typeref_OFST_QUARTERBEGIN)
static PyObject **__pyx_vp_7cytimes_7typeref_OFST_QUARTEREND = 0;
#define __pyx_v_7cytimes_7typeref_OFST_QUARTEREND (*__pyx_vp_7cytimes_7typeref_OFST_QUARTEREND)
static PyObject **__pyx_vp_7cytimes_7typeref_OFST_YEARBEGIN = 0;
#define __pyx_v_7cytimes_7typeref_OFST_YEARBEGIN (*__pyx_vp_7cytimes_7typeref_OFST_YEARBEGIN)
static PyObject **__pyx_vp_7cytimes_7typeref_OFST_YEAREND = 0;
#define __pyx_v_7cytimes_7typeref_OFST_YEAREND (*__pyx_vp_7cytimes_7typeref_OFST_YEAREND)
static PyObject **__pyx_vp_7cytimes_7typeref_PARSERINFO = 0;
#define __pyx_v_7cytimes_7typeref_PARSERINFO (*__pyx_vp_7cytimes_7typeref_PARSERINFO)
static PyObject **__pyx_vp_7cytimes_7typeref_RELATIVEDELTA = 0;
#define __pyx_v_7cytimes_7typeref_RELATIVEDELTA (*__pyx_vp_7cytimes_7typeref_RELATIVEDELTA)

/* Module declarations from "cytimes.cydatetime" */
static unsigned int __pyx_v_7cytimes_10cydatetime_DAYS_BR_MONTH[13];
static unsigned int __pyx_v_7cytimes_10cydatetime_DAYS_IN_MONTH[13];
static unsigned int __pyx_v_7cytimes_10cydatetime_DAYS_BR_QUARTER[5];
static PyArrayObject *__pyx_v_7cytimes_10cydatetime_DAYS_BR_QUARTER_NDARRAY = 0;
static unsigned int __pyx_v_7cytimes_10cydatetime_DAYS_IN_QUARTER[5];
static unsigned int __pyx_v_7cytimes_10cydatetime_MONTH_TO_QUARTER[13];
static PyDateTime_TZInfo *__pyx_v_7cytimes_10cydatetime_UTC = 0;
static PyDateTime_DateTime *__pyx_v_7cytimes_10cydatetime_EPOCH_UTC = 0;
static PY_LONG_LONG __pyx_v_7cytimes_10cydatetime_EPOCH_US;
static PY_LONG_LONG __pyx_v_7cytimes_10cydatetime_EPOCH_SEC;
static int __pyx_v_7cytimes_10cydatetime_EPOCH_DAY;
static PY_LONG_LONG __pyx_v_7cytimes_10cydatetime_DT_MAX_US;
static PY_LONG_LONG __pyx_v_7cytimes_10cydatetime_DT_MIN_US;
static PyDateTime_Time *__pyx_v_7cytimes_10cydatetime_TIME_START = 0;
static PyDateTime_Time *__pyx_v_7cytimes_10cydatetime_TIME_END = 0;
static PY_LONG_LONG __pyx_v_7cytimes_10cydatetime_US_DAY;
static PY_LONG_LONG __pyx_v_7cytimes_10cydatetime_US_HOUR;
static PY_LONG_LONG __pyx_v_7cytimes_10cydatetime_NS_DAY;
static PY_LONG_LONG __pyx_v_7cytimes_10cydatetime_NS_HOUR;
static PY_LONG_LONG __pyx_v_7cytimes_10cydatetime_NS_MINUTE;
static PyObject *__pyx_v_7cytimes_10cydatetime_TD_UNIT_ADJUSTMENT = 0;
static PyObject *__pyx_v_7cytimes_10cydatetime_FN_TIME_LOCALTIME = 0;
static CYTHON_INLINE struct tm __pyx_f_7cytimes_10cydatetime_localize_time(double); /*proto*/
static CYTHON_INLINE int __pyx_f_7cytimes_10cydatetime_raise_from_errno(void); /*proto*/
static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_localize_ts(double); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytimes_10cydatetime_stime_to_str(struct tm, PyObject *); /*proto*/
static int __pyx_f_7cytimes_10cydatetime_is_leapyear(unsigned int); /*proto*/
static unsigned int __pyx_f_7cytimes_10cydatetime_leap_bt_years(unsigned int, unsigned int); /*proto*/
static unsigned int __pyx_f_7cytimes_10cydatetime_days_in_year(unsigned int); /*proto*/
static unsigned int __pyx_f_7cytimes_10cydatetime_days_bf_year(unsigned int); /*proto*/
static unsigned int __pyx_f_7cytimes_10cydatetime_days_of_year(unsigned int, unsigned int, unsigned int); /*proto*/
static unsigned int __pyx_f_7cytimes_10cydatetime_quarter_of_month(unsigned int); /*proto*/
static unsigned int __pyx_f_7cytimes_10cydatetime_days_in_quarter(unsigned int, unsigned int); /*proto*/
static unsigned int __pyx_f_7cytimes_10cydatetime_days_bf_quarter(unsigned int, unsigned int); /*proto*/
static unsigned int __pyx_f_7cytimes_10cydatetime_days_of_quarter(unsigned int, unsigned int, unsigned int); /*proto*/
static unsigned int __pyx_f_7cytimes_10cydatetime_quarter_1st_month(unsigned int); /*proto*/
static unsigned int __pyx_f_7cytimes_10cydatetime_quarter_lst_month(unsigned int); /*proto*/
static unsigned int __pyx_f_7cytimes_10cydatetime_days_in_month(unsigned int, unsigned int); /*proto*/
static unsigned int __pyx_f_7cytimes_10cydatetime_days_bf_month(unsigned int, unsigned int); /*proto*/
static unsigned int __pyx_f_7cytimes_10cydatetime_ymd_weekday(unsigned int, unsigned int, unsigned int); /*proto*/
static unsigned int __pyx_f_7cytimes_10cydatetime_ymd_isoweekday(unsigned int, unsigned int, unsigned int); /*proto*/
static unsigned int __pyx_f_7cytimes_10cydatetime_ymd_isoweek(unsigned int, unsigned int, unsigned int); /*proto*/
static unsigned int __pyx_f_7cytimes_10cydatetime_ymd_isoyear(unsigned int, unsigned int, unsigned int); /*proto*/
static __pyx_t_7cytimes_10cydatetime_iso __pyx_f_7cytimes_10cydatetime_ymd_isocalendar(unsigned int, unsigned int, unsigned int); /*proto*/
static unsigned int __pyx_f_7cytimes_10cydatetime_iso1st_ordinal(unsigned int); /*proto*/
static unsigned int __pyx_f_7cytimes_10cydatetime_ymd_to_ordinal(unsigned int, unsigned int, unsigned int); /*proto*/
static __pyx_t_7cytimes_10cydatetime_ymd __pyx_f_7cytimes_10cydatetime_ordinal_to_ymd(int); /*proto*/
static __pyx_t_7cytimes_10cydatetime_hms __pyx_f_7cytimes_10cydatetime_microseconds_to_hms(PY_LONG_LONG); /*proto*/
static unsigned int __pyx_f_7cytimes_10cydatetime_date_weekday(PyDateTime_Date *); /*proto*/
static unsigned int __pyx_f_7cytimes_10cydatetime_date_to_ordinal(PyDateTime_Date *); /*proto*/
static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_date_to_seconds(PyDateTime_Date *); /*proto*/
static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_date_to_microseconds(PyDateTime_Date *); /*proto*/
static PyDateTime_Date *__pyx_f_7cytimes_10cydatetime_date_fr_dt(PyDateTime_DateTime *); /*proto*/
static PyDateTime_Date *__pyx_f_7cytimes_10cydatetime_date_fr_ordinal(int); /*proto*/
static PyDateTime_Date *__pyx_f_7cytimes_10cydatetime_date_fr_microseconds(PY_LONG_LONG); /*proto*/
static PyDateTime_Date *__pyx_f_7cytimes_10cydatetime_date_add(PyDateTime_Date *, struct __pyx_opt_args_7cytimes_10cydatetime_date_add *__pyx_optional_args); /*proto*/
static int __pyx_f_7cytimes_10cydatetime_date_sub_date_days(PyDateTime_Date *, PyDateTime_Date *); /*proto*/
static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_gen_dt_now_utc(void); /*proto*/
static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_gen_dt_now_tz(PyDateTime_TZInfo *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_dt_tzname(PyDateTime_DateTime *); /*proto*/
static PyDateTime_Delta *__pyx_f_7cytimes_10cydatetime_dt_dst(PyDateTime_DateTime *); /*proto*/
static PyDateTime_Delta *__pyx_f_7cytimes_10cydatetime_dt_utcoffset(PyDateTime_DateTime *); /*proto*/
static unsigned int __pyx_f_7cytimes_10cydatetime_dt_weekday(PyDateTime_DateTime *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_dt_to_isoformat(PyDateTime_DateTime *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_dt_to_isospaceformat(PyDateTime_DateTime *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_dt_to_strformat(PyDateTime_DateTime *, PyObject *); /*proto*/
static unsigned int __pyx_f_7cytimes_10cydatetime_dt_to_ordinal(PyDateTime_DateTime *); /*proto*/
static double __pyx_f_7cytimes_10cydatetime_dt_to_seconds(PyDateTime_DateTime *); /*proto*/
static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_dt_to_microseconds(PyDateTime_DateTime *); /*proto*/
static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_dt_to_posixts(PyDateTime_DateTime *); /*proto*/
static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_dt_fr_microseconds(PY_LONG_LONG, struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_microseconds *__pyx_optional_args); /*proto*/
static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_dt_fr_timestamp(double, struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_timestamp *__pyx_optional_args); /*proto*/
static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_dt_add(PyDateTime_DateTime *, struct __pyx_opt_args_7cytimes_10cydatetime_dt_add *__pyx_optional_args); /*proto*/
static PyDateTime_Delta *__pyx_f_7cytimes_10cydatetime_dt_sub_dt(PyDateTime_DateTime *, PyDateTime_DateTime *); /*proto*/
static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_dt_sub_dt_us(PyDateTime_DateTime *, PyDateTime_DateTime *); /*proto*/
static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_dt_replace_tzinfo(PyDateTime_DateTime *, PyDateTime_TZInfo *); /*proto*/
static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_time_to_microseconds(PyDateTime_Time *); /*proto*/
static PyDateTime_Time *__pyx_f_7cytimes_10cydatetime_time_fr_dt(PyDateTime_DateTime *); /*proto*/
static PyDateTime_Time *__pyx_f_7cytimes_10cydatetime_time_fr_microseconds(PY_LONG_LONG, struct __pyx_opt_args_7cytimes_10cydatetime_time_fr_microseconds *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_td_to_utcformat(PyDateTime_Delta *); /*proto*/
static double __pyx_f_7cytimes_10cydatetime_td_to_seconds(PyDateTime_Delta *); /*proto*/
static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_td_to_microseconds(PyDateTime_Delta *); /*proto*/
static PyDateTime_Delta *__pyx_f_7cytimes_10cydatetime_td_fr_microseconds(PY_LONG_LONG); /*proto*/
static PyDateTime_TZInfo *__pyx_f_7cytimes_10cydatetime_gen_tzinfo(int); /*proto*/
static PyDateTime_TZInfo *__pyx_f_7cytimes_10cydatetime_gen_tzinfo_local(struct __pyx_opt_args_7cytimes_10cydatetime_gen_tzinfo_local *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_tzinfo_name(PyObject *, PyDateTime_DateTime *); /*proto*/
static PyDateTime_Delta *__pyx_f_7cytimes_10cydatetime_tzinfo_dst(PyObject *, PyDateTime_DateTime *); /*proto*/
static PyDateTime_Delta *__pyx_f_7cytimes_10cydatetime_tzinfo_utcoffset(PyObject *, PyDateTime_DateTime *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_validate_dt64(PyObject *); /*proto*/
static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_dt64_to_days(PyObject *); /*proto*/
static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_dt64_to_hours(PyObject *); /*proto*/
static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_dt64_to_minutes(PyObject *); /*proto*/
static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_dt64_to_seconds(PyObject *); /*proto*/
static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_dt64_to_milliseconds(PyObject *); /*proto*/
static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_dt64_to_microseconds(PyObject *); /*proto*/
static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_dt64_to_nanoseconds(PyObject *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_validate_td64(PyObject *); /*proto*/
static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_td64_to_days(PyObject *); /*proto*/
static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_td64_to_hours(PyObject *); /*proto*/
static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_td64_to_minutes(PyObject *); /*proto*/
static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_td64_to_seconds(PyObject *); /*proto*/
static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_td64_to_milliseconds(PyObject *); /*proto*/
static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_td64_to_microseconds(PyObject *); /*proto*/
static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_td64_to_nanoseconds(PyObject *); /*proto*/
static int __pyx_f_7cytimes_10cydatetime_is_dt64array(PyArrayObject *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_validate_dt64array(PyArrayObject *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_get_dt64array_unit(PyArrayObject *); /*proto*/
static PyArrayObject *__pyx_f_7cytimes_10cydatetime_dt64array_to_days(PyArrayObject *); /*proto*/
static PyArrayObject *__pyx_f_7cytimes_10cydatetime_dt64array_to_hours(PyArrayObject *); /*proto*/
static PyArrayObject *__pyx_f_7cytimes_10cydatetime_dt64array_to_minutes(PyArrayObject *); /*proto*/
static PyArrayObject *__pyx_f_7cytimes_10cydatetime_dt64array_to_seconds(PyArrayObject *); /*proto*/
static PyArrayObject *__pyx_f_7cytimes_10cydatetime_dt64array_to_milliseconds(PyArrayObject *); /*proto*/
static PyArrayObject *__pyx_f_7cytimes_10cydatetime_dt64array_to_microseconds(PyArrayObject *); /*proto*/
static PyArrayObject *__pyx_f_7cytimes_10cydatetime_dt64array_to_nanoseconds(PyArrayObject *); /*proto*/
static PyArrayObject *__pyx_f_7cytimes_10cydatetime_dt64array_to_ordinals(PyArrayObject *); /*proto*/
static PyArrayObject *__pyx_f_7cytimes_10cydatetime_dt64array_to_timestamps(PyArrayObject *); /*proto*/
static int __pyx_f_7cytimes_10cydatetime_is_td64array(PyArrayObject *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_validate_td64array(PyArrayObject *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_get_td64array_unit(PyArrayObject *); /*proto*/
static PyArrayObject *__pyx_f_7cytimes_10cydatetime_td64array_to_days(PyArrayObject *); /*proto*/
static PyArrayObject *__pyx_f_7cytimes_10cydatetime_td64array_to_hours(PyArrayObject *); /*proto*/
static PyArrayObject *__pyx_f_7cytimes_10cydatetime_td64array_to_minutes(PyArrayObject *); /*proto*/
static PyArrayObject *__pyx_f_7cytimes_10cydatetime_td64array_to_seconds(PyArrayObject *); /*proto*/
static PyArrayObject *__pyx_f_7cytimes_10cydatetime_td64array_to_milliseconds(PyArrayObject *); /*proto*/
static PyArrayObject *__pyx_f_7cytimes_10cydatetime_td64array_to_microseconds(PyArrayObject *); /*proto*/
static PyArrayObject *__pyx_f_7cytimes_10cydatetime_td64array_to_nanoseconds(PyArrayObject *); /*proto*/
static int __pyx_f_7cytimes_10cydatetime_is_dt64series(PyObject *); /*proto*/
static PyArrayObject *__pyx_f_7cytimes_10cydatetime_get_dt64series_arr(PyObject *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_dt64series_to_days(PyObject *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_dt64series_to_hours(PyObject *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_dt64series_to_minutes(PyObject *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_dt64series_to_seconds(PyObject *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_dt64series_to_milliseconds(PyObject *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_dt64series_to_microseconds(PyObject *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_dt64series_to_nanoseconds(PyObject *); /*proto*/
static int __pyx_f_7cytimes_10cydatetime_is_td64series(PyObject *); /*proto*/
static PyArrayObject *__pyx_f_7cytimes_10cydatetime_get_td64series_arr(PyObject *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_get_td64series_unit(PyObject *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_td64series_to_days(PyObject *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_td64series_to_hours(PyObject *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_td64series_to_minutes(PyObject *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_td64series_to_seconds(PyObject *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_td64series_to_milliseconds(PyObject *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_td64series_to_microseconds(PyObject *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_td64series_to_nanoseconds(PyObject *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_parse_dt64array_unit(PyArrayObject *); /*proto*/
static PyObject *__pyx_f_7cytimes_10cydatetime_parse_td64array_unit(PyArrayObject *); /*proto*/
/* #### Code section: typeinfo ### */
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "cytimes.cydatetime"
extern int __pyx_module_is_main_cytimes__cydatetime;
int __pyx_module_is_main_cytimes__cydatetime = 0;

/* Implementation of "cytimes.cydatetime" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_OverflowError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_AssertionError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_ImportError;
/* #### Code section: string_decls ### */
static const char __pyx_k_D[] = "D";
static const char __pyx_k_M[] = "M";
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_h[] = "h";
static const char __pyx_k_m[] = "m";
static const char __pyx_k_s[] = "s";
static const char __pyx_k__4[] = "-";
static const char __pyx_k__5[] = ":";
static const char __pyx_k__6[] = ".";
static const char __pyx_k__7[] = " ";
static const char __pyx_k__8[] = "";
static const char __pyx_k__9[] = "%";
static const char __pyx_k_as[] = "as";
static const char __pyx_k_dt[] = "dt";
static const char __pyx_k_fs[] = "fs";
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_us[] = "us";
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_UTC[] = "UTC";
static const char __pyx_k__10[] = "%%";
static const char __pyx_k__11[] = "+";
static const char __pyx_k__15[] = "*";
static const char __pyx_k__17[] = "?";
static const char __pyx_k_day[] = "day";
static const char __pyx_k_dst[] = "dst";
static const char __pyx_k_str[] = "str";
static const char __pyx_k_hour[] = "hour";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_name[] = "name";
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_week[] = "week";
static const char __pyx_k_year[] = "year";
static const char __pyx_k_06d_2[] = "%06d";
static const char __pyx_k_array[] = "array";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_month[] = "month";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_NS_DAY[] = "NS_DAY";
static const char __pyx_k_Series[] = "Series";
static const char __pyx_k_US_DAY[] = "US_DAY";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_minute[] = "minute";
static const char __pyx_k_name_2[] = "__name__";
static const char __pyx_k_pandas[] = "pandas";
static const char __pyx_k_second[] = "second";
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_typing[] = "typing";
static const char __pyx_k_tzname[] = "tzname";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_Literal[] = "Literal";
static const char __pyx_k_NS_HOUR[] = "NS_HOUR";
static const char __pyx_k_US_HOUR[] = "US_HOUR";
static const char __pyx_k_as_unit[] = "as_unit";
static const char __pyx_k_cytimes[] = "cytimes";
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_typeref[] = "typeref";
static const char __pyx_k_weekday[] = "weekday";
static const char __pyx_k_EPOCH_US[] = "EPOCH_US";
static const char __pyx_k_Series_s[] = "<'Series[%s]'>";
static const char __pyx_k_TIME_END[] = "TIME_END";
static const char __pyx_k_datetime[] = "datetime";
static const char __pyx_k_pyx_capi[] = "__pyx_capi__";
static const char __pyx_k_tm_isdst[] = "tm_isdst";
static const char __pyx_k_DT_MAX_US[] = "DT_MAX_US";
static const char __pyx_k_DT_MIN_US[] = "DT_MIN_US";
static const char __pyx_k_EPOCH_DAY[] = "EPOCH_DAY";
static const char __pyx_k_EPOCH_SEC[] = "EPOCH_SEC";
static const char __pyx_k_EPOCH_UTC[] = "EPOCH_UTC";
static const char __pyx_k_NS_MINUTE[] = "NS_MINUTE";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_localtime[] = "localtime";
static const char __pyx_k_tm_gmtoff[] = "tm_gmtoff";
static const char __pyx_k_utcoffset[] = "utcoffset";
static const char __pyx_k_TIME_START[] = "TIME_START";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_microsecond[] = "microsecond";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_initializing[] = "_initializing";
static const char __pyx_k_DAYS_BR_MONTH[] = "DAYS_BR_MONTH";
static const char __pyx_k_DAYS_IN_MONTH[] = "DAYS_IN_MONTH";
static const char __pyx_k_OverflowError[] = "OverflowError";
static const char __pyx_k_class_getitem[] = "__class_getitem__";
static const char __pyx_k_AssertionError[] = "AssertionError";
static const char __pyx_k_time_localtime[] = "time_localtime";
static const char __pyx_k_DAYS_BR_QUARTER[] = "DAYS_BR_QUARTER";
static const char __pyx_k_DAYS_IN_QUARTER[] = "DAYS_IN_QUARTER";
static const char __pyx_k_MONTH_TO_QUARTER[] = "MONTH_TO_QUARTER";
static const char __pyx_k_FN_TIME_LOCALTIME[] = "FN_TIME_LOCALTIME";
static const char __pyx_k_TD_UNIT_ADJUSTMENT[] = "TD_UNIT_ADJUSTMENT";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_DAYS_BR_QUARTER_NDARRAY[] = "DAYS_BR_QUARTER_NDARRAY";
static const char __pyx_k_datetime_tzinfo_utcoffset_must[] = "<'datetime.tzinfo'> utcoffset() must return 'None' or <'timedelta'>, instead got: %s.";
static const char __pyx_k_Expects_datetime_tzinfo_instead[] = "Expects <'datetime.tzinfo'>, instead got: %s";
static const char __pyx_k_Only_support_ndarray_with_up_to[] = "Only support <'ndarray'> with up to 4 dimensions, instead got: %d.";
static const char __pyx_k_Unknown_ndarray_datetime64_time[] = "Unknown <'ndarray[datetime64]'> time unit: %d.";
static const char __pyx_k_Unsupported_ndarray_timedelta64[] = "Unsupported <'ndarray[timedelta64]'> time unit to perform conversion: %d.";
static const char __pyx_k_datetime_tzinfo_dst_must_return[] = "<'datetime.tzinfo'> dst() must return 'None' or <'timedelta'>, instead got: %s.";
static const char __pyx_k_datetime_tzinfo_tzname_must_ret[] = "<'datetime.tzinfo'> tzname() must return 'None' or <'str'>, instead got: %s.";
static const char __pyx_k_Cannot_adjust_Series_timedelta64[] = "Cannot adjust <'Series[timedelta64]'> to unit: %r. Supported units are <'str'>: ['s', 'ms', 'us', 'ns'].";
static const char __pyx_k_Does_not_support_conversion_of_S[] = "Does not support conversion of <'Series[datetime64]'> to time unit: %r.";
static const char __pyx_k_Does_not_support_conversion_of_n[] = "Does not support conversion of <'numpy.datetime64'> to time unit: %r.";
static const char __pyx_k_Expects_Series_datetime64_instea[] = "Expects <'Series[datetime64]'>, instead got: %s.";
static const char __pyx_k_Expects_Series_timedelta64_inste[] = "Expects <'Series[timedelta64]'>, instead got: %s.";
static const char __pyx_k_Expects_ndarray_datetime64_inste[] = "Expects <'ndarray[datetime64]'>, instead got: <'ndarray[%s]'>.";
static const char __pyx_k_Expects_ndarray_timedelta64_inst[] = "Expects <'ndarray[timedelta64]'>, instead got: <'ndarray[%s]'>.";
static const char __pyx_k_Expects_numpy_datetime64_instead[] = "Expects <'numpy.datetime64'>, instead got: ";
static const char __pyx_k_Expects_numpy_timedelta64_instea[] = "Expects <'numpy.timedelta64'>, instead got: ";
static const char __pyx_k_The_format_string_for_datetime_i[] = "The format string for datetime is too long:\n'%s'";
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_Timezone_expects_offset_86_340_8[] = "Timezone expects offset -86,340...86,340 in seconds, instead got: %d.";
static const char __pyx_k_Unable_to_parse_ndarray_datetime[] = "Unable to parse <'ndarray[datetime64]'> time unit from: '%s'.";
static const char __pyx_k_Unable_to_parse_ndarray_timedelt[] = "Unable to parse <'ndarray[timedelta64]'> time unit from: '%s'.";
static const char __pyx_k_Unknown_ndarray_timedelta64_time[] = "Unknown <'ndarray[timedelta64]'> time unit: %d.";
static const char __pyx_k_Unsupported_ndarray_datetime64_t[] = "Unsupported <'ndarray[datetime64]'> time unit to perform conversion: %d.";
static const char __pyx_k_Unsupported_numpy_datetime64_tim[] = "Unsupported <'numpy.datetime64'> time unit to perform conversion: %d.";
static const char __pyx_k_Unsupported_numpy_timedelta64_ti[] = "Unsupported <'numpy.timedelta64'> time unit to perform conversion: %d.";
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_Does_not_support_conversion_of_S_2[] = "Does not support conversion of <'Series[timedelta64]'> to time unit: %r.";
static const char __pyx_k_Does_not_support_conversion_of_n_2[] = "Does not support conversion of <'numpy.timedelta64'> to time unit: %r.";
static const char __pyx_k_Does_not_support_conversion_of_n_3[] = "Does not support conversion of <'ndarray[datetime64]'> to time unit: %r.";
static const char __pyx_k_Does_not_support_conversion_of_n_4[] = "Does not support conversion of <'ndarray[timedelta64]'> to time unit: %r.";
/* #### Code section: decls ### */
/* #### 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
  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
  #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
  PyObject *__pyx_kp_u_02d;
  PyObject *__pyx_kp_u_04d;
  PyObject *__pyx_kp_u_06d;
  PyObject *__pyx_kp_u_06d_2;
  PyObject *__pyx_n_s_AssertionError;
  PyObject *__pyx_kp_u_Cannot_adjust_Series_timedelta64;
  PyObject *__pyx_n_u_D;
  PyObject *__pyx_n_s_DAYS_BR_MONTH;
  PyObject *__pyx_n_s_DAYS_BR_QUARTER;
  PyObject *__pyx_n_s_DAYS_BR_QUARTER_NDARRAY;
  PyObject *__pyx_n_s_DAYS_IN_MONTH;
  PyObject *__pyx_n_s_DAYS_IN_QUARTER;
  PyObject *__pyx_n_s_DT_MAX_US;
  PyObject *__pyx_n_s_DT_MIN_US;
  PyObject *__pyx_kp_u_Does_not_support_conversion_of_S;
  PyObject *__pyx_kp_u_Does_not_support_conversion_of_S_2;
  PyObject *__pyx_kp_u_Does_not_support_conversion_of_n;
  PyObject *__pyx_kp_u_Does_not_support_conversion_of_n_2;
  PyObject *__pyx_kp_u_Does_not_support_conversion_of_n_3;
  PyObject *__pyx_kp_u_Does_not_support_conversion_of_n_4;
  PyObject *__pyx_n_s_EPOCH_DAY;
  PyObject *__pyx_n_s_EPOCH_SEC;
  PyObject *__pyx_n_s_EPOCH_US;
  PyObject *__pyx_n_s_EPOCH_UTC;
  PyObject *__pyx_kp_u_Expects_Series_datetime64_instea;
  PyObject *__pyx_kp_u_Expects_Series_timedelta64_inste;
  PyObject *__pyx_kp_u_Expects_datetime_tzinfo_instead;
  PyObject *__pyx_kp_u_Expects_ndarray_datetime64_inste;
  PyObject *__pyx_kp_u_Expects_ndarray_timedelta64_inst;
  PyObject *__pyx_kp_u_Expects_numpy_datetime64_instead;
  PyObject *__pyx_kp_u_Expects_numpy_timedelta64_instea;
  PyObject *__pyx_n_s_FN_TIME_LOCALTIME;
  PyObject *__pyx_n_s_ImportError;
  PyObject *__pyx_n_s_Literal;
  PyObject *__pyx_n_u_M;
  PyObject *__pyx_n_s_MONTH_TO_QUARTER;
  PyObject *__pyx_n_s_NS_DAY;
  PyObject *__pyx_n_s_NS_HOUR;
  PyObject *__pyx_n_s_NS_MINUTE;
  PyObject *__pyx_kp_u_Only_support_ndarray_with_up_to;
  PyObject *__pyx_n_s_OverflowError;
  PyObject *__pyx_n_s_RuntimeError;
  PyObject *__pyx_n_s_Series;
  PyObject *__pyx_kp_u_Series_s;
  PyObject *__pyx_n_u_T;
  PyObject *__pyx_n_s_TD_UNIT_ADJUSTMENT;
  PyObject *__pyx_n_s_TIME_END;
  PyObject *__pyx_n_s_TIME_START;
  PyObject *__pyx_kp_u_The_format_string_for_datetime_i;
  PyObject *__pyx_kp_u_Time_zones_are_not_available_fro;
  PyObject *__pyx_kp_u_Timezone_expects_offset_86_340_8;
  PyObject *__pyx_n_s_TypeError;
  PyObject *__pyx_n_s_US_DAY;
  PyObject *__pyx_n_s_US_HOUR;
  PyObject *__pyx_n_s_UTC;
  PyObject *__pyx_kp_u_Unable_to_parse_ndarray_datetime;
  PyObject *__pyx_kp_u_Unable_to_parse_ndarray_timedelt;
  PyObject *__pyx_kp_u_Unknown_ndarray_datetime64_time;
  PyObject *__pyx_kp_u_Unknown_ndarray_timedelta64_time;
  PyObject *__pyx_kp_u_Unsupported_ndarray_datetime64_t;
  PyObject *__pyx_kp_u_Unsupported_ndarray_timedelta64;
  PyObject *__pyx_kp_u_Unsupported_numpy_datetime64_tim;
  PyObject *__pyx_kp_u_Unsupported_numpy_timedelta64_ti;
  PyObject *__pyx_n_s_ValueError;
  PyObject *__pyx_n_u_W;
  PyObject *__pyx_n_u_Y;
  PyObject *__pyx_kp_u__10;
  PyObject *__pyx_kp_u__11;
  PyObject *__pyx_n_s__15;
  PyObject *__pyx_n_s__17;
  PyObject *__pyx_kp_u__4;
  PyObject *__pyx_kp_u__5;
  PyObject *__pyx_kp_u__6;
  PyObject *__pyx_kp_u__7;
  PyObject *__pyx_kp_u__8;
  PyObject *__pyx_kp_u__9;
  PyObject *__pyx_n_s_array;
  PyObject *__pyx_n_u_as;
  PyObject *__pyx_n_s_as_unit;
  PyObject *__pyx_n_s_class_getitem;
  PyObject *__pyx_n_s_cline_in_traceback;
  PyObject *__pyx_n_s_cytimes;
  PyObject *__pyx_n_u_d;
  PyObject *__pyx_n_s_datetime;
  PyObject *__pyx_kp_u_datetime_tzinfo_dst_must_return;
  PyObject *__pyx_kp_u_datetime_tzinfo_tzname_must_ret;
  PyObject *__pyx_kp_u_datetime_tzinfo_utcoffset_must;
  PyObject *__pyx_n_s_day;
  PyObject *__pyx_n_s_dst;
  PyObject *__pyx_n_s_dt;
  PyObject *__pyx_n_s_dtype;
  PyObject *__pyx_n_u_fs;
  PyObject *__pyx_n_u_h;
  PyObject *__pyx_n_s_hour;
  PyObject *__pyx_n_s_import;
  PyObject *__pyx_n_s_index;
  PyObject *__pyx_n_s_initializing;
  PyObject *__pyx_n_s_localtime;
  PyObject *__pyx_n_u_m;
  PyObject *__pyx_n_s_main;
  PyObject *__pyx_n_s_microsecond;
  PyObject *__pyx_n_s_minute;
  PyObject *__pyx_n_s_month;
  PyObject *__pyx_n_u_ms;
  PyObject *__pyx_n_s_name;
  PyObject *__pyx_n_s_name_2;
  PyObject *__pyx_n_s_np;
  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_pandas;
  PyObject *__pyx_n_u_ps;
  PyObject *__pyx_n_s_pyx_capi;
  PyObject *__pyx_n_s_range;
  PyObject *__pyx_n_u_s;
  PyObject *__pyx_n_s_second;
  PyObject *__pyx_n_s_spec;
  PyObject *__pyx_n_s_str;
  PyObject *__pyx_n_s_test;
  PyObject *__pyx_n_s_time;
  PyObject *__pyx_n_s_time_localtime;
  PyObject *__pyx_n_s_tm_gmtoff;
  PyObject *__pyx_n_s_tm_hour;
  PyObject *__pyx_n_s_tm_isdst;
  PyObject *__pyx_n_s_tm_mday;
  PyObject *__pyx_n_s_tm_min;
  PyObject *__pyx_n_s_tm_mon;
  PyObject *__pyx_n_s_tm_sec;
  PyObject *__pyx_n_s_tm_wday;
  PyObject *__pyx_n_s_tm_yday;
  PyObject *__pyx_n_s_tm_year;
  PyObject *__pyx_n_s_typeref;
  PyObject *__pyx_n_s_typing;
  PyObject *__pyx_n_s_tzname;
  PyObject *__pyx_n_u_us;
  PyObject *__pyx_n_s_utcoffset;
  PyObject *__pyx_n_s_values;
  PyObject *__pyx_n_s_week;
  PyObject *__pyx_n_s_weekday;
  PyObject *__pyx_n_s_year;
  PyObject *__pyx_int_0;
  PyObject *__pyx_int_23;
  PyObject *__pyx_int_24;
  PyObject *__pyx_int_59;
  PyObject *__pyx_int_60;
  PyObject *__pyx_int_90;
  PyObject *__pyx_int_181;
  PyObject *__pyx_int_273;
  PyObject *__pyx_int_365;
  PyObject *__pyx_int_1000;
  PyObject *__pyx_int_1440;
  PyObject *__pyx_int_3600;
  PyObject *__pyx_int_60000;
  PyObject *__pyx_int_86400;
  PyObject *__pyx_int_719163;
  PyObject *__pyx_int_999999;
  PyObject *__pyx_int_1000000;
  PyObject *__pyx_int_3600000;
  PyObject *__pyx_int_60000000;
  PyObject *__pyx_int_86400000;
  PyObject *__pyx_int_1000000000;
  PyObject *__pyx_int_3600000000;
  PyObject *__pyx_int_60000000000;
  PyObject *__pyx_int_86400000000;
  PyObject *__pyx_int_1000000000000;
  PyObject *__pyx_int_3600000000000;
  PyObject *__pyx_int_0x3691d6afc000;
  PyObject *__pyx_int_0x4e94914f0000;
  PyObject *__pyx_int_0x38d7ea4c68000;
  PyObject *__pyx_int_0xcca2e51310000;
  PyObject *__pyx_int_0xd529ae9e860000;
  PyObject *__pyx_int_0x132f4579c980000;
  PyObject *__pyx_int_0xde0b6b3a7640000;
  PyObject *__pyx_int_0x31f5c4ed27680000;
  PyObject *__pyx_int_0x340aad21b3b700000;
  PyObject *__pyx_int_0x4af0a763bb1c00000;
  PyObject *__pyx_int_0xc328093e61ee400000;
  PyObject *__pyx_int_0x124bc0ddd92e56000000;
  PyObject *__pyx_int_neg_1;
  PyObject *__pyx_tuple_;
  PyObject *__pyx_tuple__2;
  PyObject *__pyx_tuple__3;
  PyObject *__pyx_tuple__12;
  PyObject *__pyx_tuple__13;
  PyObject *__pyx_tuple__14;
  PyObject *__pyx_tuple__16;
} __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_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_n_s_AssertionError);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Cannot_adjust_Series_timedelta64);
  Py_CLEAR(clear_module_state->__pyx_n_u_D);
  Py_CLEAR(clear_module_state->__pyx_n_s_DAYS_BR_MONTH);
  Py_CLEAR(clear_module_state->__pyx_n_s_DAYS_BR_QUARTER);
  Py_CLEAR(clear_module_state->__pyx_n_s_DAYS_BR_QUARTER_NDARRAY);
  Py_CLEAR(clear_module_state->__pyx_n_s_DAYS_IN_MONTH);
  Py_CLEAR(clear_module_state->__pyx_n_s_DAYS_IN_QUARTER);
  Py_CLEAR(clear_module_state->__pyx_n_s_DT_MAX_US);
  Py_CLEAR(clear_module_state->__pyx_n_s_DT_MIN_US);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Does_not_support_conversion_of_S);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Does_not_support_conversion_of_S_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Does_not_support_conversion_of_n);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Does_not_support_conversion_of_n_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Does_not_support_conversion_of_n_3);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Does_not_support_conversion_of_n_4);
  Py_CLEAR(clear_module_state->__pyx_n_s_EPOCH_DAY);
  Py_CLEAR(clear_module_state->__pyx_n_s_EPOCH_SEC);
  Py_CLEAR(clear_module_state->__pyx_n_s_EPOCH_US);
  Py_CLEAR(clear_module_state->__pyx_n_s_EPOCH_UTC);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Expects_Series_datetime64_instea);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Expects_Series_timedelta64_inste);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Expects_datetime_tzinfo_instead);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Expects_ndarray_datetime64_inste);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Expects_ndarray_timedelta64_inst);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Expects_numpy_datetime64_instead);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Expects_numpy_timedelta64_instea);
  Py_CLEAR(clear_module_state->__pyx_n_s_FN_TIME_LOCALTIME);
  Py_CLEAR(clear_module_state->__pyx_n_s_ImportError);
  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_s_MONTH_TO_QUARTER);
  Py_CLEAR(clear_module_state->__pyx_n_s_NS_DAY);
  Py_CLEAR(clear_module_state->__pyx_n_s_NS_HOUR);
  Py_CLEAR(clear_module_state->__pyx_n_s_NS_MINUTE);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Only_support_ndarray_with_up_to);
  Py_CLEAR(clear_module_state->__pyx_n_s_OverflowError);
  Py_CLEAR(clear_module_state->__pyx_n_s_RuntimeError);
  Py_CLEAR(clear_module_state->__pyx_n_s_Series);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Series_s);
  Py_CLEAR(clear_module_state->__pyx_n_u_T);
  Py_CLEAR(clear_module_state->__pyx_n_s_TD_UNIT_ADJUSTMENT);
  Py_CLEAR(clear_module_state->__pyx_n_s_TIME_END);
  Py_CLEAR(clear_module_state->__pyx_n_s_TIME_START);
  Py_CLEAR(clear_module_state->__pyx_kp_u_The_format_string_for_datetime_i);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Time_zones_are_not_available_fro);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Timezone_expects_offset_86_340_8);
  Py_CLEAR(clear_module_state->__pyx_n_s_TypeError);
  Py_CLEAR(clear_module_state->__pyx_n_s_US_DAY);
  Py_CLEAR(clear_module_state->__pyx_n_s_US_HOUR);
  Py_CLEAR(clear_module_state->__pyx_n_s_UTC);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Unable_to_parse_ndarray_datetime);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Unable_to_parse_ndarray_timedelt);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Unknown_ndarray_datetime64_time);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Unknown_ndarray_timedelta64_time);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Unsupported_ndarray_datetime64_t);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Unsupported_ndarray_timedelta64);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Unsupported_numpy_datetime64_tim);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Unsupported_numpy_timedelta64_ti);
  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_Y);
  Py_CLEAR(clear_module_state->__pyx_kp_u__10);
  Py_CLEAR(clear_module_state->__pyx_kp_u__11);
  Py_CLEAR(clear_module_state->__pyx_n_s__15);
  Py_CLEAR(clear_module_state->__pyx_n_s__17);
  Py_CLEAR(clear_module_state->__pyx_kp_u__4);
  Py_CLEAR(clear_module_state->__pyx_kp_u__5);
  Py_CLEAR(clear_module_state->__pyx_kp_u__6);
  Py_CLEAR(clear_module_state->__pyx_kp_u__7);
  Py_CLEAR(clear_module_state->__pyx_kp_u__8);
  Py_CLEAR(clear_module_state->__pyx_kp_u__9);
  Py_CLEAR(clear_module_state->__pyx_n_s_array);
  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_class_getitem);
  Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
  Py_CLEAR(clear_module_state->__pyx_n_s_cytimes);
  Py_CLEAR(clear_module_state->__pyx_n_u_d);
  Py_CLEAR(clear_module_state->__pyx_n_s_datetime);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime_tzinfo_dst_must_return);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime_tzinfo_tzname_must_ret);
  Py_CLEAR(clear_module_state->__pyx_kp_u_datetime_tzinfo_utcoffset_must);
  Py_CLEAR(clear_module_state->__pyx_n_s_day);
  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_dtype);
  Py_CLEAR(clear_module_state->__pyx_n_u_fs);
  Py_CLEAR(clear_module_state->__pyx_n_u_h);
  Py_CLEAR(clear_module_state->__pyx_n_s_hour);
  Py_CLEAR(clear_module_state->__pyx_n_s_import);
  Py_CLEAR(clear_module_state->__pyx_n_s_index);
  Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
  Py_CLEAR(clear_module_state->__pyx_n_s_localtime);
  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_microsecond);
  Py_CLEAR(clear_module_state->__pyx_n_s_minute);
  Py_CLEAR(clear_module_state->__pyx_n_s_month);
  Py_CLEAR(clear_module_state->__pyx_n_u_ms);
  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_np);
  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_pandas);
  Py_CLEAR(clear_module_state->__pyx_n_u_ps);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_capi);
  Py_CLEAR(clear_module_state->__pyx_n_s_range);
  Py_CLEAR(clear_module_state->__pyx_n_u_s);
  Py_CLEAR(clear_module_state->__pyx_n_s_second);
  Py_CLEAR(clear_module_state->__pyx_n_s_spec);
  Py_CLEAR(clear_module_state->__pyx_n_s_str);
  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_s_time_localtime);
  Py_CLEAR(clear_module_state->__pyx_n_s_tm_gmtoff);
  Py_CLEAR(clear_module_state->__pyx_n_s_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_s_tm_min);
  Py_CLEAR(clear_module_state->__pyx_n_s_tm_mon);
  Py_CLEAR(clear_module_state->__pyx_n_s_tm_sec);
  Py_CLEAR(clear_module_state->__pyx_n_s_tm_wday);
  Py_CLEAR(clear_module_state->__pyx_n_s_tm_yday);
  Py_CLEAR(clear_module_state->__pyx_n_s_tm_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_typeref);
  Py_CLEAR(clear_module_state->__pyx_n_s_typing);
  Py_CLEAR(clear_module_state->__pyx_n_s_tzname);
  Py_CLEAR(clear_module_state->__pyx_n_u_us);
  Py_CLEAR(clear_module_state->__pyx_n_s_utcoffset);
  Py_CLEAR(clear_module_state->__pyx_n_s_values);
  Py_CLEAR(clear_module_state->__pyx_n_s_week);
  Py_CLEAR(clear_module_state->__pyx_n_s_weekday);
  Py_CLEAR(clear_module_state->__pyx_n_s_year);
  Py_CLEAR(clear_module_state->__pyx_int_0);
  Py_CLEAR(clear_module_state->__pyx_int_23);
  Py_CLEAR(clear_module_state->__pyx_int_24);
  Py_CLEAR(clear_module_state->__pyx_int_59);
  Py_CLEAR(clear_module_state->__pyx_int_60);
  Py_CLEAR(clear_module_state->__pyx_int_90);
  Py_CLEAR(clear_module_state->__pyx_int_181);
  Py_CLEAR(clear_module_state->__pyx_int_273);
  Py_CLEAR(clear_module_state->__pyx_int_365);
  Py_CLEAR(clear_module_state->__pyx_int_1000);
  Py_CLEAR(clear_module_state->__pyx_int_1440);
  Py_CLEAR(clear_module_state->__pyx_int_3600);
  Py_CLEAR(clear_module_state->__pyx_int_60000);
  Py_CLEAR(clear_module_state->__pyx_int_86400);
  Py_CLEAR(clear_module_state->__pyx_int_719163);
  Py_CLEAR(clear_module_state->__pyx_int_999999);
  Py_CLEAR(clear_module_state->__pyx_int_1000000);
  Py_CLEAR(clear_module_state->__pyx_int_3600000);
  Py_CLEAR(clear_module_state->__pyx_int_60000000);
  Py_CLEAR(clear_module_state->__pyx_int_86400000);
  Py_CLEAR(clear_module_state->__pyx_int_1000000000);
  Py_CLEAR(clear_module_state->__pyx_int_3600000000);
  Py_CLEAR(clear_module_state->__pyx_int_60000000000);
  Py_CLEAR(clear_module_state->__pyx_int_86400000000);
  Py_CLEAR(clear_module_state->__pyx_int_1000000000000);
  Py_CLEAR(clear_module_state->__pyx_int_3600000000000);
  Py_CLEAR(clear_module_state->__pyx_int_0x3691d6afc000);
  Py_CLEAR(clear_module_state->__pyx_int_0x4e94914f0000);
  Py_CLEAR(clear_module_state->__pyx_int_0x38d7ea4c68000);
  Py_CLEAR(clear_module_state->__pyx_int_0xcca2e51310000);
  Py_CLEAR(clear_module_state->__pyx_int_0xd529ae9e860000);
  Py_CLEAR(clear_module_state->__pyx_int_0x132f4579c980000);
  Py_CLEAR(clear_module_state->__pyx_int_0xde0b6b3a7640000);
  Py_CLEAR(clear_module_state->__pyx_int_0x31f5c4ed27680000);
  Py_CLEAR(clear_module_state->__pyx_int_0x340aad21b3b700000);
  Py_CLEAR(clear_module_state->__pyx_int_0x4af0a763bb1c00000);
  Py_CLEAR(clear_module_state->__pyx_int_0xc328093e61ee400000);
  Py_CLEAR(clear_module_state->__pyx_int_0x124bc0ddd92e56000000);
  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__12);
  Py_CLEAR(clear_module_state->__pyx_tuple__13);
  Py_CLEAR(clear_module_state->__pyx_tuple__14);
  Py_CLEAR(clear_module_state->__pyx_tuple__16);
  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_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_n_s_AssertionError);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Cannot_adjust_Series_timedelta64);
  Py_VISIT(traverse_module_state->__pyx_n_u_D);
  Py_VISIT(traverse_module_state->__pyx_n_s_DAYS_BR_MONTH);
  Py_VISIT(traverse_module_state->__pyx_n_s_DAYS_BR_QUARTER);
  Py_VISIT(traverse_module_state->__pyx_n_s_DAYS_BR_QUARTER_NDARRAY);
  Py_VISIT(traverse_module_state->__pyx_n_s_DAYS_IN_MONTH);
  Py_VISIT(traverse_module_state->__pyx_n_s_DAYS_IN_QUARTER);
  Py_VISIT(traverse_module_state->__pyx_n_s_DT_MAX_US);
  Py_VISIT(traverse_module_state->__pyx_n_s_DT_MIN_US);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Does_not_support_conversion_of_S);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Does_not_support_conversion_of_S_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Does_not_support_conversion_of_n);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Does_not_support_conversion_of_n_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Does_not_support_conversion_of_n_3);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Does_not_support_conversion_of_n_4);
  Py_VISIT(traverse_module_state->__pyx_n_s_EPOCH_DAY);
  Py_VISIT(traverse_module_state->__pyx_n_s_EPOCH_SEC);
  Py_VISIT(traverse_module_state->__pyx_n_s_EPOCH_US);
  Py_VISIT(traverse_module_state->__pyx_n_s_EPOCH_UTC);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Expects_Series_datetime64_instea);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Expects_Series_timedelta64_inste);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Expects_datetime_tzinfo_instead);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Expects_ndarray_datetime64_inste);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Expects_ndarray_timedelta64_inst);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Expects_numpy_datetime64_instead);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Expects_numpy_timedelta64_instea);
  Py_VISIT(traverse_module_state->__pyx_n_s_FN_TIME_LOCALTIME);
  Py_VISIT(traverse_module_state->__pyx_n_s_ImportError);
  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_s_MONTH_TO_QUARTER);
  Py_VISIT(traverse_module_state->__pyx_n_s_NS_DAY);
  Py_VISIT(traverse_module_state->__pyx_n_s_NS_HOUR);
  Py_VISIT(traverse_module_state->__pyx_n_s_NS_MINUTE);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Only_support_ndarray_with_up_to);
  Py_VISIT(traverse_module_state->__pyx_n_s_OverflowError);
  Py_VISIT(traverse_module_state->__pyx_n_s_RuntimeError);
  Py_VISIT(traverse_module_state->__pyx_n_s_Series);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Series_s);
  Py_VISIT(traverse_module_state->__pyx_n_u_T);
  Py_VISIT(traverse_module_state->__pyx_n_s_TD_UNIT_ADJUSTMENT);
  Py_VISIT(traverse_module_state->__pyx_n_s_TIME_END);
  Py_VISIT(traverse_module_state->__pyx_n_s_TIME_START);
  Py_VISIT(traverse_module_state->__pyx_kp_u_The_format_string_for_datetime_i);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Time_zones_are_not_available_fro);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Timezone_expects_offset_86_340_8);
  Py_VISIT(traverse_module_state->__pyx_n_s_TypeError);
  Py_VISIT(traverse_module_state->__pyx_n_s_US_DAY);
  Py_VISIT(traverse_module_state->__pyx_n_s_US_HOUR);
  Py_VISIT(traverse_module_state->__pyx_n_s_UTC);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Unable_to_parse_ndarray_datetime);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Unable_to_parse_ndarray_timedelt);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Unknown_ndarray_datetime64_time);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Unknown_ndarray_timedelta64_time);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Unsupported_ndarray_datetime64_t);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Unsupported_ndarray_timedelta64);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Unsupported_numpy_datetime64_tim);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Unsupported_numpy_timedelta64_ti);
  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_Y);
  Py_VISIT(traverse_module_state->__pyx_kp_u__10);
  Py_VISIT(traverse_module_state->__pyx_kp_u__11);
  Py_VISIT(traverse_module_state->__pyx_n_s__15);
  Py_VISIT(traverse_module_state->__pyx_n_s__17);
  Py_VISIT(traverse_module_state->__pyx_kp_u__4);
  Py_VISIT(traverse_module_state->__pyx_kp_u__5);
  Py_VISIT(traverse_module_state->__pyx_kp_u__6);
  Py_VISIT(traverse_module_state->__pyx_kp_u__7);
  Py_VISIT(traverse_module_state->__pyx_kp_u__8);
  Py_VISIT(traverse_module_state->__pyx_kp_u__9);
  Py_VISIT(traverse_module_state->__pyx_n_s_array);
  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_class_getitem);
  Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
  Py_VISIT(traverse_module_state->__pyx_n_s_cytimes);
  Py_VISIT(traverse_module_state->__pyx_n_u_d);
  Py_VISIT(traverse_module_state->__pyx_n_s_datetime);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime_tzinfo_dst_must_return);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime_tzinfo_tzname_must_ret);
  Py_VISIT(traverse_module_state->__pyx_kp_u_datetime_tzinfo_utcoffset_must);
  Py_VISIT(traverse_module_state->__pyx_n_s_day);
  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_dtype);
  Py_VISIT(traverse_module_state->__pyx_n_u_fs);
  Py_VISIT(traverse_module_state->__pyx_n_u_h);
  Py_VISIT(traverse_module_state->__pyx_n_s_hour);
  Py_VISIT(traverse_module_state->__pyx_n_s_import);
  Py_VISIT(traverse_module_state->__pyx_n_s_index);
  Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
  Py_VISIT(traverse_module_state->__pyx_n_s_localtime);
  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_microsecond);
  Py_VISIT(traverse_module_state->__pyx_n_s_minute);
  Py_VISIT(traverse_module_state->__pyx_n_s_month);
  Py_VISIT(traverse_module_state->__pyx_n_u_ms);
  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_np);
  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_pandas);
  Py_VISIT(traverse_module_state->__pyx_n_u_ps);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_capi);
  Py_VISIT(traverse_module_state->__pyx_n_s_range);
  Py_VISIT(traverse_module_state->__pyx_n_u_s);
  Py_VISIT(traverse_module_state->__pyx_n_s_second);
  Py_VISIT(traverse_module_state->__pyx_n_s_spec);
  Py_VISIT(traverse_module_state->__pyx_n_s_str);
  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_s_time_localtime);
  Py_VISIT(traverse_module_state->__pyx_n_s_tm_gmtoff);
  Py_VISIT(traverse_module_state->__pyx_n_s_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_s_tm_min);
  Py_VISIT(traverse_module_state->__pyx_n_s_tm_mon);
  Py_VISIT(traverse_module_state->__pyx_n_s_tm_sec);
  Py_VISIT(traverse_module_state->__pyx_n_s_tm_wday);
  Py_VISIT(traverse_module_state->__pyx_n_s_tm_yday);
  Py_VISIT(traverse_module_state->__pyx_n_s_tm_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_typeref);
  Py_VISIT(traverse_module_state->__pyx_n_s_typing);
  Py_VISIT(traverse_module_state->__pyx_n_s_tzname);
  Py_VISIT(traverse_module_state->__pyx_n_u_us);
  Py_VISIT(traverse_module_state->__pyx_n_s_utcoffset);
  Py_VISIT(traverse_module_state->__pyx_n_s_values);
  Py_VISIT(traverse_module_state->__pyx_n_s_week);
  Py_VISIT(traverse_module_state->__pyx_n_s_weekday);
  Py_VISIT(traverse_module_state->__pyx_n_s_year);
  Py_VISIT(traverse_module_state->__pyx_int_0);
  Py_VISIT(traverse_module_state->__pyx_int_23);
  Py_VISIT(traverse_module_state->__pyx_int_24);
  Py_VISIT(traverse_module_state->__pyx_int_59);
  Py_VISIT(traverse_module_state->__pyx_int_60);
  Py_VISIT(traverse_module_state->__pyx_int_90);
  Py_VISIT(traverse_module_state->__pyx_int_181);
  Py_VISIT(traverse_module_state->__pyx_int_273);
  Py_VISIT(traverse_module_state->__pyx_int_365);
  Py_VISIT(traverse_module_state->__pyx_int_1000);
  Py_VISIT(traverse_module_state->__pyx_int_1440);
  Py_VISIT(traverse_module_state->__pyx_int_3600);
  Py_VISIT(traverse_module_state->__pyx_int_60000);
  Py_VISIT(traverse_module_state->__pyx_int_86400);
  Py_VISIT(traverse_module_state->__pyx_int_719163);
  Py_VISIT(traverse_module_state->__pyx_int_999999);
  Py_VISIT(traverse_module_state->__pyx_int_1000000);
  Py_VISIT(traverse_module_state->__pyx_int_3600000);
  Py_VISIT(traverse_module_state->__pyx_int_60000000);
  Py_VISIT(traverse_module_state->__pyx_int_86400000);
  Py_VISIT(traverse_module_state->__pyx_int_1000000000);
  Py_VISIT(traverse_module_state->__pyx_int_3600000000);
  Py_VISIT(traverse_module_state->__pyx_int_60000000000);
  Py_VISIT(traverse_module_state->__pyx_int_86400000000);
  Py_VISIT(traverse_module_state->__pyx_int_1000000000000);
  Py_VISIT(traverse_module_state->__pyx_int_3600000000000);
  Py_VISIT(traverse_module_state->__pyx_int_0x3691d6afc000);
  Py_VISIT(traverse_module_state->__pyx_int_0x4e94914f0000);
  Py_VISIT(traverse_module_state->__pyx_int_0x38d7ea4c68000);
  Py_VISIT(traverse_module_state->__pyx_int_0xcca2e51310000);
  Py_VISIT(traverse_module_state->__pyx_int_0xd529ae9e860000);
  Py_VISIT(traverse_module_state->__pyx_int_0x132f4579c980000);
  Py_VISIT(traverse_module_state->__pyx_int_0xde0b6b3a7640000);
  Py_VISIT(traverse_module_state->__pyx_int_0x31f5c4ed27680000);
  Py_VISIT(traverse_module_state->__pyx_int_0x340aad21b3b700000);
  Py_VISIT(traverse_module_state->__pyx_int_0x4af0a763bb1c00000);
  Py_VISIT(traverse_module_state->__pyx_int_0xc328093e61ee400000);
  Py_VISIT(traverse_module_state->__pyx_int_0x124bc0ddd92e56000000);
  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__12);
  Py_VISIT(traverse_module_state->__pyx_tuple__13);
  Py_VISIT(traverse_module_state->__pyx_tuple__14);
  Py_VISIT(traverse_module_state->__pyx_tuple__16);
  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
#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
#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_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_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError
#define __pyx_kp_u_Cannot_adjust_Series_timedelta64 __pyx_mstate_global->__pyx_kp_u_Cannot_adjust_Series_timedelta64
#define __pyx_n_u_D __pyx_mstate_global->__pyx_n_u_D
#define __pyx_n_s_DAYS_BR_MONTH __pyx_mstate_global->__pyx_n_s_DAYS_BR_MONTH
#define __pyx_n_s_DAYS_BR_QUARTER __pyx_mstate_global->__pyx_n_s_DAYS_BR_QUARTER
#define __pyx_n_s_DAYS_BR_QUARTER_NDARRAY __pyx_mstate_global->__pyx_n_s_DAYS_BR_QUARTER_NDARRAY
#define __pyx_n_s_DAYS_IN_MONTH __pyx_mstate_global->__pyx_n_s_DAYS_IN_MONTH
#define __pyx_n_s_DAYS_IN_QUARTER __pyx_mstate_global->__pyx_n_s_DAYS_IN_QUARTER
#define __pyx_n_s_DT_MAX_US __pyx_mstate_global->__pyx_n_s_DT_MAX_US
#define __pyx_n_s_DT_MIN_US __pyx_mstate_global->__pyx_n_s_DT_MIN_US
#define __pyx_kp_u_Does_not_support_conversion_of_S __pyx_mstate_global->__pyx_kp_u_Does_not_support_conversion_of_S
#define __pyx_kp_u_Does_not_support_conversion_of_S_2 __pyx_mstate_global->__pyx_kp_u_Does_not_support_conversion_of_S_2
#define __pyx_kp_u_Does_not_support_conversion_of_n __pyx_mstate_global->__pyx_kp_u_Does_not_support_conversion_of_n
#define __pyx_kp_u_Does_not_support_conversion_of_n_2 __pyx_mstate_global->__pyx_kp_u_Does_not_support_conversion_of_n_2
#define __pyx_kp_u_Does_not_support_conversion_of_n_3 __pyx_mstate_global->__pyx_kp_u_Does_not_support_conversion_of_n_3
#define __pyx_kp_u_Does_not_support_conversion_of_n_4 __pyx_mstate_global->__pyx_kp_u_Does_not_support_conversion_of_n_4
#define __pyx_n_s_EPOCH_DAY __pyx_mstate_global->__pyx_n_s_EPOCH_DAY
#define __pyx_n_s_EPOCH_SEC __pyx_mstate_global->__pyx_n_s_EPOCH_SEC
#define __pyx_n_s_EPOCH_US __pyx_mstate_global->__pyx_n_s_EPOCH_US
#define __pyx_n_s_EPOCH_UTC __pyx_mstate_global->__pyx_n_s_EPOCH_UTC
#define __pyx_kp_u_Expects_Series_datetime64_instea __pyx_mstate_global->__pyx_kp_u_Expects_Series_datetime64_instea
#define __pyx_kp_u_Expects_Series_timedelta64_inste __pyx_mstate_global->__pyx_kp_u_Expects_Series_timedelta64_inste
#define __pyx_kp_u_Expects_datetime_tzinfo_instead __pyx_mstate_global->__pyx_kp_u_Expects_datetime_tzinfo_instead
#define __pyx_kp_u_Expects_ndarray_datetime64_inste __pyx_mstate_global->__pyx_kp_u_Expects_ndarray_datetime64_inste
#define __pyx_kp_u_Expects_ndarray_timedelta64_inst __pyx_mstate_global->__pyx_kp_u_Expects_ndarray_timedelta64_inst
#define __pyx_kp_u_Expects_numpy_datetime64_instead __pyx_mstate_global->__pyx_kp_u_Expects_numpy_datetime64_instead
#define __pyx_kp_u_Expects_numpy_timedelta64_instea __pyx_mstate_global->__pyx_kp_u_Expects_numpy_timedelta64_instea
#define __pyx_n_s_FN_TIME_LOCALTIME __pyx_mstate_global->__pyx_n_s_FN_TIME_LOCALTIME
#define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError
#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_s_MONTH_TO_QUARTER __pyx_mstate_global->__pyx_n_s_MONTH_TO_QUARTER
#define __pyx_n_s_NS_DAY __pyx_mstate_global->__pyx_n_s_NS_DAY
#define __pyx_n_s_NS_HOUR __pyx_mstate_global->__pyx_n_s_NS_HOUR
#define __pyx_n_s_NS_MINUTE __pyx_mstate_global->__pyx_n_s_NS_MINUTE
#define __pyx_kp_u_Only_support_ndarray_with_up_to __pyx_mstate_global->__pyx_kp_u_Only_support_ndarray_with_up_to
#define __pyx_n_s_OverflowError __pyx_mstate_global->__pyx_n_s_OverflowError
#define __pyx_n_s_RuntimeError __pyx_mstate_global->__pyx_n_s_RuntimeError
#define __pyx_n_s_Series __pyx_mstate_global->__pyx_n_s_Series
#define __pyx_kp_u_Series_s __pyx_mstate_global->__pyx_kp_u_Series_s
#define __pyx_n_u_T __pyx_mstate_global->__pyx_n_u_T
#define __pyx_n_s_TD_UNIT_ADJUSTMENT __pyx_mstate_global->__pyx_n_s_TD_UNIT_ADJUSTMENT
#define __pyx_n_s_TIME_END __pyx_mstate_global->__pyx_n_s_TIME_END
#define __pyx_n_s_TIME_START __pyx_mstate_global->__pyx_n_s_TIME_START
#define __pyx_kp_u_The_format_string_for_datetime_i __pyx_mstate_global->__pyx_kp_u_The_format_string_for_datetime_i
#define __pyx_kp_u_Time_zones_are_not_available_fro __pyx_mstate_global->__pyx_kp_u_Time_zones_are_not_available_fro
#define __pyx_kp_u_Timezone_expects_offset_86_340_8 __pyx_mstate_global->__pyx_kp_u_Timezone_expects_offset_86_340_8
#define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError
#define __pyx_n_s_US_DAY __pyx_mstate_global->__pyx_n_s_US_DAY
#define __pyx_n_s_US_HOUR __pyx_mstate_global->__pyx_n_s_US_HOUR
#define __pyx_n_s_UTC __pyx_mstate_global->__pyx_n_s_UTC
#define __pyx_kp_u_Unable_to_parse_ndarray_datetime __pyx_mstate_global->__pyx_kp_u_Unable_to_parse_ndarray_datetime
#define __pyx_kp_u_Unable_to_parse_ndarray_timedelt __pyx_mstate_global->__pyx_kp_u_Unable_to_parse_ndarray_timedelt
#define __pyx_kp_u_Unknown_ndarray_datetime64_time __pyx_mstate_global->__pyx_kp_u_Unknown_ndarray_datetime64_time
#define __pyx_kp_u_Unknown_ndarray_timedelta64_time __pyx_mstate_global->__pyx_kp_u_Unknown_ndarray_timedelta64_time
#define __pyx_kp_u_Unsupported_ndarray_datetime64_t __pyx_mstate_global->__pyx_kp_u_Unsupported_ndarray_datetime64_t
#define __pyx_kp_u_Unsupported_ndarray_timedelta64 __pyx_mstate_global->__pyx_kp_u_Unsupported_ndarray_timedelta64
#define __pyx_kp_u_Unsupported_numpy_datetime64_tim __pyx_mstate_global->__pyx_kp_u_Unsupported_numpy_datetime64_tim
#define __pyx_kp_u_Unsupported_numpy_timedelta64_ti __pyx_mstate_global->__pyx_kp_u_Unsupported_numpy_timedelta64_ti
#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_Y __pyx_mstate_global->__pyx_n_u_Y
#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_n_s__15 __pyx_mstate_global->__pyx_n_s__15
#define __pyx_n_s__17 __pyx_mstate_global->__pyx_n_s__17
#define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4
#define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5
#define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6
#define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7
#define __pyx_kp_u__8 __pyx_mstate_global->__pyx_kp_u__8
#define __pyx_kp_u__9 __pyx_mstate_global->__pyx_kp_u__9
#define __pyx_n_s_array __pyx_mstate_global->__pyx_n_s_array
#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_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_cytimes __pyx_mstate_global->__pyx_n_s_cytimes
#define __pyx_n_u_d __pyx_mstate_global->__pyx_n_u_d
#define __pyx_n_s_datetime __pyx_mstate_global->__pyx_n_s_datetime
#define __pyx_kp_u_datetime_tzinfo_dst_must_return __pyx_mstate_global->__pyx_kp_u_datetime_tzinfo_dst_must_return
#define __pyx_kp_u_datetime_tzinfo_tzname_must_ret __pyx_mstate_global->__pyx_kp_u_datetime_tzinfo_tzname_must_ret
#define __pyx_kp_u_datetime_tzinfo_utcoffset_must __pyx_mstate_global->__pyx_kp_u_datetime_tzinfo_utcoffset_must
#define __pyx_n_s_day __pyx_mstate_global->__pyx_n_s_day
#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_dtype __pyx_mstate_global->__pyx_n_s_dtype
#define __pyx_n_u_fs __pyx_mstate_global->__pyx_n_u_fs
#define __pyx_n_u_h __pyx_mstate_global->__pyx_n_u_h
#define __pyx_n_s_hour __pyx_mstate_global->__pyx_n_s_hour
#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
#define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index
#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
#define __pyx_n_s_localtime __pyx_mstate_global->__pyx_n_s_localtime
#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_microsecond __pyx_mstate_global->__pyx_n_s_microsecond
#define __pyx_n_s_minute __pyx_mstate_global->__pyx_n_s_minute
#define __pyx_n_s_month __pyx_mstate_global->__pyx_n_s_month
#define __pyx_n_u_ms __pyx_mstate_global->__pyx_n_u_ms
#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_np __pyx_mstate_global->__pyx_n_s_np
#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_pandas __pyx_mstate_global->__pyx_n_s_pandas
#define __pyx_n_u_ps __pyx_mstate_global->__pyx_n_u_ps
#define __pyx_n_s_pyx_capi __pyx_mstate_global->__pyx_n_s_pyx_capi
#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range
#define __pyx_n_u_s __pyx_mstate_global->__pyx_n_u_s
#define __pyx_n_s_second __pyx_mstate_global->__pyx_n_s_second
#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
#define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str
#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_s_time_localtime __pyx_mstate_global->__pyx_n_s_time_localtime
#define __pyx_n_s_tm_gmtoff __pyx_mstate_global->__pyx_n_s_tm_gmtoff
#define __pyx_n_s_tm_hour __pyx_mstate_global->__pyx_n_s_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_s_tm_min __pyx_mstate_global->__pyx_n_s_tm_min
#define __pyx_n_s_tm_mon __pyx_mstate_global->__pyx_n_s_tm_mon
#define __pyx_n_s_tm_sec __pyx_mstate_global->__pyx_n_s_tm_sec
#define __pyx_n_s_tm_wday __pyx_mstate_global->__pyx_n_s_tm_wday
#define __pyx_n_s_tm_yday __pyx_mstate_global->__pyx_n_s_tm_yday
#define __pyx_n_s_tm_year __pyx_mstate_global->__pyx_n_s_tm_year
#define __pyx_n_s_typeref __pyx_mstate_global->__pyx_n_s_typeref
#define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing
#define __pyx_n_s_tzname __pyx_mstate_global->__pyx_n_s_tzname
#define __pyx_n_u_us __pyx_mstate_global->__pyx_n_u_us
#define __pyx_n_s_utcoffset __pyx_mstate_global->__pyx_n_s_utcoffset
#define __pyx_n_s_values __pyx_mstate_global->__pyx_n_s_values
#define __pyx_n_s_week __pyx_mstate_global->__pyx_n_s_week
#define __pyx_n_s_weekday __pyx_mstate_global->__pyx_n_s_weekday
#define __pyx_n_s_year __pyx_mstate_global->__pyx_n_s_year
#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0
#define __pyx_int_23 __pyx_mstate_global->__pyx_int_23
#define __pyx_int_24 __pyx_mstate_global->__pyx_int_24
#define __pyx_int_59 __pyx_mstate_global->__pyx_int_59
#define __pyx_int_60 __pyx_mstate_global->__pyx_int_60
#define __pyx_int_90 __pyx_mstate_global->__pyx_int_90
#define __pyx_int_181 __pyx_mstate_global->__pyx_int_181
#define __pyx_int_273 __pyx_mstate_global->__pyx_int_273
#define __pyx_int_365 __pyx_mstate_global->__pyx_int_365
#define __pyx_int_1000 __pyx_mstate_global->__pyx_int_1000
#define __pyx_int_1440 __pyx_mstate_global->__pyx_int_1440
#define __pyx_int_3600 __pyx_mstate_global->__pyx_int_3600
#define __pyx_int_60000 __pyx_mstate_global->__pyx_int_60000
#define __pyx_int_86400 __pyx_mstate_global->__pyx_int_86400
#define __pyx_int_719163 __pyx_mstate_global->__pyx_int_719163
#define __pyx_int_999999 __pyx_mstate_global->__pyx_int_999999
#define __pyx_int_1000000 __pyx_mstate_global->__pyx_int_1000000
#define __pyx_int_3600000 __pyx_mstate_global->__pyx_int_3600000
#define __pyx_int_60000000 __pyx_mstate_global->__pyx_int_60000000
#define __pyx_int_86400000 __pyx_mstate_global->__pyx_int_86400000
#define __pyx_int_1000000000 __pyx_mstate_global->__pyx_int_1000000000
#define __pyx_int_3600000000 __pyx_mstate_global->__pyx_int_3600000000
#define __pyx_int_60000000000 __pyx_mstate_global->__pyx_int_60000000000
#define __pyx_int_86400000000 __pyx_mstate_global->__pyx_int_86400000000
#define __pyx_int_1000000000000 __pyx_mstate_global->__pyx_int_1000000000000
#define __pyx_int_3600000000000 __pyx_mstate_global->__pyx_int_3600000000000
#define __pyx_int_0x3691d6afc000 __pyx_mstate_global->__pyx_int_0x3691d6afc000
#define __pyx_int_0x4e94914f0000 __pyx_mstate_global->__pyx_int_0x4e94914f0000
#define __pyx_int_0x38d7ea4c68000 __pyx_mstate_global->__pyx_int_0x38d7ea4c68000
#define __pyx_int_0xcca2e51310000 __pyx_mstate_global->__pyx_int_0xcca2e51310000
#define __pyx_int_0xd529ae9e860000 __pyx_mstate_global->__pyx_int_0xd529ae9e860000
#define __pyx_int_0x132f4579c980000 __pyx_mstate_global->__pyx_int_0x132f4579c980000
#define __pyx_int_0xde0b6b3a7640000 __pyx_mstate_global->__pyx_int_0xde0b6b3a7640000
#define __pyx_int_0x31f5c4ed27680000 __pyx_mstate_global->__pyx_int_0x31f5c4ed27680000
#define __pyx_int_0x340aad21b3b700000 __pyx_mstate_global->__pyx_int_0x340aad21b3b700000
#define __pyx_int_0x4af0a763bb1c00000 __pyx_mstate_global->__pyx_int_0x4af0a763bb1c00000
#define __pyx_int_0xc328093e61ee400000 __pyx_mstate_global->__pyx_int_0xc328093e61ee400000
#define __pyx_int_0x124bc0ddd92e56000000 __pyx_mstate_global->__pyx_int_0x124bc0ddd92e56000000
#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__12 __pyx_mstate_global->__pyx_tuple__12
#define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13
#define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14
#define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16
/* #### Code section: module_code ### */

/* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":287
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286
 * 
 *         @property
 *         cdef inline npy_intp itemsize(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             return PyDataType_ELSIZE(self)
 * 
 */

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

/* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":291
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290
 * 
 *         @property
 *         cdef inline npy_intp alignment(self) noexcept nogil:             # <<<<<<<<<<<<<<
 *             return PyDataType_ALIGNMENT(self)
 * 
 */

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

/* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296
 *         # 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":297
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296
 *         # 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":301
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307
 *         # 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":308
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307
 *         # 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":313
 *         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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":325
 *         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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":330
 *         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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":335
 *         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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":340
 *         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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":345
 *         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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":351
 *             """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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":369
 *             """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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":375
 *             """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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":381
 *             """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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":389
 *             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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":396
 *             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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":402
 *             """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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":411
 *             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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405
 * 
 *         @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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":807
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":808
 * 
 * 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(2, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":807
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":810
 *     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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":811
 * 
 * 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(2, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":810
 *     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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":813
 *     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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":814
 * 
 * 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(2, 814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":813
 *     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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":816
 *     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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":817
 * 
 * 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(2, 817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":816
 *     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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":819
 *     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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":820
 * 
 * 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(2, 820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":819
 *     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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":822
 *     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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":823
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":824
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":823
 * 
 * cdef inline tuple PyDataType_SHAPE(dtype d):
 *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
 *         return <tuple>d.subarray.shape
 *     else:
 */
  }

  /* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":826
 *         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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":822
 *     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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1010
 *     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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1011
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1012
 * 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(2, 1012, __pyx_L1_error)

  /* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1010
 *     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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1014
 *     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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1015
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1016
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1017
 *     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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1016
 * cdef inline object get_array_base(ndarray arr):
 *     base = PyArray_BASE(arr)
 *     if base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     return <object>base
 */
  }

  /* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1018
 *     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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1014
 *     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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
 * # 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1023
 * # 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1024
 * 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(2, 1024, __pyx_L3_error)

      /* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1023
 * # 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025
 *     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(2, 1025, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1026
 *         __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(2, 1026, __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(2, 1026, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1023
 * # 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
 * # 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
 *         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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1029
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1030
 * 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(2, 1030, __pyx_L3_error)

      /* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1029
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031
 *     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(2, 1031, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1032
 *         _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(2, 1032, __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(2, 1032, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1029
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
 *         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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
 *         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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1035
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1036
 * 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(2, 1036, __pyx_L3_error)

      /* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1035
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1037
 *     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(2, 1037, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1038
 *         _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(2, 1038, __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(2, 1038, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1035
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
 *         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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1041
 * 
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1053
 *     bool
 *     """
 *     return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1041
 * 
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1056
 * 
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1068
 *     bool
 *     """
 *     return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
  goto __pyx_L0;

  /* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1056
 * 
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1071
 * 
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1078
 *     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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1071
 * 
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1081
 * 
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1085
 *     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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1081
 * 
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1088
 * 
 * 
 * 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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1092
 *     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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1088
 * 
 * 
 * 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(3, 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(3, 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(4, 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(4, 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(4, 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(4, 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(4, 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(4, 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(4, 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(4, 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(4, 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(4, 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(4, 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(4, 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(4, 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(4, 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(4, 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(4, 318, __pyx_L1_error);
  __pyx_t_2 = ((PyObject *)PyDateTimeAPI->Date_FromTimestamp(((PyObject *)PyDateTimeAPI->DateType), __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 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(4, 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(4, 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;
}

/* "cytimes/cydatetime.pxd":66
 * 
 * # Equivalent to `time.localtime(timestamp)`.
 * cdef inline tm localize_time(double timestamp) except * nogil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         time_t tic = <time_t>timestamp
 */

static CYTHON_INLINE struct tm __pyx_f_7cytimes_10cydatetime_localize_time(double __pyx_v_timestamp) {
  time_t __pyx_v_tic;
  struct tm *__pyx_v_tms;
  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

  /* "cytimes/cydatetime.pxd":68
 * cdef inline tm localize_time(double timestamp) except * nogil:
 *     cdef:
 *         time_t tic = <time_t>timestamp             # <<<<<<<<<<<<<<
 *         tm* tms
 * 
 */
  __pyx_v_tic = ((time_t)__pyx_v_timestamp);

  /* "cytimes/cydatetime.pxd":71
 *         tm* tms
 * 
 *     tms = libc_localtime(&tic)             # <<<<<<<<<<<<<<
 *     if tms is NULL:
 *         raise_from_errno()
 */
  __pyx_v_tms = localtime((&__pyx_v_tic));

  /* "cytimes/cydatetime.pxd":72
 * 
 *     tms = libc_localtime(&tic)
 *     if tms is NULL:             # <<<<<<<<<<<<<<
 *         raise_from_errno()
 *     # Fix 0-based date values (and the 1900-based year).
 */
  __pyx_t_1 = (__pyx_v_tms == NULL);
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.pxd":73
 *     tms = libc_localtime(&tic)
 *     if tms 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_10cydatetime_raise_from_errno(); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 73, __pyx_L1_error)

    /* "cytimes/cydatetime.pxd":72
 * 
 *     tms = libc_localtime(&tic)
 *     if tms is NULL:             # <<<<<<<<<<<<<<
 *         raise_from_errno()
 *     # Fix 0-based date values (and the 1900-based year).
 */
  }

  /* "cytimes/cydatetime.pxd":76
 *     # Fix 0-based date values (and the 1900-based year).
 *     # See tmtotuple() in https://github.com/python/cpython/blob/master/Modules/timemodule.c
 *     tms.tm_year += 1900             # <<<<<<<<<<<<<<
 *     tms.tm_mon += 1
 *     tms.tm_wday = (tms.tm_wday + 6) % 7
 */
  __pyx_v_tms->tm_year = (__pyx_v_tms->tm_year + 0x76C);

  /* "cytimes/cydatetime.pxd":77
 *     # See tmtotuple() in https://github.com/python/cpython/blob/master/Modules/timemodule.c
 *     tms.tm_year += 1900
 *     tms.tm_mon += 1             # <<<<<<<<<<<<<<
 *     tms.tm_wday = (tms.tm_wday + 6) % 7
 *     tms.tm_yday += 1
 */
  __pyx_v_tms->tm_mon = (__pyx_v_tms->tm_mon + 1);

  /* "cytimes/cydatetime.pxd":78
 *     tms.tm_year += 1900
 *     tms.tm_mon += 1
 *     tms.tm_wday = (tms.tm_wday + 6) % 7             # <<<<<<<<<<<<<<
 *     tms.tm_yday += 1
 *     return tms[0]
 */
  __pyx_v_tms->tm_wday = __Pyx_mod_long((__pyx_v_tms->tm_wday + 6), 7);

  /* "cytimes/cydatetime.pxd":79
 *     tms.tm_mon += 1
 *     tms.tm_wday = (tms.tm_wday + 6) % 7
 *     tms.tm_yday += 1             # <<<<<<<<<<<<<<
 *     return tms[0]
 * 
 */
  __pyx_v_tms->tm_yday = (__pyx_v_tms->tm_yday + 1);

  /* "cytimes/cydatetime.pxd":80
 *     tms.tm_wday = (tms.tm_wday + 6) % 7
 *     tms.tm_yday += 1
 *     return tms[0]             # <<<<<<<<<<<<<<
 * 
 * # Error handling for localize time
 */
  __pyx_r = (__pyx_v_tms[0]);
  goto __pyx_L0;

  /* "cytimes/cydatetime.pxd":66
 * 
 * # Equivalent to `time.localtime(timestamp)`.
 * cdef inline tm localize_time(double timestamp) except * nogil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         time_t tic = <time_t>timestamp
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("cytimes.cydatetime.localize_time", __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;
}

/* "cytimes/cydatetime.pxd":83
 * 
 * # Error handling for localize time
 * cdef inline int raise_from_errno() except -1 with gil:             # <<<<<<<<<<<<<<
 *     PyErr_SetFromErrno(RuntimeError)
 *     return <int> -1  # type: ignore
 */

static CYTHON_INLINE int __pyx_f_7cytimes_10cydatetime_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

  /* "cytimes/cydatetime.pxd":84
 * # Error handling for localize time
 * cdef inline int raise_from_errno() except -1 with gil:
 *     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(0, 84, __pyx_L1_error)

  /* "cytimes/cydatetime.pxd":85
 * cdef inline int raise_from_errno() except -1 with gil:
 *     PyErr_SetFromErrno(RuntimeError)
 *     return <int> -1  # type: ignore             # <<<<<<<<<<<<<<
 * 
 * # Convert timestamp to a local timestamp
 */
  __pyx_r = ((int)-1L);
  goto __pyx_L0;

  /* "cytimes/cydatetime.pxd":83
 * 
 * # Error handling for localize time
 * cdef inline int raise_from_errno() except -1 with gil:             # <<<<<<<<<<<<<<
 *     PyErr_SetFromErrno(RuntimeError)
 *     return <int> -1  # type: ignore
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.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;
}

/* "cytimes/cydatetime.pxd":88
 * 
 * # Convert timestamp to a local timestamp
 * cdef inline long long localize_ts(double timestamp) except *:             # <<<<<<<<<<<<<<
 *     # Localize timestamp
 *     cdef tm t = localize_time(timestamp)
 */

static CYTHON_INLINE PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_localize_ts(double __pyx_v_timestamp) {
  struct tm __pyx_v_t;
  PY_LONG_LONG __pyx_v_ordinal;
  PY_LONG_LONG __pyx_v_seconds;
  PY_LONG_LONG __pyx_r;
  struct tm __pyx_t_1;
  unsigned int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.pxd":90
 * cdef inline long long localize_ts(double timestamp) except *:
 *     # Localize timestamp
 *     cdef tm t = localize_time(timestamp)             # <<<<<<<<<<<<<<
 *     # Calculate total seconds
 *     cdef long long ordinal = ymd_to_ordinal(t.tm_year, t.tm_mon, t.tm_mday)
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_localize_time(__pyx_v_timestamp); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L1_error)
  __pyx_v_t = __pyx_t_1;

  /* "cytimes/cydatetime.pxd":92
 *     cdef tm t = localize_time(timestamp)
 *     # Calculate total seconds
 *     cdef long long ordinal = ymd_to_ordinal(t.tm_year, t.tm_mon, t.tm_mday)             # <<<<<<<<<<<<<<
 *     cdef long long seconds = ordinal * 86_400 + t.tm_hour * 3_600 + t.tm_min * 60 + t.tm_sec
 *     # Return seconds since epoch
 */
  __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_ymd_to_ordinal(__pyx_v_t.tm_year, __pyx_v_t.tm_mon, __pyx_v_t.tm_mday); if (unlikely(__pyx_t_2 == ((unsigned int)-1))) __PYX_ERR(0, 92, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_2;

  /* "cytimes/cydatetime.pxd":93
 *     # Calculate total seconds
 *     cdef long long ordinal = ymd_to_ordinal(t.tm_year, t.tm_mon, t.tm_mday)
 *     cdef long long seconds = ordinal * 86_400 + t.tm_hour * 3_600 + t.tm_min * 60 + t.tm_sec             # <<<<<<<<<<<<<<
 *     # Return seconds since epoch
 *     return seconds - EPOCH_SEC
 */
  __pyx_v_seconds = ((((__pyx_v_ordinal * 0x15180) + (__pyx_v_t.tm_hour * 0xE10)) + (__pyx_v_t.tm_min * 60)) + __pyx_v_t.tm_sec);

  /* "cytimes/cydatetime.pxd":95
 *     cdef long long seconds = ordinal * 86_400 + t.tm_hour * 3_600 + t.tm_min * 60 + t.tm_sec
 *     # Return seconds since epoch
 *     return seconds - EPOCH_SEC             # <<<<<<<<<<<<<<
 * 
 * # Convert struct:tm to Python string based on the 'format'
 */
  __pyx_r = (__pyx_v_seconds - __pyx_v_7cytimes_10cydatetime_EPOCH_SEC);
  goto __pyx_L0;

  /* "cytimes/cydatetime.pxd":88
 * 
 * # Convert timestamp to a local timestamp
 * cdef inline long long localize_ts(double timestamp) except *:             # <<<<<<<<<<<<<<
 *     # Localize timestamp
 *     cdef tm t = localize_time(timestamp)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.localize_ts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.pxd":98
 * 
 * # Convert struct:tm to Python string based on the 'format'
 * cdef inline str stime_to_str(tm tms, str format):             # <<<<<<<<<<<<<<
 *     cdef:
 *         char buffer[256]
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytimes_10cydatetime_stime_to_str(struct tm __pyx_v_tms, PyObject *__pyx_v_format) {
  char __pyx_v_buffer[0x100];
  size_t __pyx_v_size;
  char const *__pyx_v_fmt;
  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("stime_to_str", 1);

  /* "cytimes/cydatetime.pxd":103
 *         size_t size
 *         str result
 *         const char* fmt = PyUnicode_AsUTF8(format)             # <<<<<<<<<<<<<<
 * 
 *     # Revert back to 0-based date values.
 */
  __pyx_t_1 = PyUnicode_AsUTF8(__pyx_v_format); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(0, 103, __pyx_L1_error)
  __pyx_v_fmt = __pyx_t_1;

  /* "cytimes/cydatetime.pxd":106
 * 
 *     # Revert back to 0-based date values.
 *     tms.tm_year -= 1_900             # <<<<<<<<<<<<<<
 *     tms.tm_mon -= 1
 *     tms.tm_wday = (tms.tm_wday + 1) % 7
 */
  __pyx_v_tms.tm_year = (__pyx_v_tms.tm_year - 0x76C);

  /* "cytimes/cydatetime.pxd":107
 *     # Revert back to 0-based date values.
 *     tms.tm_year -= 1_900
 *     tms.tm_mon -= 1             # <<<<<<<<<<<<<<
 *     tms.tm_wday = (tms.tm_wday + 1) % 7
 *     tms.tm_yday -= 1
 */
  __pyx_v_tms.tm_mon = (__pyx_v_tms.tm_mon - 1);

  /* "cytimes/cydatetime.pxd":108
 *     tms.tm_year -= 1_900
 *     tms.tm_mon -= 1
 *     tms.tm_wday = (tms.tm_wday + 1) % 7             # <<<<<<<<<<<<<<
 *     tms.tm_yday -= 1
 *     # Convert to Python string.
 */
  __pyx_v_tms.tm_wday = __Pyx_mod_long((__pyx_v_tms.tm_wday + 1), 7);

  /* "cytimes/cydatetime.pxd":109
 *     tms.tm_mon -= 1
 *     tms.tm_wday = (tms.tm_wday + 1) % 7
 *     tms.tm_yday -= 1             # <<<<<<<<<<<<<<
 *     # Convert to Python string.
 *     size = strftime(buffer, sizeof(buffer), fmt, &tms)
 */
  __pyx_v_tms.tm_yday = (__pyx_v_tms.tm_yday - 1);

  /* "cytimes/cydatetime.pxd":111
 *     tms.tm_yday -= 1
 *     # Convert to Python string.
 *     size = strftime(buffer, sizeof(buffer), fmt, &tms)             # <<<<<<<<<<<<<<
 *     if size == 0:
 *         raise OverflowError("The format string for datetime is too long:\n'%s'" % format)
 */
  __pyx_v_size = strftime(__pyx_v_buffer, (sizeof(__pyx_v_buffer)), __pyx_v_fmt, (&__pyx_v_tms));

  /* "cytimes/cydatetime.pxd":112
 *     # Convert to Python string.
 *     size = strftime(buffer, sizeof(buffer), fmt, &tms)
 *     if size == 0:             # <<<<<<<<<<<<<<
 *         raise OverflowError("The format string for datetime is too long:\n'%s'" % format)
 *     return PyUnicode_DecodeUTF8(buffer, size, NULL)
 */
  __pyx_t_2 = (__pyx_v_size == 0);
  if (unlikely(__pyx_t_2)) {

    /* "cytimes/cydatetime.pxd":113
 *     size = strftime(buffer, sizeof(buffer), fmt, &tms)
 *     if size == 0:
 *         raise OverflowError("The format string for datetime is too long:\n'%s'" % format)             # <<<<<<<<<<<<<<
 *     return PyUnicode_DecodeUTF8(buffer, size, NULL)
 * 
 */
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_The_format_string_for_datetime_i, __pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __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(0, 113, __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(0, 113, __pyx_L1_error)

    /* "cytimes/cydatetime.pxd":112
 *     # Convert to Python string.
 *     size = strftime(buffer, sizeof(buffer), fmt, &tms)
 *     if size == 0:             # <<<<<<<<<<<<<<
 *         raise OverflowError("The format string for datetime is too long:\n'%s'" % format)
 *     return PyUnicode_DecodeUTF8(buffer, size, NULL)
 */
  }

  /* "cytimes/cydatetime.pxd":114
 *     if size == 0:
 *         raise OverflowError("The format string for datetime is too long:\n'%s'" % format)
 *     return PyUnicode_DecodeUTF8(buffer, size, NULL)             # <<<<<<<<<<<<<<
 * 
 * # Calendar: year
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyUnicode_DecodeUTF8(__pyx_v_buffer, __pyx_v_size, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.pxd":98
 * 
 * # Convert struct:tm to Python string based on the 'format'
 * cdef inline str stime_to_str(tm tms, str format):             # <<<<<<<<<<<<<<
 *     cdef:
 *         char buffer[256]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.cydatetime.stime_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/time.pxd":20
 * 
 * 
 * cdef inline double time() noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         _PyTime_t tic
 */

static CYTHON_INLINE double __pyx_f_7cpython_4time_time(void) {
  _PyTime_t __pyx_v_tic;
  double __pyx_r;

  /* "cpython/time.pxd":24
 *         _PyTime_t tic
 * 
 *     tic = _PyTime_GetSystemClock()             # <<<<<<<<<<<<<<
 *     return _PyTime_AsSecondsDouble(tic)
 * 
 */
  __pyx_v_tic = _PyTime_GetSystemClock();

  /* "cpython/time.pxd":25
 * 
 *     tic = _PyTime_GetSystemClock()
 *     return _PyTime_AsSecondsDouble(tic)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = _PyTime_AsSecondsDouble(__pyx_v_tic);
  goto __pyx_L0;

  /* "cpython/time.pxd":20
 * 
 * 
 * cdef inline double time() noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         _PyTime_t tic
 */

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

/* "cpython/time.pxd":28
 * 
 * 
 * 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":29
 * 
 * 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(5, 29, __pyx_L1_error)

  /* "cpython/time.pxd":30
 * 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":28
 * 
 * 
 * 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":33
 * 
 * 
 * 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":39
 *     """
 *     cdef:
 *         time_t tic = <time_t>time()             # <<<<<<<<<<<<<<
 *         tm* result
 * 
 */
  __pyx_v_tic = ((time_t)__pyx_f_7cpython_4time_time());

  /* "cpython/time.pxd":42
 *         tm* result
 * 
 *     result = libc_localtime(&tic)             # <<<<<<<<<<<<<<
 *     if result is NULL:
 *         _raise_from_errno()
 */
  __pyx_v_result = localtime((&__pyx_v_tic));

  /* "cpython/time.pxd":43
 * 
 *     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":44
 *     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(5, 44, __pyx_L1_error)

    /* "cpython/time.pxd":43
 * 
 *     result = libc_localtime(&tic)
 *     if result is NULL:             # <<<<<<<<<<<<<<
 *         _raise_from_errno()
 *     # Fix 0-based date values (and the 1900-based year).
 */
  }

  /* "cpython/time.pxd":47
 *     # 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 = (result.tm_wday + 6) % 7
 */
  __pyx_v_result->tm_year = (__pyx_v_result->tm_year + 0x76C);

  /* "cpython/time.pxd":48
 *     # See tmtotuple() in https://github.com/python/cpython/blob/master/Modules/timemodule.c
 *     result.tm_year += 1900
 *     result.tm_mon += 1             # <<<<<<<<<<<<<<
 *     result.tm_wday = (result.tm_wday + 6) % 7
 *     result.tm_yday += 1
 */
  __pyx_v_result->tm_mon = (__pyx_v_result->tm_mon + 1);

  /* "cpython/time.pxd":49
 *     result.tm_year += 1900
 *     result.tm_mon += 1
 *     result.tm_wday = (result.tm_wday + 6) % 7             # <<<<<<<<<<<<<<
 *     result.tm_yday += 1
 *     return result[0]
 */
  __pyx_v_result->tm_wday = __Pyx_mod_long((__pyx_v_result->tm_wday + 6), 7);

  /* "cpython/time.pxd":50
 *     result.tm_mon += 1
 *     result.tm_wday = (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":51
 *     result.tm_wday = (result.tm_wday + 6) % 7
 *     result.tm_yday += 1
 *     return result[0]             # <<<<<<<<<<<<<<
 */
  __pyx_r = (__pyx_v_result[0]);
  goto __pyx_L0;

  /* "cpython/time.pxd":33
 * 
 * 
 * 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;
}

/* "cytimes/cydatetime.py":64
 * # Calendar =============================================================================================
 * # Calender: year ---------------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static int __pyx_f_7cytimes_10cydatetime_is_leapyear(unsigned int __pyx_v_year) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;

  /* "cytimes/cydatetime.py":69
 * def is_leapyear(year: cython.uint) -> cython.bint:
 *     """Determine whether the given 'year' is a leap year `<'bool'>`."""
 *     if year == 0:             # <<<<<<<<<<<<<<
 *         return False
 *     else:
 */
  __pyx_t_1 = (__pyx_v_year == 0);
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":70
 *     """Determine whether the given 'year' is a leap year `<'bool'>`."""
 *     if year == 0:
 *         return False             # <<<<<<<<<<<<<<
 *     else:
 *         return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":69
 * def is_leapyear(year: cython.uint) -> cython.bint:
 *     """Determine whether the given 'year' is a leap year `<'bool'>`."""
 *     if year == 0:             # <<<<<<<<<<<<<<
 *         return False
 *     else:
 */
  }

  /* "cytimes/cydatetime.py":72
 *         return False
 *     else:
 *         return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_2 = (__Pyx_mod_long(__pyx_v_year, 4) == 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_2 = (__Pyx_mod_long(__pyx_v_year, 0x64) != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_2 = (__Pyx_mod_long(__pyx_v_year, 0x190) == 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L4_bool_binop_done:;
    __pyx_r = __pyx_t_1;
    goto __pyx_L0;
  }

  /* "cytimes/cydatetime.py":64
 * # Calendar =============================================================================================
 * # Calender: year ---------------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

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

/* "cytimes/cydatetime.py":75
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_leap_bt_years(unsigned int __pyx_v_year1, unsigned int __pyx_v_year2) {
  Py_ssize_t __pyx_v_y1;
  Py_ssize_t __pyx_v_y2;
  unsigned int __pyx_r;
  int __pyx_t_1;

  /* "cytimes/cydatetime.py":80
 * def leap_bt_years(year1: cython.uint, year2: cython.uint) -> cython.uint:
 *     """Calculate the number of leap years between 'year1' and 'year2' `<'int'>`."""
 *     if year1 <= year2:             # <<<<<<<<<<<<<<
 *         y1: cython.Py_ssize_t = year1 - 1
 *         y2: cython.Py_ssize_t = year2 - 1
 */
  __pyx_t_1 = (__pyx_v_year1 <= __pyx_v_year2);
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":81
 *     """Calculate the number of leap years between 'year1' and 'year2' `<'int'>`."""
 *     if year1 <= year2:
 *         y1: cython.Py_ssize_t = year1 - 1             # <<<<<<<<<<<<<<
 *         y2: cython.Py_ssize_t = year2 - 1
 *     else:
 */
    __pyx_v_y1 = (__pyx_v_year1 - 1);

    /* "cytimes/cydatetime.py":82
 *     if year1 <= year2:
 *         y1: cython.Py_ssize_t = year1 - 1
 *         y2: cython.Py_ssize_t = year2 - 1             # <<<<<<<<<<<<<<
 *     else:
 *         y1: cython.Py_ssize_t = year2 - 1
 */
    __pyx_v_y2 = (__pyx_v_year2 - 1);

    /* "cytimes/cydatetime.py":80
 * def leap_bt_years(year1: cython.uint, year2: cython.uint) -> cython.uint:
 *     """Calculate the number of leap years between 'year1' and 'year2' `<'int'>`."""
 *     if year1 <= year2:             # <<<<<<<<<<<<<<
 *         y1: cython.Py_ssize_t = year1 - 1
 *         y2: cython.Py_ssize_t = year2 - 1
 */
    goto __pyx_L3;
  }

  /* "cytimes/cydatetime.py":84
 *         y2: cython.Py_ssize_t = year2 - 1
 *     else:
 *         y1: cython.Py_ssize_t = year2 - 1             # <<<<<<<<<<<<<<
 *         y2: cython.Py_ssize_t = year1 - 1
 *     return (y2 // 4 - y1 // 4) - (y2 // 100 - y1 // 100) + (y2 // 400 - y1 // 400)
 */
  /*else*/ {
    __pyx_v_y1 = (__pyx_v_year2 - 1);

    /* "cytimes/cydatetime.py":85
 *     else:
 *         y1: cython.Py_ssize_t = year2 - 1
 *         y2: cython.Py_ssize_t = year1 - 1             # <<<<<<<<<<<<<<
 *     return (y2 // 4 - y1 // 4) - (y2 // 100 - y1 // 100) + (y2 // 400 - y1 // 400)
 * 
 */
    __pyx_v_y2 = (__pyx_v_year1 - 1);
  }
  __pyx_L3:;

  /* "cytimes/cydatetime.py":86
 *         y1: cython.Py_ssize_t = year2 - 1
 *         y2: cython.Py_ssize_t = year1 - 1
 *     return (y2 // 4 - y1 // 4) - (y2 // 100 - y1 // 100) + (y2 // 400 - y1 // 400)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (((__Pyx_div_Py_ssize_t(__pyx_v_y2, 4) - __Pyx_div_Py_ssize_t(__pyx_v_y1, 4)) - (__Pyx_div_Py_ssize_t(__pyx_v_y2, 0x64) - __Pyx_div_Py_ssize_t(__pyx_v_y1, 0x64))) + (__Pyx_div_Py_ssize_t(__pyx_v_y2, 0x190) - __Pyx_div_Py_ssize_t(__pyx_v_y1, 0x190)));
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":75
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

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

/* "cytimes/cydatetime.py":89
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_days_in_year(unsigned int __pyx_v_year) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":94
 * def days_in_year(year: cython.uint) -> cython.uint:
 *     """Get the maximum number of days in the 'year', expects 365 or 366 `<'int'>`."""
 *     return 366 if is_leapyear(year) else 365             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_is_leapyear(__pyx_v_year); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 94, __pyx_L1_error)
  if (__pyx_t_2) {
    __pyx_t_1 = 0x16E;
  } else {
    __pyx_t_1 = 0x16D;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":89
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.days_in_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":97
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_days_bf_year(unsigned int __pyx_v_year) {
  Py_ssize_t __pyx_v_y;
  unsigned int __pyx_r;
  int __pyx_t_1;

  /* "cytimes/cydatetime.py":103
 *     """Calculate the number of days between the 1st day
 *     of the given 'year' and the 1st day of 1AD `<'int'>`."""
 *     if year <= 1:             # <<<<<<<<<<<<<<
 *         return 0
 *     y: cython.Py_ssize_t = year - 1
 */
  __pyx_t_1 = (__pyx_v_year <= 1);
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":104
 *     of the given 'year' and the 1st day of 1AD `<'int'>`."""
 *     if year <= 1:
 *         return 0             # <<<<<<<<<<<<<<
 *     y: cython.Py_ssize_t = year - 1
 *     return y * 365 + y // 4 - y // 100 + y // 400
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":103
 *     """Calculate the number of days between the 1st day
 *     of the given 'year' and the 1st day of 1AD `<'int'>`."""
 *     if year <= 1:             # <<<<<<<<<<<<<<
 *         return 0
 *     y: cython.Py_ssize_t = year - 1
 */
  }

  /* "cytimes/cydatetime.py":105
 *     if year <= 1:
 *         return 0
 *     y: cython.Py_ssize_t = year - 1             # <<<<<<<<<<<<<<
 *     return y * 365 + y // 4 - y // 100 + y // 400
 * 
 */
  __pyx_v_y = (__pyx_v_year - 1);

  /* "cytimes/cydatetime.py":106
 *         return 0
 *     y: cython.Py_ssize_t = year - 1
 *     return y * 365 + y // 4 - y // 100 + y // 400             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((((__pyx_v_y * 0x16D) + __Pyx_div_Py_ssize_t(__pyx_v_y, 4)) - __Pyx_div_Py_ssize_t(__pyx_v_y, 0x64)) + __Pyx_div_Py_ssize_t(__pyx_v_y, 0x190));
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":97
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

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

/* "cytimes/cydatetime.py":109
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_days_of_year(unsigned int __pyx_v_year, unsigned int __pyx_v_month, unsigned int __pyx_v_day) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  unsigned int __pyx_t_2;
  unsigned int __pyx_t_3;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":119
 *     """Calculate the number of days between the given 'year'
 *     & 'month' & 'day' and the 1st day of the 'year' `<'int'>`."""
 *     return days_bf_month(year, month) + min(day, days_in_month(year, month))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_days_bf_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 119, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_days_in_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_2 == ((unsigned int)-1))) __PYX_ERR(1, 119, __pyx_L1_error)
  __pyx_t_3 = __pyx_v_day;
  __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_r = (__pyx_t_1 + __pyx_t_4);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":109
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.days_of_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":123
 * 
 * # Calendar: quarter ------------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_quarter_of_month(unsigned int __pyx_v_month) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_t_2;

  /* "cytimes/cydatetime.py":128
 * def quarter_of_month(month: cython.uint) -> cython.uint:
 *     """Get the quarter of the 'month', expects 1-4 `<'int'>`."""
 *     return MONTH_TO_QUARTER[month] if month <= 12 else 4             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = (__pyx_v_month <= 12);
  if (__pyx_t_2) {
    __pyx_t_1 = (__pyx_v_7cytimes_10cydatetime_MONTH_TO_QUARTER[__pyx_v_month]);
  } else {
    __pyx_t_1 = 4;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":123
 * 
 * # Calendar: quarter ------------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

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

/* "cytimes/cydatetime.py":131
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_days_in_quarter(unsigned int __pyx_v_year, unsigned int __pyx_v_month) {
  unsigned int __pyx_v_quarter;
  unsigned int __pyx_v_days;
  unsigned int __pyx_r;
  unsigned 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;

  /* "cytimes/cydatetime.py":136
 * def days_in_quarter(year: cython.uint, month: cython.uint) -> cython.uint:
 *     """Calculate the maximum number of days in the quarter `<'int'>`."""
 *     quarter: cython.uint = quarter_of_month(month)             # <<<<<<<<<<<<<<
 *     days: cython.uint = DAYS_IN_QUARTER[quarter]
 *     if quarter == 1 and is_leapyear(year):
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_quarter_of_month(__pyx_v_month); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 136, __pyx_L1_error)
  __pyx_v_quarter = __pyx_t_1;

  /* "cytimes/cydatetime.py":137
 *     """Calculate the maximum number of days in the quarter `<'int'>`."""
 *     quarter: cython.uint = quarter_of_month(month)
 *     days: cython.uint = DAYS_IN_QUARTER[quarter]             # <<<<<<<<<<<<<<
 *     if quarter == 1 and is_leapyear(year):
 *         days += 1
 */
  __pyx_v_days = (__pyx_v_7cytimes_10cydatetime_DAYS_IN_QUARTER[__pyx_v_quarter]);

  /* "cytimes/cydatetime.py":138
 *     quarter: cython.uint = quarter_of_month(month)
 *     days: cython.uint = DAYS_IN_QUARTER[quarter]
 *     if quarter == 1 and is_leapyear(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_10cydatetime_is_leapyear(__pyx_v_year); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 138, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":139
 *     days: cython.uint = DAYS_IN_QUARTER[quarter]
 *     if quarter == 1 and is_leapyear(year):
 *         days += 1             # <<<<<<<<<<<<<<
 *     return days
 * 
 */
    __pyx_v_days = (__pyx_v_days + 1);

    /* "cytimes/cydatetime.py":138
 *     quarter: cython.uint = quarter_of_month(month)
 *     days: cython.uint = DAYS_IN_QUARTER[quarter]
 *     if quarter == 1 and is_leapyear(year):             # <<<<<<<<<<<<<<
 *         days += 1
 *     return days
 */
  }

  /* "cytimes/cydatetime.py":140
 *     if quarter == 1 and is_leapyear(year):
 *         days += 1
 *     return days             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_days;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":131
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.days_in_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":143
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_days_bf_quarter(unsigned int __pyx_v_year, unsigned int __pyx_v_month) {
  unsigned int __pyx_v_quarter;
  unsigned int __pyx_v_days;
  unsigned int __pyx_r;
  unsigned 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;

  /* "cytimes/cydatetime.py":149
 *     """Calculate the number of days between the 1st day
 *     of the quarter and the 1st day of the year `<'int'>."""
 *     quarter: cython.uint = quarter_of_month(month)             # <<<<<<<<<<<<<<
 *     days: cython.uint = DAYS_BR_QUARTER[quarter - 1]
 *     if quarter >= 2 and is_leapyear(year):
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_quarter_of_month(__pyx_v_month); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 149, __pyx_L1_error)
  __pyx_v_quarter = __pyx_t_1;

  /* "cytimes/cydatetime.py":150
 *     of the quarter and the 1st day of the year `<'int'>."""
 *     quarter: cython.uint = quarter_of_month(month)
 *     days: cython.uint = DAYS_BR_QUARTER[quarter - 1]             # <<<<<<<<<<<<<<
 *     if quarter >= 2 and is_leapyear(year):
 *         days += 1
 */
  __pyx_v_days = (__pyx_v_7cytimes_10cydatetime_DAYS_BR_QUARTER[(__pyx_v_quarter - 1)]);

  /* "cytimes/cydatetime.py":151
 *     quarter: cython.uint = quarter_of_month(month)
 *     days: cython.uint = DAYS_BR_QUARTER[quarter - 1]
 *     if quarter >= 2 and is_leapyear(year):             # <<<<<<<<<<<<<<
 *         days += 1
 *     return days
 */
  __pyx_t_3 = (__pyx_v_quarter >= 2);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __pyx_f_7cytimes_10cydatetime_is_leapyear(__pyx_v_year); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 151, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":152
 *     days: cython.uint = DAYS_BR_QUARTER[quarter - 1]
 *     if quarter >= 2 and is_leapyear(year):
 *         days += 1             # <<<<<<<<<<<<<<
 *     return days
 * 
 */
    __pyx_v_days = (__pyx_v_days + 1);

    /* "cytimes/cydatetime.py":151
 *     quarter: cython.uint = quarter_of_month(month)
 *     days: cython.uint = DAYS_BR_QUARTER[quarter - 1]
 *     if quarter >= 2 and is_leapyear(year):             # <<<<<<<<<<<<<<
 *         days += 1
 *     return days
 */
  }

  /* "cytimes/cydatetime.py":153
 *     if quarter >= 2 and is_leapyear(year):
 *         days += 1
 *     return days             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_days;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":143
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.days_bf_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":156
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_days_of_quarter(unsigned int __pyx_v_year, unsigned int __pyx_v_month, unsigned int __pyx_v_day) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  unsigned int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":166
 *     """Calculate the number of days between the given 'year'
 *     & 'month' & 'day' and the 1st day of the quarter `<'int'>`."""
 *     return days_of_year(year, month, day) - days_bf_quarter(year, month)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_days_of_year(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 166, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_days_bf_quarter(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_2 == ((unsigned int)-1))) __PYX_ERR(1, 166, __pyx_L1_error)
  __pyx_r = (__pyx_t_1 - __pyx_t_2);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":156
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.days_of_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":169
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_quarter_1st_month(unsigned int __pyx_v_month) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":174
 * def quarter_1st_month(month: cython.uint) -> cython.uint:
 *     """Get the first month of the quarter, expects 1, 4, 7, 10 `<'int'>`."""
 *     return 3 * quarter_of_month(month) - 2             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_quarter_of_month(__pyx_v_month); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 174, __pyx_L1_error)
  __pyx_r = ((3 * __pyx_t_1) - 2);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":169
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.quarter_1st_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":177
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_quarter_lst_month(unsigned int __pyx_v_month) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":182
 * def quarter_lst_month(month: cython.uint) -> cython.uint:
 *     """Get the last month of the quarter, expects 3, 6, 9, 12 `<'int'>`."""
 *     return 3 * quarter_of_month(month)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_quarter_of_month(__pyx_v_month); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 182, __pyx_L1_error)
  __pyx_r = (3 * __pyx_t_1);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":177
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.quarter_lst_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":186
 * 
 * # Calendar: month --------------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_days_in_month(unsigned int __pyx_v_year, unsigned int __pyx_v_month) {
  unsigned int __pyx_v_days;
  unsigned int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":193
 *     expects 28, 29, 30, 31 `<'int'>`."""
 *     # Invalid month => 31 days
 *     if not 1 <= month <= 12:             # <<<<<<<<<<<<<<
 *         return 31
 *     # Calculate days
 */
  __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) {

    /* "cytimes/cydatetime.py":194
 *     # Invalid month => 31 days
 *     if not 1 <= month <= 12:
 *         return 31             # <<<<<<<<<<<<<<
 *     # Calculate days
 *     days: cython.uint = DAYS_IN_MONTH[month]
 */
    __pyx_r = 31;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":193
 *     expects 28, 29, 30, 31 `<'int'>`."""
 *     # Invalid month => 31 days
 *     if not 1 <= month <= 12:             # <<<<<<<<<<<<<<
 *         return 31
 *     # Calculate days
 */
  }

  /* "cytimes/cydatetime.py":196
 *         return 31
 *     # Calculate days
 *     days: cython.uint = DAYS_IN_MONTH[month]             # <<<<<<<<<<<<<<
 *     if month == 2 and is_leapyear(year):
 *         days += 1
 */
  __pyx_v_days = (__pyx_v_7cytimes_10cydatetime_DAYS_IN_MONTH[__pyx_v_month]);

  /* "cytimes/cydatetime.py":197
 *     # Calculate days
 *     days: cython.uint = DAYS_IN_MONTH[month]
 *     if month == 2 and is_leapyear(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_10cydatetime_is_leapyear(__pyx_v_year); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 197, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":198
 *     days: cython.uint = DAYS_IN_MONTH[month]
 *     if month == 2 and is_leapyear(year):
 *         days += 1             # <<<<<<<<<<<<<<
 *     return days
 * 
 */
    __pyx_v_days = (__pyx_v_days + 1);

    /* "cytimes/cydatetime.py":197
 *     # Calculate days
 *     days: cython.uint = DAYS_IN_MONTH[month]
 *     if month == 2 and is_leapyear(year):             # <<<<<<<<<<<<<<
 *         days += 1
 *     return days
 */
  }

  /* "cytimes/cydatetime.py":199
 *     if month == 2 and is_leapyear(year):
 *         days += 1
 *     return days             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_days;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":186
 * 
 * # Calendar: month --------------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.days_in_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":202
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_days_bf_month(unsigned int __pyx_v_year, unsigned int __pyx_v_month) {
  unsigned int __pyx_v_days;
  unsigned int __pyx_r;
  int __pyx_t_1;
  unsigned 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;

  /* "cytimes/cydatetime.py":208
 *     """Calculate the number of days between the 1st day
 *     of the given 'year' and the 1st day of the 'month' `<'int'>`."""
 *     if month <= 2:             # <<<<<<<<<<<<<<
 *         return 31 if month == 2 else 0
 *     days: cython.uint = DAYS_BR_MONTH[min(month, 12) - 1]
 */
  __pyx_t_1 = (__pyx_v_month <= 2);
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":209
 *     of the given 'year' and the 1st day of the 'month' `<'int'>`."""
 *     if month <= 2:
 *         return 31 if month == 2 else 0             # <<<<<<<<<<<<<<
 *     days: cython.uint = DAYS_BR_MONTH[min(month, 12) - 1]
 *     if is_leapyear(year):
 */
    __pyx_t_1 = (__pyx_v_month == 2);
    if (__pyx_t_1) {
      __pyx_t_2 = 31;
    } else {
      __pyx_t_2 = 0;
    }
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":208
 *     """Calculate the number of days between the 1st day
 *     of the given 'year' and the 1st day of the 'month' `<'int'>`."""
 *     if month <= 2:             # <<<<<<<<<<<<<<
 *         return 31 if month == 2 else 0
 *     days: cython.uint = DAYS_BR_MONTH[min(month, 12) - 1]
 */
  }

  /* "cytimes/cydatetime.py":210
 *     if month <= 2:
 *         return 31 if month == 2 else 0
 *     days: cython.uint = DAYS_BR_MONTH[min(month, 12) - 1]             # <<<<<<<<<<<<<<
 *     if is_leapyear(year):
 *         days += 1
 */
  __pyx_t_3 = 12;
  __pyx_t_2 = __pyx_v_month;
  __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_days = (__pyx_v_7cytimes_10cydatetime_DAYS_BR_MONTH[(__pyx_t_4 - 1)]);

  /* "cytimes/cydatetime.py":211
 *         return 31 if month == 2 else 0
 *     days: cython.uint = DAYS_BR_MONTH[min(month, 12) - 1]
 *     if is_leapyear(year):             # <<<<<<<<<<<<<<
 *         days += 1
 *     return days
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_is_leapyear(__pyx_v_year); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 211, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":212
 *     days: cython.uint = DAYS_BR_MONTH[min(month, 12) - 1]
 *     if is_leapyear(year):
 *         days += 1             # <<<<<<<<<<<<<<
 *     return days
 * 
 */
    __pyx_v_days = (__pyx_v_days + 1);

    /* "cytimes/cydatetime.py":211
 *         return 31 if month == 2 else 0
 *     days: cython.uint = DAYS_BR_MONTH[min(month, 12) - 1]
 *     if is_leapyear(year):             # <<<<<<<<<<<<<<
 *         days += 1
 *     return days
 */
  }

  /* "cytimes/cydatetime.py":213
 *     if is_leapyear(year):
 *         days += 1
 *     return days             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_days;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":202
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.days_bf_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":217
 * 
 * # Calendar: week ---------------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_ymd_weekday(unsigned int __pyx_v_year, unsigned int __pyx_v_month, unsigned int __pyx_v_day) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":226
 * ) -> cython.uint:
 *     """Get the day of the week, where 0=Monday...6=Sunday `<'int'>`."""
 *     return (ymd_to_ordinal(year, month, day) + 6) % 7             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_ymd_to_ordinal(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 226, __pyx_L1_error)
  __pyx_r = __Pyx_mod_long((__pyx_t_1 + 6), 7);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":217
 * 
 * # Calendar: week ---------------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.ymd_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":229
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_ymd_isoweekday(unsigned int __pyx_v_year, unsigned int __pyx_v_month, unsigned int __pyx_v_day) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":238
 * ) -> cython.uint:
 *     """Get the ISO calendar day of the week, where 1=Monday...7=Sunday `<'int'>`."""
 *     return ymd_weekday(year, month, day) + 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_ymd_weekday(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 238, __pyx_L1_error)
  __pyx_r = (__pyx_t_1 + 1);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":229
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.ymd_isoweekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":241
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_ymd_isoweek(unsigned int __pyx_v_year, unsigned int __pyx_v_month, unsigned int __pyx_v_day) {
  unsigned int __pyx_v_ordinal;
  unsigned int __pyx_v_iso1st_ord;
  Py_ssize_t __pyx_v_delta;
  Py_ssize_t __pyx_v_isoweek;
  unsigned int __pyx_r;
  unsigned 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;

  /* "cytimes/cydatetime.py":246
 * def ymd_isoweek(year: cython.uint, month: cython.uint, day: cython.uint) -> cython.uint:
 *     """Get the ISO calendar week number `<'int'>`."""
 *     ordinal: cython.uint = ymd_to_ordinal(year, month, day)             # <<<<<<<<<<<<<<
 *     iso1st_ord: cython.uint = iso1st_ordinal(year)
 *     delta: cython.Py_ssize_t = ordinal - iso1st_ord
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_ymd_to_ordinal(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 246, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_1;

  /* "cytimes/cydatetime.py":247
 *     """Get the ISO calendar week number `<'int'>`."""
 *     ordinal: cython.uint = ymd_to_ordinal(year, month, day)
 *     iso1st_ord: cython.uint = iso1st_ordinal(year)             # <<<<<<<<<<<<<<
 *     delta: cython.Py_ssize_t = ordinal - iso1st_ord
 *     isoweek: cython.Py_ssize_t = delta // 7
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_iso1st_ordinal(__pyx_v_year); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 247, __pyx_L1_error)
  __pyx_v_iso1st_ord = __pyx_t_1;

  /* "cytimes/cydatetime.py":248
 *     ordinal: cython.uint = ymd_to_ordinal(year, month, day)
 *     iso1st_ord: cython.uint = iso1st_ordinal(year)
 *     delta: cython.Py_ssize_t = ordinal - iso1st_ord             # <<<<<<<<<<<<<<
 *     isoweek: cython.Py_ssize_t = delta // 7
 *     if isoweek < 0:
 */
  __pyx_v_delta = (__pyx_v_ordinal - __pyx_v_iso1st_ord);

  /* "cytimes/cydatetime.py":249
 *     iso1st_ord: cython.uint = iso1st_ordinal(year)
 *     delta: cython.Py_ssize_t = ordinal - iso1st_ord
 *     isoweek: cython.Py_ssize_t = delta // 7             # <<<<<<<<<<<<<<
 *     if isoweek < 0:
 *         iso1st_ord = iso1st_ordinal(year - 1)
 */
  __pyx_v_isoweek = __Pyx_div_Py_ssize_t(__pyx_v_delta, 7);

  /* "cytimes/cydatetime.py":250
 *     delta: cython.Py_ssize_t = ordinal - iso1st_ord
 *     isoweek: cython.Py_ssize_t = delta // 7
 *     if isoweek < 0:             # <<<<<<<<<<<<<<
 *         iso1st_ord = iso1st_ordinal(year - 1)
 *         return (ordinal - iso1st_ord) // 7 + 1
 */
  __pyx_t_2 = (__pyx_v_isoweek < 0);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":251
 *     isoweek: cython.Py_ssize_t = delta // 7
 *     if isoweek < 0:
 *         iso1st_ord = iso1st_ordinal(year - 1)             # <<<<<<<<<<<<<<
 *         return (ordinal - iso1st_ord) // 7 + 1
 *     elif isoweek >= 52 and ordinal >= iso1st_ordinal(year + 1):
 */
    __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_iso1st_ordinal((__pyx_v_year - 1)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 251, __pyx_L1_error)
    __pyx_v_iso1st_ord = __pyx_t_1;

    /* "cytimes/cydatetime.py":252
 *     if isoweek < 0:
 *         iso1st_ord = iso1st_ordinal(year - 1)
 *         return (ordinal - iso1st_ord) // 7 + 1             # <<<<<<<<<<<<<<
 *     elif isoweek >= 52 and ordinal >= iso1st_ordinal(year + 1):
 *         return 1
 */
    __pyx_r = (__Pyx_div_long((__pyx_v_ordinal - __pyx_v_iso1st_ord), 7) + 1);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":250
 *     delta: cython.Py_ssize_t = ordinal - iso1st_ord
 *     isoweek: cython.Py_ssize_t = delta // 7
 *     if isoweek < 0:             # <<<<<<<<<<<<<<
 *         iso1st_ord = iso1st_ordinal(year - 1)
 *         return (ordinal - iso1st_ord) // 7 + 1
 */
  }

  /* "cytimes/cydatetime.py":253
 *         iso1st_ord = iso1st_ordinal(year - 1)
 *         return (ordinal - iso1st_ord) // 7 + 1
 *     elif isoweek >= 52 and ordinal >= iso1st_ordinal(year + 1):             # <<<<<<<<<<<<<<
 *         return 1
 *     else:
 */
  __pyx_t_3 = (__pyx_v_isoweek >= 52);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_iso1st_ordinal((__pyx_v_year + 1)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 253, __pyx_L1_error)
  __pyx_t_3 = (__pyx_v_ordinal >= __pyx_t_1);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":254
 *         return (ordinal - iso1st_ord) // 7 + 1
 *     elif isoweek >= 52 and ordinal >= iso1st_ordinal(year + 1):
 *         return 1             # <<<<<<<<<<<<<<
 *     else:
 *         return isoweek + 1
 */
    __pyx_r = 1;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":253
 *         iso1st_ord = iso1st_ordinal(year - 1)
 *         return (ordinal - iso1st_ord) // 7 + 1
 *     elif isoweek >= 52 and ordinal >= iso1st_ordinal(year + 1):             # <<<<<<<<<<<<<<
 *         return 1
 *     else:
 */
  }

  /* "cytimes/cydatetime.py":256
 *         return 1
 *     else:
 *         return isoweek + 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_r = (__pyx_v_isoweek + 1);
    goto __pyx_L0;
  }

  /* "cytimes/cydatetime.py":241
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.ymd_isoweek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":259
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_ymd_isoyear(unsigned int __pyx_v_year, unsigned int __pyx_v_month, unsigned int __pyx_v_day) {
  unsigned int __pyx_v_ordinal;
  unsigned int __pyx_v_iso1st_ord;
  Py_ssize_t __pyx_v_delta;
  Py_ssize_t __pyx_v_isoweek;
  unsigned int __pyx_r;
  unsigned 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;

  /* "cytimes/cydatetime.py":264
 * def ymd_isoyear(year: cython.uint, month: cython.uint, day: cython.uint) -> cython.uint:
 *     """Get the ISO calendar year `<'int'>`."""
 *     ordinal: cython.uint = ymd_to_ordinal(year, month, day)             # <<<<<<<<<<<<<<
 *     iso1st_ord: cython.uint = iso1st_ordinal(year)
 *     delta: cython.Py_ssize_t = ordinal - iso1st_ord
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_ymd_to_ordinal(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 264, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_1;

  /* "cytimes/cydatetime.py":265
 *     """Get the ISO calendar year `<'int'>`."""
 *     ordinal: cython.uint = ymd_to_ordinal(year, month, day)
 *     iso1st_ord: cython.uint = iso1st_ordinal(year)             # <<<<<<<<<<<<<<
 *     delta: cython.Py_ssize_t = ordinal - iso1st_ord
 *     isoweek: cython.Py_ssize_t = delta // 7
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_iso1st_ordinal(__pyx_v_year); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 265, __pyx_L1_error)
  __pyx_v_iso1st_ord = __pyx_t_1;

  /* "cytimes/cydatetime.py":266
 *     ordinal: cython.uint = ymd_to_ordinal(year, month, day)
 *     iso1st_ord: cython.uint = iso1st_ordinal(year)
 *     delta: cython.Py_ssize_t = ordinal - iso1st_ord             # <<<<<<<<<<<<<<
 *     isoweek: cython.Py_ssize_t = delta // 7
 *     if isoweek < 0:
 */
  __pyx_v_delta = (__pyx_v_ordinal - __pyx_v_iso1st_ord);

  /* "cytimes/cydatetime.py":267
 *     iso1st_ord: cython.uint = iso1st_ordinal(year)
 *     delta: cython.Py_ssize_t = ordinal - iso1st_ord
 *     isoweek: cython.Py_ssize_t = delta // 7             # <<<<<<<<<<<<<<
 *     if isoweek < 0:
 *         return year - 1
 */
  __pyx_v_isoweek = __Pyx_div_Py_ssize_t(__pyx_v_delta, 7);

  /* "cytimes/cydatetime.py":268
 *     delta: cython.Py_ssize_t = ordinal - iso1st_ord
 *     isoweek: cython.Py_ssize_t = delta // 7
 *     if isoweek < 0:             # <<<<<<<<<<<<<<
 *         return year - 1
 *     elif isoweek >= 52 and ordinal >= iso1st_ordinal(year + 1):
 */
  __pyx_t_2 = (__pyx_v_isoweek < 0);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":269
 *     isoweek: cython.Py_ssize_t = delta // 7
 *     if isoweek < 0:
 *         return year - 1             # <<<<<<<<<<<<<<
 *     elif isoweek >= 52 and ordinal >= iso1st_ordinal(year + 1):
 *         return year + 1
 */
    __pyx_r = (__pyx_v_year - 1);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":268
 *     delta: cython.Py_ssize_t = ordinal - iso1st_ord
 *     isoweek: cython.Py_ssize_t = delta // 7
 *     if isoweek < 0:             # <<<<<<<<<<<<<<
 *         return year - 1
 *     elif isoweek >= 52 and ordinal >= iso1st_ordinal(year + 1):
 */
  }

  /* "cytimes/cydatetime.py":270
 *     if isoweek < 0:
 *         return year - 1
 *     elif isoweek >= 52 and ordinal >= iso1st_ordinal(year + 1):             # <<<<<<<<<<<<<<
 *         return year + 1
 *     else:
 */
  __pyx_t_3 = (__pyx_v_isoweek >= 52);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_iso1st_ordinal((__pyx_v_year + 1)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 270, __pyx_L1_error)
  __pyx_t_3 = (__pyx_v_ordinal >= __pyx_t_1);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":271
 *         return year - 1
 *     elif isoweek >= 52 and ordinal >= iso1st_ordinal(year + 1):
 *         return year + 1             # <<<<<<<<<<<<<<
 *     else:
 *         return year
 */
    __pyx_r = (__pyx_v_year + 1);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":270
 *     if isoweek < 0:
 *         return year - 1
 *     elif isoweek >= 52 and ordinal >= iso1st_ordinal(year + 1):             # <<<<<<<<<<<<<<
 *         return year + 1
 *     else:
 */
  }

  /* "cytimes/cydatetime.py":273
 *         return year + 1
 *     else:
 *         return year             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_r = __pyx_v_year;
    goto __pyx_L0;
  }

  /* "cytimes/cydatetime.py":259
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.ymd_isoyear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":276
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

static __pyx_t_7cytimes_10cydatetime_iso __pyx_f_7cytimes_10cydatetime_ymd_isocalendar(unsigned int __pyx_v_year, unsigned int __pyx_v_month, unsigned int __pyx_v_day) {
  unsigned int __pyx_v_ordinal;
  unsigned int __pyx_v_iso1st_ord;
  Py_ssize_t __pyx_v_delta;
  Py_ssize_t __pyx_v_isoweek;
  __pyx_t_7cytimes_10cydatetime_iso __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  __pyx_t_7cytimes_10cydatetime_iso __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":285
 * ) -> iso:  # type: ignore
 *     """Get the ISO calendar of the YMD `<'struct:iso'>`."""
 *     ordinal: cython.uint = ymd_to_ordinal(year, month, day)             # <<<<<<<<<<<<<<
 *     iso1st_ord: cython.uint = iso1st_ordinal(year)
 *     delta: cython.Py_ssize_t = ordinal - iso1st_ord
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_ymd_to_ordinal(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 285, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_1;

  /* "cytimes/cydatetime.py":286
 *     """Get the ISO calendar of the YMD `<'struct:iso'>`."""
 *     ordinal: cython.uint = ymd_to_ordinal(year, month, day)
 *     iso1st_ord: cython.uint = iso1st_ordinal(year)             # <<<<<<<<<<<<<<
 *     delta: cython.Py_ssize_t = ordinal - iso1st_ord
 *     isoweek: cython.Py_ssize_t = delta // 7
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_iso1st_ordinal(__pyx_v_year); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 286, __pyx_L1_error)
  __pyx_v_iso1st_ord = __pyx_t_1;

  /* "cytimes/cydatetime.py":287
 *     ordinal: cython.uint = ymd_to_ordinal(year, month, day)
 *     iso1st_ord: cython.uint = iso1st_ordinal(year)
 *     delta: cython.Py_ssize_t = ordinal - iso1st_ord             # <<<<<<<<<<<<<<
 *     isoweek: cython.Py_ssize_t = delta // 7
 *     if isoweek < 0:
 */
  __pyx_v_delta = (__pyx_v_ordinal - __pyx_v_iso1st_ord);

  /* "cytimes/cydatetime.py":288
 *     iso1st_ord: cython.uint = iso1st_ordinal(year)
 *     delta: cython.Py_ssize_t = ordinal - iso1st_ord
 *     isoweek: cython.Py_ssize_t = delta // 7             # <<<<<<<<<<<<<<
 *     if isoweek < 0:
 *         year -= 1
 */
  __pyx_v_isoweek = __Pyx_div_Py_ssize_t(__pyx_v_delta, 7);

  /* "cytimes/cydatetime.py":289
 *     delta: cython.Py_ssize_t = ordinal - iso1st_ord
 *     isoweek: cython.Py_ssize_t = delta // 7
 *     if isoweek < 0:             # <<<<<<<<<<<<<<
 *         year -= 1
 *         iso1st_ord = iso1st_ordinal(year)
 */
  __pyx_t_2 = (__pyx_v_isoweek < 0);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":290
 *     isoweek: cython.Py_ssize_t = delta // 7
 *     if isoweek < 0:
 *         year -= 1             # <<<<<<<<<<<<<<
 *         iso1st_ord = iso1st_ordinal(year)
 *         delta = ordinal - iso1st_ord
 */
    __pyx_v_year = (__pyx_v_year - 1);

    /* "cytimes/cydatetime.py":291
 *     if isoweek < 0:
 *         year -= 1
 *         iso1st_ord = iso1st_ordinal(year)             # <<<<<<<<<<<<<<
 *         delta = ordinal - iso1st_ord
 *         isoweek = delta // 7
 */
    __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_iso1st_ordinal(__pyx_v_year); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 291, __pyx_L1_error)
    __pyx_v_iso1st_ord = __pyx_t_1;

    /* "cytimes/cydatetime.py":292
 *         year -= 1
 *         iso1st_ord = iso1st_ordinal(year)
 *         delta = ordinal - iso1st_ord             # <<<<<<<<<<<<<<
 *         isoweek = delta // 7
 *     elif isoweek >= 52 and ordinal >= iso1st_ordinal(year + 1):
 */
    __pyx_v_delta = (__pyx_v_ordinal - __pyx_v_iso1st_ord);

    /* "cytimes/cydatetime.py":293
 *         iso1st_ord = iso1st_ordinal(year)
 *         delta = ordinal - iso1st_ord
 *         isoweek = delta // 7             # <<<<<<<<<<<<<<
 *     elif isoweek >= 52 and ordinal >= iso1st_ordinal(year + 1):
 *         year += 1
 */
    __pyx_v_isoweek = __Pyx_div_Py_ssize_t(__pyx_v_delta, 7);

    /* "cytimes/cydatetime.py":289
 *     delta: cython.Py_ssize_t = ordinal - iso1st_ord
 *     isoweek: cython.Py_ssize_t = delta // 7
 *     if isoweek < 0:             # <<<<<<<<<<<<<<
 *         year -= 1
 *         iso1st_ord = iso1st_ordinal(year)
 */
    goto __pyx_L3;
  }

  /* "cytimes/cydatetime.py":294
 *         delta = ordinal - iso1st_ord
 *         isoweek = delta // 7
 *     elif isoweek >= 52 and ordinal >= iso1st_ordinal(year + 1):             # <<<<<<<<<<<<<<
 *         year += 1
 *         isoweek = 0
 */
  __pyx_t_3 = (__pyx_v_isoweek >= 52);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_iso1st_ordinal((__pyx_v_year + 1)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 294, __pyx_L1_error)
  __pyx_t_3 = (__pyx_v_ordinal >= __pyx_t_1);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":295
 *         isoweek = delta // 7
 *     elif isoweek >= 52 and ordinal >= iso1st_ordinal(year + 1):
 *         year += 1             # <<<<<<<<<<<<<<
 *         isoweek = 0
 *     return iso(year, isoweek + 1, delta % 7 + 1)  # type: ignore
 */
    __pyx_v_year = (__pyx_v_year + 1);

    /* "cytimes/cydatetime.py":296
 *     elif isoweek >= 52 and ordinal >= iso1st_ordinal(year + 1):
 *         year += 1
 *         isoweek = 0             # <<<<<<<<<<<<<<
 *     return iso(year, isoweek + 1, delta % 7 + 1)  # type: ignore
 * 
 */
    __pyx_v_isoweek = 0;

    /* "cytimes/cydatetime.py":294
 *         delta = ordinal - iso1st_ord
 *         isoweek = delta // 7
 *     elif isoweek >= 52 and ordinal >= iso1st_ordinal(year + 1):             # <<<<<<<<<<<<<<
 *         year += 1
 *         isoweek = 0
 */
  }
  __pyx_L3:;

  /* "cytimes/cydatetime.py":297
 *         year += 1
 *         isoweek = 0
 *     return iso(year, isoweek + 1, delta % 7 + 1)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4.year = __pyx_v_year;
  __pyx_t_4.week = (__pyx_v_isoweek + 1);
  __pyx_t_4.weekday = (__Pyx_mod_Py_ssize_t(__pyx_v_delta, 7) + 1);
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":276
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("cytimes.cydatetime.ymd_isocalendar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":300
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_iso1st_ordinal(unsigned int __pyx_v_year) {
  unsigned int __pyx_v_day_1st;
  unsigned int __pyx_v_weekday_1st;
  unsigned int __pyx_v_weekmon_1st;
  unsigned int __pyx_r;
  unsigned 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;

  /* "cytimes/cydatetime.py":305
 * def iso1st_ordinal(year: cython.uint) -> cython.uint:
 *     """Get the ordinal for the 1st day of ISO calendar year `<'int'>`."""
 *     day_1st: cython.uint = ymd_to_ordinal(year, 1, 1)             # <<<<<<<<<<<<<<
 *     weekday_1st: cython.uint = (day_1st + 6) % 7
 *     weekmon_1st: cython.uint = day_1st - weekday_1st
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_ymd_to_ordinal(__pyx_v_year, 1, 1); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 305, __pyx_L1_error)
  __pyx_v_day_1st = __pyx_t_1;

  /* "cytimes/cydatetime.py":306
 *     """Get the ordinal for the 1st day of ISO calendar year `<'int'>`."""
 *     day_1st: cython.uint = ymd_to_ordinal(year, 1, 1)
 *     weekday_1st: cython.uint = (day_1st + 6) % 7             # <<<<<<<<<<<<<<
 *     weekmon_1st: cython.uint = day_1st - weekday_1st
 *     return weekmon_1st + 7 if weekday_1st > 3 else weekmon_1st
 */
  __pyx_v_weekday_1st = __Pyx_mod_long((__pyx_v_day_1st + 6), 7);

  /* "cytimes/cydatetime.py":307
 *     day_1st: cython.uint = ymd_to_ordinal(year, 1, 1)
 *     weekday_1st: cython.uint = (day_1st + 6) % 7
 *     weekmon_1st: cython.uint = day_1st - weekday_1st             # <<<<<<<<<<<<<<
 *     return weekmon_1st + 7 if weekday_1st > 3 else weekmon_1st
 * 
 */
  __pyx_v_weekmon_1st = (__pyx_v_day_1st - __pyx_v_weekday_1st);

  /* "cytimes/cydatetime.py":308
 *     weekday_1st: cython.uint = (day_1st + 6) % 7
 *     weekmon_1st: cython.uint = day_1st - weekday_1st
 *     return weekmon_1st + 7 if weekday_1st > 3 else weekmon_1st             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = (__pyx_v_weekday_1st > 3);
  if (__pyx_t_3) {
    __pyx_t_2 = (__pyx_v_weekmon_1st + 7);
  } else {
    __pyx_t_2 = __pyx_v_weekmon_1st;
  }
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":300
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.iso1st_ordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":312
 * 
 * # Calendar: conversion ---------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_ymd_to_ordinal(unsigned int __pyx_v_year, unsigned int __pyx_v_month, unsigned int __pyx_v_day) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  unsigned int __pyx_t_2;
  unsigned int __pyx_t_3;
  unsigned int __pyx_t_4;
  unsigned int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":322
 *     """Convert 'year' & 'month' & 'day' to ordinal `<'int'>`."""
 *     return (
 *         days_bf_year(year)             # <<<<<<<<<<<<<<
 *         + days_bf_month(year, month)
 *         + min(day, days_in_month(year, month))
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_days_bf_year(__pyx_v_year); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 322, __pyx_L1_error)

  /* "cytimes/cydatetime.py":323
 *     return (
 *         days_bf_year(year)
 *         + days_bf_month(year, month)             # <<<<<<<<<<<<<<
 *         + min(day, days_in_month(year, month))
 *     )
 */
  __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_days_bf_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_2 == ((unsigned int)-1))) __PYX_ERR(1, 323, __pyx_L1_error)

  /* "cytimes/cydatetime.py":324
 *         days_bf_year(year)
 *         + days_bf_month(year, month)
 *         + min(day, days_in_month(year, month))             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_3 = __pyx_f_7cytimes_10cydatetime_days_in_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_3 == ((unsigned int)-1))) __PYX_ERR(1, 324, __pyx_L1_error)
  __pyx_t_4 = __pyx_v_day;
  __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_r = ((__pyx_t_1 + __pyx_t_2) + __pyx_t_5);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":312
 * 
 * # Calendar: conversion ---------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.ymd_to_ordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":328
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

static __pyx_t_7cytimes_10cydatetime_ymd __pyx_f_7cytimes_10cydatetime_ordinal_to_ymd(int __pyx_v_ordinal) {
  unsigned int __pyx_v_n;
  unsigned int __pyx_v_n400;
  unsigned int __pyx_v_year;
  unsigned int __pyx_v_n100;
  unsigned int __pyx_v_n4;
  unsigned int __pyx_v_n1;
  unsigned int __pyx_v_month;
  unsigned int __pyx_v_days_bf;
  __pyx_t_7cytimes_10cydatetime_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;
  __pyx_t_7cytimes_10cydatetime_ymd __pyx_t_7;
  unsigned int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":339
 *     # n first -- then the values of n at 400-year boundaries are exactly
 *     # those divisible by _DI400Y:
 *     n: cython.uint = min(max(ordinal, 1), 3_652_059) - 1             # <<<<<<<<<<<<<<
 *     n400: cython.uint = n // 146_097
 *     n = n % 146_097
 */
  __pyx_t_1 = 0x37B9DB;
  __pyx_t_2 = 1;
  __pyx_t_3 = __pyx_v_ordinal;
  __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);

  /* "cytimes/cydatetime.py":340
 *     # those divisible by _DI400Y:
 *     n: cython.uint = min(max(ordinal, 1), 3_652_059) - 1
 *     n400: cython.uint = n // 146_097             # <<<<<<<<<<<<<<
 *     n = n % 146_097
 *     year: cython.uint = n400 * 400 + 1
 */
  __pyx_v_n400 = __Pyx_div_long(__pyx_v_n, 0x23AB1);

  /* "cytimes/cydatetime.py":341
 *     n: cython.uint = min(max(ordinal, 1), 3_652_059) - 1
 *     n400: cython.uint = n // 146_097
 *     n = n % 146_097             # <<<<<<<<<<<<<<
 *     year: cython.uint = n400 * 400 + 1
 * 
 */
  __pyx_v_n = __Pyx_mod_long(__pyx_v_n, 0x23AB1);

  /* "cytimes/cydatetime.py":342
 *     n400: cython.uint = n // 146_097
 *     n = n % 146_097
 *     year: cython.uint = n400 * 400 + 1             # <<<<<<<<<<<<<<
 * 
 *     # Now n is the (non-negative) offset, in days, from January 1 of year, to
 */
  __pyx_v_year = ((__pyx_v_n400 * 0x190) + 1);

  /* "cytimes/cydatetime.py":349
 *     # 100-year cycles precede the desired day, which implies the desired
 *     # day is December 31 at the end of a 400-year cycle.
 *     n100: cython.uint = n // 36_524             # <<<<<<<<<<<<<<
 *     n = n % 36_524
 * 
 */
  __pyx_v_n100 = __Pyx_div_long(__pyx_v_n, 0x8EAC);

  /* "cytimes/cydatetime.py":350
 *     # day is December 31 at the end of a 400-year cycle.
 *     n100: cython.uint = n // 36_524
 *     n = n % 36_524             # <<<<<<<<<<<<<<
 * 
 *     # Now compute how many 4-year cycles precede it.
 */
  __pyx_v_n = __Pyx_mod_long(__pyx_v_n, 0x8EAC);

  /* "cytimes/cydatetime.py":353
 * 
 *     # Now compute how many 4-year cycles precede it.
 *     n4: cython.uint = n // 1_461             # <<<<<<<<<<<<<<
 *     n = n % 1_461
 * 
 */
  __pyx_v_n4 = __Pyx_div_long(__pyx_v_n, 0x5B5);

  /* "cytimes/cydatetime.py":354
 *     # Now compute how many 4-year cycles precede it.
 *     n4: cython.uint = n // 1_461
 *     n = n % 1_461             # <<<<<<<<<<<<<<
 * 
 *     # And now how many single years.  Again n1 can be 4, and again meaning
 */
  __pyx_v_n = __Pyx_mod_long(__pyx_v_n, 0x5B5);

  /* "cytimes/cydatetime.py":358
 *     # 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: cython.uint = n // 365             # <<<<<<<<<<<<<<
 *     n = n % 365
 * 
 */
  __pyx_v_n1 = __Pyx_div_long(__pyx_v_n, 0x16D);

  /* "cytimes/cydatetime.py":359
 *     # that the desired day is December 31 at the end of the 4-year cycle.
 *     n1: cython.uint = n // 365
 *     n = n % 365             # <<<<<<<<<<<<<<
 * 
 *     # We now know the year and the offset from January 1st.  Leap years are
 */
  __pyx_v_n = __Pyx_mod_long(__pyx_v_n, 0x16D);

  /* "cytimes/cydatetime.py":367
 *     # whether year is divisible by 4.  If not, then we're done -- the answer
 *     # is December 31 at the end of the year.
 *     year += n100 * 100 + n4 * 4 + n1             # <<<<<<<<<<<<<<
 *     if n1 == 4 or n100 == 4:
 *         # Return ymd
 */
  __pyx_v_year = (__pyx_v_year + (((__pyx_v_n100 * 0x64) + (__pyx_v_n4 * 4)) + __pyx_v_n1));

  /* "cytimes/cydatetime.py":368
 *     # is December 31 at the end of the year.
 *     year += n100 * 100 + n4 * 4 + n1
 *     if n1 == 4 or n100 == 4:             # <<<<<<<<<<<<<<
 *         # Return ymd
 *         return ymd(year - 1, 12, 31)  # type: ignore
 */
  __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) {

    /* "cytimes/cydatetime.py":370
 *     if n1 == 4 or n100 == 4:
 *         # Return ymd
 *         return ymd(year - 1, 12, 31)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     # Now the year is correct, and n is the offset from January 1.  We find
 */
    __pyx_t_7.year = (__pyx_v_year - 1);
    __pyx_t_7.month = 12;
    __pyx_t_7.day = 31;
    __pyx_r = __pyx_t_7;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":368
 *     # is December 31 at the end of the year.
 *     year += n100 * 100 + n4 * 4 + n1
 *     if n1 == 4 or n100 == 4:             # <<<<<<<<<<<<<<
 *         # Return ymd
 *         return ymd(year - 1, 12, 31)  # type: ignore
 */
  }

  /* "cytimes/cydatetime.py":374
 *     # 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.
 *     month: cython.uint = (n + 50) >> 5             # <<<<<<<<<<<<<<
 *     days_bf: cython.uint = days_bf_month(year, month)
 *     if days_bf > n:
 */
  __pyx_v_month = ((__pyx_v_n + 50) >> 5);

  /* "cytimes/cydatetime.py":375
 *     # the month via an estimate that's either exact or one too large.
 *     month: cython.uint = (n + 50) >> 5
 *     days_bf: cython.uint = days_bf_month(year, month)             # <<<<<<<<<<<<<<
 *     if days_bf > n:
 *         month -= 1
 */
  __pyx_t_8 = __pyx_f_7cytimes_10cydatetime_days_bf_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_8 == ((unsigned int)-1))) __PYX_ERR(1, 375, __pyx_L1_error)
  __pyx_v_days_bf = __pyx_t_8;

  /* "cytimes/cydatetime.py":376
 *     month: cython.uint = (n + 50) >> 5
 *     days_bf: cython.uint = days_bf_month(year, month)
 *     if days_bf > n:             # <<<<<<<<<<<<<<
 *         month -= 1
 *         days_bf = days_bf_month(year, month)
 */
  __pyx_t_5 = (__pyx_v_days_bf > __pyx_v_n);
  if (__pyx_t_5) {

    /* "cytimes/cydatetime.py":377
 *     days_bf: cython.uint = days_bf_month(year, month)
 *     if days_bf > n:
 *         month -= 1             # <<<<<<<<<<<<<<
 *         days_bf = days_bf_month(year, month)
 *     n = n - days_bf + 1
 */
    __pyx_v_month = (__pyx_v_month - 1);

    /* "cytimes/cydatetime.py":378
 *     if days_bf > n:
 *         month -= 1
 *         days_bf = days_bf_month(year, month)             # <<<<<<<<<<<<<<
 *     n = n - days_bf + 1
 * 
 */
    __pyx_t_8 = __pyx_f_7cytimes_10cydatetime_days_bf_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_8 == ((unsigned int)-1))) __PYX_ERR(1, 378, __pyx_L1_error)
    __pyx_v_days_bf = __pyx_t_8;

    /* "cytimes/cydatetime.py":376
 *     month: cython.uint = (n + 50) >> 5
 *     days_bf: cython.uint = days_bf_month(year, month)
 *     if days_bf > n:             # <<<<<<<<<<<<<<
 *         month -= 1
 *         days_bf = days_bf_month(year, month)
 */
  }

  /* "cytimes/cydatetime.py":379
 *         month -= 1
 *         days_bf = days_bf_month(year, month)
 *     n = n - days_bf + 1             # <<<<<<<<<<<<<<
 * 
 *     # Return ymd
 */
  __pyx_v_n = ((__pyx_v_n - __pyx_v_days_bf) + 1);

  /* "cytimes/cydatetime.py":382
 * 
 *     # Return ymd
 *     return ymd(year, month, n)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_7.year = __pyx_v_year;
  __pyx_t_7.month = __pyx_v_month;
  __pyx_t_7.day = __pyx_v_n;
  __pyx_r = __pyx_t_7;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":328
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("cytimes.cydatetime.ordinal_to_ymd", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":385
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

static __pyx_t_7cytimes_10cydatetime_ymd __pyx_f_7cytimes_10cydatetime_isocalendar_to_ymd(unsigned int __pyx_v_year, unsigned int __pyx_v_week, unsigned int __pyx_v_weekday) {
  unsigned int __pyx_v_wkd_1st;
  unsigned int __pyx_v_iso1st_ord;
  unsigned int __pyx_v_offset;
  unsigned int __pyx_v_ordinal;
  __pyx_t_7cytimes_10cydatetime_ymd __pyx_r;
  long __pyx_t_1;
  long __pyx_t_2;
  unsigned 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;

  /* "cytimes/cydatetime.py":395
 *     """Convert isocalendar (year, week, weekday) to YMD `<'struct:ymd'>`."""
 *     # Clip year
 *     year = min(max(year, 1), 9_999)             # <<<<<<<<<<<<<<
 * 
 *     # Adjust the 53rd week
 */
  __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;

  /* "cytimes/cydatetime.py":398
 * 
 *     # Adjust the 53rd week
 *     if week == 53:             # <<<<<<<<<<<<<<
 *         # ISO years have 53 weeks in them on years starting with a
 *         # Thursday and leap years starting on a Wednesday
 */
  __pyx_t_5 = (__pyx_v_week == 53);
  if (__pyx_t_5) {

    /* "cytimes/cydatetime.py":401
 *         # ISO years have 53 weeks in them on years starting with a
 *         # Thursday and leap years starting on a Wednesday
 *         wkd_1st: cython.uint = ymd_to_ordinal(year, 1, 1) % 7             # <<<<<<<<<<<<<<
 *         if wkd_1st == 4 or (wkd_1st == 3 and is_leapyear(year)):
 *             if year < 9_999:
 */
    __pyx_t_3 = __pyx_f_7cytimes_10cydatetime_ymd_to_ordinal(__pyx_v_year, 1, 1); if (unlikely(__pyx_t_3 == ((unsigned int)-1))) __PYX_ERR(1, 401, __pyx_L1_error)
    __pyx_v_wkd_1st = __Pyx_mod_long(__pyx_t_3, 7);

    /* "cytimes/cydatetime.py":402
 *         # Thursday and leap years starting on a Wednesday
 *         wkd_1st: cython.uint = ymd_to_ordinal(year, 1, 1) % 7
 *         if wkd_1st == 4 or (wkd_1st == 3 and is_leapyear(year)):             # <<<<<<<<<<<<<<
 *             if year < 9_999:
 *                 week = 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_6 = (__pyx_v_wkd_1st == 3);
    if (__pyx_t_6) {
    } else {
      __pyx_t_5 = __pyx_t_6;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_6 = __pyx_f_7cytimes_10cydatetime_is_leapyear(__pyx_v_year); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 402, __pyx_L1_error)
    __pyx_t_5 = __pyx_t_6;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_5) {

      /* "cytimes/cydatetime.py":403
 *         wkd_1st: cython.uint = ymd_to_ordinal(year, 1, 1) % 7
 *         if wkd_1st == 4 or (wkd_1st == 3 and is_leapyear(year)):
 *             if year < 9_999:             # <<<<<<<<<<<<<<
 *                 week = 1
 *                 year += 1
 */
      __pyx_t_5 = (__pyx_v_year < 0x270F);
      if (__pyx_t_5) {

        /* "cytimes/cydatetime.py":404
 *         if wkd_1st == 4 or (wkd_1st == 3 and is_leapyear(year)):
 *             if year < 9_999:
 *                 week = 1             # <<<<<<<<<<<<<<
 *                 year += 1
 *             else:
 */
        __pyx_v_week = 1;

        /* "cytimes/cydatetime.py":405
 *             if year < 9_999:
 *                 week = 1
 *                 year += 1             # <<<<<<<<<<<<<<
 *             else:
 *                 week = 52
 */
        __pyx_v_year = (__pyx_v_year + 1);

        /* "cytimes/cydatetime.py":403
 *         wkd_1st: cython.uint = ymd_to_ordinal(year, 1, 1) % 7
 *         if wkd_1st == 4 or (wkd_1st == 3 and is_leapyear(year)):
 *             if year < 9_999:             # <<<<<<<<<<<<<<
 *                 week = 1
 *                 year += 1
 */
        goto __pyx_L8;
      }

      /* "cytimes/cydatetime.py":407
 *                 year += 1
 *             else:
 *                 week = 52             # <<<<<<<<<<<<<<
 *     # Clip week
 *     else:
 */
      /*else*/ {
        __pyx_v_week = 52;
      }
      __pyx_L8:;

      /* "cytimes/cydatetime.py":402
 *         # Thursday and leap years starting on a Wednesday
 *         wkd_1st: cython.uint = ymd_to_ordinal(year, 1, 1) % 7
 *         if wkd_1st == 4 or (wkd_1st == 3 and is_leapyear(year)):             # <<<<<<<<<<<<<<
 *             if year < 9_999:
 *                 week = 1
 */
    }

    /* "cytimes/cydatetime.py":398
 * 
 *     # Adjust the 53rd week
 *     if week == 53:             # <<<<<<<<<<<<<<
 *         # ISO years have 53 weeks in them on years starting with a
 *         # Thursday and leap years starting on a Wednesday
 */
    goto __pyx_L3;
  }

  /* "cytimes/cydatetime.py":410
 *     # Clip week
 *     else:
 *         week = min(max(week, 1), 52)             # <<<<<<<<<<<<<<
 * 
 *     # Clip day
 */
  /*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:;

  /* "cytimes/cydatetime.py":413
 * 
 *     # Clip day
 *     weekday = min(max(weekday, 1), 7)             # <<<<<<<<<<<<<<
 * 
 *     # Calculate 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;

  /* "cytimes/cydatetime.py":416
 * 
 *     # Calculate ordinal
 *     iso1st_ord: cython.uint = iso1st_ordinal(year)             # <<<<<<<<<<<<<<
 *     offset: cython.uint = (week - 1) * 7 + weekday - 1
 *     ordinal: cython.uint = iso1st_ord + offset
 */
  __pyx_t_3 = __pyx_f_7cytimes_10cydatetime_iso1st_ordinal(__pyx_v_year); if (unlikely(__pyx_t_3 == ((unsigned int)-1))) __PYX_ERR(1, 416, __pyx_L1_error)
  __pyx_v_iso1st_ord = __pyx_t_3;

  /* "cytimes/cydatetime.py":417
 *     # Calculate ordinal
 *     iso1st_ord: cython.uint = iso1st_ordinal(year)
 *     offset: cython.uint = (week - 1) * 7 + weekday - 1             # <<<<<<<<<<<<<<
 *     ordinal: cython.uint = iso1st_ord + offset
 * 
 */
  __pyx_v_offset = ((((__pyx_v_week - 1) * 7) + __pyx_v_weekday) - 1);

  /* "cytimes/cydatetime.py":418
 *     iso1st_ord: cython.uint = iso1st_ordinal(year)
 *     offset: cython.uint = (week - 1) * 7 + weekday - 1
 *     ordinal: cython.uint = iso1st_ord + offset             # <<<<<<<<<<<<<<
 * 
 *     # Convert to ymd
 */
  __pyx_v_ordinal = (__pyx_v_iso1st_ord + __pyx_v_offset);

  /* "cytimes/cydatetime.py":421
 * 
 *     # Convert to ymd
 *     return ordinal_to_ymd(ordinal)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_7cytimes_10cydatetime_ordinal_to_ymd(__pyx_v_ordinal);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":385
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("cytimes.cydatetime.isocalendar_to_ymd", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":424
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

static __pyx_t_7cytimes_10cydatetime_ymd __pyx_f_7cytimes_10cydatetime_days_of_year_to_ymd(unsigned int __pyx_v_year, unsigned int __pyx_v_days) {
  unsigned int __pyx_v_leap;
  unsigned int __pyx_v_month;
  CYTHON_UNUSED long __pyx_v__;
  unsigned int __pyx_v_days_bf;
  unsigned int __pyx_v_day;
  __pyx_t_7cytimes_10cydatetime_ymd __pyx_r;
  long __pyx_t_1;
  long __pyx_t_2;
  unsigned int __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  unsigned int __pyx_t_6;
  __pyx_t_7cytimes_10cydatetime_ymd __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":430
 *     """Convert days of the year to YMD `<'struct:ymd'>`."""
 *     # Clip year & days
 *     year = min(max(year, 1), 9_999)             # <<<<<<<<<<<<<<
 *     days = min(max(days, 1), days_in_year(year))
 * 
 */
  __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;

  /* "cytimes/cydatetime.py":431
 *     # Clip year & days
 *     year = min(max(year, 1), 9_999)
 *     days = min(max(days, 1), days_in_year(year))             # <<<<<<<<<<<<<<
 * 
 *     # Must be January
 */
  __pyx_t_3 = __pyx_f_7cytimes_10cydatetime_days_in_year(__pyx_v_year); if (unlikely(__pyx_t_3 == ((unsigned int)-1))) __PYX_ERR(1, 431, __pyx_L1_error)
  __pyx_t_4 = 1;
  __pyx_t_6 = __pyx_v_days;
  __pyx_t_5 = (__pyx_t_4 > __pyx_t_6);
  if (__pyx_t_5) {
    __pyx_t_1 = __pyx_t_4;
  } else {
    __pyx_t_1 = __pyx_t_6;
  }
  __pyx_t_4 = __pyx_t_1;
  __pyx_t_5 = (__pyx_t_3 < __pyx_t_4);
  if (__pyx_t_5) {
    __pyx_t_1 = __pyx_t_3;
  } else {
    __pyx_t_1 = __pyx_t_4;
  }
  __pyx_v_days = __pyx_t_1;

  /* "cytimes/cydatetime.py":434
 * 
 *     # Must be January
 *     if days <= 31:             # <<<<<<<<<<<<<<
 *         return ymd(year, 1, days)  # type: ignore
 * 
 */
  __pyx_t_5 = (__pyx_v_days <= 31);
  if (__pyx_t_5) {

    /* "cytimes/cydatetime.py":435
 *     # Must be January
 *     if days <= 31:
 *         return ymd(year, 1, days)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     # Must be February
 */
    __pyx_t_7.year = __pyx_v_year;
    __pyx_t_7.month = 1;
    __pyx_t_7.day = __pyx_v_days;
    __pyx_r = __pyx_t_7;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":434
 * 
 *     # Must be January
 *     if days <= 31:             # <<<<<<<<<<<<<<
 *         return ymd(year, 1, days)  # type: ignore
 * 
 */
  }

  /* "cytimes/cydatetime.py":438
 * 
 *     # Must be February
 *     leap: cython.uint = is_leapyear(year)             # <<<<<<<<<<<<<<
 *     if days <= 59 + leap:
 *         return ymd(year, 2, days - 31)  # type: ignore
 */
  __pyx_t_5 = __pyx_f_7cytimes_10cydatetime_is_leapyear(__pyx_v_year); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 438, __pyx_L1_error)
  __pyx_v_leap = __pyx_t_5;

  /* "cytimes/cydatetime.py":439
 *     # Must be February
 *     leap: cython.uint = is_leapyear(year)
 *     if days <= 59 + leap:             # <<<<<<<<<<<<<<
 *         return ymd(year, 2, days - 31)  # type: ignore
 * 
 */
  __pyx_t_5 = (__pyx_v_days <= (59 + __pyx_v_leap));
  if (__pyx_t_5) {

    /* "cytimes/cydatetime.py":440
 *     leap: cython.uint = is_leapyear(year)
 *     if days <= 59 + leap:
 *         return ymd(year, 2, days - 31)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     # Find month & calculate day
 */
    __pyx_t_7.year = __pyx_v_year;
    __pyx_t_7.month = 2;
    __pyx_t_7.day = (__pyx_v_days - 31);
    __pyx_r = __pyx_t_7;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":439
 *     # Must be February
 *     leap: cython.uint = is_leapyear(year)
 *     if days <= 59 + leap:             # <<<<<<<<<<<<<<
 *         return ymd(year, 2, days - 31)  # type: ignore
 * 
 */
  }

  /* "cytimes/cydatetime.py":443
 * 
 *     # Find month & calculate day
 *     days -= leap             # <<<<<<<<<<<<<<
 *     month: cython.uint = 3
 *     for _ in range(10):
 */
  __pyx_v_days = (__pyx_v_days - __pyx_v_leap);

  /* "cytimes/cydatetime.py":444
 *     # Find month & calculate day
 *     days -= leap
 *     month: cython.uint = 3             # <<<<<<<<<<<<<<
 *     for _ in range(10):
 *         days_bf: cython.uint = DAYS_BR_MONTH[month]
 */
  __pyx_v_month = 3;

  /* "cytimes/cydatetime.py":445
 *     days -= leap
 *     month: cython.uint = 3
 *     for _ in range(10):             # <<<<<<<<<<<<<<
 *         days_bf: cython.uint = DAYS_BR_MONTH[month]
 *         if days <= days_bf:
 */
  for (__pyx_t_1 = 0; __pyx_t_1 < 10; __pyx_t_1+=1) {
    __pyx_v__ = __pyx_t_1;

    /* "cytimes/cydatetime.py":446
 *     month: cython.uint = 3
 *     for _ in range(10):
 *         days_bf: cython.uint = DAYS_BR_MONTH[month]             # <<<<<<<<<<<<<<
 *         if days <= days_bf:
 *             day: cython.uint = days - DAYS_BR_MONTH[month - 1]
 */
    __pyx_v_days_bf = (__pyx_v_7cytimes_10cydatetime_DAYS_BR_MONTH[__pyx_v_month]);

    /* "cytimes/cydatetime.py":447
 *     for _ in range(10):
 *         days_bf: cython.uint = DAYS_BR_MONTH[month]
 *         if days <= days_bf:             # <<<<<<<<<<<<<<
 *             day: cython.uint = days - DAYS_BR_MONTH[month - 1]
 *             return ymd(year, month, day)  # type: ignore
 */
    __pyx_t_5 = (__pyx_v_days <= __pyx_v_days_bf);
    if (__pyx_t_5) {

      /* "cytimes/cydatetime.py":448
 *         days_bf: cython.uint = DAYS_BR_MONTH[month]
 *         if days <= days_bf:
 *             day: cython.uint = days - DAYS_BR_MONTH[month - 1]             # <<<<<<<<<<<<<<
 *             return ymd(year, month, day)  # type: ignore
 *         month += 1
 */
      __pyx_v_day = (__pyx_v_days - (__pyx_v_7cytimes_10cydatetime_DAYS_BR_MONTH[(__pyx_v_month - 1)]));

      /* "cytimes/cydatetime.py":449
 *         if days <= days_bf:
 *             day: cython.uint = days - DAYS_BR_MONTH[month - 1]
 *             return ymd(year, month, day)  # type: ignore             # <<<<<<<<<<<<<<
 *         month += 1
 *     return ymd(year, 12, 31)  # type: ignore
 */
      __pyx_t_7.year = __pyx_v_year;
      __pyx_t_7.month = __pyx_v_month;
      __pyx_t_7.day = __pyx_v_day;
      __pyx_r = __pyx_t_7;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":447
 *     for _ in range(10):
 *         days_bf: cython.uint = DAYS_BR_MONTH[month]
 *         if days <= days_bf:             # <<<<<<<<<<<<<<
 *             day: cython.uint = days - DAYS_BR_MONTH[month - 1]
 *             return ymd(year, month, day)  # type: ignore
 */
    }

    /* "cytimes/cydatetime.py":450
 *             day: cython.uint = days - DAYS_BR_MONTH[month - 1]
 *             return ymd(year, month, day)  # type: ignore
 *         month += 1             # <<<<<<<<<<<<<<
 *     return ymd(year, 12, 31)  # type: ignore
 * 
 */
    __pyx_v_month = (__pyx_v_month + 1);
  }

  /* "cytimes/cydatetime.py":451
 *             return ymd(year, month, day)  # type: ignore
 *         month += 1
 *     return ymd(year, 12, 31)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_7.year = __pyx_v_year;
  __pyx_t_7.month = 12;
  __pyx_t_7.day = 31;
  __pyx_r = __pyx_t_7;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":424
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("cytimes.cydatetime.days_of_year_to_ymd", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":454
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.cdivision(True)
 */

static __pyx_t_7cytimes_10cydatetime_hms __pyx_f_7cytimes_10cydatetime_microseconds_to_hms(PY_LONG_LONG __pyx_v_microseconds) {
  unsigned int __pyx_v_hour;
  unsigned int __pyx_v_minute;
  unsigned int __pyx_v_second;
  unsigned int __pyx_v_microsecond;
  __pyx_t_7cytimes_10cydatetime_hms __pyx_r;
  int __pyx_t_1;
  __pyx_t_7cytimes_10cydatetime_hms __pyx_t_2;

  /* "cytimes/cydatetime.py":460
 * def microseconds_to_hms(microseconds: cython.longlong) -> hms:  # type: ignore
 *     """Convert microseconds to HMS `<'struct:hms'>`."""
 *     if microseconds <= 0:             # <<<<<<<<<<<<<<
 *         return hms(0, 0, 0, 0)  # type: ignore
 * 
 */
  __pyx_t_1 = (__pyx_v_microseconds <= 0);
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":461
 *     """Convert microseconds to HMS `<'struct:hms'>`."""
 *     if microseconds <= 0:
 *         return hms(0, 0, 0, 0)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 *     microseconds = microseconds % 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;

    /* "cytimes/cydatetime.py":460
 * def microseconds_to_hms(microseconds: cython.longlong) -> hms:  # type: ignore
 *     """Convert microseconds to HMS `<'struct:hms'>`."""
 *     if microseconds <= 0:             # <<<<<<<<<<<<<<
 *         return hms(0, 0, 0, 0)  # type: ignore
 * 
 */
  }

  /* "cytimes/cydatetime.py":463
 *         return hms(0, 0, 0, 0)  # type: ignore
 * 
 *     microseconds = microseconds % US_DAY             # <<<<<<<<<<<<<<
 *     hour: cython.uint = microseconds // US_HOUR
 *     microseconds = microseconds % US_HOUR
 */
  __pyx_v_microseconds = (__pyx_v_microseconds % __pyx_v_7cytimes_10cydatetime_US_DAY);

  /* "cytimes/cydatetime.py":464
 * 
 *     microseconds = microseconds % US_DAY
 *     hour: cython.uint = microseconds // US_HOUR             # <<<<<<<<<<<<<<
 *     microseconds = microseconds % US_HOUR
 *     minute: cython.uint = microseconds // 60_000_000
 */
  __pyx_v_hour = (__pyx_v_microseconds / __pyx_v_7cytimes_10cydatetime_US_HOUR);

  /* "cytimes/cydatetime.py":465
 *     microseconds = microseconds % US_DAY
 *     hour: cython.uint = microseconds // US_HOUR
 *     microseconds = microseconds % US_HOUR             # <<<<<<<<<<<<<<
 *     minute: cython.uint = microseconds // 60_000_000
 *     microseconds = microseconds % 60_000_000
 */
  __pyx_v_microseconds = (__pyx_v_microseconds % __pyx_v_7cytimes_10cydatetime_US_HOUR);

  /* "cytimes/cydatetime.py":466
 *     hour: cython.uint = microseconds // US_HOUR
 *     microseconds = microseconds % US_HOUR
 *     minute: cython.uint = microseconds // 60_000_000             # <<<<<<<<<<<<<<
 *     microseconds = microseconds % 60_000_000
 *     second: cython.uint = microseconds // 1_000_000
 */
  __pyx_v_minute = (__pyx_v_microseconds / 0x3938700);

  /* "cytimes/cydatetime.py":467
 *     microseconds = microseconds % US_HOUR
 *     minute: cython.uint = microseconds // 60_000_000
 *     microseconds = microseconds % 60_000_000             # <<<<<<<<<<<<<<
 *     second: cython.uint = microseconds // 1_000_000
 *     microsecond: cython.uint = microseconds % 1_000_000
 */
  __pyx_v_microseconds = (__pyx_v_microseconds % 0x3938700);

  /* "cytimes/cydatetime.py":468
 *     minute: cython.uint = microseconds // 60_000_000
 *     microseconds = microseconds % 60_000_000
 *     second: cython.uint = microseconds // 1_000_000             # <<<<<<<<<<<<<<
 *     microsecond: cython.uint = microseconds % 1_000_000
 *     return hms(hour, minute, second, microsecond)  # type: ignore
 */
  __pyx_v_second = (__pyx_v_microseconds / 0xF4240);

  /* "cytimes/cydatetime.py":469
 *     microseconds = microseconds % 60_000_000
 *     second: cython.uint = microseconds // 1_000_000
 *     microsecond: cython.uint = microseconds % 1_000_000             # <<<<<<<<<<<<<<
 *     return hms(hour, minute, second, microsecond)  # type: ignore
 * 
 */
  __pyx_v_microsecond = (__pyx_v_microseconds % 0xF4240);

  /* "cytimes/cydatetime.py":470
 *     second: cython.uint = microseconds // 1_000_000
 *     microsecond: cython.uint = microseconds % 1_000_000
 *     return hms(hour, minute, second, microsecond)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2.hour = __pyx_v_hour;
  __pyx_t_2.minute = __pyx_v_minute;
  __pyx_t_2.second = __pyx_v_second;
  __pyx_t_2.microsecond = __pyx_v_microsecond;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":454
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.cdivision(True)
 */

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

/* "cytimes/cydatetime.py":475
 * # Datetime.date ========================================================================================
 * # Date: generate ---------------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_date(
 */

static PyDateTime_Date *__pyx_f_7cytimes_10cydatetime_gen_date(struct __pyx_opt_args_7cytimes_10cydatetime_gen_date *__pyx_optional_args) {
  unsigned int __pyx_v_year = ((unsigned int)1);
  unsigned int __pyx_v_month = ((unsigned int)1);
  unsigned int __pyx_v_day = ((unsigned int)1);
  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("gen_date", 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;
        }
      }
    }
  }

  /* "cytimes/cydatetime.py":483
 * ) -> datetime.date:
 *     """Generate a new `<'datetime.date'>`."""
 *     return datetime.date_new(year, month, day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cpython_8datetime_date_new(__pyx_v_year, __pyx_v_month, __pyx_v_day)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":475
 * # Datetime.date ========================================================================================
 * # Date: generate ---------------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_date(
 */

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

/* "cytimes/cydatetime.py":486
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_date_now() -> datetime.date:
 */

static PyDateTime_Date *__pyx_f_7cytimes_10cydatetime_gen_date_now(void) {
  struct tm __pyx_v_tms;
  PyDateTime_Date *__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("gen_date_now", 1);

  /* "cytimes/cydatetime.py":491
 *     """Generate the current local `<'datetime.date'>`.
 *     Equivalent to `datetime.date.today()`."""
 *     tms = localtime()             # <<<<<<<<<<<<<<
 *     return datetime.date_new(tms.tm_year, tms.tm_mon, tms.tm_mday)
 * 
 */
  __pyx_t_1 = __pyx_f_7cpython_4time_localtime(); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 491, __pyx_L1_error)
  __pyx_v_tms = __pyx_t_1;

  /* "cytimes/cydatetime.py":492
 *     Equivalent to `datetime.date.today()`."""
 *     tms = localtime()
 *     return datetime.date_new(tms.tm_year, tms.tm_mon, tms.tm_mday)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_date_new(__pyx_v_tms.tm_year, __pyx_v_tms.tm_mon, __pyx_v_tms.tm_mday)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":486
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_date_now() -> datetime.date:
 */

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

/* "cytimes/cydatetime.py":495
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_date_now_utc() -> datetime.date:
 */

static PyDateTime_Date *__pyx_f_7cytimes_10cydatetime_gen_date_now_utc(void) {
  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("gen_date_now_utc", 1);

  /* "cytimes/cydatetime.py":500
 *     """Generate the current `<'datetime.date'>` under UTC.
 *     Equivalent to `datetime.datetime.now(UTC).date()`."""
 *     return date_fr_dt(gen_dt_now_utc())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_gen_dt_now_utc()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_date_fr_dt(((PyDateTime_DateTime *)__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 500, __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;

  /* "cytimes/cydatetime.py":495
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_date_now_utc() -> datetime.date:
 */

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

/* "cytimes/cydatetime.py":503
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_date_now_tz(tzinfo: datetime.tzinfo) -> datetime.date:
 */

static PyDateTime_Date *__pyx_f_7cytimes_10cydatetime_gen_date_now_tz(PyDateTime_TZInfo *__pyx_v_tzinfo) {
  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("gen_date_now_tz", 1);

  /* "cytimes/cydatetime.py":508
 *     """Generate the current `<'datetime.date'>` under specific timezone.
 *     Equivalent to `datetime.datetime.now(tzinfo).date()`."""
 *     return date_fr_dt(gen_dt_now_tz(tzinfo))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_gen_dt_now_tz(__pyx_v_tzinfo)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_date_fr_dt(((PyDateTime_DateTime *)__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 508, __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;

  /* "cytimes/cydatetime.py":503
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_date_now_tz(tzinfo: datetime.tzinfo) -> datetime.date:
 */

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

/* "cytimes/cydatetime.py":512
 * 
 * # Datetime.date: check types ---------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static int __pyx_f_7cytimes_10cydatetime_is_date(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "cytimes/cydatetime.py":518
 *     """Check if an object is type of datetime.date `<'bool'>`.
 *     Equivalent to `isinstance(obj, datetime.date)`."""
 *     return datetime.PyDate_Check(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyDate_Check(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":512
 * 
 * # Datetime.date: check types ---------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

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

/* "cytimes/cydatetime.py":521
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static int __pyx_f_7cytimes_10cydatetime_is_date_exact(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "cytimes/cydatetime.py":527
 *     """Check if an object is the exact type of datetime.date `<'bool'>`.
 *     Equivalent to `type(obj) is datetime.date`."""
 *     return datetime.PyDate_CheckExact(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyDate_CheckExact(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":521
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

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

/* "cytimes/cydatetime.py":531
 * 
 * # Datetime.date: calendar - year -----------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static int __pyx_f_7cytimes_10cydatetime_date_is_leapyear(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;

  /* "cytimes/cydatetime.py":536
 * def date_is_leapyear(date: datetime.date) -> cython.bint:
 *     """Whether the 'date' is a leap year `<'bool'>`."""
 *     return is_leapyear(date.year)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_is_leapyear(__pyx_f_7cpython_8datetime_4date_4year_year(__pyx_v_date)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 536, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":531
 * 
 * # Datetime.date: calendar - year -----------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.date_is_leapyear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":539
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_date_leap_bt_years(PyDateTime_Date *__pyx_v_date1, PyDateTime_Date *__pyx_v_date2) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":544
 * def date_leap_bt_years(date1: datetime.date, date2: datetime.date) -> cython.uint:
 *     """Calculate the number of leap years between two 'dates' `<'int'>`."""
 *     return leap_bt_years(date1.year, date2.year)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_leap_bt_years(__pyx_f_7cpython_8datetime_4date_4year_year(__pyx_v_date1), __pyx_f_7cpython_8datetime_4date_4year_year(__pyx_v_date2)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 544, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":539
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.date_leap_bt_years", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":547
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_date_days_in_year(PyDateTime_Date *__pyx_v_date) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":552
 * def date_days_in_year(date: datetime.date) -> cython.uint:
 *     """Get the maximum number of days in the 'year', expects 365 or 366 `<'int'>`."""
 *     return days_in_year(date.year)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_days_in_year(__pyx_f_7cpython_8datetime_4date_4year_year(__pyx_v_date)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 552, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":547
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.date_days_in_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":555
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_date_days_bf_year(PyDateTime_Date *__pyx_v_date) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":561
 *     """Calculate the number of days between the given 'date'
 *     and the 1st day of 1AD `<'int'>`."""
 *     return days_bf_year(date.year)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_days_bf_year(__pyx_f_7cpython_8datetime_4date_4year_year(__pyx_v_date)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 561, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":555
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.date_days_bf_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":564
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_date_days_of_year(PyDateTime_Date *__pyx_v_date) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":570
 *     """Calculate the number of days between the given 'date'
 *     and the 1st day of the 'year' `<'int'>`."""
 *     return days_of_year(date.year, date.month, date.day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_days_of_year(__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 == ((unsigned int)-1))) __PYX_ERR(1, 570, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":564
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.date_days_of_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":574
 * 
 * # Datetime.date: calendar - quarter --------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_date_quarter(PyDateTime_Date *__pyx_v_date) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":579
 * def date_quarter(date: datetime.date) -> cython.uint:
 *     """Get the quarter of 'date' `<'int'>`"""
 *     return quarter_of_month(date.month)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_quarter_of_month(__pyx_f_7cpython_8datetime_4date_5month_month(__pyx_v_date)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 579, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":574
 * 
 * # Datetime.date: calendar - quarter --------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.date_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":582
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_date_days_in_quarter(PyDateTime_Date *__pyx_v_date) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":588
 *     """Calculate the maximum number of days in the
 *     quarter of the 'date' `<'int'>`."""
 *     return days_in_quarter(date.year, date.month)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_days_in_quarter(__pyx_f_7cpython_8datetime_4date_4year_year(__pyx_v_date), __pyx_f_7cpython_8datetime_4date_5month_month(__pyx_v_date)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 588, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":582
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.date_days_in_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":591
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_date_days_bf_quarter(PyDateTime_Date *__pyx_v_date) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":597
 *     """Calculate the number of days between the 1st day
 *     of the quarter and the 1st day of the year `<'int'>."""
 *     return days_bf_quarter(date.year, date.month)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_days_bf_quarter(__pyx_f_7cpython_8datetime_4date_4year_year(__pyx_v_date), __pyx_f_7cpython_8datetime_4date_5month_month(__pyx_v_date)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 597, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":591
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.date_days_bf_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":600
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_date_days_of_quarter(PyDateTime_Date *__pyx_v_date) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":606
 *     """Calculate the number of days between the given 'date'
 *     and the 1st day of the quarter `<'int'>`."""
 *     return days_of_quarter(date.year, date.month, date.day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_days_of_quarter(__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 == ((unsigned int)-1))) __PYX_ERR(1, 606, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":600
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.date_days_of_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":609
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_date_quarter_1st_month(PyDateTime_Date *__pyx_v_date) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":614
 * def date_quarter_1st_month(date: datetime.date) -> cython.uint:
 *     """Get the first month of the quarter, expects 1, 4, 7, 10 `<'int'>`."""
 *     return quarter_1st_month(date.month)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_quarter_1st_month(__pyx_f_7cpython_8datetime_4date_5month_month(__pyx_v_date)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 614, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":609
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.date_quarter_1st_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":617
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_date_quarter_lst_month(PyDateTime_Date *__pyx_v_date) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":622
 * def date_quarter_lst_month(date: datetime.date) -> cython.uint:
 *     """Get the last month of the quarter, expects 3, 6, 9, 12 `<'int'>`."""
 *     return quarter_lst_month(date.month)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_quarter_lst_month(__pyx_f_7cpython_8datetime_4date_5month_month(__pyx_v_date)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 622, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":617
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.date_quarter_lst_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":626
 * 
 * # Datetime.date: calendar - month ----------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_date_days_in_month(PyDateTime_Date *__pyx_v_date) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":632
 *     """Get the maximum number of days in the month of the 'date',
 *     expects 28, 29, 30, 31 `<'int'>`."""
 *     return days_in_month(date.year, date.month)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_days_in_month(__pyx_f_7cpython_8datetime_4date_4year_year(__pyx_v_date), __pyx_f_7cpython_8datetime_4date_5month_month(__pyx_v_date)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 632, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":626
 * 
 * # Datetime.date: calendar - month ----------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.date_days_in_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":635
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_date_days_bf_month(PyDateTime_Date *__pyx_v_date) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":641
 *     """Get the number of days between the 1st day of the year
 *     and the 1st day of the month of the 'date' `<'int'>`."""
 *     return days_bf_month(date.year, date.month)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_days_bf_month(__pyx_f_7cpython_8datetime_4date_4year_year(__pyx_v_date), __pyx_f_7cpython_8datetime_4date_5month_month(__pyx_v_date)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 641, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":635
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.date_days_bf_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":645
 * 
 * # Datetime.date: calendar - week -----------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_date_weekday(PyDateTime_Date *__pyx_v_date) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":650
 * def date_weekday(date: datetime.date) -> cython.uint:
 *     """Get the day of the week, where 0=Monday...6=Sunday `<'int'>`."""
 *     return ymd_weekday(date.year, date.month, date.day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_ymd_weekday(__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 == ((unsigned int)-1))) __PYX_ERR(1, 650, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":645
 * 
 * # Datetime.date: calendar - week -----------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.date_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":653
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_date_isoweekday(PyDateTime_Date *__pyx_v_date) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":658
 * def date_isoweekday(date: datetime.date) -> cython.uint:
 *     """Get the ISO calendar day of the week, where 1=Monday...7=Sunday `<'int'>`."""
 *     return ymd_isoweekday(date.year, date.month, date.day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_ymd_isoweekday(__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 == ((unsigned int)-1))) __PYX_ERR(1, 658, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":653
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.date_isoweekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":661
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_date_isoweek(PyDateTime_Date *__pyx_v_date) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":666
 * def date_isoweek(date: datetime.date) -> cython.uint:
 *     """Get the ISO calendar week number `<'int'>`."""
 *     return ymd_isoweek(date.year, date.month, date.day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_ymd_isoweek(__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 == ((unsigned int)-1))) __PYX_ERR(1, 666, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":661
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.date_isoweek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":669
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_date_isoyear(PyDateTime_Date *__pyx_v_date) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":674
 * def date_isoyear(date: datetime.date) -> cython.uint:
 *     """Get the ISO calendar year `<'int'>`."""
 *     return ymd_isoyear(date.year, date.month, date.day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_ymd_isoyear(__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 == ((unsigned int)-1))) __PYX_ERR(1, 674, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":669
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.date_isoyear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":677
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

static __pyx_t_7cytimes_10cydatetime_iso __pyx_f_7cytimes_10cydatetime_date_isocalendar(PyDateTime_Date *__pyx_v_date) {
  __pyx_t_7cytimes_10cydatetime_iso __pyx_r;

  /* "cytimes/cydatetime.py":682
 * def date_isocalendar(date: datetime.date) -> iso:  # type: ignore
 *     """Get the ISO calendar of the 'date' `<'struct:iso'>`."""
 *     return ymd_isocalendar(date.year, date.month, date.day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_7cytimes_10cydatetime_ymd_isocalendar(__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));
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":677
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

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

/* "cytimes/cydatetime.py":686
 * 
 * # Datetime.date: conversion ----------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_to_isoformat(date: datetime.date) -> str:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_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);

  /* "cytimes/cydatetime.py":690
 * def date_to_isoformat(date: datetime.date) -> str:
 *     """Convert 'date' to ISO format: '%Y-%m-%d' `<'str'>`."""
 *     return "%04d-%02d-%02d" % (date.year, date.month, date.day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 690, __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(1, 690, __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__4);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__4);
  __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(1, 690, __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__4);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__4);
  __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(1, 690, __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(1, 690, __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;

  /* "cytimes/cydatetime.py":686
 * 
 * # Datetime.date: conversion ----------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_to_isoformat(date: datetime.date) -> str:
 */

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

/* "cytimes/cydatetime.py":693
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_to_strformat(date: datetime.date, format: str) -> str:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_date_to_strformat(PyDateTime_Date *__pyx_v_date, PyObject *__pyx_v_format) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_to_strformat", 1);

  /* "cytimes/cydatetime.py":699
 *     Equivalent to `date.strftime(format)`."""
 *     # fmt: off
 *     return dt_to_strformat(datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         date.year, date.month, date.day, 0, 0, 0, 0, None, 0), format
 *     )
 */
  __Pyx_XDECREF(__pyx_r);

  /* "cytimes/cydatetime.py":700
 *     # fmt: off
 *     return dt_to_strformat(datetime.datetime_new(
 *         date.year, date.month, date.day, 0, 0, 0, 0, None, 0), format             # <<<<<<<<<<<<<<
 *     )
 *     # fmt: on
 */
  __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, Py_None, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cytimes/cydatetime.py":699
 *     Equivalent to `date.strftime(format)`."""
 *     # fmt: off
 *     return dt_to_strformat(datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         date.year, date.month, date.day, 0, 0, 0, 0, None, 0), format
 *     )
 */
  __pyx_t_3 = __pyx_f_7cytimes_10cydatetime_dt_to_strformat(((PyDateTime_DateTime *)__pyx_t_1), __pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 699, __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;

  /* "cytimes/cydatetime.py":693
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_to_strformat(date: datetime.date, format: str) -> str:
 */

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

/* "cytimes/cydatetime.py":705
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_date_to_ordinal(PyDateTime_Date *__pyx_v_date) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":710
 * def date_to_ordinal(date: datetime.date) -> cython.uint:
 *     """Convert 'date' to ordinal `<'int'>`."""
 *     return ymd_to_ordinal(date.year, date.month, date.day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_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 == ((unsigned int)-1))) __PYX_ERR(1, 710, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":705
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.date_to_ordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":713
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_date_to_seconds(PyDateTime_Date *__pyx_v_date) {
  PY_LONG_LONG __pyx_v_ordinal;
  PY_LONG_LONG __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":718
 * def date_to_seconds(date: datetime.date) -> cython.longlong:
 *     """Convert 'date' to total seconds after POSIX epoch `<'int'>`."""
 *     ordinal: cython.longlong = date_to_ordinal(date)             # <<<<<<<<<<<<<<
 *     return (ordinal - EPOCH_DAY) * 86_400
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_date_to_ordinal(__pyx_v_date); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 718, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_1;

  /* "cytimes/cydatetime.py":719
 *     """Convert 'date' to total seconds after POSIX epoch `<'int'>`."""
 *     ordinal: cython.longlong = date_to_ordinal(date)
 *     return (ordinal - EPOCH_DAY) * 86_400             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((__pyx_v_ordinal - __pyx_v_7cytimes_10cydatetime_EPOCH_DAY) * 0x15180);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":713
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("cytimes.cydatetime.date_to_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":722
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_date_to_microseconds(PyDateTime_Date *__pyx_v_date) {
  PY_LONG_LONG __pyx_v_ordinal;
  PY_LONG_LONG __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":727
 * def date_to_microseconds(date: datetime.date) -> cython.longlong:
 *     """Convert 'date' to total microseconds after POSIX epoch `<'int'>`."""
 *     ordinal: cython.longlong = date_to_ordinal(date)             # <<<<<<<<<<<<<<
 *     return (ordinal - EPOCH_DAY) * US_DAY
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_date_to_ordinal(__pyx_v_date); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 727, __pyx_L1_error)
  __pyx_v_ordinal = __pyx_t_1;

  /* "cytimes/cydatetime.py":728
 *     """Convert 'date' to total microseconds after POSIX epoch `<'int'>`."""
 *     ordinal: cython.longlong = date_to_ordinal(date)
 *     return (ordinal - EPOCH_DAY) * US_DAY             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((__pyx_v_ordinal - __pyx_v_7cytimes_10cydatetime_EPOCH_DAY) * __pyx_v_7cytimes_10cydatetime_US_DAY);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":722
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("cytimes.cydatetime.date_to_microseconds", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":731
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_to_timestamp(date: datetime.date) -> cython.longlong:
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_date_to_timestamp(PyDateTime_Date *__pyx_v_date) {
  PY_LONG_LONG __pyx_v_base_ts;
  PY_LONG_LONG __pyx_v_offset;
  PY_LONG_LONG __pyx_r;
  PY_LONG_LONG __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":735
 * def date_to_timestamp(date: datetime.date) -> cython.longlong:
 *     """Convert 'date' to timestamp `<'int'>`."""
 *     base_ts: cython.longlong = date_to_seconds(date)             # <<<<<<<<<<<<<<
 *     offset: cython.longlong = localize_ts(base_ts) - base_ts  # type: ignore
 *     return base_ts - offset
 */
  __pyx_v_base_ts = __pyx_f_7cytimes_10cydatetime_date_to_seconds(__pyx_v_date);

  /* "cytimes/cydatetime.py":736
 *     """Convert 'date' to timestamp `<'int'>`."""
 *     base_ts: cython.longlong = date_to_seconds(date)
 *     offset: cython.longlong = localize_ts(base_ts) - base_ts  # type: ignore             # <<<<<<<<<<<<<<
 *     return base_ts - offset
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_localize_ts(__pyx_v_base_ts); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 736, __pyx_L1_error)
  __pyx_v_offset = (__pyx_t_1 - __pyx_v_base_ts);

  /* "cytimes/cydatetime.py":737
 *     base_ts: cython.longlong = date_to_seconds(date)
 *     offset: cython.longlong = localize_ts(base_ts) - base_ts  # type: ignore
 *     return base_ts - offset             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_base_ts - __pyx_v_offset);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":731
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_to_timestamp(date: datetime.date) -> cython.longlong:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.date_to_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":740
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_fr_dt(dt: datetime.datetime) -> datetime.date:
 */

static PyDateTime_Date *__pyx_f_7cytimes_10cydatetime_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);

  /* "cytimes/cydatetime.py":744
 * def date_fr_dt(dt: datetime.datetime) -> datetime.date:
 *     """Convert `<'datetime.datetime'>` to `<'datetime.date'>`."""
 *     return datetime.date_new(dt.year, dt.month, dt.day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __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(1, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":740
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_fr_dt(dt: datetime.datetime) -> datetime.date:
 */

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

/* "cytimes/cydatetime.py":747
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_fr_date(date: datetime.date) -> datetime.date:
 */

static PyDateTime_Date *__pyx_f_7cytimes_10cydatetime_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);

  /* "cytimes/cydatetime.py":751
 * def date_fr_date(date: datetime.date) -> datetime.date:
 *     """Convert subclass of `<'datetime.date'>` to `<'datetime.date'>`."""
 *     return datetime.date_new(date.year, date.month, date.day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __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(1, 751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":747
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_fr_date(date: datetime.date) -> datetime.date:
 */

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

/* "cytimes/cydatetime.py":754
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_fr_ordinal(ordinal: cython.int) -> datetime.date:
 */

static PyDateTime_Date *__pyx_f_7cytimes_10cydatetime_date_fr_ordinal(int __pyx_v_ordinal) {
  __pyx_t_7cytimes_10cydatetime_ymd __pyx_v_ymd;
  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_ordinal", 1);

  /* "cytimes/cydatetime.py":758
 * def date_fr_ordinal(ordinal: cython.int) -> datetime.date:
 *     """Convert ordinal to `<'datetime.date'>`."""
 *     ymd = ordinal_to_ymd(ordinal)             # <<<<<<<<<<<<<<
 *     return datetime.date_new(ymd.year, ymd.month, ymd.day)
 * 
 */
  __pyx_v_ymd = __pyx_f_7cytimes_10cydatetime_ordinal_to_ymd(__pyx_v_ordinal);

  /* "cytimes/cydatetime.py":759
 *     """Convert ordinal to `<'datetime.date'>`."""
 *     ymd = ordinal_to_ymd(ordinal)
 *     return datetime.date_new(ymd.year, ymd.month, ymd.day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cpython_8datetime_date_new(__pyx_v_ymd.year, __pyx_v_ymd.month, __pyx_v_ymd.day)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":754
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_fr_ordinal(ordinal: cython.int) -> datetime.date:
 */

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

/* "cytimes/cydatetime.py":762
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_fr_seconds(seconds: cython.double) -> datetime.date:
 */

static PyDateTime_Date *__pyx_f_7cytimes_10cydatetime_date_fr_seconds(double __pyx_v_seconds) {
  PY_LONG_LONG __pyx_v_total_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);

  /* "cytimes/cydatetime.py":766
 * def date_fr_seconds(seconds: cython.double) -> datetime.date:
 *     """Convert total seconds after POSIX epoch to `<'datetime.date'>`."""
 *     total_sec: cython.longlong = int(seconds)             # <<<<<<<<<<<<<<
 *     return date_fr_ordinal(total_sec // 86_400 + EPOCH_DAY)
 * 
 */
  __pyx_v_total_sec = ((PY_LONG_LONG)__pyx_v_seconds);

  /* "cytimes/cydatetime.py":767
 *     """Convert total seconds after POSIX epoch to `<'datetime.date'>`."""
 *     total_sec: cython.longlong = int(seconds)
 *     return date_fr_ordinal(total_sec // 86_400 + EPOCH_DAY)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_date_fr_ordinal((__Pyx_div_PY_LONG_LONG(__pyx_v_total_sec, 0x15180) + __pyx_v_7cytimes_10cydatetime_EPOCH_DAY))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":762
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_fr_seconds(seconds: cython.double) -> datetime.date:
 */

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

/* "cytimes/cydatetime.py":770
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.cdivision(True)
 */

static PyDateTime_Date *__pyx_f_7cytimes_10cydatetime_date_fr_microseconds(PY_LONG_LONG __pyx_v_microseconds) {
  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_microseconds", 1);

  /* "cytimes/cydatetime.py":775
 * def date_fr_microseconds(microseconds: cython.longlong) -> datetime.date:
 *     """Convert total microseconds after POSIX epoch to `<'datetime.date'>`."""
 *     return date_fr_ordinal(microseconds // US_DAY + EPOCH_DAY)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_date_fr_ordinal(((__pyx_v_microseconds / __pyx_v_7cytimes_10cydatetime_US_DAY) + __pyx_v_7cytimes_10cydatetime_EPOCH_DAY))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":770
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.cdivision(True)
 */

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

/* "cytimes/cydatetime.py":778
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_fr_timestamp(timestamp: cython.double) -> datetime.date:
 */

static PyDateTime_Date *__pyx_f_7cytimes_10cydatetime_date_fr_timestamp(double __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_fr_timestamp", 1);

  /* "cytimes/cydatetime.py":782
 * def date_fr_timestamp(timestamp: cython.double) -> datetime.date:
 *     """Convert timestamp to `<'datetime.date'>`."""
 *     return datetime.date_from_timestamp(timestamp)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 782, __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(1, 782, __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;

  /* "cytimes/cydatetime.py":778
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_fr_timestamp(timestamp: cython.double) -> datetime.date:
 */

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

/* "cytimes/cydatetime.py":786
 * 
 * # Datetime.date: arithmetic ----------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_add(
 */

static PyDateTime_Date *__pyx_f_7cytimes_10cydatetime_date_add(PyDateTime_Date *__pyx_v_date, struct __pyx_opt_args_7cytimes_10cydatetime_date_add *__pyx_optional_args) {
  int __pyx_v_days = ((int)0);
  PY_LONG_LONG __pyx_v_seconds = ((PY_LONG_LONG)0);
  PY_LONG_LONG __pyx_v_microseconds = ((PY_LONG_LONG)0);
  PyDateTime_Date *__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("date_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;
        }
      }
    }
  }

  /* "cytimes/cydatetime.py":796
 *     """Add 'days', 'seconds' and 'microseconds' to `<'datetime.date'>`.
 *     Equivalent to `date + timedelta(days, seconds, microseconds)`."""
 *     if days == 0 and seconds == 0 and microseconds == 0:             # <<<<<<<<<<<<<<
 *         return date
 *     return date_fr_microseconds(
 */
  __pyx_t_2 = (__pyx_v_days == 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __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) {

    /* "cytimes/cydatetime.py":797
 *     Equivalent to `date + timedelta(days, seconds, microseconds)`."""
 *     if days == 0 and seconds == 0 and microseconds == 0:
 *         return date             # <<<<<<<<<<<<<<
 *     return date_fr_microseconds(
 *         date_to_microseconds(date) + days * US_DAY + seconds * 1_000_000 + microseconds
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_date);
    __pyx_r = __pyx_v_date;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":796
 *     """Add 'days', 'seconds' and 'microseconds' to `<'datetime.date'>`.
 *     Equivalent to `date + timedelta(days, seconds, microseconds)`."""
 *     if days == 0 and seconds == 0 and microseconds == 0:             # <<<<<<<<<<<<<<
 *         return date
 *     return date_fr_microseconds(
 */
  }

  /* "cytimes/cydatetime.py":798
 *     if days == 0 and seconds == 0 and microseconds == 0:
 *         return date
 *     return date_fr_microseconds(             # <<<<<<<<<<<<<<
 *         date_to_microseconds(date) + days * US_DAY + seconds * 1_000_000 + microseconds
 *     )
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":799
 *         return date
 *     return date_fr_microseconds(
 *         date_to_microseconds(date) + days * US_DAY + seconds * 1_000_000 + microseconds             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_date_fr_microseconds((((__pyx_f_7cytimes_10cydatetime_date_to_microseconds(__pyx_v_date) + (__pyx_v_days * __pyx_v_7cytimes_10cydatetime_US_DAY)) + (__pyx_v_seconds * 0xF4240)) + __pyx_v_microseconds))); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":786
 * 
 * # Datetime.date: arithmetic ----------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_add(
 */

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

/* "cytimes/cydatetime.py":803
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_add_td(date: datetime.date, td: datetime.timedelta) -> datetime.date:
 */

static PyDateTime_Date *__pyx_f_7cytimes_10cydatetime_date_add_td(PyDateTime_Date *__pyx_v_date, PyDateTime_Delta *__pyx_v_td) {
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  unsigned int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_add_td", 1);

  /* "cytimes/cydatetime.py":808
 *     """Add `<'datetime.timedelta'>` to `<'datetime.date'>`.
 *     Equivalent to `date + timedelta`."""
 *     return date_fr_ordinal(date_to_ordinal(date) + td.day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_date_to_ordinal(__pyx_v_date); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 808, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_date_fr_ordinal((__pyx_t_1 + __pyx_f_7cpython_8datetime_9timedelta_3day_day(__pyx_v_td)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":803
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_add_td(date: datetime.date, td: datetime.timedelta) -> datetime.date:
 */

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

/* "cytimes/cydatetime.py":811
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_sub_td(date: datetime.date, td: datetime.timedelta) -> datetime.date:
 */

static PyDateTime_Date *__pyx_f_7cytimes_10cydatetime_date_sub_td(PyDateTime_Date *__pyx_v_date, PyDateTime_Delta *__pyx_v_td) {
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  unsigned int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_sub_td", 1);

  /* "cytimes/cydatetime.py":816
 *     """Substract `<'datetime.timedelta'>` from `<'datetime.date'>`.
 *     Equivalent to `date - timedelta`."""
 *     return date_fr_ordinal(date_to_ordinal(date) - td.day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_date_to_ordinal(__pyx_v_date); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 816, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_date_fr_ordinal((__pyx_t_1 - __pyx_f_7cpython_8datetime_9timedelta_3day_day(__pyx_v_td)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":811
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_sub_td(date: datetime.date, td: datetime.timedelta) -> datetime.date:
 */

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

/* "cytimes/cydatetime.py":819
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_sub_date(date_l: datetime.date, date_r: datetime.date) -> datetime.timedelta:
 */

static PyDateTime_Delta *__pyx_f_7cytimes_10cydatetime_date_sub_date(PyDateTime_Date *__pyx_v_date_l, PyDateTime_Date *__pyx_v_date_r) {
  PyDateTime_Delta *__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("date_sub_date", 1);

  /* "cytimes/cydatetime.py":824
 *     """Substruction between datetime.dates and returns `<'datetime.timedelta'>`.
 *     Equivalent to `date - date`."""
 *     return datetime.timedelta_new(date_sub_date_days(date_l, date_r), 0, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_date_sub_date_days(__pyx_v_date_l, __pyx_v_date_r); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 824, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(__pyx_t_1, 0, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":819
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_sub_date(date_l: datetime.date, date_r: datetime.date) -> datetime.timedelta:
 */

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

/* "cytimes/cydatetime.py":827
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_sub_date_days(date_l: datetime.date, date_r: datetime.date) -> cython.int:
 */

static int __pyx_f_7cytimes_10cydatetime_date_sub_date_days(PyDateTime_Date *__pyx_v_date_l, PyDateTime_Date *__pyx_v_date_r) {
  int __pyx_r;
  unsigned int __pyx_t_1;
  unsigned int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":832
 *     """Substruction between datetime.dates and returns `<'int'>`
 *     (differences in days). Equivalent to `date - date`."""
 *     return date_to_ordinal(date_l) - date_to_ordinal(date_r)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_date_to_ordinal(__pyx_v_date_l); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_date_to_ordinal(__pyx_v_date_r); if (unlikely(__pyx_t_2 == ((unsigned int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
  __pyx_r = (__pyx_t_1 - __pyx_t_2);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":827
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_sub_date_days(date_l: datetime.date, date_r: datetime.date) -> cython.int:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.date_sub_date_days", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":836
 * 
 * # Datetime.date: manipulation --------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_replace(
 */

static PyDateTime_Date *__pyx_f_7cytimes_10cydatetime_date_replace(PyDateTime_Date *__pyx_v_date, struct __pyx_opt_args_7cytimes_10cydatetime_date_replace *__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
  int __pyx_t_1;
  int __pyx_t_2;
  unsigned int __pyx_t_3;
  int __pyx_t_4;
  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("date_replace", 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;
        }
      }
    }
  }

  /* "cytimes/cydatetime.py":846
 *     """Replace `<'datetime.date'>`. Equivalent to `date.replace()`.
 *     Value of `-1` indicates preserving the original value."""
 *     if not 1 <= year <= 9999:             # <<<<<<<<<<<<<<
 *         year = date.year
 *     if not 1 <= month <= 12:
 */
  __pyx_t_1 = (1 <= __pyx_v_year);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_year <= 0x270F);
  }
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":847
 *     Value of `-1` indicates preserving the original value."""
 *     if not 1 <= year <= 9999:
 *         year = date.year             # <<<<<<<<<<<<<<
 *     if not 1 <= month <= 12:
 *         month = date.month
 */
    __pyx_v_year = __pyx_f_7cpython_8datetime_4date_4year_year(__pyx_v_date);

    /* "cytimes/cydatetime.py":846
 *     """Replace `<'datetime.date'>`. Equivalent to `date.replace()`.
 *     Value of `-1` indicates preserving the original value."""
 *     if not 1 <= year <= 9999:             # <<<<<<<<<<<<<<
 *         year = date.year
 *     if not 1 <= month <= 12:
 */
  }

  /* "cytimes/cydatetime.py":848
 *     if not 1 <= year <= 9999:
 *         year = date.year
 *     if not 1 <= month <= 12:             # <<<<<<<<<<<<<<
 *         month = date.month
 *     return datetime.date_new(
 */
  __pyx_t_2 = (1 <= __pyx_v_month);
  if (__pyx_t_2) {
    __pyx_t_2 = (__pyx_v_month <= 12);
  }
  __pyx_t_1 = (!__pyx_t_2);
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":849
 *         year = date.year
 *     if not 1 <= month <= 12:
 *         month = date.month             # <<<<<<<<<<<<<<
 *     return datetime.date_new(
 *         year, month, min(day if day > 0 else date.day, days_in_month(year, month))
 */
    __pyx_v_month = __pyx_f_7cpython_8datetime_4date_5month_month(__pyx_v_date);

    /* "cytimes/cydatetime.py":848
 *     if not 1 <= year <= 9999:
 *         year = date.year
 *     if not 1 <= month <= 12:             # <<<<<<<<<<<<<<
 *         month = date.month
 *     return datetime.date_new(
 */
  }

  /* "cytimes/cydatetime.py":850
 *     if not 1 <= month <= 12:
 *         month = date.month
 *     return datetime.date_new(             # <<<<<<<<<<<<<<
 *         year, month, min(day if day > 0 else date.day, days_in_month(year, month))
 *     )
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":851
 *         month = date.month
 *     return datetime.date_new(
 *         year, month, min(day if day > 0 else date.day, days_in_month(year, month))             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_3 = __pyx_f_7cytimes_10cydatetime_days_in_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_3 == ((unsigned int)-1))) __PYX_ERR(1, 851, __pyx_L1_error)
  __pyx_t_1 = (__pyx_v_day > 0);
  if (__pyx_t_1) {
    __pyx_t_4 = __pyx_v_day;
  } else {
    __pyx_t_4 = __pyx_f_7cpython_8datetime_4date_3day_day(__pyx_v_date);
  }
  __pyx_t_1 = (__pyx_t_3 < __pyx_t_4);
  if (__pyx_t_1) {
    __pyx_t_5 = __pyx_t_3;
  } else {
    __pyx_t_5 = __pyx_t_4;
  }

  /* "cytimes/cydatetime.py":850
 *     if not 1 <= month <= 12:
 *         month = date.month
 *     return datetime.date_new(             # <<<<<<<<<<<<<<
 *         year, month, min(day if day > 0 else date.day, days_in_month(year, month))
 *     )
 */
  __pyx_t_6 = ((PyObject *)__pyx_f_7cpython_8datetime_date_new(__pyx_v_year, __pyx_v_month, __pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_6);
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":836
 * 
 * # Datetime.date: manipulation --------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_replace(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cytimes.cydatetime.date_replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":855
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_adj_weekday(date: datetime.date, weekday: cython.uint) -> datetime.date:
 */

static PyDateTime_Date *__pyx_f_7cytimes_10cydatetime_date_adj_weekday(PyDateTime_Date *__pyx_v_date, unsigned int __pyx_v_weekday) {
  unsigned int __pyx_v_wday;
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  unsigned int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  struct __pyx_opt_args_7cytimes_10cydatetime_date_add __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_adj_weekday", 1);

  /* "cytimes/cydatetime.py":861
 *     the current week, where Monday is 0 and Sunday is 6.
 *     Equivalent to: `date + timedelta(weekday - date.weekday())`."""
 *     weekday = weekday % 7             # <<<<<<<<<<<<<<
 *     wday: cython.uint = date_weekday(date)
 *     return date if weekday == wday else date_add(date, days=weekday - wday)
 */
  __pyx_v_weekday = __Pyx_mod_long(__pyx_v_weekday, 7);

  /* "cytimes/cydatetime.py":862
 *     Equivalent to: `date + timedelta(weekday - date.weekday())`."""
 *     weekday = weekday % 7
 *     wday: cython.uint = date_weekday(date)             # <<<<<<<<<<<<<<
 *     return date if weekday == wday else date_add(date, days=weekday - wday)
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_date_weekday(__pyx_v_date); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 862, __pyx_L1_error)
  __pyx_v_wday = __pyx_t_1;

  /* "cytimes/cydatetime.py":863
 *     weekday = weekday % 7
 *     wday: cython.uint = date_weekday(date)
 *     return date if weekday == wday else date_add(date, days=weekday - wday)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_3 = (__pyx_v_weekday == __pyx_v_wday);
  if (__pyx_t_3) {
    __Pyx_INCREF((PyObject *)__pyx_v_date);
    __pyx_t_2 = ((PyObject *)__pyx_v_date);
  } else {
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.days = (__pyx_v_weekday - __pyx_v_wday);
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_date_add(__pyx_v_date, &__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_r = ((PyDateTime_Date *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":855
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def date_adj_weekday(date: datetime.date, weekday: cython.uint) -> datetime.date:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.cydatetime.date_adj_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":868
 * # Datetime.datetime ====================================================================================
 * # Datetime.datetime: generate --------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_dt(
 */

static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_gen_dt(struct __pyx_opt_args_7cytimes_10cydatetime_gen_dt *__pyx_optional_args) {
  unsigned int __pyx_v_year = ((unsigned int)1);
  unsigned int __pyx_v_month = ((unsigned int)1);
  unsigned int __pyx_v_day = ((unsigned int)1);
  unsigned int __pyx_v_hour = ((unsigned int)0);
  unsigned int __pyx_v_minute = ((unsigned int)0);
  unsigned int __pyx_v_second = ((unsigned int)0);
  unsigned int __pyx_v_microsecond = ((unsigned int)0);

  /* "cytimes/cydatetime.py":878
 *     second: cython.uint = 0,
 *     microsecond: cython.uint = 0,
 *     tzinfo: datetime.tzinfo = None,             # <<<<<<<<<<<<<<
 *     fold: cython.uint = 0,
 * ) -> datetime.datetime:
 */
  PyDateTime_TZInfo *__pyx_v_tzinfo = ((PyDateTime_TZInfo *)Py_None);
  unsigned int __pyx_v_fold = ((unsigned int)0);
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __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("gen_dt", 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_tzinfo = __pyx_optional_args->tzinfo;
                    if (__pyx_optional_args->__pyx_n > 8) {
                      __pyx_v_fold = __pyx_optional_args->fold;
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }

  /* "cytimes/cydatetime.py":883
 *     """Generate a new `<'datetime.datetime'>`."""
 *     # fmt: off
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         year, month, day, hour, minute, second, microsecond,
 *         tzinfo, 1 if fold == 1 and tzinfo is not None else 0
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":885
 *     return datetime.datetime_new(
 *         year, month, day, hour, minute, second, microsecond,
 *         tzinfo, 1 if fold == 1 and tzinfo is not None else 0             # <<<<<<<<<<<<<<
 *     )
 *     # fmt: on
 */
  __pyx_t_3 = (__pyx_v_fold == 1);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = (((PyObject *)__pyx_v_tzinfo) != Py_None);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L3_bool_binop_done:;
  if (__pyx_t_2) {
    __pyx_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }

  /* "cytimes/cydatetime.py":883
 *     """Generate a new `<'datetime.datetime'>`."""
 *     # fmt: off
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         year, month, day, hour, minute, second, microsecond,
 *         tzinfo, 1 if fold == 1 and tzinfo is not None else 0
 */
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.fold = __pyx_t_1;
  __pyx_t_4 = ((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, ((PyObject *)__pyx_v_tzinfo), &__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":868
 * # Datetime.datetime ====================================================================================
 * # Datetime.datetime: generate --------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_dt(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.cydatetime.gen_dt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":890
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_dt_now() -> datetime.datetime:
 */

static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_gen_dt_now(void) {
  int __pyx_v_microseconds;
  struct tm __pyx_v_tms;
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct tm __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("gen_dt_now", 1);

  /* "cytimes/cydatetime.py":895
 *     """Generate the current local `<'datetime.datetime'>`.
 *     Equivalent to `datetime.datetime.now()`."""
 *     microseconds: cython.int = int(unix_time() % 1 * 1_000_000)             # <<<<<<<<<<<<<<
 *     tms = localtime()
 *     # fmt: off
 */
  __pyx_v_microseconds = ((int)(__Pyx_mod_double(__pyx_f_7cpython_4time_time(), 1.0) * 1000000.0));

  /* "cytimes/cydatetime.py":896
 *     Equivalent to `datetime.datetime.now()`."""
 *     microseconds: cython.int = int(unix_time() % 1 * 1_000_000)
 *     tms = localtime()             # <<<<<<<<<<<<<<
 *     # fmt: off
 *     return datetime.datetime_new(
 */
  __pyx_t_1 = __pyx_f_7cpython_4time_localtime(); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 896, __pyx_L1_error)
  __pyx_v_tms = __pyx_t_1;

  /* "cytimes/cydatetime.py":898
 *     tms = localtime()
 *     # fmt: off
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         tms.tm_year, tms.tm_mon, tms.tm_mday,
 *         tms.tm_hour, tms.tm_min, tms.tm_sec,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":901
 *         tms.tm_year, tms.tm_mon, tms.tm_mday,
 *         tms.tm_hour, tms.tm_min, tms.tm_sec,
 *         microseconds, None, 0,             # <<<<<<<<<<<<<<
 *     )
 *     # fmt: on
 */
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.fold = 0;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_v_tms.tm_year, __pyx_v_tms.tm_mon, __pyx_v_tms.tm_mday, __pyx_v_tms.tm_hour, __pyx_v_tms.tm_min, __pyx_v_tms.tm_sec, __pyx_v_microseconds, Py_None, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":890
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_dt_now() -> datetime.datetime:
 */

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

/* "cytimes/cydatetime.py":906
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_dt_now_utc() -> datetime.datetime:
 */

static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_gen_dt_now_utc(void) {
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_timestamp __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("gen_dt_now_utc", 1);

  /* "cytimes/cydatetime.py":911
 *     """Generate the current `<'datetime.datetime'>` under UTC.
 *     Equivalent to `datetime.datetime.now(UTC)`."""
 *     return dt_fr_timestamp(unix_time(), UTC)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_v_7cytimes_10cydatetime_UTC);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.tzinfo = ((PyDateTime_TZInfo *)__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt_fr_timestamp(__pyx_f_7cpython_4time_time(), &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 911, __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;

  /* "cytimes/cydatetime.py":906
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_dt_now_utc() -> datetime.datetime:
 */

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

/* "cytimes/cydatetime.py":914
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_dt_now_tz(tzinfo: datetime.tzinfo) -> datetime.datetime:
 */

static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_gen_dt_now_tz(PyDateTime_TZInfo *__pyx_v_tzinfo) {
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_timestamp __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("gen_dt_now_tz", 1);

  /* "cytimes/cydatetime.py":919
 *     """Generate the current `<'datetime.datetime'>` under specific timezone.
 *     Equivalent to `datetime.datetime.now(tzinfo)`."""
 *     return dt_fr_timestamp(unix_time(), tzinfo)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.tzinfo = __pyx_v_tzinfo;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt_fr_timestamp(__pyx_f_7cpython_4time_time(), &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":914
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_dt_now_tz(tzinfo: datetime.tzinfo) -> datetime.datetime:
 */

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

/* "cytimes/cydatetime.py":923
 * 
 * # Datetime.datetime: check types -----------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static int __pyx_f_7cytimes_10cydatetime_is_dt(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "cytimes/cydatetime.py":929
 *     """Check if an object is type of datetime.datetime `<'bool'>`.
 *     Equivalent to `isinstance(obj, datetime.datetime)`"""
 *     return datetime.PyDateTime_Check(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyDateTime_Check(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":923
 * 
 * # Datetime.datetime: check types -----------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

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

/* "cytimes/cydatetime.py":932
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static int __pyx_f_7cytimes_10cydatetime_is_dt_exact(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "cytimes/cydatetime.py":938
 *     """Check if an object is the exact type of datetime.datetime `<'bool'>`.
 *     Equivalent to `type(obj) is datetime.datetime`."""
 *     return datetime.PyDateTime_CheckExact(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyDateTime_CheckExact(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":932
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

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

/* "cytimes/cydatetime.py":942
 * 
 * # Datetime.datetime: tzinfo ----------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_tzname(dt: datetime.datetime) -> str:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_dt_tzname(PyDateTime_DateTime *__pyx_v_dt) {
  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("dt_tzname", 1);

  /* "cytimes/cydatetime.py":947
 *     """Access the 'tzname' `<'str'>`.
 *     Equivalent to `dt.tzname()`."""
 *     return tzinfo_name(dt.tzinfo, 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(1, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_tzinfo_name(__pyx_t_1, __pyx_v_dt); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 947, __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;

  /* "cytimes/cydatetime.py":942
 * 
 * # Datetime.datetime: tzinfo ----------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_tzname(dt: datetime.datetime) -> str:
 */

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

/* "cytimes/cydatetime.py":950
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_dst(dt: datetime.datetime) -> datetime.timedelta:
 */

static PyDateTime_Delta *__pyx_f_7cytimes_10cydatetime_dt_dst(PyDateTime_DateTime *__pyx_v_dt) {
  PyDateTime_Delta *__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("dt_dst", 1);

  /* "cytimes/cydatetime.py":955
 *     """Access the 'dst' `<'datetime.datetime'>`.
 *     Equivalent to `dt.dst()`."""
 *     return tzinfo_dst(dt.tzinfo, 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(1, 955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_tzinfo_dst(__pyx_t_1, __pyx_v_dt)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 955, __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;

  /* "cytimes/cydatetime.py":950
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_dst(dt: datetime.datetime) -> datetime.timedelta:
 */

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

/* "cytimes/cydatetime.py":958
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_utcoffset(dt: datetime.datetime) -> datetime.timedelta:
 */

static PyDateTime_Delta *__pyx_f_7cytimes_10cydatetime_dt_utcoffset(PyDateTime_DateTime *__pyx_v_dt) {
  PyDateTime_Delta *__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("dt_utcoffset", 1);

  /* "cytimes/cydatetime.py":963
 *     """Access the 'utcoffset' `<'datetime.timedelta'>`.
 *     Equivalent to `dt.utcoffset()`."""
 *     return tzinfo_utcoffset(dt.tzinfo, 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(1, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_tzinfo_utcoffset(__pyx_t_1, __pyx_v_dt)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 963, __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;

  /* "cytimes/cydatetime.py":958
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_utcoffset(dt: datetime.datetime) -> datetime.timedelta:
 */

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

/* "cytimes/cydatetime.py":967
 * 
 * # Datetime.datetime: calendar - year -------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static int __pyx_f_7cytimes_10cydatetime_dt_is_leapyear(PyDateTime_DateTime *__pyx_v_dt) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":972
 * def dt_is_leapyear(dt: datetime.datetime) -> cython.bint:
 *     """Whether the 'dt' is a leap year `<'bool'>`."""
 *     return is_leapyear(dt.year)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_is_leapyear(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 972, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":967
 * 
 * # Datetime.datetime: calendar - year -------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.dt_is_leapyear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":975
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_dt_leap_bt_years(PyDateTime_DateTime *__pyx_v_dt1, PyDateTime_DateTime *__pyx_v_dt2) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":980
 * def dt_leap_bt_years(dt1: datetime.datetime, dt2: datetime.datetime) -> cython.uint:
 *     """Calculate the number of leap years between two 'datetimes' `<'int'>`."""
 *     return leap_bt_years(dt1.year, dt2.year)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_leap_bt_years(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt1), __pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt2)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 980, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":975
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.dt_leap_bt_years", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":983
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_dt_days_in_year(PyDateTime_DateTime *__pyx_v_dt) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":988
 * def dt_days_in_year(dt: datetime.datetime) -> cython.uint:
 *     """Get the maximum number of days in the 'year', expects 365 or 366 `<'int'>`."""
 *     return days_in_year(dt.year)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_days_in_year(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 988, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":983
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.dt_days_in_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":991
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_dt_days_bf_year(PyDateTime_DateTime *__pyx_v_dt) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":997
 *     """Calculate the number of days between the given 'dt'
 *     and the 1st day of 1AD `<'int'>`."""
 *     return days_bf_year(dt.year)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_days_bf_year(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 997, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":991
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.dt_days_bf_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1000
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_dt_days_of_year(PyDateTime_DateTime *__pyx_v_dt) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":1006
 *     """Calculate the number of days between the given 'dt'
 *     and the 1st day of the 'year' `<'int'>`."""
 *     return days_of_year(dt.year, dt.month, dt.day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_days_of_year(__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 == ((unsigned int)-1))) __PYX_ERR(1, 1006, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1000
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.dt_days_of_year", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1010
 * 
 * # Datetime.datetime: calendar - quarter ----------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_dt_quarter(PyDateTime_DateTime *__pyx_v_dt) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":1015
 * def dt_quarter(dt: datetime.datetime) -> cython.uint:
 *     """Get the quarter of 'dt' `<'int'>`"""
 *     return quarter_of_month(dt.month)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_quarter_of_month(__pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 1015, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1010
 * 
 * # Datetime.datetime: calendar - quarter ----------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.dt_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1018
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_dt_days_in_quarter(PyDateTime_DateTime *__pyx_v_dt) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":1024
 *     """Calculate the maximum number of days in the
 *     quarter of the 'dt' `<'int'>`."""
 *     return days_in_quarter(dt.year, dt.month)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_days_in_quarter(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 1024, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1018
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.dt_days_in_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1027
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_dt_days_bf_quarter(PyDateTime_DateTime *__pyx_v_dt) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":1033
 *     """Calculate the number of days between the 1st day
 *     of the quarter and the 1st day of the year `<'int'>."""
 *     return days_bf_quarter(dt.year, dt.month)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_days_bf_quarter(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 1033, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1027
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.dt_days_bf_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1036
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_dt_days_of_quarter(PyDateTime_DateTime *__pyx_v_dt) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":1042
 *     """Calculate the number of days between the given 'dt'
 *     and the 1st day of the quarter `<'int'>`."""
 *     return days_of_quarter(dt.year, dt.month, dt.day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_days_of_quarter(__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 == ((unsigned int)-1))) __PYX_ERR(1, 1042, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1036
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.dt_days_of_quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1045
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_dt_quarter_1st_month(PyDateTime_DateTime *__pyx_v_dt) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":1050
 * def dt_quarter_1st_month(dt: datetime.datetime) -> cython.uint:
 *     """Get the first month of the quarter, expects 1, 4, 7, 10 `<'int'>`."""
 *     return quarter_1st_month(dt.month)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_quarter_1st_month(__pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 1050, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1045
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.dt_quarter_1st_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1053
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_dt_quarter_lst_month(PyDateTime_DateTime *__pyx_v_dt) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":1058
 * def dt_quarter_lst_month(dt: datetime.datetime) -> cython.uint:
 *     """Get the last month of the quarter, expects 3, 6, 9, 12 `<'int'>`."""
 *     return quarter_lst_month(dt.month)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_quarter_lst_month(__pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 1058, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1053
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.dt_quarter_lst_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1062
 * 
 * # Datetime.datetime: calendar - month ------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_dt_days_in_month(PyDateTime_DateTime *__pyx_v_dt) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":1068
 *     """Get the maximum number of days in the month of the 'dt',
 *     expects 28, 29, 30, 31 `<'int'>`."""
 *     return days_in_month(dt.year, dt.month)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_days_in_month(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 1068, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1062
 * 
 * # Datetime.datetime: calendar - month ------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.dt_days_in_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1071
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_dt_days_bf_month(PyDateTime_DateTime *__pyx_v_dt) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":1077
 *     """Get the number of days between the 1st day of the year
 *     and the 1st day of the month of the 'dt' `<'int'>`."""
 *     return days_bf_month(dt.year, dt.month)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_days_bf_month(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt)); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 1077, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1071
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.dt_days_bf_month", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1081
 * 
 * # Datetime.datetime: calendar - week -------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_dt_weekday(PyDateTime_DateTime *__pyx_v_dt) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":1086
 * def dt_weekday(dt: datetime.datetime) -> cython.uint:
 *     """Get the day of the week, where 0=Monday...6=Sunday `<'int'>`."""
 *     return ymd_weekday(dt.year, dt.month, dt.day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_ymd_weekday(__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 == ((unsigned int)-1))) __PYX_ERR(1, 1086, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1081
 * 
 * # Datetime.datetime: calendar - week -------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.dt_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1089
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_dt_isoweekday(PyDateTime_DateTime *__pyx_v_dt) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":1094
 * def dt_isoweekday(dt: datetime.datetime) -> cython.uint:
 *     """Get the ISO calendar day of the week, where 1=Monday...7=Sunday `<'int'>`."""
 *     return ymd_isoweekday(dt.year, dt.month, dt.day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_ymd_isoweekday(__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 == ((unsigned int)-1))) __PYX_ERR(1, 1094, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1089
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.dt_isoweekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1097
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_dt_isoweek(PyDateTime_DateTime *__pyx_v_dt) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":1102
 * def dt_isoweek(dt: datetime.datetime) -> cython.uint:
 *     """Get the ISO calendar week number `<'int'>`."""
 *     return ymd_isoweek(dt.year, dt.month, dt.day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_ymd_isoweek(__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 == ((unsigned int)-1))) __PYX_ERR(1, 1102, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1097
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.dt_isoweek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1105
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_dt_isoyear(PyDateTime_DateTime *__pyx_v_dt) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":1110
 * def dt_isoyear(dt: datetime.datetime) -> cython.uint:
 *     """Get the ISO calendar year `<'int'>`."""
 *     return ymd_isoyear(dt.year, dt.month, dt.day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_ymd_isoyear(__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 == ((unsigned int)-1))) __PYX_ERR(1, 1110, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1105
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.dt_isoyear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1113
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

static __pyx_t_7cytimes_10cydatetime_iso __pyx_f_7cytimes_10cydatetime_dt_isocalendar(PyDateTime_DateTime *__pyx_v_dt) {
  __pyx_t_7cytimes_10cydatetime_iso __pyx_r;

  /* "cytimes/cydatetime.py":1118
 * def dt_isocalendar(dt: datetime.datetime) -> iso:  # type: ignore
 *     """Get the ISO calendar of the 'dt' `<'struct:iso'>`."""
 *     return ymd_isocalendar(dt.year, dt.month, dt.day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_7cytimes_10cydatetime_ymd_isocalendar(__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));
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1113
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

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

/* "cytimes/cydatetime.py":1122
 * 
 * # Datetime.datetime: conversion ------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_to_isoformat(dt: datetime.datetime) -> str:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_dt_to_isoformat(PyDateTime_DateTime *__pyx_v_dt) {
  int __pyx_v_microsecond;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_isoformat", 1);

  /* "cytimes/cydatetime.py":1126
 * def dt_to_isoformat(dt: datetime.datetime) -> str:
 *     """Convert datetime to ISO format: '%Y-%m-%dT%H:%M:%S.f' `<'str'>`."""
 *     microsecond: cython.int = dt.microsecond             # <<<<<<<<<<<<<<
 *     # fmt: off
 *     if microsecond == 0:
 */
  __pyx_v_microsecond = __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt);

  /* "cytimes/cydatetime.py":1128
 *     microsecond: cython.int = dt.microsecond
 *     # fmt: off
 *     if microsecond == 0:             # <<<<<<<<<<<<<<
 *         return "%04d-%02d-%02dT%02d:%02d:%02d" % (
 *             dt.year, dt.month, dt.day,
 */
  __pyx_t_1 = (__pyx_v_microsecond == 0);
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":1129
 *     # fmt: off
 *     if microsecond == 0:
 *         return "%04d-%02d-%02dT%02d:%02d:%02d" % (             # <<<<<<<<<<<<<<
 *             dt.year, dt.month, dt.day,
 *             dt.hour, dt.minute, dt.second,
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyTuple_New(11); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_4 = 127;

    /* "cytimes/cydatetime.py":1130
 *     if microsecond == 0:
 *         return "%04d-%02d-%02dT%02d:%02d:%02d" % (
 *             dt.year, dt.month, dt.day,             # <<<<<<<<<<<<<<
 *             dt.hour, dt.minute, dt.second,
 *         )
 */
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), 4, '0', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__4);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__4);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u__4);
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__4);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__4);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_kp_u__4);
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_n_u_T);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_n_u_T);
    PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_n_u_T);

    /* "cytimes/cydatetime.py":1131
 *         return "%04d-%02d-%02dT%02d:%02d:%02d" % (
 *             dt.year, dt.month, dt.day,
 *             dt.hour, dt.minute, dt.second,             # <<<<<<<<<<<<<<
 *         )
 *     else:
 */
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_kp_u__5);
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 8, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_2, 9, __pyx_kp_u__5);
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 10, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cytimes/cydatetime.py":1129
 *     # fmt: off
 *     if microsecond == 0:
 *         return "%04d-%02d-%02dT%02d:%02d:%02d" % (             # <<<<<<<<<<<<<<
 *             dt.year, dt.month, dt.day,
 *             dt.hour, dt.minute, dt.second,
 */
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 11, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":1128
 *     microsecond: cython.int = dt.microsecond
 *     # fmt: off
 *     if microsecond == 0:             # <<<<<<<<<<<<<<
 *         return "%04d-%02d-%02dT%02d:%02d:%02d" % (
 *             dt.year, dt.month, dt.day,
 */
  }

  /* "cytimes/cydatetime.py":1134
 *         )
 *     else:
 *         return "%04d-%02d-%02dT%02d:%02d:%02d.%06d" % (             # <<<<<<<<<<<<<<
 *             dt.year, dt.month, dt.day,
 *             dt.hour, dt.minute, dt.second, microsecond,
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = PyTuple_New(13); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_4 = 127;

    /* "cytimes/cydatetime.py":1135
 *     else:
 *         return "%04d-%02d-%02dT%02d:%02d:%02d.%06d" % (
 *             dt.year, dt.month, dt.day,             # <<<<<<<<<<<<<<
 *             dt.hour, dt.minute, dt.second, microsecond,
 *         )
 */
    __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), 4, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u__4);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__4);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_u__4);
    __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u__4);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__4);
    PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_kp_u__4);
    __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_n_u_T);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_n_u_T);
    PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_n_u_T);

    /* "cytimes/cydatetime.py":1136
 *         return "%04d-%02d-%02dT%02d:%02d:%02d.%06d" % (
 *             dt.year, dt.month, dt.day,
 *             dt.hour, dt.minute, dt.second, microsecond,             # <<<<<<<<<<<<<<
 *         )
 *     # fmt: on
 */
    __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_5, 7, __pyx_kp_u__5);
    __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 8, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_5, 9, __pyx_kp_u__5);
    __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 10, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u__6);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__6);
    PyTuple_SET_ITEM(__pyx_t_5, 11, __pyx_kp_u__6);
    __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_microsecond, 6, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 12, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/cydatetime.py":1134
 *         )
 *     else:
 *         return "%04d-%02d-%02dT%02d:%02d:%02d.%06d" % (             # <<<<<<<<<<<<<<
 *             dt.year, dt.month, dt.day,
 *             dt.hour, dt.minute, dt.second, microsecond,
 */
    __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_5, 13, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "cytimes/cydatetime.py":1122
 * 
 * # Datetime.datetime: conversion ------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_to_isoformat(dt: datetime.datetime) -> str:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.cydatetime.dt_to_isoformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1141
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_to_isoformat_tz(dt: datetime.datetime) -> str:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_dt_to_isoformat_tz(PyDateTime_DateTime *__pyx_v_dt) {
  PyObject *__pyx_v_fmt = 0;
  PyDateTime_Delta *__pyx_v_offset = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_isoformat_tz", 1);

  /* "cytimes/cydatetime.py":1146
 *     """Convert datetime to ISO format with tzinfo:
 *     '%Y-%m-%dT%H:%M:%S.f.Z' `<'str'>`."""
 *     fmt: str = dt_to_isoformat(dt)             # <<<<<<<<<<<<<<
 *     offset = dt_utcoffset(dt)
 *     if offset is not None:
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_dt_to_isoformat(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_fmt = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":1147
 *     '%Y-%m-%dT%H:%M:%S.f.Z' `<'str'>`."""
 *     fmt: str = dt_to_isoformat(dt)
 *     offset = dt_utcoffset(dt)             # <<<<<<<<<<<<<<
 *     if offset is not None:
 *         fmt += td_to_utcformat(offset)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt_utcoffset(__pyx_v_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_offset = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":1148
 *     fmt: str = dt_to_isoformat(dt)
 *     offset = dt_utcoffset(dt)
 *     if offset is not None:             # <<<<<<<<<<<<<<
 *         fmt += td_to_utcformat(offset)
 *     return fmt
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_offset) != Py_None);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":1149
 *     offset = dt_utcoffset(dt)
 *     if offset is not None:
 *         fmt += td_to_utcformat(offset)             # <<<<<<<<<<<<<<
 *     return fmt
 * 
 */
    __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_td_to_utcformat(__pyx_v_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyUnicode_ConcatInPlaceSafe(__pyx_v_fmt, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_fmt, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/cydatetime.py":1148
 *     fmt: str = dt_to_isoformat(dt)
 *     offset = dt_utcoffset(dt)
 *     if offset is not None:             # <<<<<<<<<<<<<<
 *         fmt += td_to_utcformat(offset)
 *     return fmt
 */
  }

  /* "cytimes/cydatetime.py":1150
 *     if offset is not None:
 *         fmt += td_to_utcformat(offset)
 *     return fmt             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_fmt);
  __pyx_r = __pyx_v_fmt;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1141
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_to_isoformat_tz(dt: datetime.datetime) -> str:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.dt_to_isoformat_tz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fmt);
  __Pyx_XDECREF((PyObject *)__pyx_v_offset);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1153
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_to_isospaceformat(dt: datetime.datetime) -> str:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_dt_to_isospaceformat(PyDateTime_DateTime *__pyx_v_dt) {
  int __pyx_v_microsecond;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_isospaceformat", 1);

  /* "cytimes/cydatetime.py":1158
 *     """Convert datetime to ISO format with space as
 *     the seperator: '%Y-%m-%d %H:%M:%S.f' `<'str'>`."""
 *     microsecond: cython.int = dt.microsecond             # <<<<<<<<<<<<<<
 *     # fmt: off
 *     if microsecond == 0:
 */
  __pyx_v_microsecond = __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt);

  /* "cytimes/cydatetime.py":1160
 *     microsecond: cython.int = dt.microsecond
 *     # fmt: off
 *     if microsecond == 0:             # <<<<<<<<<<<<<<
 *         return "%04d-%02d-%02d %02d:%02d:%02d" % (
 *             dt.year, dt.month, dt.day,
 */
  __pyx_t_1 = (__pyx_v_microsecond == 0);
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":1161
 *     # fmt: off
 *     if microsecond == 0:
 *         return "%04d-%02d-%02d %02d:%02d:%02d" % (             # <<<<<<<<<<<<<<
 *             dt.year, dt.month, dt.day,
 *             dt.hour, dt.minute, dt.second,
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyTuple_New(11); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_4 = 127;

    /* "cytimes/cydatetime.py":1162
 *     if microsecond == 0:
 *         return "%04d-%02d-%02d %02d:%02d:%02d" % (
 *             dt.year, dt.month, dt.day,             # <<<<<<<<<<<<<<
 *             dt.hour, dt.minute, dt.second,
 *         )
 */
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), 4, '0', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__4);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__4);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u__4);
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__4);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__4);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_kp_u__4);
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__7);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__7);
    PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_kp_u__7);

    /* "cytimes/cydatetime.py":1163
 *         return "%04d-%02d-%02d %02d:%02d:%02d" % (
 *             dt.year, dt.month, dt.day,
 *             dt.hour, dt.minute, dt.second,             # <<<<<<<<<<<<<<
 *         )
 *     else:
 */
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_kp_u__5);
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 8, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_2, 9, __pyx_kp_u__5);
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 10, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cytimes/cydatetime.py":1161
 *     # fmt: off
 *     if microsecond == 0:
 *         return "%04d-%02d-%02d %02d:%02d:%02d" % (             # <<<<<<<<<<<<<<
 *             dt.year, dt.month, dt.day,
 *             dt.hour, dt.minute, dt.second,
 */
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 11, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":1160
 *     microsecond: cython.int = dt.microsecond
 *     # fmt: off
 *     if microsecond == 0:             # <<<<<<<<<<<<<<
 *         return "%04d-%02d-%02d %02d:%02d:%02d" % (
 *             dt.year, dt.month, dt.day,
 */
  }

  /* "cytimes/cydatetime.py":1166
 *         )
 *     else:
 *         return "%04d-%02d-%02d %02d:%02d:%02d.%06d" % (             # <<<<<<<<<<<<<<
 *             dt.year, dt.month, dt.day,
 *             dt.hour, dt.minute, dt.second, microsecond,
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = PyTuple_New(13); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_4 = 127;

    /* "cytimes/cydatetime.py":1167
 *     else:
 *         return "%04d-%02d-%02d %02d:%02d:%02d.%06d" % (
 *             dt.year, dt.month, dt.day,             # <<<<<<<<<<<<<<
 *             dt.hour, dt.minute, dt.second, microsecond,
 *         )
 */
    __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt), 4, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u__4);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__4);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_u__4);
    __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u__4);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__4);
    PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_kp_u__4);
    __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u__7);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__7);
    PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_kp_u__7);

    /* "cytimes/cydatetime.py":1168
 *         return "%04d-%02d-%02d %02d:%02d:%02d.%06d" % (
 *             dt.year, dt.month, dt.day,
 *             dt.hour, dt.minute, dt.second, microsecond,             # <<<<<<<<<<<<<<
 *         )
 *     # fmt: on
 */
    __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_5, 7, __pyx_kp_u__5);
    __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 8, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_5, 9, __pyx_kp_u__5);
    __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt), 2, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 10, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u__6);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__6);
    PyTuple_SET_ITEM(__pyx_t_5, 11, __pyx_kp_u__6);
    __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_microsecond, 6, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 12, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytimes/cydatetime.py":1166
 *         )
 *     else:
 *         return "%04d-%02d-%02d %02d:%02d:%02d.%06d" % (             # <<<<<<<<<<<<<<
 *             dt.year, dt.month, dt.day,
 *             dt.hour, dt.minute, dt.second, microsecond,
 */
    __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_5, 13, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "cytimes/cydatetime.py":1153
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_to_isospaceformat(dt: datetime.datetime) -> str:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.cydatetime.dt_to_isospaceformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1173
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_to_isospaceformat_tz(dt: datetime.datetime) -> str:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_dt_to_isospaceformat_tz(PyDateTime_DateTime *__pyx_v_dt) {
  PyObject *__pyx_v_fmt = 0;
  PyDateTime_Delta *__pyx_v_offset = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_isospaceformat_tz", 1);

  /* "cytimes/cydatetime.py":1178
 *     """Convert datetime to ISO format with tzinfo and space
 *     as the separator: '%Y-%m-%d %H:%M:%S.f.Z' `<'str'>`."""
 *     fmt: str = dt_to_isospaceformat(dt)             # <<<<<<<<<<<<<<
 *     offset = dt_utcoffset(dt)
 *     if offset is not None:
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_dt_to_isospaceformat(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_fmt = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":1179
 *     as the separator: '%Y-%m-%d %H:%M:%S.f.Z' `<'str'>`."""
 *     fmt: str = dt_to_isospaceformat(dt)
 *     offset = dt_utcoffset(dt)             # <<<<<<<<<<<<<<
 *     if offset is not None:
 *         fmt += td_to_utcformat(offset)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt_utcoffset(__pyx_v_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_offset = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":1180
 *     fmt: str = dt_to_isospaceformat(dt)
 *     offset = dt_utcoffset(dt)
 *     if offset is not None:             # <<<<<<<<<<<<<<
 *         fmt += td_to_utcformat(offset)
 *     return fmt
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_offset) != Py_None);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":1181
 *     offset = dt_utcoffset(dt)
 *     if offset is not None:
 *         fmt += td_to_utcformat(offset)             # <<<<<<<<<<<<<<
 *     return fmt
 * 
 */
    __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_td_to_utcformat(__pyx_v_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyUnicode_ConcatInPlaceSafe(__pyx_v_fmt, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_fmt, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cytimes/cydatetime.py":1180
 *     fmt: str = dt_to_isospaceformat(dt)
 *     offset = dt_utcoffset(dt)
 *     if offset is not None:             # <<<<<<<<<<<<<<
 *         fmt += td_to_utcformat(offset)
 *     return fmt
 */
  }

  /* "cytimes/cydatetime.py":1182
 *     if offset is not None:
 *         fmt += td_to_utcformat(offset)
 *     return fmt             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_fmt);
  __pyx_r = __pyx_v_fmt;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1173
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_to_isospaceformat_tz(dt: datetime.datetime) -> str:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.dt_to_isospaceformat_tz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fmt);
  __Pyx_XDECREF((PyObject *)__pyx_v_offset);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1185
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_to_strformat(dt: datetime.datetime, format: str) -> str:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_dt_to_strformat(PyDateTime_DateTime *__pyx_v_dt, PyObject *__pyx_v_format) {
  PyObject *__pyx_v_frepl = 0;
  PyObject *__pyx_v_zrepl = 0;
  PyObject *__pyx_v_Zrepl = 0;
  PyObject *__pyx_v_fmt = 0;
  Py_ssize_t __pyx_v_idx;
  Py_ssize_t __pyx_v_length;
  Py_UCS4 __pyx_v_ch;
  PyDateTime_Delta *__pyx_v_offset = NULL;
  PyObject *__pyx_v_tzname = NULL;
  int __pyx_v_year;
  int __pyx_v_month;
  int __pyx_v_day;
  struct tm __pyx_v_tms;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  struct tm __pyx_t_5;
  unsigned int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_strformat", 1);

  /* "cytimes/cydatetime.py":1190
 *     """Convert datetime by string format `<'str'>`.
 *     Equivalent to `dt.strftime(format)`."""
 *     frepl: str = None             # <<<<<<<<<<<<<<
 *     zrepl: str = None
 *     Zrepl: str = None
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_frepl = ((PyObject*)Py_None);

  /* "cytimes/cydatetime.py":1191
 *     Equivalent to `dt.strftime(format)`."""
 *     frepl: str = None
 *     zrepl: str = None             # <<<<<<<<<<<<<<
 *     Zrepl: str = None
 *     # Scan format for %f %z and %Z escapes, replacing as needed.
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_zrepl = ((PyObject*)Py_None);

  /* "cytimes/cydatetime.py":1192
 *     frepl: str = None
 *     zrepl: str = None
 *     Zrepl: str = None             # <<<<<<<<<<<<<<
 *     # Scan format for %f %z and %Z escapes, replacing as needed.
 *     fmt: list = []
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_Zrepl = ((PyObject*)Py_None);

  /* "cytimes/cydatetime.py":1194
 *     Zrepl: str = None
 *     # Scan format for %f %z and %Z escapes, replacing as needed.
 *     fmt: list = []             # <<<<<<<<<<<<<<
 *     idx: cython.Py_ssize_t = 0
 *     length: cython.Py_ssize_t = str_len(format)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_fmt = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":1195
 *     # Scan format for %f %z and %Z escapes, replacing as needed.
 *     fmt: list = []
 *     idx: cython.Py_ssize_t = 0             # <<<<<<<<<<<<<<
 *     length: cython.Py_ssize_t = str_len(format)
 *     ch: cython.Py_UCS4
 */
  __pyx_v_idx = 0;

  /* "cytimes/cydatetime.py":1196
 *     fmt: list = []
 *     idx: cython.Py_ssize_t = 0
 *     length: cython.Py_ssize_t = str_len(format)             # <<<<<<<<<<<<<<
 *     ch: cython.Py_UCS4
 *     while idx < length:
 */
  __pyx_v_length = PyUnicode_GET_LENGTH(__pyx_v_format);

  /* "cytimes/cydatetime.py":1198
 *     length: cython.Py_ssize_t = str_len(format)
 *     ch: cython.Py_UCS4
 *     while idx < length:             # <<<<<<<<<<<<<<
 *         ch = read_char(format, idx)
 *         idx += 1
 */
  while (1) {
    __pyx_t_2 = (__pyx_v_idx < __pyx_v_length);
    if (!__pyx_t_2) break;

    /* "cytimes/cydatetime.py":1199
 *     ch: cython.Py_UCS4
 *     while idx < length:
 *         ch = read_char(format, idx)             # <<<<<<<<<<<<<<
 *         idx += 1
 *         # Identifier '%'
 */
    __pyx_v_ch = PyUnicode_READ_CHAR(__pyx_v_format, __pyx_v_idx);

    /* "cytimes/cydatetime.py":1200
 *     while idx < length:
 *         ch = read_char(format, idx)
 *         idx += 1             # <<<<<<<<<<<<<<
 *         # Identifier '%'
 *         if ch == "%":
 */
    __pyx_v_idx = (__pyx_v_idx + 1);

    /* "cytimes/cydatetime.py":1202
 *         idx += 1
 *         # Identifier '%'
 *         if ch == "%":             # <<<<<<<<<<<<<<
 *             if idx < length:
 *                 ch = read_char(format, idx)
 */
    __pyx_t_2 = (__pyx_v_ch == 37);
    if (__pyx_t_2) {

      /* "cytimes/cydatetime.py":1203
 *         # Identifier '%'
 *         if ch == "%":
 *             if idx < length:             # <<<<<<<<<<<<<<
 *                 ch = read_char(format, idx)
 *                 idx += 1
 */
      __pyx_t_2 = (__pyx_v_idx < __pyx_v_length);
      if (__pyx_t_2) {

        /* "cytimes/cydatetime.py":1204
 *         if ch == "%":
 *             if idx < length:
 *                 ch = read_char(format, idx)             # <<<<<<<<<<<<<<
 *                 idx += 1
 *                 # Microsecond fraction
 */
        __pyx_v_ch = PyUnicode_READ_CHAR(__pyx_v_format, __pyx_v_idx);

        /* "cytimes/cydatetime.py":1205
 *             if idx < length:
 *                 ch = read_char(format, idx)
 *                 idx += 1             # <<<<<<<<<<<<<<
 *                 # Microsecond fraction
 *                 if ch == "f":
 */
        __pyx_v_idx = (__pyx_v_idx + 1);

        /* "cytimes/cydatetime.py":1207
 *                 idx += 1
 *                 # Microsecond fraction
 *                 if ch == "f":             # <<<<<<<<<<<<<<
 *                     if frepl is None:
 *                         frepl = "%06d" % dt.microsecond
 */
        switch (__pyx_v_ch) {
          case 0x66:

          /* "cytimes/cydatetime.py":1208
 *                 # Microsecond fraction
 *                 if ch == "f":
 *                     if frepl is None:             # <<<<<<<<<<<<<<
 *                         frepl = "%06d" % dt.microsecond
 *                     fmt.append(frepl)
 */
          __pyx_t_2 = (__pyx_v_frepl == ((PyObject*)Py_None));
          if (__pyx_t_2) {

            /* "cytimes/cydatetime.py":1209
 *                 if ch == "f":
 *                     if frepl is None:
 *                         frepl = "%06d" % dt.microsecond             # <<<<<<<<<<<<<<
 *                     fmt.append(frepl)
 *                 # UTC offset
 */
            __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1209, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_06d_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1209, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF_SET(__pyx_v_frepl, ((PyObject*)__pyx_t_3));
            __pyx_t_3 = 0;

            /* "cytimes/cydatetime.py":1208
 *                 # Microsecond fraction
 *                 if ch == "f":
 *                     if frepl is None:             # <<<<<<<<<<<<<<
 *                         frepl = "%06d" % dt.microsecond
 *                     fmt.append(frepl)
 */
          }

          /* "cytimes/cydatetime.py":1210
 *                     if frepl is None:
 *                         frepl = "%06d" % dt.microsecond
 *                     fmt.append(frepl)             # <<<<<<<<<<<<<<
 *                 # UTC offset
 *                 elif ch == "z":
 */
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_fmt, __pyx_v_frepl); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1210, __pyx_L1_error)

          /* "cytimes/cydatetime.py":1207
 *                 idx += 1
 *                 # Microsecond fraction
 *                 if ch == "f":             # <<<<<<<<<<<<<<
 *                     if frepl is None:
 *                         frepl = "%06d" % dt.microsecond
 */
          break;
          case 0x7A:

          /* "cytimes/cydatetime.py":1213
 *                 # UTC offset
 *                 elif ch == "z":
 *                     if zrepl is None:             # <<<<<<<<<<<<<<
 *                         offset = dt_utcoffset(dt)
 *                         if offset is None:
 */
          __pyx_t_2 = (__pyx_v_zrepl == ((PyObject*)Py_None));
          if (__pyx_t_2) {

            /* "cytimes/cydatetime.py":1214
 *                 elif ch == "z":
 *                     if zrepl is None:
 *                         offset = dt_utcoffset(dt)             # <<<<<<<<<<<<<<
 *                         if offset is None:
 *                             zrepl = ""
 */
            __pyx_t_3 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt_utcoffset(__pyx_v_dt)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1214, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_XDECREF_SET(__pyx_v_offset, ((PyDateTime_Delta *)__pyx_t_3));
            __pyx_t_3 = 0;

            /* "cytimes/cydatetime.py":1215
 *                     if zrepl is None:
 *                         offset = dt_utcoffset(dt)
 *                         if offset is None:             # <<<<<<<<<<<<<<
 *                             zrepl = ""
 *                         else:
 */
            __pyx_t_2 = (((PyObject *)__pyx_v_offset) == Py_None);
            if (__pyx_t_2) {

              /* "cytimes/cydatetime.py":1216
 *                         offset = dt_utcoffset(dt)
 *                         if offset is None:
 *                             zrepl = ""             # <<<<<<<<<<<<<<
 *                         else:
 *                             zrepl = td_to_utcformat(offset)
 */
              __Pyx_INCREF(__pyx_kp_u__8);
              __Pyx_DECREF_SET(__pyx_v_zrepl, __pyx_kp_u__8);

              /* "cytimes/cydatetime.py":1215
 *                     if zrepl is None:
 *                         offset = dt_utcoffset(dt)
 *                         if offset is None:             # <<<<<<<<<<<<<<
 *                             zrepl = ""
 *                         else:
 */
              goto __pyx_L9;
            }

            /* "cytimes/cydatetime.py":1218
 *                             zrepl = ""
 *                         else:
 *                             zrepl = td_to_utcformat(offset)             # <<<<<<<<<<<<<<
 *                     fmt.append(zrepl)
 *                 # Timezone name
 */
            /*else*/ {
              __pyx_t_3 = __pyx_f_7cytimes_10cydatetime_td_to_utcformat(__pyx_v_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1218, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF_SET(__pyx_v_zrepl, ((PyObject*)__pyx_t_3));
              __pyx_t_3 = 0;
            }
            __pyx_L9:;

            /* "cytimes/cydatetime.py":1213
 *                 # UTC offset
 *                 elif ch == "z":
 *                     if zrepl is None:             # <<<<<<<<<<<<<<
 *                         offset = dt_utcoffset(dt)
 *                         if offset is None:
 */
          }

          /* "cytimes/cydatetime.py":1219
 *                         else:
 *                             zrepl = td_to_utcformat(offset)
 *                     fmt.append(zrepl)             # <<<<<<<<<<<<<<
 *                 # Timezone name
 *                 elif ch == "Z":
 */
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_fmt, __pyx_v_zrepl); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1219, __pyx_L1_error)

          /* "cytimes/cydatetime.py":1212
 *                     fmt.append(frepl)
 *                 # UTC offset
 *                 elif ch == "z":             # <<<<<<<<<<<<<<
 *                     if zrepl is None:
 *                         offset = dt_utcoffset(dt)
 */
          break;
          case 90:

          /* "cytimes/cydatetime.py":1222
 *                 # Timezone name
 *                 elif ch == "Z":
 *                     if Zrepl is None:             # <<<<<<<<<<<<<<
 *                         tzname = dt_tzname(dt)
 *                         if tzname is None:
 */
          __pyx_t_2 = (__pyx_v_Zrepl == ((PyObject*)Py_None));
          if (__pyx_t_2) {

            /* "cytimes/cydatetime.py":1223
 *                 elif ch == "Z":
 *                     if Zrepl is None:
 *                         tzname = dt_tzname(dt)             # <<<<<<<<<<<<<<
 *                         if tzname is None:
 *                             Zrepl = ""
 */
            __pyx_t_3 = __pyx_f_7cytimes_10cydatetime_dt_tzname(__pyx_v_dt); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1223, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_XDECREF_SET(__pyx_v_tzname, ((PyObject*)__pyx_t_3));
            __pyx_t_3 = 0;

            /* "cytimes/cydatetime.py":1224
 *                     if Zrepl is None:
 *                         tzname = dt_tzname(dt)
 *                         if tzname is None:             # <<<<<<<<<<<<<<
 *                             Zrepl = ""
 *                         else:
 */
            __pyx_t_2 = (__pyx_v_tzname == ((PyObject*)Py_None));
            if (__pyx_t_2) {

              /* "cytimes/cydatetime.py":1225
 *                         tzname = dt_tzname(dt)
 *                         if tzname is None:
 *                             Zrepl = ""             # <<<<<<<<<<<<<<
 *                         else:
 *                             Zrepl = tzname.replace("%", "%%")
 */
              __Pyx_INCREF(__pyx_kp_u__8);
              __Pyx_DECREF_SET(__pyx_v_Zrepl, __pyx_kp_u__8);

              /* "cytimes/cydatetime.py":1224
 *                     if Zrepl is None:
 *                         tzname = dt_tzname(dt)
 *                         if tzname is None:             # <<<<<<<<<<<<<<
 *                             Zrepl = ""
 *                         else:
 */
              goto __pyx_L11;
            }

            /* "cytimes/cydatetime.py":1227
 *                             Zrepl = ""
 *                         else:
 *                             Zrepl = tzname.replace("%", "%%")             # <<<<<<<<<<<<<<
 *                     fmt.append(Zrepl)
 *                 # Normal escapes
 */
            /*else*/ {
              if (unlikely(__pyx_v_tzname == Py_None)) {
                PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "replace");
                __PYX_ERR(1, 1227, __pyx_L1_error)
              }
              __pyx_t_3 = PyUnicode_Replace(__pyx_v_tzname, __pyx_kp_u__9, __pyx_kp_u__10, -1L); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1227, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF_SET(__pyx_v_Zrepl, ((PyObject*)__pyx_t_3));
              __pyx_t_3 = 0;
            }
            __pyx_L11:;

            /* "cytimes/cydatetime.py":1222
 *                 # Timezone name
 *                 elif ch == "Z":
 *                     if Zrepl is None:             # <<<<<<<<<<<<<<
 *                         tzname = dt_tzname(dt)
 *                         if tzname is None:
 */
          }

          /* "cytimes/cydatetime.py":1228
 *                         else:
 *                             Zrepl = tzname.replace("%", "%%")
 *                     fmt.append(Zrepl)             # <<<<<<<<<<<<<<
 *                 # Normal escapes
 *                 else:
 */
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_fmt, __pyx_v_Zrepl); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1228, __pyx_L1_error)

          /* "cytimes/cydatetime.py":1221
 *                     fmt.append(zrepl)
 *                 # Timezone name
 *                 elif ch == "Z":             # <<<<<<<<<<<<<<
 *                     if Zrepl is None:
 *                         tzname = dt_tzname(dt)
 */
          break;
          default:

          /* "cytimes/cydatetime.py":1231
 *                 # Normal escapes
 *                 else:
 *                     fmt.append("%")             # <<<<<<<<<<<<<<
 *                     fmt.append(str_fr_ucs4(ch))
 *             else:
 */
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_fmt, __pyx_kp_u__9); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1231, __pyx_L1_error)

          /* "cytimes/cydatetime.py":1232
 *                 else:
 *                     fmt.append("%")
 *                     fmt.append(str_fr_ucs4(ch))             # <<<<<<<<<<<<<<
 *             else:
 *                 fmt.append("%")
 */
          __pyx_t_3 = PyUnicode_FromOrdinal(__pyx_v_ch); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1232, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_fmt, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1232, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          break;
        }

        /* "cytimes/cydatetime.py":1203
 *         # Identifier '%'
 *         if ch == "%":
 *             if idx < length:             # <<<<<<<<<<<<<<
 *                 ch = read_char(format, idx)
 *                 idx += 1
 */
        goto __pyx_L6;
      }

      /* "cytimes/cydatetime.py":1234
 *                     fmt.append(str_fr_ucs4(ch))
 *             else:
 *                 fmt.append("%")             # <<<<<<<<<<<<<<
 *         else:
 *             fmt.append(str_fr_ucs4(ch))
 */
      /*else*/ {
        __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_fmt, __pyx_kp_u__9); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1234, __pyx_L1_error)
      }
      __pyx_L6:;

      /* "cytimes/cydatetime.py":1202
 *         idx += 1
 *         # Identifier '%'
 *         if ch == "%":             # <<<<<<<<<<<<<<
 *             if idx < length:
 *                 ch = read_char(format, idx)
 */
      goto __pyx_L5;
    }

    /* "cytimes/cydatetime.py":1236
 *                 fmt.append("%")
 *         else:
 *             fmt.append(str_fr_ucs4(ch))             # <<<<<<<<<<<<<<
 * 
 *     # Convert datetime to struct:tm
 */
    /*else*/ {
      __pyx_t_3 = PyUnicode_FromOrdinal(__pyx_v_ch); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1236, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_fmt, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1236, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_L5:;
  }

  /* "cytimes/cydatetime.py":1240
 *     # Convert datetime to struct:tm
 *     # fmt: off
 *     year: cython.int = dt.year             # <<<<<<<<<<<<<<
 *     month: cython.int = dt.month
 *     day: cython.int = dt.day
 */
  __pyx_v_year = __pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt);

  /* "cytimes/cydatetime.py":1241
 *     # fmt: off
 *     year: cython.int = dt.year
 *     month: cython.int = dt.month             # <<<<<<<<<<<<<<
 *     day: cython.int = dt.day
 *     tms = tm( # type: ignore
 */
  __pyx_v_month = __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt);

  /* "cytimes/cydatetime.py":1242
 *     year: cython.int = dt.year
 *     month: cython.int = dt.month
 *     day: cython.int = dt.day             # <<<<<<<<<<<<<<
 *     tms = tm( # type: ignore
 *         dt.second, dt.minute, dt.hour, day, month, year,
 */
  __pyx_v_day = __pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt);

  /* "cytimes/cydatetime.py":1244
 *     day: cython.int = dt.day
 *     tms = tm( # type: ignore
 *         dt.second, dt.minute, dt.hour, day, month, year,             # <<<<<<<<<<<<<<
 *         ymd_weekday(year, month, day), days_bf_month(year, month) + day, -1
 *     )
 */
  __pyx_t_5.tm_sec = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);
  __pyx_t_5.tm_min = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);
  __pyx_t_5.tm_hour = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);
  __pyx_t_5.tm_mday = __pyx_v_day;
  __pyx_t_5.tm_mon = __pyx_v_month;
  __pyx_t_5.tm_year = __pyx_v_year;

  /* "cytimes/cydatetime.py":1245
 *     tms = tm( # type: ignore
 *         dt.second, dt.minute, dt.hour, day, month, year,
 *         ymd_weekday(year, month, day), days_bf_month(year, month) + day, -1             # <<<<<<<<<<<<<<
 *     )
 *     # fmt: on
 */
  __pyx_t_6 = __pyx_f_7cytimes_10cydatetime_ymd_weekday(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_6 == ((unsigned int)-1))) __PYX_ERR(1, 1245, __pyx_L1_error)
  __pyx_t_5.tm_wday = __pyx_t_6;
  __pyx_t_6 = __pyx_f_7cytimes_10cydatetime_days_bf_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_6 == ((unsigned int)-1))) __PYX_ERR(1, 1245, __pyx_L1_error)
  __pyx_t_5.tm_yday = (__pyx_t_6 + __pyx_v_day);
  __pyx_t_5.tm_isdst = -1;
  __pyx_v_tms = __pyx_t_5;

  /* "cytimes/cydatetime.py":1249
 *     # fmt: on
 *     # Format the datetime
 *     return stime_to_str(tms, "".join(fmt))  # type: ignore             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__8, __pyx_v_fmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_stime_to_str(__pyx_v_tms, ((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1249, __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;

  /* "cytimes/cydatetime.py":1185
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_to_strformat(dt: datetime.datetime, format: str) -> str:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.dt_to_strformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_frepl);
  __Pyx_XDECREF(__pyx_v_zrepl);
  __Pyx_XDECREF(__pyx_v_Zrepl);
  __Pyx_XDECREF(__pyx_v_fmt);
  __Pyx_XDECREF((PyObject *)__pyx_v_offset);
  __Pyx_XDECREF(__pyx_v_tzname);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1252
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static unsigned int __pyx_f_7cytimes_10cydatetime_dt_to_ordinal(PyDateTime_DateTime *__pyx_v_dt) {
  unsigned int __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":1257
 * def dt_to_ordinal(dt: datetime.datetime) -> cython.uint:
 *     """Convert the date of 'dt' to ordinal `<'int'>`."""
 *     return ymd_to_ordinal(dt.year, dt.month, dt.day)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_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 == ((unsigned int)-1))) __PYX_ERR(1, 1257, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1252
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.dt_to_ordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1260
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

static double __pyx_f_7cytimes_10cydatetime_dt_to_seconds(PyDateTime_DateTime *__pyx_v_dt) {
  double __pyx_v_days;
  double __pyx_v_hour;
  double __pyx_v_minute;
  double __pyx_v_second;
  double __pyx_v_microsecond;
  double __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":1268
 *     thus should `NOT` be treated as `datetime.timestamp()`.
 *     """
 *     days: cython.double = dt_to_ordinal(dt)             # <<<<<<<<<<<<<<
 *     hour: cython.double = dt.hour
 *     minute: cython.double = dt.minute
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_dt_to_ordinal(__pyx_v_dt); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 1268, __pyx_L1_error)
  __pyx_v_days = __pyx_t_1;

  /* "cytimes/cydatetime.py":1269
 *     """
 *     days: cython.double = dt_to_ordinal(dt)
 *     hour: cython.double = dt.hour             # <<<<<<<<<<<<<<
 *     minute: cython.double = dt.minute
 *     second: cython.double = dt.second
 */
  __pyx_v_hour = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);

  /* "cytimes/cydatetime.py":1270
 *     days: cython.double = dt_to_ordinal(dt)
 *     hour: cython.double = dt.hour
 *     minute: cython.double = dt.minute             # <<<<<<<<<<<<<<
 *     second: cython.double = dt.second
 *     microsecond: cython.double = dt.microsecond
 */
  __pyx_v_minute = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);

  /* "cytimes/cydatetime.py":1271
 *     hour: cython.double = dt.hour
 *     minute: cython.double = dt.minute
 *     second: cython.double = dt.second             # <<<<<<<<<<<<<<
 *     microsecond: cython.double = dt.microsecond
 *     return (
 */
  __pyx_v_second = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);

  /* "cytimes/cydatetime.py":1272
 *     minute: cython.double = dt.minute
 *     second: cython.double = dt.second
 *     microsecond: cython.double = dt.microsecond             # <<<<<<<<<<<<<<
 *     return (
 *         (days - EPOCH_DAY) * 86_400
 */
  __pyx_v_microsecond = __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt);

  /* "cytimes/cydatetime.py":1278
 *         + minute * 60
 *         + second
 *         + microsecond / 1_000_000             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_r = ((((((__pyx_v_days - __pyx_v_7cytimes_10cydatetime_EPOCH_DAY) * 86400.0) + (__pyx_v_hour * 3600.0)) + (__pyx_v_minute * 60.0)) + __pyx_v_second) + (__pyx_v_microsecond / 1000000.0));
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1260
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("cytimes.cydatetime.dt_to_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1282
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

static double __pyx_f_7cytimes_10cydatetime_dt_to_seconds_utc(PyDateTime_DateTime *__pyx_v_dt) {
  double __pyx_v_sec;
  PyDateTime_Delta *__pyx_v_offset = NULL;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_seconds_utc", 1);

  /* "cytimes/cydatetime.py":1293
 *       to `dt_to_seconds()`.
 *     """
 *     sec: cython.double = dt_to_seconds(dt)             # <<<<<<<<<<<<<<
 *     offset = dt_utcoffset(dt)
 *     if offset is not None:
 */
  __pyx_v_sec = __pyx_f_7cytimes_10cydatetime_dt_to_seconds(__pyx_v_dt);

  /* "cytimes/cydatetime.py":1294
 *     """
 *     sec: cython.double = dt_to_seconds(dt)
 *     offset = dt_utcoffset(dt)             # <<<<<<<<<<<<<<
 *     if offset is not None:
 *         sec -= td_to_seconds(offset)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt_utcoffset(__pyx_v_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_offset = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":1295
 *     sec: cython.double = dt_to_seconds(dt)
 *     offset = dt_utcoffset(dt)
 *     if offset is not None:             # <<<<<<<<<<<<<<
 *         sec -= td_to_seconds(offset)
 *     return sec
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_offset) != Py_None);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":1296
 *     offset = dt_utcoffset(dt)
 *     if offset is not None:
 *         sec -= td_to_seconds(offset)             # <<<<<<<<<<<<<<
 *     return sec
 * 
 */
    __pyx_v_sec = (__pyx_v_sec - __pyx_f_7cytimes_10cydatetime_td_to_seconds(__pyx_v_offset));

    /* "cytimes/cydatetime.py":1295
 *     sec: cython.double = dt_to_seconds(dt)
 *     offset = dt_utcoffset(dt)
 *     if offset is not None:             # <<<<<<<<<<<<<<
 *         sec -= td_to_seconds(offset)
 *     return sec
 */
  }

  /* "cytimes/cydatetime.py":1297
 *     if offset is not None:
 *         sec -= td_to_seconds(offset)
 *     return sec             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_sec;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1282
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cytimes.cydatetime.dt_to_seconds_utc", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_offset);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1300
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_dt_to_microseconds(PyDateTime_DateTime *__pyx_v_dt) {
  PY_LONG_LONG __pyx_v_days;
  PY_LONG_LONG __pyx_v_hour;
  PY_LONG_LONG __pyx_v_minute;
  PY_LONG_LONG __pyx_v_second;
  PY_LONG_LONG __pyx_v_microsecond;
  PY_LONG_LONG __pyx_r;
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":1308
 *     thus should `NOT` be treated as `datetime.timestamp()`.
 *     """
 *     days: cython.longlong = dt_to_ordinal(dt)             # <<<<<<<<<<<<<<
 *     hour: cython.longlong = dt.hour
 *     minute: cython.longlong = dt.minute
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_dt_to_ordinal(__pyx_v_dt); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 1308, __pyx_L1_error)
  __pyx_v_days = __pyx_t_1;

  /* "cytimes/cydatetime.py":1309
 *     """
 *     days: cython.longlong = dt_to_ordinal(dt)
 *     hour: cython.longlong = dt.hour             # <<<<<<<<<<<<<<
 *     minute: cython.longlong = dt.minute
 *     second: cython.longlong = dt.second
 */
  __pyx_v_hour = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);

  /* "cytimes/cydatetime.py":1310
 *     days: cython.longlong = dt_to_ordinal(dt)
 *     hour: cython.longlong = dt.hour
 *     minute: cython.longlong = dt.minute             # <<<<<<<<<<<<<<
 *     second: cython.longlong = dt.second
 *     microsecond: cython.longlong = dt.microsecond
 */
  __pyx_v_minute = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);

  /* "cytimes/cydatetime.py":1311
 *     hour: cython.longlong = dt.hour
 *     minute: cython.longlong = dt.minute
 *     second: cython.longlong = dt.second             # <<<<<<<<<<<<<<
 *     microsecond: cython.longlong = dt.microsecond
 *     return (
 */
  __pyx_v_second = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);

  /* "cytimes/cydatetime.py":1312
 *     minute: cython.longlong = dt.minute
 *     second: cython.longlong = dt.second
 *     microsecond: cython.longlong = dt.microsecond             # <<<<<<<<<<<<<<
 *     return (
 *         (days - EPOCH_DAY) * US_DAY
 */
  __pyx_v_microsecond = __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt);

  /* "cytimes/cydatetime.py":1318
 *         + minute * 60_000_000
 *         + second * 1_000_000
 *         + microsecond             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_r = ((((((__pyx_v_days - __pyx_v_7cytimes_10cydatetime_EPOCH_DAY) * __pyx_v_7cytimes_10cydatetime_US_DAY) + (__pyx_v_hour * __pyx_v_7cytimes_10cydatetime_US_HOUR)) + (__pyx_v_minute * 0x3938700)) + (__pyx_v_second * 0xF4240)) + __pyx_v_microsecond);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1300
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("cytimes.cydatetime.dt_to_microseconds", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1322
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_dt_to_microseconds_utc(PyDateTime_DateTime *__pyx_v_dt) {
  PY_LONG_LONG __pyx_v_us;
  PyDateTime_Delta *__pyx_v_offset = NULL;
  PY_LONG_LONG __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_microseconds_utc", 1);

  /* "cytimes/cydatetime.py":1332
 *       requivalent to `dt_to_microseconds()`.
 *     """
 *     us: cython.longlong = dt_to_microseconds(dt)             # <<<<<<<<<<<<<<
 *     offset = dt_utcoffset(dt)
 *     if offset is not None:
 */
  __pyx_v_us = __pyx_f_7cytimes_10cydatetime_dt_to_microseconds(__pyx_v_dt);

  /* "cytimes/cydatetime.py":1333
 *     """
 *     us: cython.longlong = dt_to_microseconds(dt)
 *     offset = dt_utcoffset(dt)             # <<<<<<<<<<<<<<
 *     if offset is not None:
 *         us -= td_to_microseconds(offset)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt_utcoffset(__pyx_v_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_offset = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":1334
 *     us: cython.longlong = dt_to_microseconds(dt)
 *     offset = dt_utcoffset(dt)
 *     if offset is not None:             # <<<<<<<<<<<<<<
 *         us -= td_to_microseconds(offset)
 *     return us
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_offset) != Py_None);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":1335
 *     offset = dt_utcoffset(dt)
 *     if offset is not None:
 *         us -= td_to_microseconds(offset)             # <<<<<<<<<<<<<<
 *     return us
 * 
 */
    __pyx_v_us = (__pyx_v_us - __pyx_f_7cytimes_10cydatetime_td_to_microseconds(__pyx_v_offset));

    /* "cytimes/cydatetime.py":1334
 *     us: cython.longlong = dt_to_microseconds(dt)
 *     offset = dt_utcoffset(dt)
 *     if offset is not None:             # <<<<<<<<<<<<<<
 *         us -= td_to_microseconds(offset)
 *     return us
 */
  }

  /* "cytimes/cydatetime.py":1336
 *     if offset is not None:
 *         us -= td_to_microseconds(offset)
 *     return us             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_us;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1322
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cytimes.cydatetime.dt_to_microseconds_utc", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_offset);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1339
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_to_posixts(dt: datetime.datetime) -> cython.longlong:
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_dt_to_posixts(PyDateTime_DateTime *__pyx_v_dt) {
  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;
  PY_LONG_LONG __pyx_t_1;
  int __pyx_t_2;
  PY_LONG_LONG __pyx_t_3;
  PY_LONG_LONG __pyx_t_4;
  PY_LONG_LONG __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "cytimes/cydatetime.py":1351
 *     """
 *     # Total seconds of the 'dt' since epoch
 *     t: cython.longlong = int(dt_to_seconds(dt))             # <<<<<<<<<<<<<<
 *     # Adjustment for local time
 *     adj1: cython.longlong = localize_ts(t) - t  # type: ignore
 */
  __pyx_v_t = ((PY_LONG_LONG)__pyx_f_7cytimes_10cydatetime_dt_to_seconds(__pyx_v_dt));

  /* "cytimes/cydatetime.py":1353
 *     t: cython.longlong = int(dt_to_seconds(dt))
 *     # Adjustment for local time
 *     adj1: cython.longlong = localize_ts(t) - t  # type: ignore             # <<<<<<<<<<<<<<
 *     adj2: cython.longlong
 *     u1: cython.longlong = t - adj1
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_localize_ts(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 1353, __pyx_L1_error)
  __pyx_v_adj1 = (__pyx_t_1 - __pyx_v_t);

  /* "cytimes/cydatetime.py":1355
 *     adj1: cython.longlong = localize_ts(t) - t  # type: ignore
 *     adj2: cython.longlong
 *     u1: cython.longlong = t - adj1             # <<<<<<<<<<<<<<
 *     u2: cython.longlong
 *     t1: cython.longlong = localize_ts(u1)  # type: ignore
 */
  __pyx_v_u1 = (__pyx_v_t - __pyx_v_adj1);

  /* "cytimes/cydatetime.py":1357
 *     u1: cython.longlong = t - adj1
 *     u2: cython.longlong
 *     t1: cython.longlong = localize_ts(u1)  # type: ignore             # <<<<<<<<<<<<<<
 *     # Adjustment for Daylight Saving
 *     if t == t1:
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_localize_ts(__pyx_v_u1); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 1357, __pyx_L1_error)
  __pyx_v_t1 = __pyx_t_1;

  /* "cytimes/cydatetime.py":1359
 *     t1: cython.longlong = localize_ts(u1)  # type: ignore
 *     # Adjustment for Daylight Saving
 *     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_2 = (__pyx_v_t == __pyx_v_t1);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":1363
 *         # Look for an earlier solution (if `fold` is 0), or a later
 *         # one (if `fold` is 1).
 *         u2 = u1 - 86_400 if dt.fold == 0 else u1 + 86_400             # <<<<<<<<<<<<<<
 *         adj2 = localize_ts(u2) - u2  # type: ignore
 *         if adj1 == adj2:
 */
    __pyx_t_2 = (__pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt) == 0);
    if (__pyx_t_2) {
      __pyx_t_1 = (__pyx_v_u1 - 0x15180);
    } else {
      __pyx_t_1 = (__pyx_v_u1 + 0x15180);
    }
    __pyx_v_u2 = __pyx_t_1;

    /* "cytimes/cydatetime.py":1364
 *         # one (if `fold` is 1).
 *         u2 = u1 - 86_400 if dt.fold == 0 else u1 + 86_400
 *         adj2 = localize_ts(u2) - u2  # type: ignore             # <<<<<<<<<<<<<<
 *         if adj1 == adj2:
 *             return u1
 */
    __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_localize_ts(__pyx_v_u2); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 1364, __pyx_L1_error)
    __pyx_v_adj2 = (__pyx_t_1 - __pyx_v_u2);

    /* "cytimes/cydatetime.py":1365
 *         u2 = u1 - 86_400 if dt.fold == 0 else u1 + 86_400
 *         adj2 = localize_ts(u2) - u2  # type: ignore
 *         if adj1 == adj2:             # <<<<<<<<<<<<<<
 *             return u1
 *     else:
 */
    __pyx_t_2 = (__pyx_v_adj1 == __pyx_v_adj2);
    if (__pyx_t_2) {

      /* "cytimes/cydatetime.py":1366
 *         adj2 = localize_ts(u2) - u2  # type: ignore
 *         if adj1 == adj2:
 *             return u1             # <<<<<<<<<<<<<<
 *     else:
 *         adj2 = t1 - u1
 */
      __pyx_r = __pyx_v_u1;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":1365
 *         u2 = u1 - 86_400 if dt.fold == 0 else u1 + 86_400
 *         adj2 = localize_ts(u2) - u2  # type: ignore
 *         if adj1 == adj2:             # <<<<<<<<<<<<<<
 *             return u1
 *     else:
 */
    }

    /* "cytimes/cydatetime.py":1359
 *     t1: cython.longlong = localize_ts(u1)  # type: ignore
 *     # Adjustment for Daylight Saving
 *     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;
  }

  /* "cytimes/cydatetime.py":1368
 *             return u1
 *     else:
 *         adj2 = t1 - u1             # <<<<<<<<<<<<<<
 *         assert adj1 != adj2
 *     # Final adjustment
 */
  /*else*/ {
    __pyx_v_adj2 = (__pyx_v_t1 - __pyx_v_u1);

    /* "cytimes/cydatetime.py":1369
 *     else:
 *         adj2 = t1 - u1
 *         assert adj1 != adj2             # <<<<<<<<<<<<<<
 *     # Final adjustment
 *     u2 = t - adj2
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_2 = (__pyx_v_adj1 != __pyx_v_adj2);
      if (unlikely(!__pyx_t_2)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(1, 1369, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(1, 1369, __pyx_L1_error)
    #endif
  }
  __pyx_L3:;

  /* "cytimes/cydatetime.py":1371
 *         assert adj1 != adj2
 *     # Final adjustment
 *     u2 = t - adj2             # <<<<<<<<<<<<<<
 *     t2: cython.longlong = localize_ts(u2)  # type: ignore
 *     if t == t2:
 */
  __pyx_v_u2 = (__pyx_v_t - __pyx_v_adj2);

  /* "cytimes/cydatetime.py":1372
 *     # Final adjustment
 *     u2 = t - adj2
 *     t2: cython.longlong = localize_ts(u2)  # type: ignore             # <<<<<<<<<<<<<<
 *     if t == t2:
 *         return u2
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_localize_ts(__pyx_v_u2); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 1372, __pyx_L1_error)
  __pyx_v_t2 = __pyx_t_1;

  /* "cytimes/cydatetime.py":1373
 *     u2 = t - adj2
 *     t2: cython.longlong = localize_ts(u2)  # type: ignore
 *     if t == t2:             # <<<<<<<<<<<<<<
 *         return u2
 *     if t == t1:
 */
  __pyx_t_2 = (__pyx_v_t == __pyx_v_t2);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":1374
 *     t2: cython.longlong = localize_ts(u2)  # type: ignore
 *     if t == t2:
 *         return u2             # <<<<<<<<<<<<<<
 *     if t == t1:
 *         return u1
 */
    __pyx_r = __pyx_v_u2;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":1373
 *     u2 = t - adj2
 *     t2: cython.longlong = localize_ts(u2)  # type: ignore
 *     if t == t2:             # <<<<<<<<<<<<<<
 *         return u2
 *     if t == t1:
 */
  }

  /* "cytimes/cydatetime.py":1375
 *     if t == t2:
 *         return u2
 *     if t == t1:             # <<<<<<<<<<<<<<
 *         return u1
 *     # We have found both offsets adj1 and adj2,
 */
  __pyx_t_2 = (__pyx_v_t == __pyx_v_t1);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":1376
 *         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;

    /* "cytimes/cydatetime.py":1375
 *     if t == t2:
 *         return u2
 *     if t == t1:             # <<<<<<<<<<<<<<
 *         return u1
 *     # We have found both offsets adj1 and adj2,
 */
  }

  /* "cytimes/cydatetime.py":1380
 *     # 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)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = (__pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt) == 0);
  if (__pyx_t_2) {
    __pyx_t_3 = __pyx_v_u2;
    __pyx_t_4 = __pyx_v_u1;
    __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_t_1 = __pyx_t_5;
  } else {
    __pyx_t_5 = __pyx_v_u2;
    __pyx_t_3 = __pyx_v_u1;
    __pyx_t_6 = (__pyx_t_5 < __pyx_t_3);
    if (__pyx_t_6) {
      __pyx_t_4 = __pyx_t_5;
    } else {
      __pyx_t_4 = __pyx_t_3;
    }
    __pyx_t_1 = __pyx_t_4;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1339
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_to_posixts(dt: datetime.datetime) -> cython.longlong:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cytimes.cydatetime.dt_to_posixts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1383
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_to_timestamp(dt: datetime.datetime) -> cython.double:
 */

static double __pyx_f_7cytimes_10cydatetime_dt_to_timestamp(PyDateTime_DateTime *__pyx_v_dt) {
  double __pyx_v_ts;
  double __pyx_v_us;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PY_LONG_LONG __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_timestamp", 1);

  /* "cytimes/cydatetime.py":1390
 *     Equivalent to `datetime.timestamp()`
 *     """
 *     if dt.tzinfo is None:             # <<<<<<<<<<<<<<
 *         ts: cython.double = dt_to_posixts(dt)
 *         us: cython.double = dt.microsecond
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1390, __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/cydatetime.py":1391
 *     """
 *     if dt.tzinfo is None:
 *         ts: cython.double = dt_to_posixts(dt)             # <<<<<<<<<<<<<<
 *         us: cython.double = dt.microsecond
 *         return ts + us / 1_000_000
 */
    __pyx_t_3 = __pyx_f_7cytimes_10cydatetime_dt_to_posixts(__pyx_v_dt); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 1391, __pyx_L1_error)
    __pyx_v_ts = __pyx_t_3;

    /* "cytimes/cydatetime.py":1392
 *     if dt.tzinfo is None:
 *         ts: cython.double = dt_to_posixts(dt)
 *         us: cython.double = dt.microsecond             # <<<<<<<<<<<<<<
 *         return ts + us / 1_000_000
 *     else:
 */
    __pyx_v_us = __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt);

    /* "cytimes/cydatetime.py":1393
 *         ts: cython.double = dt_to_posixts(dt)
 *         us: cython.double = dt.microsecond
 *         return ts + us / 1_000_000             # <<<<<<<<<<<<<<
 *     else:
 *         return td_to_seconds(dt_sub_dt(dt, EPOCH_UTC))
 */
    __pyx_r = (__pyx_v_ts + (__pyx_v_us / 1000000.0));
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":1390
 *     Equivalent to `datetime.timestamp()`
 *     """
 *     if dt.tzinfo is None:             # <<<<<<<<<<<<<<
 *         ts: cython.double = dt_to_posixts(dt)
 *         us: cython.double = dt.microsecond
 */
  }

  /* "cytimes/cydatetime.py":1395
 *         return ts + us / 1_000_000
 *     else:
 *         return td_to_seconds(dt_sub_dt(dt, EPOCH_UTC))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_1 = ((PyObject *)__pyx_v_7cytimes_10cydatetime_EPOCH_UTC);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt_sub_dt(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_1))); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_f_7cytimes_10cydatetime_td_to_seconds(((PyDateTime_Delta *)__pyx_t_4));
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "cytimes/cydatetime.py":1383
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_to_timestamp(dt: datetime.datetime) -> cython.double:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.cydatetime.dt_to_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1398
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_to_stime(dt: datetime.datetime) -> tm:  # type: ignore
 */

static struct tm __pyx_f_7cytimes_10cydatetime_dt_to_stime(PyDateTime_DateTime *__pyx_v_dt) {
  int __pyx_v_dst;
  PyDateTime_Delta *__pyx_v_offset = NULL;
  int __pyx_v_year;
  int __pyx_v_month;
  int __pyx_v_day;
  struct tm __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  struct tm __pyx_t_4;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_stime", 1);

  /* "cytimes/cydatetime.py":1404
 *     # Calculate DST
 *     dst: cython.int
 *     offset = dt_dst(dt)             # <<<<<<<<<<<<<<
 *     if offset is None:
 *         dst = -1
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt_dst(__pyx_v_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_offset = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":1405
 *     dst: cython.int
 *     offset = dt_dst(dt)
 *     if offset is None:             # <<<<<<<<<<<<<<
 *         dst = -1
 *     else:
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_offset) == Py_None);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":1406
 *     offset = dt_dst(dt)
 *     if offset is None:
 *         dst = -1             # <<<<<<<<<<<<<<
 *     else:
 *         dst = 1 if offset else 0
 */
    __pyx_v_dst = -1;

    /* "cytimes/cydatetime.py":1405
 *     dst: cython.int
 *     offset = dt_dst(dt)
 *     if offset is None:             # <<<<<<<<<<<<<<
 *         dst = -1
 *     else:
 */
    goto __pyx_L3;
  }

  /* "cytimes/cydatetime.py":1408
 *         dst = -1
 *     else:
 *         dst = 1 if offset else 0             # <<<<<<<<<<<<<<
 * 
 *     # Generate struct time
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_offset)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 1408, __pyx_L1_error)
    if (__pyx_t_2) {
      __pyx_t_3 = 1;
    } else {
      __pyx_t_3 = 0;
    }
    __pyx_v_dst = __pyx_t_3;
  }
  __pyx_L3:;

  /* "cytimes/cydatetime.py":1411
 * 
 *     # Generate struct time
 *     year: cython.int = dt.year             # <<<<<<<<<<<<<<
 *     month: cython.int = dt.month
 *     day: cython.int = dt.day
 */
  __pyx_v_year = __pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt);

  /* "cytimes/cydatetime.py":1412
 *     # Generate struct time
 *     year: cython.int = dt.year
 *     month: cython.int = dt.month             # <<<<<<<<<<<<<<
 *     day: cython.int = dt.day
 *     # fmt: off
 */
  __pyx_v_month = __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt);

  /* "cytimes/cydatetime.py":1413
 *     year: cython.int = dt.year
 *     month: cython.int = dt.month
 *     day: cython.int = dt.day             # <<<<<<<<<<<<<<
 *     # fmt: off
 *     return tm( # type: ignore
 */
  __pyx_v_day = __pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt);

  /* "cytimes/cydatetime.py":1416
 *     # fmt: off
 *     return tm( # type: ignore
 *         dt.second, dt.minute, dt.hour, day, month, year,             # <<<<<<<<<<<<<<
 *         ymd_weekday(year, month, day), days_bf_month(year, month) + day, dst,
 *     )
 */
  __pyx_t_4.tm_sec = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);
  __pyx_t_4.tm_min = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);
  __pyx_t_4.tm_hour = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);
  __pyx_t_4.tm_mday = __pyx_v_day;
  __pyx_t_4.tm_mon = __pyx_v_month;
  __pyx_t_4.tm_year = __pyx_v_year;

  /* "cytimes/cydatetime.py":1417
 *     return tm( # type: ignore
 *         dt.second, dt.minute, dt.hour, day, month, year,
 *         ymd_weekday(year, month, day), days_bf_month(year, month) + day, dst,             # <<<<<<<<<<<<<<
 *     )
 *     # fmt: on
 */
  __pyx_t_5 = __pyx_f_7cytimes_10cydatetime_ymd_weekday(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_5 == ((unsigned int)-1))) __PYX_ERR(1, 1417, __pyx_L1_error)
  __pyx_t_4.tm_wday = __pyx_t_5;
  __pyx_t_5 = __pyx_f_7cytimes_10cydatetime_days_bf_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_5 == ((unsigned int)-1))) __PYX_ERR(1, 1417, __pyx_L1_error)
  __pyx_t_4.tm_yday = (__pyx_t_5 + __pyx_v_day);
  __pyx_t_4.tm_isdst = __pyx_v_dst;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1398
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_to_stime(dt: datetime.datetime) -> tm:  # type: ignore
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.cydatetime.dt_to_stime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_offset);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1422
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_to_stime_utc(dt: datetime.datetime) -> tm:  # type: ignore
 */

static struct tm __pyx_f_7cytimes_10cydatetime_dt_to_stime_utc(PyDateTime_DateTime *__pyx_v_dt) {
  PyDateTime_Delta *__pyx_v_offset = NULL;
  int __pyx_v_year;
  int __pyx_v_month;
  int __pyx_v_day;
  struct tm __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  struct tm __pyx_t_3;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_to_stime_utc", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_dt);

  /* "cytimes/cydatetime.py":1427
 *     """Convert datetime to `<'struct:tm'>` under UTC."""
 *     # Convert to UTC
 *     offset = dt_utcoffset(dt)             # <<<<<<<<<<<<<<
 *     if offset is not None:
 *         dt -= offset
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt_utcoffset(__pyx_v_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_offset = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":1428
 *     # Convert to UTC
 *     offset = dt_utcoffset(dt)
 *     if offset is not None:             # <<<<<<<<<<<<<<
 *         dt -= offset
 * 
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_offset) != Py_None);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":1429
 *     offset = dt_utcoffset(dt)
 *     if offset is not None:
 *         dt -= offset             # <<<<<<<<<<<<<<
 * 
 *     # Generate struct time
 */
    __pyx_t_1 = PyNumber_InPlaceSubtract(((PyObject *)__pyx_v_dt), ((PyObject *)__pyx_v_offset)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1429, __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_datetime))))) __PYX_ERR(1, 1429, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":1428
 *     # Convert to UTC
 *     offset = dt_utcoffset(dt)
 *     if offset is not None:             # <<<<<<<<<<<<<<
 *         dt -= offset
 * 
 */
  }

  /* "cytimes/cydatetime.py":1432
 * 
 *     # Generate struct time
 *     year: cython.int = dt.year             # <<<<<<<<<<<<<<
 *     month: cython.int = dt.month
 *     day: cython.int = dt.day
 */
  __pyx_v_year = __pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt);

  /* "cytimes/cydatetime.py":1433
 *     # Generate struct time
 *     year: cython.int = dt.year
 *     month: cython.int = dt.month             # <<<<<<<<<<<<<<
 *     day: cython.int = dt.day
 *     # fmt: off
 */
  __pyx_v_month = __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt);

  /* "cytimes/cydatetime.py":1434
 *     year: cython.int = dt.year
 *     month: cython.int = dt.month
 *     day: cython.int = dt.day             # <<<<<<<<<<<<<<
 *     # fmt: off
 *     return tm( # type: ignore
 */
  __pyx_v_day = __pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt);

  /* "cytimes/cydatetime.py":1437
 *     # fmt: off
 *     return tm( # type: ignore
 *         dt.second, dt.minute, dt.hour, day, month, year,             # <<<<<<<<<<<<<<
 *         ymd_weekday(year, month, day), days_bf_month(year, month) + day, 0,
 *     )
 */
  __pyx_t_3.tm_sec = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);
  __pyx_t_3.tm_min = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);
  __pyx_t_3.tm_hour = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);
  __pyx_t_3.tm_mday = __pyx_v_day;
  __pyx_t_3.tm_mon = __pyx_v_month;
  __pyx_t_3.tm_year = __pyx_v_year;

  /* "cytimes/cydatetime.py":1438
 *     return tm( # type: ignore
 *         dt.second, dt.minute, dt.hour, day, month, year,
 *         ymd_weekday(year, month, day), days_bf_month(year, month) + day, 0,             # <<<<<<<<<<<<<<
 *     )
 *     # fmt: on
 */
  __pyx_t_4 = __pyx_f_7cytimes_10cydatetime_ymd_weekday(__pyx_v_year, __pyx_v_month, __pyx_v_day); if (unlikely(__pyx_t_4 == ((unsigned int)-1))) __PYX_ERR(1, 1438, __pyx_L1_error)
  __pyx_t_3.tm_wday = __pyx_t_4;
  __pyx_t_4 = __pyx_f_7cytimes_10cydatetime_days_bf_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_4 == ((unsigned int)-1))) __PYX_ERR(1, 1438, __pyx_L1_error)
  __pyx_t_3.tm_yday = (__pyx_t_4 + __pyx_v_day);
  __pyx_t_3.tm_isdst = 0;
  __pyx_r = __pyx_t_3;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1422
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_to_stime_utc(dt: datetime.datetime) -> tm:  # type: ignore
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.cydatetime.dt_to_stime_utc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_offset);
  __Pyx_XDECREF((PyObject *)__pyx_v_dt);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1443
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_fr_dt(dt: datetime.datetime) -> datetime.datetime:
 */

static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_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);

  /* "cytimes/cydatetime.py":1448
 *     """Convert subclass of datetime.datetime to `<'datetime.datetime'>`."""
 *     # fmt: off
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":1451
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 *         dt.microsecond, dt.tzinfo, dt.fold,             # <<<<<<<<<<<<<<
 *     )
 *     # fmt: on
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cytimes/cydatetime.py":1448
 *     """Convert subclass of datetime.datetime to `<'datetime.datetime'>`."""
 *     # fmt: off
 *     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(1, 1448, __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;

  /* "cytimes/cydatetime.py":1443
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_fr_dt(dt: datetime.datetime) -> datetime.datetime:
 */

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

/* "cytimes/cydatetime.py":1456
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_fr_date(
 */

static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_dt_fr_date(PyDateTime_Date *__pyx_v_date, struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_date *__pyx_optional_args) {

  /* "cytimes/cydatetime.py":1460
 * def dt_fr_date(
 *     date: datetime.date,
 *     tzinfo: datetime.tzinfo = None,             # <<<<<<<<<<<<<<
 *     fold: cython.uint = 0,
 * ) -> datetime.datetime:
 */
  PyDateTime_TZInfo *__pyx_v_tzinfo = ((PyDateTime_TZInfo *)Py_None);
  unsigned int __pyx_v_fold = ((unsigned int)0);
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __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_date", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tzinfo = __pyx_optional_args->tzinfo;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_fold = __pyx_optional_args->fold;
      }
    }
  }

  /* "cytimes/cydatetime.py":1465
 *     """Convert datetime.date to `<'datetime.datetime'>`."""
 *     # fmt: off
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         date.year, date.month, date.day, 0, 0, 0, 0,
 *         tzinfo, 1 if fold == 1 and tzinfo is not None else 0
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":1467
 *     return datetime.datetime_new(
 *         date.year, date.month, date.day, 0, 0, 0, 0,
 *         tzinfo, 1 if fold == 1 and tzinfo is not None else 0             # <<<<<<<<<<<<<<
 *     )
 *     # fmt: on
 */
  __pyx_t_3 = (__pyx_v_fold == 1);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = (((PyObject *)__pyx_v_tzinfo) != Py_None);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L3_bool_binop_done:;
  if (__pyx_t_2) {
    __pyx_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }

  /* "cytimes/cydatetime.py":1465
 *     """Convert datetime.date to `<'datetime.datetime'>`."""
 *     # fmt: off
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         date.year, date.month, date.day, 0, 0, 0, 0,
 *         tzinfo, 1 if fold == 1 and tzinfo is not None else 0
 */
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.fold = __pyx_t_1;
  __pyx_t_4 = ((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, ((PyObject *)__pyx_v_tzinfo), &__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1456
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_fr_date(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.cydatetime.dt_fr_date", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1472
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_fr_time(time: datetime.time) -> datetime.datetime:
 */

static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_dt_fr_time(PyDateTime_Time *__pyx_v_time) {
  struct tm __pyx_v_tms;
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct tm __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_fr_time", 1);

  /* "cytimes/cydatetime.py":1479
 *     Year, month, day will be auto set to the current date.
 *     """
 *     tms = localtime()             # <<<<<<<<<<<<<<
 *     # fmt: off
 *     return datetime.datetime_new(
 */
  __pyx_t_1 = __pyx_f_7cpython_4time_localtime(); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1479, __pyx_L1_error)
  __pyx_v_tms = __pyx_t_1;

  /* "cytimes/cydatetime.py":1481
 *     tms = localtime()
 *     # fmt: off
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         tms.tm_year, tms.tm_mon, tms.tm_mday,
 *         time.hour, time.minute, time.second,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":1484
 *         tms.tm_year, tms.tm_mon, tms.tm_mday,
 *         time.hour, time.minute, time.second,
 *         time.microsecond, time.tzinfo, time.fold,             # <<<<<<<<<<<<<<
 *     )
 *     # fmt: on
 */
  __pyx_t_2 = __pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(__pyx_v_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cytimes/cydatetime.py":1481
 *     tms = localtime()
 *     # fmt: off
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         tms.tm_year, tms.tm_mon, tms.tm_mday,
 *         time.hour, time.minute, time.second,
 */
  __pyx_t_4.__pyx_n = 1;
  __pyx_t_4.fold = __pyx_f_7cpython_8datetime_4time_4fold_fold(__pyx_v_time);
  __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_v_tms.tm_year, __pyx_v_tms.tm_mon, __pyx_v_tms.tm_mday, __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_2, &__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1481, __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;

  /* "cytimes/cydatetime.py":1472
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_fr_time(time: datetime.time) -> datetime.datetime:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.dt_fr_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1489
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_fr_date_n_time(date: datetime.date, time: datetime.time) -> datetime.datetime:
 */

static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_dt_fr_date_n_time(PyDateTime_Date *__pyx_v_date, 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_date_n_time", 1);

  /* "cytimes/cydatetime.py":1494
 *     """Convert datetime.date & datetime.time to `<'datetime.datetime'>`."""
 *     # fmt: off
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         date.year, date.month, date.day,
 *         time.hour, time.minute, time.second,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":1497
 *         date.year, date.month, date.day,
 *         time.hour, time.minute, time.second,
 *         time.microsecond, time.tzinfo, time.fold,             # <<<<<<<<<<<<<<
 *     )
 *     # fmt: on
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(__pyx_v_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cytimes/cydatetime.py":1494
 *     """Convert datetime.date & datetime.time to `<'datetime.datetime'>`."""
 *     # fmt: off
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         date.year, date.month, date.day,
 *         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(__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), __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(1, 1494, __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;

  /* "cytimes/cydatetime.py":1489
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_fr_date_n_time(date: datetime.date, time: datetime.time) -> datetime.datetime:
 */

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

/* "cytimes/cydatetime.py":1502
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_fr_ordinal(
 */

static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_dt_fr_ordinal(int __pyx_v_ordinal, struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_ordinal *__pyx_optional_args) {

  /* "cytimes/cydatetime.py":1506
 * def dt_fr_ordinal(
 *     ordinal: cython.int,
 *     tzinfo: datetime.tzinfo = None,             # <<<<<<<<<<<<<<
 *     fold: cython.uint = 0,
 * ) -> datetime.datetime:
 */
  PyDateTime_TZInfo *__pyx_v_tzinfo = ((PyDateTime_TZInfo *)Py_None);
  unsigned int __pyx_v_fold = ((unsigned int)0);
  __pyx_t_7cytimes_10cydatetime_ymd __pyx_v_ymd;
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __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_ordinal", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tzinfo = __pyx_optional_args->tzinfo;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_fold = __pyx_optional_args->fold;
      }
    }
  }

  /* "cytimes/cydatetime.py":1510
 * ) -> datetime.datetime:
 *     """Convert ordinal to `<'datetime.datetime'>`."""
 *     ymd = ordinal_to_ymd(ordinal)             # <<<<<<<<<<<<<<
 *     # fmt: off
 *     return datetime.datetime_new(
 */
  __pyx_v_ymd = __pyx_f_7cytimes_10cydatetime_ordinal_to_ymd(__pyx_v_ordinal);

  /* "cytimes/cydatetime.py":1512
 *     ymd = ordinal_to_ymd(ordinal)
 *     # fmt: off
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         ymd.year, ymd.month, ymd.day, 0, 0, 0, 0,
 *         tzinfo, 1 if fold == 1 and tzinfo is not None else 0
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":1514
 *     return datetime.datetime_new(
 *         ymd.year, ymd.month, ymd.day, 0, 0, 0, 0,
 *         tzinfo, 1 if fold == 1 and tzinfo is not None else 0             # <<<<<<<<<<<<<<
 *     )
 *     # fmt: on
 */
  __pyx_t_3 = (__pyx_v_fold == 1);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = (((PyObject *)__pyx_v_tzinfo) != Py_None);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L3_bool_binop_done:;
  if (__pyx_t_2) {
    __pyx_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }

  /* "cytimes/cydatetime.py":1512
 *     ymd = ordinal_to_ymd(ordinal)
 *     # fmt: off
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         ymd.year, ymd.month, ymd.day, 0, 0, 0, 0,
 *         tzinfo, 1 if fold == 1 and tzinfo is not None else 0
 */
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.fold = __pyx_t_1;
  __pyx_t_4 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_v_ymd.year, __pyx_v_ymd.month, __pyx_v_ymd.day, 0, 0, 0, 0, ((PyObject *)__pyx_v_tzinfo), &__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1502
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_fr_ordinal(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.cydatetime.dt_fr_ordinal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1519
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_fr_seconds(
 */

static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_dt_fr_seconds(double __pyx_v_seconds, struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_seconds *__pyx_optional_args) {

  /* "cytimes/cydatetime.py":1523
 * def dt_fr_seconds(
 *     seconds: cython.double,
 *     tzinfo: datetime.tzinfo = None,             # <<<<<<<<<<<<<<
 *     fold: cython.uint = 0,
 * ) -> datetime.datetime:
 */
  PyDateTime_TZInfo *__pyx_v_tzinfo = ((PyDateTime_TZInfo *)Py_None);
  unsigned int __pyx_v_fold = ((unsigned int)0);
  PY_LONG_LONG __pyx_v_microseconds;
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_microseconds __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_tzinfo = __pyx_optional_args->tzinfo;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_fold = __pyx_optional_args->fold;
      }
    }
  }

  /* "cytimes/cydatetime.py":1527
 * ) -> datetime.datetime:
 *     """Convert total seconds after POSIX epoch to `<'datetime.datetime'>`."""
 *     microseconds: cython.longlong = int(seconds * 1_000_000)             # <<<<<<<<<<<<<<
 *     return dt_fr_microseconds(microseconds, tzinfo, fold)
 * 
 */
  __pyx_v_microseconds = ((PY_LONG_LONG)(__pyx_v_seconds * 1000000.0));

  /* "cytimes/cydatetime.py":1528
 *     """Convert total seconds after POSIX epoch to `<'datetime.datetime'>`."""
 *     microseconds: cython.longlong = int(seconds * 1_000_000)
 *     return dt_fr_microseconds(microseconds, tzinfo, fold)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.tzinfo = __pyx_v_tzinfo;
  __pyx_t_2.fold = __pyx_v_fold;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt_fr_microseconds(__pyx_v_microseconds, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1519
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_fr_seconds(
 */

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

/* "cytimes/cydatetime.py":1531
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.cdivision(True)
 */

static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_dt_fr_microseconds(PY_LONG_LONG __pyx_v_microseconds, struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_microseconds *__pyx_optional_args) {

  /* "cytimes/cydatetime.py":1536
 * def dt_fr_microseconds(
 *     microseconds: cython.longlong,
 *     tzinfo: datetime.tzinfo = None,             # <<<<<<<<<<<<<<
 *     fold: cython.uint = 0,
 * ) -> datetime.datetime:
 */
  PyDateTime_TZInfo *__pyx_v_tzinfo = ((PyDateTime_TZInfo *)Py_None);
  unsigned int __pyx_v_fold = ((unsigned int)0);
  __pyx_t_7cytimes_10cydatetime_ymd __pyx_v_ymd;
  __pyx_t_7cytimes_10cydatetime_hms __pyx_v_hms;
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PY_LONG_LONG __pyx_t_1;
  PY_LONG_LONG __pyx_t_2;
  PY_LONG_LONG __pyx_t_3;
  PY_LONG_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_fr_microseconds", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tzinfo = __pyx_optional_args->tzinfo;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_fold = __pyx_optional_args->fold;
      }
    }
  }

  /* "cytimes/cydatetime.py":1541
 *     """Convert total microseconds after POSIX epoch to `<'datetime.datetime'>`."""
 *     # Add back epoch microseconds
 *     microseconds += EPOCH_US             # <<<<<<<<<<<<<<
 *     microseconds = min(max(microseconds, DT_MIN_US), DT_MAX_US)
 *     # Calculate ymd
 */
  __pyx_v_microseconds = (__pyx_v_microseconds + __pyx_v_7cytimes_10cydatetime_EPOCH_US);

  /* "cytimes/cydatetime.py":1542
 *     # Add back epoch microseconds
 *     microseconds += EPOCH_US
 *     microseconds = min(max(microseconds, DT_MIN_US), DT_MAX_US)             # <<<<<<<<<<<<<<
 *     # Calculate ymd
 *     ymd = ordinal_to_ymd(microseconds // US_DAY)
 */
  __pyx_t_1 = __pyx_v_7cytimes_10cydatetime_DT_MAX_US;
  __pyx_t_2 = __pyx_v_7cytimes_10cydatetime_DT_MIN_US;
  __pyx_t_3 = __pyx_v_microseconds;
  __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_microseconds = __pyx_t_4;

  /* "cytimes/cydatetime.py":1544
 *     microseconds = min(max(microseconds, DT_MIN_US), DT_MAX_US)
 *     # Calculate ymd
 *     ymd = ordinal_to_ymd(microseconds // US_DAY)             # <<<<<<<<<<<<<<
 *     # Calculate hms
 *     hms = microseconds_to_hms(microseconds)
 */
  __pyx_v_ymd = __pyx_f_7cytimes_10cydatetime_ordinal_to_ymd((__pyx_v_microseconds / __pyx_v_7cytimes_10cydatetime_US_DAY));

  /* "cytimes/cydatetime.py":1546
 *     ymd = ordinal_to_ymd(microseconds // US_DAY)
 *     # Calculate hms
 *     hms = microseconds_to_hms(microseconds)             # <<<<<<<<<<<<<<
 *     # Generate datetime
 *     # fmt: off
 */
  __pyx_v_hms = __pyx_f_7cytimes_10cydatetime_microseconds_to_hms(__pyx_v_microseconds);

  /* "cytimes/cydatetime.py":1549
 *     # Generate datetime
 *     # fmt: off
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         ymd.year, ymd.month, ymd.day,
 *         hms.hour, hms.minute, hms.second, hms.microsecond,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":1552
 *         ymd.year, ymd.month, ymd.day,
 *         hms.hour, hms.minute, hms.second, hms.microsecond,
 *         tzinfo, 1 if fold == 1 and tzinfo is not None else 0,             # <<<<<<<<<<<<<<
 *     )
 *     # fmt: on
 */
  __pyx_t_7 = (__pyx_v_fold == 1);
  if (__pyx_t_7) {
  } else {
    __pyx_t_5 = __pyx_t_7;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_7 = (((PyObject *)__pyx_v_tzinfo) != Py_None);
  __pyx_t_5 = __pyx_t_7;
  __pyx_L3_bool_binop_done:;
  if (__pyx_t_5) {
    __pyx_t_6 = 1;
  } else {
    __pyx_t_6 = 0;
  }

  /* "cytimes/cydatetime.py":1549
 *     # Generate datetime
 *     # fmt: off
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         ymd.year, ymd.month, ymd.day,
 *         hms.hour, hms.minute, hms.second, hms.microsecond,
 */
  __pyx_t_9.__pyx_n = 1;
  __pyx_t_9.fold = __pyx_t_6;
  __pyx_t_8 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_v_ymd.year, __pyx_v_ymd.month, __pyx_v_ymd.day, __pyx_v_hms.hour, __pyx_v_hms.minute, __pyx_v_hms.second, __pyx_v_hms.microsecond, ((PyObject *)__pyx_v_tzinfo), &__pyx_t_9)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_8);
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1531
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.cdivision(True)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cytimes.cydatetime.dt_fr_microseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1557
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_fr_timestamp(
 */

static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_dt_fr_timestamp(double __pyx_v_timestamp, struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_timestamp *__pyx_optional_args) {

  /* "cytimes/cydatetime.py":1561
 * def dt_fr_timestamp(
 *     timestamp: cython.double,
 *     tzinfo: datetime.tzinfo = None,             # <<<<<<<<<<<<<<
 * ) -> datetime.datetime:
 *     """Convert timestamp to `<'datetime.datetime'>`."""
 */
  PyDateTime_TZInfo *__pyx_v_tzinfo = ((PyDateTime_TZInfo *)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_timestamp", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tzinfo = __pyx_optional_args->tzinfo;
    }
  }

  /* "cytimes/cydatetime.py":1564
 * ) -> datetime.datetime:
 *     """Convert timestamp to `<'datetime.datetime'>`."""
 *     return datetime.datetime_from_timestamp(timestamp, tzinfo)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.tz = ((PyObject *)__pyx_v_tzinfo);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_from_timestamp(__pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1564, __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;

  /* "cytimes/cydatetime.py":1557
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_fr_timestamp(
 */

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

/* "cytimes/cydatetime.py":1568
 * 
 * # Datetime.datetime: arithmetic ------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_add(
 */

static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_dt_add(PyDateTime_DateTime *__pyx_v_dt, struct __pyx_opt_args_7cytimes_10cydatetime_dt_add *__pyx_optional_args) {
  int __pyx_v_days = ((int)0);
  PY_LONG_LONG __pyx_v_seconds = ((PY_LONG_LONG)0);
  PY_LONG_LONG __pyx_v_microseconds = ((PY_LONG_LONG)0);
  PyDateTime_DateTime *__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_10cydatetime_dt_fr_microseconds __pyx_t_5;
  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;
        }
      }
    }
  }

  /* "cytimes/cydatetime.py":1578
 *     """Add 'days', 'seconds' and 'microseconds' to `<'datetime.datetime'>`.
 *     Equivalent to `datetime + timedelta(days, seconds, microseconds)`."""
 *     if days == 0 and seconds == 0 and microseconds == 0:             # <<<<<<<<<<<<<<
 *         return dt
 *     return dt_fr_microseconds(
 */
  __pyx_t_2 = (__pyx_v_days == 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __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) {

    /* "cytimes/cydatetime.py":1579
 *     Equivalent to `datetime + timedelta(days, seconds, microseconds)`."""
 *     if days == 0 and seconds == 0 and microseconds == 0:
 *         return dt             # <<<<<<<<<<<<<<
 *     return dt_fr_microseconds(
 *         dt_to_microseconds(dt) + days * US_DAY + seconds * 1_000_000 + microseconds,
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_dt);
    __pyx_r = __pyx_v_dt;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":1578
 *     """Add 'days', 'seconds' and 'microseconds' to `<'datetime.datetime'>`.
 *     Equivalent to `datetime + timedelta(days, seconds, microseconds)`."""
 *     if days == 0 and seconds == 0 and microseconds == 0:             # <<<<<<<<<<<<<<
 *         return dt
 *     return dt_fr_microseconds(
 */
  }

  /* "cytimes/cydatetime.py":1580
 *     if days == 0 and seconds == 0 and microseconds == 0:
 *         return dt
 *     return dt_fr_microseconds(             # <<<<<<<<<<<<<<
 *         dt_to_microseconds(dt) + days * US_DAY + seconds * 1_000_000 + microseconds,
 *         dt.tzinfo,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":1582
 *     return dt_fr_microseconds(
 *         dt_to_microseconds(dt) + days * US_DAY + seconds * 1_000_000 + microseconds,
 *         dt.tzinfo,             # <<<<<<<<<<<<<<
 *         dt.fold,
 *     )
 */
  __pyx_t_3 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7cpython_8datetime_tzinfo))))) __PYX_ERR(1, 1582, __pyx_L1_error)

  /* "cytimes/cydatetime.py":1580
 *     if days == 0 and seconds == 0 and microseconds == 0:
 *         return dt
 *     return dt_fr_microseconds(             # <<<<<<<<<<<<<<
 *         dt_to_microseconds(dt) + days * US_DAY + seconds * 1_000_000 + microseconds,
 *         dt.tzinfo,
 */
  __pyx_t_5.__pyx_n = 2;
  __pyx_t_5.tzinfo = ((PyDateTime_TZInfo *)__pyx_t_3);
  __pyx_t_5.fold = __pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt);
  __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt_fr_microseconds((((__pyx_f_7cytimes_10cydatetime_dt_to_microseconds(__pyx_v_dt) + (__pyx_v_days * __pyx_v_7cytimes_10cydatetime_US_DAY)) + (__pyx_v_seconds * 0xF4240)) + __pyx_v_microseconds), &__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1568
 * 
 * # Datetime.datetime: arithmetic ------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_add(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.cydatetime.dt_add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1587
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_add_td(dt: datetime.datetime, td: datetime.timedelta) -> datetime.datetime:
 */

static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_dt_add_td(PyDateTime_DateTime *__pyx_v_dt, PyDateTime_Delta *__pyx_v_td) {
  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("dt_add_td", 1);

  /* "cytimes/cydatetime.py":1592
 *     """Add datetime.timedelta to `<'datetime.datetime'>`.
 *     Equivalent to `datetime + timedelta)`."""
 *     return dt + td             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_v_dt), ((PyObject *)__pyx_v_td)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1592, __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_datetime))))) __PYX_ERR(1, 1592, __pyx_L1_error)
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1587
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_add_td(dt: datetime.datetime, td: datetime.timedelta) -> datetime.datetime:
 */

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

/* "cytimes/cydatetime.py":1595
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_sub_td(dt: datetime.datetime, td: datetime.timedelta) -> datetime.datetime:
 */

static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_dt_sub_td(PyDateTime_DateTime *__pyx_v_dt, PyDateTime_Delta *__pyx_v_td) {
  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("dt_sub_td", 1);

  /* "cytimes/cydatetime.py":1600
 *     """Substract datetime.timedelta from `<'datetime.datetime'>`.
 *     Equivalent to `datetime - timedelta)`."""
 *     return dt - td             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = PyNumber_Subtract(((PyObject *)__pyx_v_dt), ((PyObject *)__pyx_v_td)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1600, __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_datetime))))) __PYX_ERR(1, 1600, __pyx_L1_error)
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1595
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_sub_td(dt: datetime.datetime, td: datetime.timedelta) -> datetime.datetime:
 */

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

/* "cytimes/cydatetime.py":1603
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_sub_dt(dt_l: datetime.datetime, dt_r: datetime.datetime) -> datetime.timedelta:
 */

static PyDateTime_Delta *__pyx_f_7cytimes_10cydatetime_dt_sub_dt(PyDateTime_DateTime *__pyx_v_dt_l, PyDateTime_DateTime *__pyx_v_dt_r) {
  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("dt_sub_dt", 1);

  /* "cytimes/cydatetime.py":1609
 *     Equivalent to `datetime - datetime`.
 *     """
 *     return td_fr_microseconds(dt_sub_dt_us(dt_l, dt_r))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_dt_sub_dt_us(__pyx_v_dt_l, __pyx_v_dt_r); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 1609, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_td_fr_microseconds(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1603
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_sub_dt(dt_l: datetime.datetime, dt_r: datetime.datetime) -> datetime.timedelta:
 */

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

/* "cytimes/cydatetime.py":1612
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_sub_dt_us(dt_l: datetime.datetime, dt_r: datetime.datetime) -> cython.longlong:
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_dt_sub_dt_us(PyDateTime_DateTime *__pyx_v_dt_l, PyDateTime_DateTime *__pyx_v_dt_r) {
  PY_LONG_LONG __pyx_v_delta_us;
  PyDateTime_TZInfo *__pyx_v_tzinfo_l = 0;
  PyDateTime_TZInfo *__pyx_v_tzinfo_r = 0;
  PY_LONG_LONG __pyx_v_offset_l;
  PyDateTime_Delta *__pyx_v_td = NULL;
  PY_LONG_LONG __pyx_v_offset_r;
  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("dt_sub_dt_us", 1);

  /* "cytimes/cydatetime.py":1617
 *     """Substraction between datetime.datetimes and returns `<'int'>`
 *     (difference in microseconds). Equivalent to `datetime - datetime`."""
 *     delta_us: cython.longlong = dt_to_microseconds(dt_l) - dt_to_microseconds(dt_r)             # <<<<<<<<<<<<<<
 *     tzinfo_l: datetime.tzinfo = dt_l.tzinfo
 *     tzinfo_r: datetime.tzinfo = dt_r.tzinfo
 */
  __pyx_v_delta_us = (__pyx_f_7cytimes_10cydatetime_dt_to_microseconds(__pyx_v_dt_l) - __pyx_f_7cytimes_10cydatetime_dt_to_microseconds(__pyx_v_dt_r));

  /* "cytimes/cydatetime.py":1618
 *     (difference in microseconds). Equivalent to `datetime - datetime`."""
 *     delta_us: cython.longlong = dt_to_microseconds(dt_l) - dt_to_microseconds(dt_r)
 *     tzinfo_l: datetime.tzinfo = dt_l.tzinfo             # <<<<<<<<<<<<<<
 *     tzinfo_r: datetime.tzinfo = dt_r.tzinfo
 *     # If both are naive or have the same tzinfo
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt_l); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1618, __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_tzinfo))))) __PYX_ERR(1, 1618, __pyx_L1_error)
  __pyx_v_tzinfo_l = ((PyDateTime_TZInfo *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":1619
 *     delta_us: cython.longlong = dt_to_microseconds(dt_l) - dt_to_microseconds(dt_r)
 *     tzinfo_l: datetime.tzinfo = dt_l.tzinfo
 *     tzinfo_r: datetime.tzinfo = dt_r.tzinfo             # <<<<<<<<<<<<<<
 *     # If both are naive or have the same tzinfo
 *     # return delta directly.
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1619, __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_tzinfo))))) __PYX_ERR(1, 1619, __pyx_L1_error)
  __pyx_v_tzinfo_r = ((PyDateTime_TZInfo *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":1622
 *     # If both are naive or have the same tzinfo
 *     # return delta directly.
 *     if tzinfo_l is tzinfo_r:             # <<<<<<<<<<<<<<
 *         return delta_us
 *     # Calculate left timezone offset
 */
  __pyx_t_2 = (__pyx_v_tzinfo_l == __pyx_v_tzinfo_r);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":1623
 *     # return delta directly.
 *     if tzinfo_l is tzinfo_r:
 *         return delta_us             # <<<<<<<<<<<<<<
 *     # Calculate left timezone offset
 *     if tzinfo_l is None:
 */
    __pyx_r = __pyx_v_delta_us;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":1622
 *     # If both are naive or have the same tzinfo
 *     # return delta directly.
 *     if tzinfo_l is tzinfo_r:             # <<<<<<<<<<<<<<
 *         return delta_us
 *     # Calculate left timezone offset
 */
  }

  /* "cytimes/cydatetime.py":1625
 *         return delta_us
 *     # Calculate left timezone offset
 *     if tzinfo_l is None:             # <<<<<<<<<<<<<<
 *         offset_l: cython.longlong = 0
 *     else:
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_tzinfo_l) == Py_None);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":1626
 *     # Calculate left timezone offset
 *     if tzinfo_l is None:
 *         offset_l: cython.longlong = 0             # <<<<<<<<<<<<<<
 *     else:
 *         td = dt_utcoffset(dt_l)
 */
    __pyx_v_offset_l = 0;

    /* "cytimes/cydatetime.py":1625
 *         return delta_us
 *     # Calculate left timezone offset
 *     if tzinfo_l is None:             # <<<<<<<<<<<<<<
 *         offset_l: cython.longlong = 0
 *     else:
 */
    goto __pyx_L4;
  }

  /* "cytimes/cydatetime.py":1628
 *         offset_l: cython.longlong = 0
 *     else:
 *         td = dt_utcoffset(dt_l)             # <<<<<<<<<<<<<<
 *         offset_l: cython.longlong = 0 if td is None else td_to_microseconds(td)
 *     # Calculate right timezone offset
 */
  /*else*/ {
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt_utcoffset(__pyx_v_dt_l)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_td = ((PyDateTime_Delta *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":1629
 *     else:
 *         td = dt_utcoffset(dt_l)
 *         offset_l: cython.longlong = 0 if td is None else td_to_microseconds(td)             # <<<<<<<<<<<<<<
 *     # Calculate right timezone offset
 *     if tzinfo_r is None:
 */
    __pyx_t_2 = (((PyObject *)__pyx_v_td) == Py_None);
    if (__pyx_t_2) {
      __pyx_t_3 = 0;
    } else {
      __pyx_t_3 = __pyx_f_7cytimes_10cydatetime_td_to_microseconds(__pyx_v_td);
    }
    __pyx_v_offset_l = __pyx_t_3;
  }
  __pyx_L4:;

  /* "cytimes/cydatetime.py":1631
 *         offset_l: cython.longlong = 0 if td is None else td_to_microseconds(td)
 *     # Calculate right timezone offset
 *     if tzinfo_r is None:             # <<<<<<<<<<<<<<
 *         offset_r: cython.longlong = 0
 *     else:
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_tzinfo_r) == Py_None);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":1632
 *     # Calculate right timezone offset
 *     if tzinfo_r is None:
 *         offset_r: cython.longlong = 0             # <<<<<<<<<<<<<<
 *     else:
 *         td = dt_utcoffset(dt_r)
 */
    __pyx_v_offset_r = 0;

    /* "cytimes/cydatetime.py":1631
 *         offset_l: cython.longlong = 0 if td is None else td_to_microseconds(td)
 *     # Calculate right timezone offset
 *     if tzinfo_r is None:             # <<<<<<<<<<<<<<
 *         offset_r: cython.longlong = 0
 *     else:
 */
    goto __pyx_L5;
  }

  /* "cytimes/cydatetime.py":1634
 *         offset_r: cython.longlong = 0
 *     else:
 *         td = dt_utcoffset(dt_r)             # <<<<<<<<<<<<<<
 *         offset_r: cython.longlong = 0 if td is None else td_to_microseconds(td)
 *     # Return the difference
 */
  /*else*/ {
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt_utcoffset(__pyx_v_dt_r)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1634, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_td, ((PyDateTime_Delta *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":1635
 *     else:
 *         td = dt_utcoffset(dt_r)
 *         offset_r: cython.longlong = 0 if td is None else td_to_microseconds(td)             # <<<<<<<<<<<<<<
 *     # Return the difference
 *     return delta_us + offset_r - offset_l
 */
    __pyx_t_2 = (((PyObject *)__pyx_v_td) == Py_None);
    if (__pyx_t_2) {
      __pyx_t_3 = 0;
    } else {
      __pyx_t_3 = __pyx_f_7cytimes_10cydatetime_td_to_microseconds(__pyx_v_td);
    }
    __pyx_v_offset_r = __pyx_t_3;
  }
  __pyx_L5:;

  /* "cytimes/cydatetime.py":1637
 *         offset_r: cython.longlong = 0 if td is None else td_to_microseconds(td)
 *     # Return the difference
 *     return delta_us + offset_r - offset_l             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((__pyx_v_delta_us + __pyx_v_offset_r) - __pyx_v_offset_l);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1612
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_sub_dt_us(dt_l: datetime.datetime, dt_r: datetime.datetime) -> cython.longlong:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytimes.cydatetime.dt_sub_dt_us", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_tzinfo_l);
  __Pyx_XDECREF((PyObject *)__pyx_v_tzinfo_r);
  __Pyx_XDECREF((PyObject *)__pyx_v_td);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1641
 * 
 * # Datetime.datetime: manipulation ----------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_replace(
 */

static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_dt_replace(PyDateTime_DateTime *__pyx_v_dt, struct __pyx_opt_args_7cytimes_10cydatetime_dt_replace *__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)-1);
  int __pyx_v_minute = ((int)-1);
  int __pyx_v_second = ((int)-1);
  int __pyx_v_microsecond = ((int)-1);
  PyObject *__pyx_v_tzinfo = ((PyObject *)__pyx_int_neg_1);
  int __pyx_v_fold = ((int)-1);
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  unsigned int __pyx_t_3;
  int __pyx_t_4;
  unsigned int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_replace", 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_tzinfo = __pyx_optional_args->tzinfo;
                    if (__pyx_optional_args->__pyx_n > 8) {
                      __pyx_v_fold = __pyx_optional_args->fold;
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }

  /* "cytimes/cydatetime.py":1657
 *     """Replace `<'datetime.datetime'>`. Equivalent to `datetime.replcae()`.
 *     Value of `-1` indicates preserving the original value."""
 *     if not 1 <= year <= 9999:             # <<<<<<<<<<<<<<
 *         year = dt.year
 *     if not 1 <= month <= 12:
 */
  __pyx_t_1 = (1 <= __pyx_v_year);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_year <= 0x270F);
  }
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":1658
 *     Value of `-1` indicates preserving the original value."""
 *     if not 1 <= year <= 9999:
 *         year = dt.year             # <<<<<<<<<<<<<<
 *     if not 1 <= month <= 12:
 *         month = dt.month
 */
    __pyx_v_year = __pyx_f_7cpython_8datetime_8datetime_4year_year(__pyx_v_dt);

    /* "cytimes/cydatetime.py":1657
 *     """Replace `<'datetime.datetime'>`. Equivalent to `datetime.replcae()`.
 *     Value of `-1` indicates preserving the original value."""
 *     if not 1 <= year <= 9999:             # <<<<<<<<<<<<<<
 *         year = dt.year
 *     if not 1 <= month <= 12:
 */
  }

  /* "cytimes/cydatetime.py":1659
 *     if not 1 <= year <= 9999:
 *         year = dt.year
 *     if not 1 <= month <= 12:             # <<<<<<<<<<<<<<
 *         month = dt.month
 *     return datetime.datetime_new(
 */
  __pyx_t_2 = (1 <= __pyx_v_month);
  if (__pyx_t_2) {
    __pyx_t_2 = (__pyx_v_month <= 12);
  }
  __pyx_t_1 = (!__pyx_t_2);
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":1660
 *         year = dt.year
 *     if not 1 <= month <= 12:
 *         month = dt.month             # <<<<<<<<<<<<<<
 *     return datetime.datetime_new(
 *         year,
 */
    __pyx_v_month = __pyx_f_7cpython_8datetime_8datetime_5month_month(__pyx_v_dt);

    /* "cytimes/cydatetime.py":1659
 *     if not 1 <= year <= 9999:
 *         year = dt.year
 *     if not 1 <= month <= 12:             # <<<<<<<<<<<<<<
 *         month = dt.month
 *     return datetime.datetime_new(
 */
  }

  /* "cytimes/cydatetime.py":1661
 *     if not 1 <= month <= 12:
 *         month = dt.month
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         year,
 *         month,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":1664
 *         year,
 *         month,
 *         min(day if day > 0 else dt.day, days_in_month(year, month)),             # <<<<<<<<<<<<<<
 *         hour if 0 <= hour <= 23 else dt.hour,
 *         minute if 0 <= minute <= 59 else dt.minute,
 */
  __pyx_t_3 = __pyx_f_7cytimes_10cydatetime_days_in_month(__pyx_v_year, __pyx_v_month); if (unlikely(__pyx_t_3 == ((unsigned int)-1))) __PYX_ERR(1, 1664, __pyx_L1_error)
  __pyx_t_1 = (__pyx_v_day > 0);
  if (__pyx_t_1) {
    __pyx_t_4 = __pyx_v_day;
  } else {
    __pyx_t_4 = __pyx_f_7cpython_8datetime_8datetime_3day_day(__pyx_v_dt);
  }
  __pyx_t_1 = (__pyx_t_3 < __pyx_t_4);
  if (__pyx_t_1) {
    __pyx_t_5 = __pyx_t_3;
  } else {
    __pyx_t_5 = __pyx_t_4;
  }

  /* "cytimes/cydatetime.py":1665
 *         month,
 *         min(day if day > 0 else dt.day, days_in_month(year, month)),
 *         hour if 0 <= hour <= 23 else dt.hour,             # <<<<<<<<<<<<<<
 *         minute if 0 <= minute <= 59 else dt.minute,
 *         second if 0 <= second <= 59 else dt.second,
 */
  __pyx_t_1 = (0 <= __pyx_v_hour);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_hour <= 23);
  }
  if (__pyx_t_1) {
    __pyx_t_4 = __pyx_v_hour;
  } else {
    __pyx_t_4 = __pyx_f_7cpython_8datetime_8datetime_4hour_hour(__pyx_v_dt);
  }

  /* "cytimes/cydatetime.py":1666
 *         min(day if day > 0 else dt.day, days_in_month(year, month)),
 *         hour if 0 <= hour <= 23 else dt.hour,
 *         minute if 0 <= minute <= 59 else dt.minute,             # <<<<<<<<<<<<<<
 *         second if 0 <= second <= 59 else dt.second,
 *         microsecond if 0 <= microsecond <= 999999 else dt.microsecond,
 */
  __pyx_t_1 = (0 <= __pyx_v_minute);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_minute <= 59);
  }
  if (__pyx_t_1) {
    __pyx_t_6 = __pyx_v_minute;
  } else {
    __pyx_t_6 = __pyx_f_7cpython_8datetime_8datetime_6minute_minute(__pyx_v_dt);
  }

  /* "cytimes/cydatetime.py":1667
 *         hour if 0 <= hour <= 23 else dt.hour,
 *         minute if 0 <= minute <= 59 else dt.minute,
 *         second if 0 <= second <= 59 else dt.second,             # <<<<<<<<<<<<<<
 *         microsecond if 0 <= microsecond <= 999999 else dt.microsecond,
 *         tzinfo if (datetime.PyTZInfo_Check(tzinfo) or tzinfo is None) else dt.tzinfo,
 */
  __pyx_t_1 = (0 <= __pyx_v_second);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_second <= 59);
  }
  if (__pyx_t_1) {
    __pyx_t_7 = __pyx_v_second;
  } else {
    __pyx_t_7 = __pyx_f_7cpython_8datetime_8datetime_6second_second(__pyx_v_dt);
  }

  /* "cytimes/cydatetime.py":1668
 *         minute if 0 <= minute <= 59 else dt.minute,
 *         second if 0 <= second <= 59 else dt.second,
 *         microsecond if 0 <= microsecond <= 999999 else dt.microsecond,             # <<<<<<<<<<<<<<
 *         tzinfo if (datetime.PyTZInfo_Check(tzinfo) or tzinfo is None) else dt.tzinfo,
 *         0 if tzinfo is None else (fold if 0 <= fold <= 1 else dt.fold),
 */
  __pyx_t_1 = (0 <= __pyx_v_microsecond);
  if (__pyx_t_1) {
    __pyx_t_1 = (__pyx_v_microsecond <= 0xF423F);
  }
  if (__pyx_t_1) {
    __pyx_t_8 = __pyx_v_microsecond;
  } else {
    __pyx_t_8 = __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(__pyx_v_dt);
  }

  /* "cytimes/cydatetime.py":1669
 *         second if 0 <= second <= 59 else dt.second,
 *         microsecond if 0 <= microsecond <= 999999 else dt.microsecond,
 *         tzinfo if (datetime.PyTZInfo_Check(tzinfo) or tzinfo is None) else dt.tzinfo,             # <<<<<<<<<<<<<<
 *         0 if tzinfo is None else (fold if 0 <= fold <= 1 else dt.fold),
 *     )
 */
  __pyx_t_2 = PyTZInfo_Check(__pyx_v_tzinfo);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_tzinfo == Py_None);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {
    __Pyx_INCREF(__pyx_v_tzinfo);
    __pyx_t_9 = __pyx_v_tzinfo;
  } else {
    __pyx_t_10 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_9 = __pyx_t_10;
    __pyx_t_10 = 0;
  }

  /* "cytimes/cydatetime.py":1670
 *         microsecond if 0 <= microsecond <= 999999 else dt.microsecond,
 *         tzinfo if (datetime.PyTZInfo_Check(tzinfo) or tzinfo is None) else dt.tzinfo,
 *         0 if tzinfo is None else (fold if 0 <= fold <= 1 else dt.fold),             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = (__pyx_v_tzinfo == Py_None);
  if (__pyx_t_1) {
    __pyx_t_11 = 0;
  } else {
    __pyx_t_2 = (0 <= __pyx_v_fold);
    if (__pyx_t_2) {
      __pyx_t_2 = (__pyx_v_fold <= 1);
    }
    if (__pyx_t_2) {
      __pyx_t_12 = __pyx_v_fold;
    } else {
      __pyx_t_12 = __pyx_f_7cpython_8datetime_8datetime_4fold_fold(__pyx_v_dt);
    }
    __pyx_t_11 = __pyx_t_12;
  }

  /* "cytimes/cydatetime.py":1661
 *     if not 1 <= month <= 12:
 *         month = dt.month
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         year,
 *         month,
 */
  __pyx_t_13.__pyx_n = 1;
  __pyx_t_13.fold = __pyx_t_11;
  __pyx_t_10 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(__pyx_v_year, __pyx_v_month, __pyx_t_5, __pyx_t_4, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, &__pyx_t_13)); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_10);
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1641
 * 
 * # Datetime.datetime: manipulation ----------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_replace(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cytimes.cydatetime.dt_replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1674
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_replace_tzinfo(
 */

static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_dt_replace_tzinfo(PyDateTime_DateTime *__pyx_v_dt, PyDateTime_TZInfo *__pyx_v_tzinfo) {
  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_replace_tzinfo", 1);

  /* "cytimes/cydatetime.py":1683
 *     Equivalent to `datetime.replace(tzinfo=tzinfo)."""
 *     # fmt: off
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":1686
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 *         dt.microsecond, tzinfo, dt.fold,             # <<<<<<<<<<<<<<
 *     )
 *     # fmt: on
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.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), ((PyObject *)__pyx_v_tzinfo), &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1674
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_replace_tzinfo(
 */

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

/* "cytimes/cydatetime.py":1691
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_replace_fold(dt: datetime.datetime, fold: cython.uint) -> datetime.datetime:
 */

static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_dt_replace_fold(PyDateTime_DateTime *__pyx_v_dt, unsigned int __pyx_v_fold) {
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __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_replace_fold", 1);

  /* "cytimes/cydatetime.py":1697
 *     Equivalent to `datetime.replace(fold=fold)."""
 *     # fmt: off
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":1700
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 *         dt.microsecond, dt.tzinfo,             # <<<<<<<<<<<<<<
 *         1 if fold == 1 else 0,
 *     )
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cytimes/cydatetime.py":1701
 *         dt.hour, dt.minute, dt.second,
 *         dt.microsecond, dt.tzinfo,
 *         1 if fold == 1 else 0,             # <<<<<<<<<<<<<<
 *     )
 *     # fmt: on
 */
  __pyx_t_3 = (__pyx_v_fold == 1);
  if (__pyx_t_3) {
    __pyx_t_2 = 1;
  } else {
    __pyx_t_2 = 0;
  }

  /* "cytimes/cydatetime.py":1697
 *     Equivalent to `datetime.replace(fold=fold)."""
 *     # fmt: off
 *     return datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         dt.year, dt.month, dt.day,
 *         dt.hour, dt.minute, dt.second,
 */
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.fold = __pyx_t_2;
  __pyx_t_4 = ((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_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1691
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_replace_fold(dt: datetime.datetime, fold: cython.uint) -> datetime.datetime:
 */

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

/* "cytimes/cydatetime.py":1706
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_adj_weekday(dt: datetime.datetime, weekday: cython.uint) -> datetime.datetime:
 */

static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_dt_adj_weekday(PyDateTime_DateTime *__pyx_v_dt, unsigned int __pyx_v_weekday) {
  unsigned int __pyx_v_wday;
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  unsigned int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  struct __pyx_opt_args_7cytimes_10cydatetime_dt_add __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_adj_weekday", 1);

  /* "cytimes/cydatetime.py":1712
 *     the current week, where Monday is 0 and Sunday is 6.
 *     Equivalent to: `datetime + timedelta(days=weekday - dt.weekday())`."""
 *     weekday = weekday % 7             # <<<<<<<<<<<<<<
 *     wday: cython.uint = dt_weekday(dt)
 *     return dt if weekday == wday else dt_add(dt, days=weekday - wday)
 */
  __pyx_v_weekday = __Pyx_mod_long(__pyx_v_weekday, 7);

  /* "cytimes/cydatetime.py":1713
 *     Equivalent to: `datetime + timedelta(days=weekday - dt.weekday())`."""
 *     weekday = weekday % 7
 *     wday: cython.uint = dt_weekday(dt)             # <<<<<<<<<<<<<<
 *     return dt if weekday == wday else dt_add(dt, days=weekday - wday)
 * 
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_dt_weekday(__pyx_v_dt); if (unlikely(__pyx_t_1 == ((unsigned int)-1))) __PYX_ERR(1, 1713, __pyx_L1_error)
  __pyx_v_wday = __pyx_t_1;

  /* "cytimes/cydatetime.py":1714
 *     weekday = weekday % 7
 *     wday: cython.uint = dt_weekday(dt)
 *     return dt if weekday == wday else dt_add(dt, days=weekday - wday)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_3 = (__pyx_v_weekday == __pyx_v_wday);
  if (__pyx_t_3) {
    __Pyx_INCREF((PyObject *)__pyx_v_dt);
    __pyx_t_2 = ((PyObject *)__pyx_v_dt);
  } else {
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.days = (__pyx_v_weekday - __pyx_v_wday);
    __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt_add(__pyx_v_dt, &__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1714, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1706
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_adj_weekday(dt: datetime.datetime, weekday: cython.uint) -> datetime.datetime:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.cydatetime.dt_adj_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1717
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_astimezone(dt: datetime.datetime, tzinfo: datetime.tzinfo) -> datetime.datetime:
 */

static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_dt_astimezone(PyDateTime_DateTime *__pyx_v_dt, PyDateTime_TZInfo *__pyx_v_tzinfo) {
  PyDateTime_TZInfo *__pyx_v_b_tz = 0;
  PyDateTime_TZInfo *__pyx_v_t_tz = 0;
  PyDateTime_Delta *__pyx_v_b_offset = NULL;
  PY_LONG_LONG __pyx_v_t_delta;
  PY_LONG_LONG __pyx_v_b_delta;
  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_10cydatetime_gen_tzinfo_local __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_microseconds __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt_astimezone", 1);

  /* "cytimes/cydatetime.py":1723
 *     Equivalent to `datetime.astimezone(tzinfo)`.
 *     """
 *     b_tz: datetime.tzinfo = dt.tzinfo             # <<<<<<<<<<<<<<
 *     if tzinfo is None:
 *         t_tz: datetime.tzinfo = gen_tzinfo_local(None)
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1723, __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_tzinfo))))) __PYX_ERR(1, 1723, __pyx_L1_error)
  __pyx_v_b_tz = ((PyDateTime_TZInfo *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":1724
 *     """
 *     b_tz: datetime.tzinfo = dt.tzinfo
 *     if tzinfo is None:             # <<<<<<<<<<<<<<
 *         t_tz: datetime.tzinfo = gen_tzinfo_local(None)
 *         if b_tz is None:
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_tzinfo) == Py_None);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":1725
 *     b_tz: datetime.tzinfo = dt.tzinfo
 *     if tzinfo is None:
 *         t_tz: datetime.tzinfo = gen_tzinfo_local(None)             # <<<<<<<<<<<<<<
 *         if b_tz is None:
 *             return dt_replace_tzinfo(dt, t_tz)  # exit: replace tzinfo
 */
    __pyx_t_3.__pyx_n = 1;
    __pyx_t_3.dt = ((PyDateTime_DateTime *)Py_None);
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_gen_tzinfo_local(&__pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_t_tz = ((PyDateTime_TZInfo *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":1726
 *     if tzinfo is None:
 *         t_tz: datetime.tzinfo = gen_tzinfo_local(None)
 *         if b_tz is None:             # <<<<<<<<<<<<<<
 *             return dt_replace_tzinfo(dt, t_tz)  # exit: replace tzinfo
 *     else:
 */
    __pyx_t_2 = (((PyObject *)__pyx_v_b_tz) == Py_None);
    if (__pyx_t_2) {

      /* "cytimes/cydatetime.py":1727
 *         t_tz: datetime.tzinfo = gen_tzinfo_local(None)
 *         if b_tz is None:
 *             return dt_replace_tzinfo(dt, t_tz)  # exit: replace tzinfo             # <<<<<<<<<<<<<<
 *     else:
 *         t_tz: datetime.tzinfo = tzinfo
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt_replace_tzinfo(__pyx_v_dt, __pyx_v_t_tz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1727, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1);
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":1726
 *     if tzinfo is None:
 *         t_tz: datetime.tzinfo = gen_tzinfo_local(None)
 *         if b_tz is None:             # <<<<<<<<<<<<<<
 *             return dt_replace_tzinfo(dt, t_tz)  # exit: replace tzinfo
 *     else:
 */
    }

    /* "cytimes/cydatetime.py":1724
 *     """
 *     b_tz: datetime.tzinfo = dt.tzinfo
 *     if tzinfo is None:             # <<<<<<<<<<<<<<
 *         t_tz: datetime.tzinfo = gen_tzinfo_local(None)
 *         if b_tz is None:
 */
    goto __pyx_L3;
  }

  /* "cytimes/cydatetime.py":1729
 *             return dt_replace_tzinfo(dt, t_tz)  # exit: replace tzinfo
 *     else:
 *         t_tz: datetime.tzinfo = tzinfo             # <<<<<<<<<<<<<<
 * 
 *     if b_tz is None:
 */
  /*else*/ {
    __Pyx_INCREF((PyObject *)__pyx_v_tzinfo);
    __pyx_v_t_tz = __pyx_v_tzinfo;
  }
  __pyx_L3:;

  /* "cytimes/cydatetime.py":1731
 *         t_tz: datetime.tzinfo = tzinfo
 * 
 *     if b_tz is None:             # <<<<<<<<<<<<<<
 *         b_tz = gen_tzinfo_local(dt)
 *         b_offset = tzinfo_utcoffset(b_tz, dt)
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_b_tz) == Py_None);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":1732
 * 
 *     if b_tz is None:
 *         b_tz = gen_tzinfo_local(dt)             # <<<<<<<<<<<<<<
 *         b_offset = tzinfo_utcoffset(b_tz, dt)
 *     else:
 */
    __pyx_t_3.__pyx_n = 1;
    __pyx_t_3.dt = __pyx_v_dt;
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_gen_tzinfo_local(&__pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1732, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_b_tz, ((PyDateTime_TZInfo *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":1733
 *     if b_tz is None:
 *         b_tz = gen_tzinfo_local(dt)
 *         b_offset = tzinfo_utcoffset(b_tz, dt)             # <<<<<<<<<<<<<<
 *     else:
 *         b_offset = tzinfo_utcoffset(b_tz, dt)
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_tzinfo_utcoffset(((PyObject *)__pyx_v_b_tz), __pyx_v_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1733, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_b_offset = ((PyDateTime_Delta *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":1731
 *         t_tz: datetime.tzinfo = tzinfo
 * 
 *     if b_tz is None:             # <<<<<<<<<<<<<<
 *         b_tz = gen_tzinfo_local(dt)
 *         b_offset = tzinfo_utcoffset(b_tz, dt)
 */
    goto __pyx_L5;
  }

  /* "cytimes/cydatetime.py":1735
 *         b_offset = tzinfo_utcoffset(b_tz, dt)
 *     else:
 *         b_offset = tzinfo_utcoffset(b_tz, dt)             # <<<<<<<<<<<<<<
 *         if b_offset is None:
 *             b_tz = gen_tzinfo_local(dt_replace_tzinfo(dt, None))
 */
  /*else*/ {
    __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_tzinfo_utcoffset(((PyObject *)__pyx_v_b_tz), __pyx_v_dt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1735, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_b_offset = ((PyDateTime_Delta *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":1736
 *     else:
 *         b_offset = tzinfo_utcoffset(b_tz, dt)
 *         if b_offset is None:             # <<<<<<<<<<<<<<
 *             b_tz = gen_tzinfo_local(dt_replace_tzinfo(dt, None))
 *             b_offset = tzinfo_utcoffset(b_tz, dt)
 */
    __pyx_t_2 = (((PyObject *)__pyx_v_b_offset) == Py_None);
    if (__pyx_t_2) {

      /* "cytimes/cydatetime.py":1737
 *         b_offset = tzinfo_utcoffset(b_tz, dt)
 *         if b_offset is None:
 *             b_tz = gen_tzinfo_local(dt_replace_tzinfo(dt, None))             # <<<<<<<<<<<<<<
 *             b_offset = tzinfo_utcoffset(b_tz, dt)
 * 
 */
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt_replace_tzinfo(__pyx_v_dt, ((PyDateTime_TZInfo *)Py_None))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1737, __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_4 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_gen_tzinfo_local(&__pyx_t_3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1737, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF_SET(__pyx_v_b_tz, ((PyDateTime_TZInfo *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/cydatetime.py":1738
 *         if b_offset is None:
 *             b_tz = gen_tzinfo_local(dt_replace_tzinfo(dt, None))
 *             b_offset = tzinfo_utcoffset(b_tz, dt)             # <<<<<<<<<<<<<<
 * 
 *     if t_tz is b_tz:
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_tzinfo_utcoffset(((PyObject *)__pyx_v_b_tz), __pyx_v_dt)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1738, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_b_offset, ((PyDateTime_Delta *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "cytimes/cydatetime.py":1736
 *     else:
 *         b_offset = tzinfo_utcoffset(b_tz, dt)
 *         if b_offset is None:             # <<<<<<<<<<<<<<
 *             b_tz = gen_tzinfo_local(dt_replace_tzinfo(dt, None))
 *             b_offset = tzinfo_utcoffset(b_tz, dt)
 */
    }
  }
  __pyx_L5:;

  /* "cytimes/cydatetime.py":1740
 *             b_offset = tzinfo_utcoffset(b_tz, dt)
 * 
 *     if t_tz is b_tz:             # <<<<<<<<<<<<<<
 *         return dt
 * 
 */
  __pyx_t_2 = (__pyx_v_t_tz == __pyx_v_b_tz);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":1741
 * 
 *     if t_tz is b_tz:
 *         return dt             # <<<<<<<<<<<<<<
 * 
 *     # Calculate delta in microseconds
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_dt);
    __pyx_r = __pyx_v_dt;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":1740
 *             b_offset = tzinfo_utcoffset(b_tz, dt)
 * 
 *     if t_tz is b_tz:             # <<<<<<<<<<<<<<
 *         return dt
 * 
 */
  }

  /* "cytimes/cydatetime.py":1744
 * 
 *     # Calculate delta in microseconds
 *     t_delta: cython.longlong = td_to_microseconds(tzinfo_utcoffset(t_tz, dt))             # <<<<<<<<<<<<<<
 *     b_delta: cython.longlong = td_to_microseconds(b_offset)
 * 
 */
  __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_tzinfo_utcoffset(((PyObject *)__pyx_v_t_tz), __pyx_v_dt)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_t_delta = __pyx_f_7cytimes_10cydatetime_td_to_microseconds(((PyDateTime_Delta *)__pyx_t_4));
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/cydatetime.py":1745
 *     # Calculate delta in microseconds
 *     t_delta: cython.longlong = td_to_microseconds(tzinfo_utcoffset(t_tz, dt))
 *     b_delta: cython.longlong = td_to_microseconds(b_offset)             # <<<<<<<<<<<<<<
 * 
 *     # Generate new datetime
 */
  __pyx_v_b_delta = __pyx_f_7cytimes_10cydatetime_td_to_microseconds(__pyx_v_b_offset);

  /* "cytimes/cydatetime.py":1748
 * 
 *     # Generate new datetime
 *     us: cython.longlong = dt_to_microseconds(dt)             # <<<<<<<<<<<<<<
 *     return dt_fr_microseconds(us + t_delta - b_delta, t_tz, 0)
 * 
 */
  __pyx_v_us = __pyx_f_7cytimes_10cydatetime_dt_to_microseconds(__pyx_v_dt);

  /* "cytimes/cydatetime.py":1749
 *     # Generate new datetime
 *     us: cython.longlong = dt_to_microseconds(dt)
 *     return dt_fr_microseconds(us + t_delta - b_delta, t_tz, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_5.__pyx_n = 2;
  __pyx_t_5.tzinfo = __pyx_v_t_tz;
  __pyx_t_5.fold = 0;
  __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt_fr_microseconds(((__pyx_v_us + __pyx_v_t_delta) - __pyx_v_b_delta), &__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1717
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt_astimezone(dt: datetime.datetime, tzinfo: datetime.tzinfo) -> datetime.datetime:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.cydatetime.dt_astimezone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_b_tz);
  __Pyx_XDECREF((PyObject *)__pyx_v_t_tz);
  __Pyx_XDECREF((PyObject *)__pyx_v_b_offset);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1754
 * # Datetime.time ========================================================================================
 * # Datetime.time: generate ------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_time(
 */

static PyDateTime_Time *__pyx_f_7cytimes_10cydatetime_gen_time(struct __pyx_opt_args_7cytimes_10cydatetime_gen_time *__pyx_optional_args) {
  unsigned int __pyx_v_hour = ((unsigned int)0);
  unsigned int __pyx_v_minute = ((unsigned int)0);
  unsigned int __pyx_v_second = ((unsigned int)0);
  unsigned int __pyx_v_microsecond = ((unsigned int)0);

  /* "cytimes/cydatetime.py":1761
 *     second: cython.uint = 0,
 *     microsecond: cython.uint = 0,
 *     tzinfo: datetime.tzinfo = None,             # <<<<<<<<<<<<<<
 *     fold: cython.uint = 0,
 * ) -> datetime.time:
 */
  PyDateTime_TZInfo *__pyx_v_tzinfo = ((PyDateTime_TZInfo *)Py_None);
  unsigned int __pyx_v_fold = ((unsigned int)0);
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_time_new __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("gen_time", 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_tzinfo = __pyx_optional_args->tzinfo;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_fold = __pyx_optional_args->fold;
              }
            }
          }
        }
      }
    }
  }

  /* "cytimes/cydatetime.py":1766
 *     """Generate a new `<'datetime.time'>`."""
 *     # fmt: off
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         hour, minute, second, microsecond,
 *         tzinfo, 1 if fold == 1 and tzinfo is not None else 0
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":1768
 *     return datetime.time_new(
 *         hour, minute, second, microsecond,
 *         tzinfo, 1 if fold == 1 and tzinfo is not None else 0             # <<<<<<<<<<<<<<
 *     )
 *     # fmt: on
 */
  __pyx_t_3 = (__pyx_v_fold == 1);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = (((PyObject *)__pyx_v_tzinfo) != Py_None);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L3_bool_binop_done:;
  if (__pyx_t_2) {
    __pyx_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }

  /* "cytimes/cydatetime.py":1766
 *     """Generate a new `<'datetime.time'>`."""
 *     # fmt: off
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         hour, minute, second, microsecond,
 *         tzinfo, 1 if fold == 1 and tzinfo is not None else 0
 */
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.fold = __pyx_t_1;
  __pyx_t_4 = ((PyObject *)__pyx_f_7cpython_8datetime_time_new(__pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, ((PyObject *)__pyx_v_tzinfo), &__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = ((PyDateTime_Time *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1754
 * # Datetime.time ========================================================================================
 * # Datetime.time: generate ------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_time(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.cydatetime.gen_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1773
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_time_now() -> datetime.time:
 */

static PyDateTime_Time *__pyx_f_7cytimes_10cydatetime_gen_time_now(void) {
  int __pyx_v_microseconds;
  struct tm __pyx_v_tms;
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct tm __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("gen_time_now", 1);

  /* "cytimes/cydatetime.py":1778
 *     """Generate the current local `<'datetime.time'>`.
 *     Equivalent to `datetime.datetime.now().time()`."""
 *     microseconds: cython.int = int(unix_time() % 1 * 1_000_000)             # <<<<<<<<<<<<<<
 *     tms = localtime()
 *     return datetime.time_new(tms.tm_hour, tms.tm_min, tms.tm_sec, microseconds, None, 0)
 */
  __pyx_v_microseconds = ((int)(__Pyx_mod_double(__pyx_f_7cpython_4time_time(), 1.0) * 1000000.0));

  /* "cytimes/cydatetime.py":1779
 *     Equivalent to `datetime.datetime.now().time()`."""
 *     microseconds: cython.int = int(unix_time() % 1 * 1_000_000)
 *     tms = localtime()             # <<<<<<<<<<<<<<
 *     return datetime.time_new(tms.tm_hour, tms.tm_min, tms.tm_sec, microseconds, None, 0)
 * 
 */
  __pyx_t_1 = __pyx_f_7cpython_4time_localtime(); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1779, __pyx_L1_error)
  __pyx_v_tms = __pyx_t_1;

  /* "cytimes/cydatetime.py":1780
 *     microseconds: cython.int = int(unix_time() % 1 * 1_000_000)
 *     tms = localtime()
 *     return datetime.time_new(tms.tm_hour, tms.tm_min, tms.tm_sec, microseconds, None, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.fold = 0;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cpython_8datetime_time_new(__pyx_v_tms.tm_hour, __pyx_v_tms.tm_min, __pyx_v_tms.tm_sec, __pyx_v_microseconds, Py_None, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_Time *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1773
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_time_now() -> datetime.time:
 */

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

/* "cytimes/cydatetime.py":1783
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_time_now_utc() -> datetime.time:
 */

static PyDateTime_Time *__pyx_f_7cytimes_10cydatetime_gen_time_now_utc(void) {
  PyDateTime_Time *__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("gen_time_now_utc", 1);

  /* "cytimes/cydatetime.py":1788
 *     """Generate the current `<'datetime.time'>` under UTC.
 *     Equivalent to `datetime.datetime.now(UTC).time()`."""
 *     return time_fr_dt(gen_dt_now_utc())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_gen_dt_now_utc()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_time_fr_dt(((PyDateTime_DateTime *)__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1788, __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;

  /* "cytimes/cydatetime.py":1783
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_time_now_utc() -> datetime.time:
 */

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

/* "cytimes/cydatetime.py":1791
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_time_now_tz(tzinfo: datetime.tzinfo) -> datetime.time:
 */

static PyDateTime_Time *__pyx_f_7cytimes_10cydatetime_gen_time_now_tz(PyDateTime_TZInfo *__pyx_v_tzinfo) {
  PyDateTime_Time *__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("gen_time_now_tz", 1);

  /* "cytimes/cydatetime.py":1796
 *     """Generate the current `<'datetime.time'>` under specific timezone.
 *     Equivalent to `datetime.datetime.now(tzinfo).time()`."""
 *     return time_fr_dt(gen_dt_now_tz(tzinfo))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_gen_dt_now_tz(__pyx_v_tzinfo)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1796, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_time_fr_dt(((PyDateTime_DateTime *)__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1796, __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;

  /* "cytimes/cydatetime.py":1791
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_time_now_tz(tzinfo: datetime.tzinfo) -> datetime.time:
 */

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

/* "cytimes/cydatetime.py":1800
 * 
 * # Datetime.time: check types ---------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static int __pyx_f_7cytimes_10cydatetime_is_time(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "cytimes/cydatetime.py":1806
 *     """Check if an object is type of datetime.time `<'bool'>`.
 *     Equivalent to `isinstance(obj, datetime.time)`."""
 *     return datetime.PyTime_Check(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyTime_Check(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1800
 * 
 * # Datetime.time: check types ---------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

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

/* "cytimes/cydatetime.py":1809
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static int __pyx_f_7cytimes_10cydatetime_is_time_exact(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "cytimes/cydatetime.py":1815
 *     """Check if an object is the exact type of datetime.time `<'bool'>`.
 *     Equivalent to `type(obj) is datetime.time`."""
 *     return datetime.PyTime_CheckExact(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyTime_CheckExact(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1809
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

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

/* "cytimes/cydatetime.py":1819
 * 
 * # Datetime.time: tzinfo --------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def time_tzname(time: datetime.time) -> str:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_time_tzname(PyDateTime_Time *__pyx_v_time) {
  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_tzname", 1);

  /* "cytimes/cydatetime.py":1824
 *     """Access the 'tzname' `<'str'>`.
 *     Equivalent to `time.tzname()`."""
 *     return tzinfo_name(time.tzinfo, None)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(__pyx_v_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_tzinfo_name(__pyx_t_1, ((PyDateTime_DateTime *)Py_None)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1824, __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;

  /* "cytimes/cydatetime.py":1819
 * 
 * # Datetime.time: tzinfo --------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def time_tzname(time: datetime.time) -> str:
 */

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

/* "cytimes/cydatetime.py":1827
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def time_dst(time: datetime.time) -> datetime.timedelta:
 */

static PyDateTime_Delta *__pyx_f_7cytimes_10cydatetime_time_dst(PyDateTime_Time *__pyx_v_time) {
  PyDateTime_Delta *__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_dst", 1);

  /* "cytimes/cydatetime.py":1832
 *     """Access the 'dst' `<'datetime.timedelta'>`.
 *     Equivalent to `time.dst()`."""
 *     return tzinfo_dst(time.tzinfo, None)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __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(1, 1832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_tzinfo_dst(__pyx_t_1, ((PyDateTime_DateTime *)Py_None))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1832, __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;

  /* "cytimes/cydatetime.py":1827
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def time_dst(time: datetime.time) -> datetime.timedelta:
 */

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

/* "cytimes/cydatetime.py":1835
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def time_utcoffset(time: datetime.time) -> datetime.timedelta:
 */

static PyDateTime_Delta *__pyx_f_7cytimes_10cydatetime_time_utcoffset(PyDateTime_Time *__pyx_v_time) {
  PyDateTime_Delta *__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_utcoffset", 1);

  /* "cytimes/cydatetime.py":1840
 *     """Access the 'utcoffset' `<'datetime.timedelta'>`.
 *     Equivalent to `time.utcoffset()`."""
 *     return tzinfo_utcoffset(time.tzinfo, None)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __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(1, 1840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_tzinfo_utcoffset(__pyx_t_1, ((PyDateTime_DateTime *)Py_None))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1840, __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;

  /* "cytimes/cydatetime.py":1835
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def time_utcoffset(time: datetime.time) -> datetime.timedelta:
 */

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

/* "cytimes/cydatetime.py":1844
 * 
 * # Datetime.time: conversion ----------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def time_to_isoformat(time: datetime.time) -> str:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_time_to_isoformat(PyDateTime_Time *__pyx_v_time) {
  int __pyx_v_microsecond;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_to_isoformat", 1);

  /* "cytimes/cydatetime.py":1848
 * def time_to_isoformat(time: datetime.time) -> str:
 *     """Convert time to ISO format: '%H:%M:%S.f' `<'str'>`."""
 *     microsecond: cython.int = time.microsecond             # <<<<<<<<<<<<<<
 *     if microsecond == 0:
 *         return "%02d:%02d:%02d" % (time.hour, time.minute, time.second)
 */
  __pyx_v_microsecond = __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(__pyx_v_time);

  /* "cytimes/cydatetime.py":1849
 *     """Convert time to ISO format: '%H:%M:%S.f' `<'str'>`."""
 *     microsecond: cython.int = time.microsecond
 *     if microsecond == 0:             # <<<<<<<<<<<<<<
 *         return "%02d:%02d:%02d" % (time.hour, time.minute, time.second)
 *     return "%02d:%02d:%02d.%06d" % (time.hour, time.minute, time.second, microsecond)
 */
  __pyx_t_1 = (__pyx_v_microsecond == 0);
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":1850
 *     microsecond: cython.int = time.microsecond
 *     if microsecond == 0:
 *         return "%02d:%02d:%02d" % (time.hour, time.minute, time.second)             # <<<<<<<<<<<<<<
 *     return "%02d:%02d:%02d.%06d" % (time.hour, time.minute, time.second, microsecond)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1850, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_4 = 127;
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_4hour_hour(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1850, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u__5);
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_6minute_minute(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1850, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_kp_u__5);
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_6second_second(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1850, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1850, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":1849
 *     """Convert time to ISO format: '%H:%M:%S.f' `<'str'>`."""
 *     microsecond: cython.int = time.microsecond
 *     if microsecond == 0:             # <<<<<<<<<<<<<<
 *         return "%02d:%02d:%02d" % (time.hour, time.minute, time.second)
 *     return "%02d:%02d:%02d.%06d" % (time.hour, time.minute, time.second, microsecond)
 */
  }

  /* "cytimes/cydatetime.py":1851
 *     if microsecond == 0:
 *         return "%02d:%02d:%02d" % (time.hour, time.minute, time.second)
 *     return "%02d:%02d:%02d.%06d" % (time.hour, time.minute, time.second, microsecond)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyTuple_New(7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = 0;
  __pyx_t_4 = 127;
  __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_4hour_hour(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u__5);
  __pyx_t_3 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__5);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_u__5);
  __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_6minute_minute(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u__5);
  __pyx_t_3 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__5);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_kp_u__5);
  __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_f_7cpython_8datetime_4time_6second_second(__pyx_v_time), 2, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u__6);
  __pyx_t_3 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__6);
  PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_kp_u__6);
  __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_microsecond, 6, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_5, 7, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1844
 * 
 * # Datetime.time: conversion ----------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def time_to_isoformat(time: datetime.time) -> str:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.cydatetime.time_to_isoformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1854
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def time_to_strformat(time: datetime.time, format: str) -> str:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_time_to_strformat(PyDateTime_Time *__pyx_v_time, PyObject *__pyx_v_format) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_to_strformat", 1);

  /* "cytimes/cydatetime.py":1860
 *     Equivalent to `time.strftime(format)`."""
 *     # fmt: off
 *     return dt_to_strformat(datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         1900, 1, 1, time.hour, time.minute, time.second, time.microsecond, None, 0), format
 *     )
 */
  __Pyx_XDECREF(__pyx_r);

  /* "cytimes/cydatetime.py":1861
 *     # fmt: off
 *     return dt_to_strformat(datetime.datetime_new(
 *         1900, 1, 1, time.hour, time.minute, time.second, time.microsecond, None, 0), format             # <<<<<<<<<<<<<<
 *     )
 *     # fmt: on
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fold = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(0x76C, 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), Py_None, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cytimes/cydatetime.py":1860
 *     Equivalent to `time.strftime(format)`."""
 *     # fmt: off
 *     return dt_to_strformat(datetime.datetime_new(             # <<<<<<<<<<<<<<
 *         1900, 1, 1, time.hour, time.minute, time.second, time.microsecond, None, 0), format
 *     )
 */
  __pyx_t_3 = __pyx_f_7cytimes_10cydatetime_dt_to_strformat(((PyDateTime_DateTime *)__pyx_t_1), __pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1860, __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;

  /* "cytimes/cydatetime.py":1854
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def time_to_strformat(time: datetime.time, format: str) -> str:
 */

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

/* "cytimes/cydatetime.py":1866
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

static double __pyx_f_7cytimes_10cydatetime_time_to_seconds(PyDateTime_Time *__pyx_v_time) {
  double __pyx_v_microseconds;
  double __pyx_r;

  /* "cytimes/cydatetime.py":1871
 * def time_to_seconds(time: datetime.time) -> cython.double:
 *     """Convert datetime.time to total seconds `<'float'>`."""
 *     microseconds: cython.double = time_to_microseconds(time)             # <<<<<<<<<<<<<<
 *     return microseconds / 1_000_000
 * 
 */
  __pyx_v_microseconds = __pyx_f_7cytimes_10cydatetime_time_to_microseconds(__pyx_v_time);

  /* "cytimes/cydatetime.py":1872
 *     """Convert datetime.time to total seconds `<'float'>`."""
 *     microseconds: cython.double = time_to_microseconds(time)
 *     return microseconds / 1_000_000             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_microseconds / 1000000.0);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1866
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

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

/* "cytimes/cydatetime.py":1875
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_time_to_microseconds(PyDateTime_Time *__pyx_v_time) {
  PY_LONG_LONG __pyx_v_hour;
  PY_LONG_LONG __pyx_v_minute;
  PY_LONG_LONG __pyx_v_second;
  PY_LONG_LONG __pyx_v_microsecond;
  PY_LONG_LONG __pyx_r;

  /* "cytimes/cydatetime.py":1880
 * def time_to_microseconds(time: datetime.time) -> cython.longlong:
 *     """Convert datetime.time to total microseconds `<'int'>`."""
 *     hour: cython.longlong = time.hour             # <<<<<<<<<<<<<<
 *     minute: cython.longlong = time.minute
 *     second: cython.longlong = time.second
 */
  __pyx_v_hour = __pyx_f_7cpython_8datetime_4time_4hour_hour(__pyx_v_time);

  /* "cytimes/cydatetime.py":1881
 *     """Convert datetime.time to total microseconds `<'int'>`."""
 *     hour: cython.longlong = time.hour
 *     minute: cython.longlong = time.minute             # <<<<<<<<<<<<<<
 *     second: cython.longlong = time.second
 *     microsecond: cython.longlong = time.microsecond
 */
  __pyx_v_minute = __pyx_f_7cpython_8datetime_4time_6minute_minute(__pyx_v_time);

  /* "cytimes/cydatetime.py":1882
 *     hour: cython.longlong = time.hour
 *     minute: cython.longlong = time.minute
 *     second: cython.longlong = time.second             # <<<<<<<<<<<<<<
 *     microsecond: cython.longlong = time.microsecond
 *     return hour * US_HOUR + minute * 60_000_000 + second * 1_000_000 + microsecond
 */
  __pyx_v_second = __pyx_f_7cpython_8datetime_4time_6second_second(__pyx_v_time);

  /* "cytimes/cydatetime.py":1883
 *     minute: cython.longlong = time.minute
 *     second: cython.longlong = time.second
 *     microsecond: cython.longlong = time.microsecond             # <<<<<<<<<<<<<<
 *     return hour * US_HOUR + minute * 60_000_000 + second * 1_000_000 + microsecond
 * 
 */
  __pyx_v_microsecond = __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(__pyx_v_time);

  /* "cytimes/cydatetime.py":1884
 *     second: cython.longlong = time.second
 *     microsecond: cython.longlong = time.microsecond
 *     return hour * US_HOUR + minute * 60_000_000 + second * 1_000_000 + microsecond             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((((__pyx_v_hour * __pyx_v_7cytimes_10cydatetime_US_HOUR) + (__pyx_v_minute * 0x3938700)) + (__pyx_v_second * 0xF4240)) + __pyx_v_microsecond);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1875
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

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

/* "cytimes/cydatetime.py":1887
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def time_fr_dt(dt: datetime.datetime) -> datetime.time:
 */

static PyDateTime_Time *__pyx_f_7cytimes_10cydatetime_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);

  /* "cytimes/cydatetime.py":1892
 *     """Convert datetime.datetime to `<'datetime.time'>`."""
 *     # fmt: off
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         dt.hour, dt.minute, dt.second,
 *         dt.microsecond, dt.tzinfo, dt.fold,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":1894
 *     return datetime.time_new(
 *         dt.hour, dt.minute, dt.second,
 *         dt.microsecond, dt.tzinfo, dt.fold,             # <<<<<<<<<<<<<<
 *     )
 *     # fmt: on
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cytimes/cydatetime.py":1892
 *     """Convert datetime.datetime to `<'datetime.time'>`."""
 *     # fmt: off
 *     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(1, 1892, __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;

  /* "cytimes/cydatetime.py":1887
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def time_fr_dt(dt: datetime.datetime) -> datetime.time:
 */

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

/* "cytimes/cydatetime.py":1899
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def time_fr_seconds(
 */

static PyDateTime_Time *__pyx_f_7cytimes_10cydatetime_time_fr_seconds(double __pyx_v_seconds, struct __pyx_opt_args_7cytimes_10cydatetime_time_fr_seconds *__pyx_optional_args) {

  /* "cytimes/cydatetime.py":1903
 * def time_fr_seconds(
 *     seconds: cython.double,
 *     tzinfo: datetime.tzinfo = None,             # <<<<<<<<<<<<<<
 *     fold: cython.uint = 0,
 * ) -> datetime.time:
 */
  PyDateTime_TZInfo *__pyx_v_tzinfo = ((PyDateTime_TZInfo *)Py_None);
  unsigned int __pyx_v_fold = ((unsigned int)0);
  PY_LONG_LONG __pyx_v_mciroseconds;
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytimes_10cydatetime_time_fr_microseconds __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_tzinfo = __pyx_optional_args->tzinfo;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_fold = __pyx_optional_args->fold;
      }
    }
  }

  /* "cytimes/cydatetime.py":1907
 * ) -> datetime.time:
 *     """Convert total seconds to `<'datetime.time'>`."""
 *     mciroseconds: cython.longlong = int(seconds * 1_000_000)             # <<<<<<<<<<<<<<
 *     return time_fr_microseconds(mciroseconds, tzinfo, fold)
 * 
 */
  __pyx_v_mciroseconds = ((PY_LONG_LONG)(__pyx_v_seconds * 1000000.0));

  /* "cytimes/cydatetime.py":1908
 *     """Convert total seconds to `<'datetime.time'>`."""
 *     mciroseconds: cython.longlong = int(seconds * 1_000_000)
 *     return time_fr_microseconds(mciroseconds, tzinfo, fold)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.tzinfo = __pyx_v_tzinfo;
  __pyx_t_2.fold = __pyx_v_fold;
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_time_fr_microseconds(__pyx_v_mciroseconds, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Time *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1899
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def time_fr_seconds(
 */

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

/* "cytimes/cydatetime.py":1911
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def time_fr_microseconds(
 */

static PyDateTime_Time *__pyx_f_7cytimes_10cydatetime_time_fr_microseconds(PY_LONG_LONG __pyx_v_microseconds, struct __pyx_opt_args_7cytimes_10cydatetime_time_fr_microseconds *__pyx_optional_args) {

  /* "cytimes/cydatetime.py":1915
 * def time_fr_microseconds(
 *     microseconds: cython.longlong,
 *     tzinfo: datetime.tzinfo = None,             # <<<<<<<<<<<<<<
 *     fold: cython.uint = 0,
 * ) -> datetime.time:
 */
  PyDateTime_TZInfo *__pyx_v_tzinfo = ((PyDateTime_TZInfo *)Py_None);
  unsigned int __pyx_v_fold = ((unsigned int)0);
  __pyx_t_7cytimes_10cydatetime_hms __pyx_v_hms;
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PY_LONG_LONG __pyx_t_2;
  long __pyx_t_3;
  PY_LONG_LONG __pyx_t_4;
  PY_LONG_LONG __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_time_new __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_fr_microseconds", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tzinfo = __pyx_optional_args->tzinfo;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_fold = __pyx_optional_args->fold;
      }
    }
  }

  /* "cytimes/cydatetime.py":1920
 *     """Convert total microseconds to `<'datetime.time'>`."""
 *     # Add back epoch microseconds
 *     if microseconds < 0:             # <<<<<<<<<<<<<<
 *         microseconds += EPOCH_US
 *     microseconds = min(max(microseconds, 0), DT_MAX_US)
 */
  __pyx_t_1 = (__pyx_v_microseconds < 0);
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":1921
 *     # Add back epoch microseconds
 *     if microseconds < 0:
 *         microseconds += EPOCH_US             # <<<<<<<<<<<<<<
 *     microseconds = min(max(microseconds, 0), DT_MAX_US)
 *     # Calculate hms
 */
    __pyx_v_microseconds = (__pyx_v_microseconds + __pyx_v_7cytimes_10cydatetime_EPOCH_US);

    /* "cytimes/cydatetime.py":1920
 *     """Convert total microseconds to `<'datetime.time'>`."""
 *     # Add back epoch microseconds
 *     if microseconds < 0:             # <<<<<<<<<<<<<<
 *         microseconds += EPOCH_US
 *     microseconds = min(max(microseconds, 0), DT_MAX_US)
 */
  }

  /* "cytimes/cydatetime.py":1922
 *     if microseconds < 0:
 *         microseconds += EPOCH_US
 *     microseconds = min(max(microseconds, 0), DT_MAX_US)             # <<<<<<<<<<<<<<
 *     # Calculate hms
 *     hms = microseconds_to_hms(microseconds)
 */
  __pyx_t_2 = __pyx_v_7cytimes_10cydatetime_DT_MAX_US;
  __pyx_t_3 = 0;
  __pyx_t_4 = __pyx_v_microseconds;
  __pyx_t_1 = (__pyx_t_3 > __pyx_t_4);
  if (__pyx_t_1) {
    __pyx_t_5 = __pyx_t_3;
  } else {
    __pyx_t_5 = __pyx_t_4;
  }
  __pyx_t_4 = __pyx_t_5;
  __pyx_t_1 = (__pyx_t_2 < __pyx_t_4);
  if (__pyx_t_1) {
    __pyx_t_5 = __pyx_t_2;
  } else {
    __pyx_t_5 = __pyx_t_4;
  }
  __pyx_v_microseconds = __pyx_t_5;

  /* "cytimes/cydatetime.py":1924
 *     microseconds = min(max(microseconds, 0), DT_MAX_US)
 *     # Calculate hms
 *     hms = microseconds_to_hms(microseconds)             # <<<<<<<<<<<<<<
 *     # Generate time
 *     # fmt: off
 */
  __pyx_v_hms = __pyx_f_7cytimes_10cydatetime_microseconds_to_hms(__pyx_v_microseconds);

  /* "cytimes/cydatetime.py":1927
 *     # Generate time
 *     # fmt: off
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         hms.hour, hms.minute, hms.second, hms.microsecond,
 *         tzinfo, 1 if fold == 1 and tzinfo is not None else 0,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":1929
 *     return datetime.time_new(
 *         hms.hour, hms.minute, hms.second, hms.microsecond,
 *         tzinfo, 1 if fold == 1 and tzinfo is not None else 0,             # <<<<<<<<<<<<<<
 *     )
 *     # fmt: on
 */
  __pyx_t_7 = (__pyx_v_fold == 1);
  if (__pyx_t_7) {
  } else {
    __pyx_t_1 = __pyx_t_7;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_7 = (((PyObject *)__pyx_v_tzinfo) != Py_None);
  __pyx_t_1 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {
    __pyx_t_6 = 1;
  } else {
    __pyx_t_6 = 0;
  }

  /* "cytimes/cydatetime.py":1927
 *     # Generate time
 *     # fmt: off
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         hms.hour, hms.minute, hms.second, hms.microsecond,
 *         tzinfo, 1 if fold == 1 and tzinfo is not None else 0,
 */
  __pyx_t_9.__pyx_n = 1;
  __pyx_t_9.fold = __pyx_t_6;
  __pyx_t_8 = ((PyObject *)__pyx_f_7cpython_8datetime_time_new(__pyx_v_hms.hour, __pyx_v_hms.minute, __pyx_v_hms.second, __pyx_v_hms.microsecond, ((PyObject *)__pyx_v_tzinfo), &__pyx_t_9)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_r = ((PyDateTime_Time *)__pyx_t_8);
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1911
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def time_fr_microseconds(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cytimes.cydatetime.time_fr_microseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1935
 * 
 * # Datetime.time: manipulation --------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def time_replace(
 */

static PyDateTime_Time *__pyx_f_7cytimes_10cydatetime_time_replace(PyDateTime_Time *__pyx_v_time, struct __pyx_opt_args_7cytimes_10cydatetime_time_replace *__pyx_optional_args) {
  int __pyx_v_hour = ((int)-1);
  int __pyx_v_minute = ((int)-1);
  int __pyx_v_second = ((int)-1);
  int __pyx_v_microsecond = ((int)-1);
  PyObject *__pyx_v_tzinfo = ((PyObject *)__pyx_int_neg_1);
  int __pyx_v_fold = ((int)-1);
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  struct __pyx_opt_args_7cpython_8datetime_time_new __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_replace", 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_tzinfo = __pyx_optional_args->tzinfo;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_fold = __pyx_optional_args->fold;
              }
            }
          }
        }
      }
    }
  }

  /* "cytimes/cydatetime.py":1948
 *     """Replace `<'datetime.time'>`. Equivalent to `time.replcae()`.
 *     Value of `-1` indicates preserving the original value."""
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         hour if 0 <= hour <= 23 else time.hour,
 *         minute if 0 <= minute <= 59 else time.minute,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":1949
 *     Value of `-1` indicates preserving the original value."""
 *     return datetime.time_new(
 *         hour if 0 <= hour <= 23 else time.hour,             # <<<<<<<<<<<<<<
 *         minute if 0 <= minute <= 59 else time.minute,
 *         second if 0 <= second <= 59 else time.second,
 */
  __pyx_t_2 = (0 <= __pyx_v_hour);
  if (__pyx_t_2) {
    __pyx_t_2 = (__pyx_v_hour <= 23);
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __pyx_v_hour;
  } else {
    __pyx_t_1 = __pyx_f_7cpython_8datetime_4time_4hour_hour(__pyx_v_time);
  }

  /* "cytimes/cydatetime.py":1950
 *     return datetime.time_new(
 *         hour if 0 <= hour <= 23 else time.hour,
 *         minute if 0 <= minute <= 59 else time.minute,             # <<<<<<<<<<<<<<
 *         second if 0 <= second <= 59 else time.second,
 *         microsecond if 0 <= microsecond <= 999999 else time.microsecond,
 */
  __pyx_t_2 = (0 <= __pyx_v_minute);
  if (__pyx_t_2) {
    __pyx_t_2 = (__pyx_v_minute <= 59);
  }
  if (__pyx_t_2) {
    __pyx_t_3 = __pyx_v_minute;
  } else {
    __pyx_t_3 = __pyx_f_7cpython_8datetime_4time_6minute_minute(__pyx_v_time);
  }

  /* "cytimes/cydatetime.py":1951
 *         hour if 0 <= hour <= 23 else time.hour,
 *         minute if 0 <= minute <= 59 else time.minute,
 *         second if 0 <= second <= 59 else time.second,             # <<<<<<<<<<<<<<
 *         microsecond if 0 <= microsecond <= 999999 else time.microsecond,
 *         tzinfo if (datetime.PyTZInfo_Check(tzinfo) or tzinfo is None) else time.tzinfo,
 */
  __pyx_t_2 = (0 <= __pyx_v_second);
  if (__pyx_t_2) {
    __pyx_t_2 = (__pyx_v_second <= 59);
  }
  if (__pyx_t_2) {
    __pyx_t_4 = __pyx_v_second;
  } else {
    __pyx_t_4 = __pyx_f_7cpython_8datetime_4time_6second_second(__pyx_v_time);
  }

  /* "cytimes/cydatetime.py":1952
 *         minute if 0 <= minute <= 59 else time.minute,
 *         second if 0 <= second <= 59 else time.second,
 *         microsecond if 0 <= microsecond <= 999999 else time.microsecond,             # <<<<<<<<<<<<<<
 *         tzinfo if (datetime.PyTZInfo_Check(tzinfo) or tzinfo is None) else time.tzinfo,
 *         0 if tzinfo is None else (fold if 0 <= fold <= 1 else time.fold),
 */
  __pyx_t_2 = (0 <= __pyx_v_microsecond);
  if (__pyx_t_2) {
    __pyx_t_2 = (__pyx_v_microsecond <= 0xF423F);
  }
  if (__pyx_t_2) {
    __pyx_t_5 = __pyx_v_microsecond;
  } else {
    __pyx_t_5 = __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(__pyx_v_time);
  }

  /* "cytimes/cydatetime.py":1953
 *         second if 0 <= second <= 59 else time.second,
 *         microsecond if 0 <= microsecond <= 999999 else time.microsecond,
 *         tzinfo if (datetime.PyTZInfo_Check(tzinfo) or tzinfo is None) else time.tzinfo,             # <<<<<<<<<<<<<<
 *         0 if tzinfo is None else (fold if 0 <= fold <= 1 else time.fold),
 *     )
 */
  __pyx_t_7 = PyTZInfo_Check(__pyx_v_tzinfo);
  if (!__pyx_t_7) {
  } else {
    __pyx_t_2 = __pyx_t_7;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_tzinfo == Py_None);
  __pyx_t_2 = __pyx_t_7;
  __pyx_L3_bool_binop_done:;
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_v_tzinfo);
    __pyx_t_6 = __pyx_v_tzinfo;
  } else {
    __pyx_t_8 = __pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(__pyx_v_time); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = __pyx_t_8;
    __pyx_t_8 = 0;
  }

  /* "cytimes/cydatetime.py":1954
 *         microsecond if 0 <= microsecond <= 999999 else time.microsecond,
 *         tzinfo if (datetime.PyTZInfo_Check(tzinfo) or tzinfo is None) else time.tzinfo,
 *         0 if tzinfo is None else (fold if 0 <= fold <= 1 else time.fold),             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_2 = (__pyx_v_tzinfo == Py_None);
  if (__pyx_t_2) {
    __pyx_t_9 = 0;
  } else {
    __pyx_t_7 = (0 <= __pyx_v_fold);
    if (__pyx_t_7) {
      __pyx_t_7 = (__pyx_v_fold <= 1);
    }
    if (__pyx_t_7) {
      __pyx_t_10 = __pyx_v_fold;
    } else {
      __pyx_t_10 = __pyx_f_7cpython_8datetime_4time_4fold_fold(__pyx_v_time);
    }
    __pyx_t_9 = __pyx_t_10;
  }

  /* "cytimes/cydatetime.py":1948
 *     """Replace `<'datetime.time'>`. Equivalent to `time.replcae()`.
 *     Value of `-1` indicates preserving the original value."""
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         hour if 0 <= hour <= 23 else time.hour,
 *         minute if 0 <= minute <= 59 else time.minute,
 */
  __pyx_t_11.__pyx_n = 1;
  __pyx_t_11.fold = __pyx_t_9;
  __pyx_t_8 = ((PyObject *)__pyx_f_7cpython_8datetime_time_new(__pyx_t_1, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, &__pyx_t_11)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = ((PyDateTime_Time *)__pyx_t_8);
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1935
 * 
 * # Datetime.time: manipulation --------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def time_replace(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cytimes.cydatetime.time_replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":1958
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def time_replace_tzinfo(time: datetime.time, tzinfo: datetime.tzinfo) -> datetime.time:
 */

static PyDateTime_Time *__pyx_f_7cytimes_10cydatetime_time_replace_tzinfo(PyDateTime_Time *__pyx_v_time, PyDateTime_TZInfo *__pyx_v_tzinfo) {
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_time_new __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_replace_tzinfo", 1);

  /* "cytimes/cydatetime.py":1964
 *     Equivalent to `time.replace(tzinfo=tzinfo)."""
 *     # fmt: off
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         time.hour, time.minute, time.second,
 *         time.microsecond, tzinfo, time.fold,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":1966
 *     return datetime.time_new(
 *         time.hour, time.minute, time.second,
 *         time.microsecond, tzinfo, time.fold,             # <<<<<<<<<<<<<<
 *     )
 *     # fmt: on
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fold = __pyx_f_7cpython_8datetime_4time_4fold_fold(__pyx_v_time);
  __pyx_t_1 = ((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), ((PyObject *)__pyx_v_tzinfo), &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Time *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1958
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def time_replace_tzinfo(time: datetime.time, tzinfo: datetime.tzinfo) -> datetime.time:
 */

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

/* "cytimes/cydatetime.py":1971
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def time_replace_fold(time: datetime.time, fold: cython.uint) -> datetime.time:
 */

static PyDateTime_Time *__pyx_f_7cytimes_10cydatetime_time_replace_fold(PyDateTime_Time *__pyx_v_time, unsigned int __pyx_v_fold) {
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  struct __pyx_opt_args_7cpython_8datetime_time_new __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_replace_fold", 1);

  /* "cytimes/cydatetime.py":1977
 *     Equivalent to `time.replace(fold=fold)."""
 *     # fmt: off
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         time.hour, time.minute, time.second,
 *         time.microsecond, time.tzinfo, 1 if fold == 1 else 0,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":1979
 *     return datetime.time_new(
 *         time.hour, time.minute, time.second,
 *         time.microsecond, time.tzinfo, 1 if fold == 1 else 0,             # <<<<<<<<<<<<<<
 *     )
 *     # fmt: on
 */
  __pyx_t_1 = __pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(__pyx_v_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_v_fold == 1);
  if (__pyx_t_3) {
    __pyx_t_2 = 1;
  } else {
    __pyx_t_2 = 0;
  }

  /* "cytimes/cydatetime.py":1977
 *     Equivalent to `time.replace(fold=fold)."""
 *     # fmt: off
 *     return datetime.time_new(             # <<<<<<<<<<<<<<
 *         time.hour, time.minute, time.second,
 *         time.microsecond, time.tzinfo, 1 if fold == 1 else 0,
 */
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.fold = __pyx_t_2;
  __pyx_t_4 = ((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_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_Time *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1971
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def time_replace_fold(time: datetime.time, fold: cython.uint) -> datetime.time:
 */

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

/* "cytimes/cydatetime.py":1986
 * # Datetime.timedelta ===================================================================================
 * # Datetime.timedelta: generate -------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_td(
 */

static PyDateTime_Delta *__pyx_f_7cytimes_10cydatetime_gen_td(struct __pyx_opt_args_7cytimes_10cydatetime_gen_td *__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("gen_td", 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;
        }
      }
    }
  }

  /* "cytimes/cydatetime.py":1994
 * ) -> datetime.timedelta:
 *     """Generate a new `<'datetime.timedelta'>`."""
 *     return datetime.timedelta_new(days, seconds, microseconds)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __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(1, 1994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1986
 * # Datetime.timedelta ===================================================================================
 * # Datetime.timedelta: generate -------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_td(
 */

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

/* "cytimes/cydatetime.py":1998
 * 
 * # Datetime.timedelta: check types ----------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static int __pyx_f_7cytimes_10cydatetime_is_td(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "cytimes/cydatetime.py":2004
 *     """Check if an object is type of datetime.timedelta `<'bool'>`.
 *     Equivalent to `isinstance(obj, datetime.timedelta)`."""
 *     return datetime.PyDelta_Check(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyDelta_Check(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":1998
 * 
 * # Datetime.timedelta: check types ----------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

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

/* "cytimes/cydatetime.py":2007
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static int __pyx_f_7cytimes_10cydatetime_is_td_exact(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "cytimes/cydatetime.py":2013
 *     """Check if an object is the exact type of datetime.timedelta `<'bool'>`.
 *     Equivalent to `type(obj) is datetime.timedelta`."""
 *     return datetime.PyDelta_CheckExact(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyDelta_CheckExact(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":2007
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

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

/* "cytimes/cydatetime.py":2017
 * 
 * # Datetime.timedelta: conversion -----------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td_to_isoformat(td: datetime.timedelta) -> str:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_td_to_isoformat(PyDateTime_Delta *__pyx_v_td) {
  int __pyx_v_days;
  int __pyx_v_secs;
  int __pyx_v_hours;
  int __pyx_v_minutes;
  int __pyx_v_seconds;
  int __pyx_v_microseconds;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("td_to_isoformat", 1);

  /* "cytimes/cydatetime.py":2021
 * def td_to_isoformat(td: datetime.timedelta) -> str:
 *     """Convert timedelta to ISO format: '%H:%M:%S.f' `<'str'>`."""
 *     days: cython.int = td.day             # <<<<<<<<<<<<<<
 *     secs: cython.int = td.second
 *     hours: cython.int = secs // 3_600 % 24 + days * 24
 */
  __pyx_v_days = __pyx_f_7cpython_8datetime_9timedelta_3day_day(__pyx_v_td);

  /* "cytimes/cydatetime.py":2022
 *     """Convert timedelta to ISO format: '%H:%M:%S.f' `<'str'>`."""
 *     days: cython.int = td.day
 *     secs: cython.int = td.second             # <<<<<<<<<<<<<<
 *     hours: cython.int = secs // 3_600 % 24 + days * 24
 *     minutes: cython.int = secs // 60 % 60
 */
  __pyx_v_secs = __pyx_f_7cpython_8datetime_9timedelta_6second_second(__pyx_v_td);

  /* "cytimes/cydatetime.py":2023
 *     days: cython.int = td.day
 *     secs: cython.int = td.second
 *     hours: cython.int = secs // 3_600 % 24 + days * 24             # <<<<<<<<<<<<<<
 *     minutes: cython.int = secs // 60 % 60
 *     seconds: cython.int = secs % 60
 */
  __pyx_v_hours = (__Pyx_mod_long(__Pyx_div_long(__pyx_v_secs, 0xE10), 24) + (__pyx_v_days * 24));

  /* "cytimes/cydatetime.py":2024
 *     secs: cython.int = td.second
 *     hours: cython.int = secs // 3_600 % 24 + days * 24
 *     minutes: cython.int = secs // 60 % 60             # <<<<<<<<<<<<<<
 *     seconds: cython.int = secs % 60
 *     microseconds: cython.int = td.microsecond
 */
  __pyx_v_minutes = __Pyx_mod_long(__Pyx_div_long(__pyx_v_secs, 60), 60);

  /* "cytimes/cydatetime.py":2025
 *     hours: cython.int = secs // 3_600 % 24 + days * 24
 *     minutes: cython.int = secs // 60 % 60
 *     seconds: cython.int = secs % 60             # <<<<<<<<<<<<<<
 *     microseconds: cython.int = td.microsecond
 *     if microseconds == 0:
 */
  __pyx_v_seconds = __Pyx_mod_long(__pyx_v_secs, 60);

  /* "cytimes/cydatetime.py":2026
 *     minutes: cython.int = secs // 60 % 60
 *     seconds: cython.int = secs % 60
 *     microseconds: cython.int = td.microsecond             # <<<<<<<<<<<<<<
 *     if microseconds == 0:
 *         return "%02d:%02d:%02d" % (hours, minutes, seconds)
 */
  __pyx_v_microseconds = __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(__pyx_v_td);

  /* "cytimes/cydatetime.py":2027
 *     seconds: cython.int = secs % 60
 *     microseconds: cython.int = td.microsecond
 *     if microseconds == 0:             # <<<<<<<<<<<<<<
 *         return "%02d:%02d:%02d" % (hours, minutes, seconds)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_microseconds == 0);
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":2028
 *     microseconds: cython.int = td.microsecond
 *     if microseconds == 0:
 *         return "%02d:%02d:%02d" % (hours, minutes, seconds)             # <<<<<<<<<<<<<<
 *     else:
 *         return "%02d:%02d:%02d.%06d" % (hours, minutes, seconds, microseconds)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2028, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_4 = 127;
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_v_hours, 2, '0', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2028, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u__5);
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2028, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_kp_u__5);
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_v_seconds, 2, '0', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2028, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2028, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2027
 *     seconds: cython.int = secs % 60
 *     microseconds: cython.int = td.microsecond
 *     if microseconds == 0:             # <<<<<<<<<<<<<<
 *         return "%02d:%02d:%02d" % (hours, minutes, seconds)
 *     else:
 */
  }

  /* "cytimes/cydatetime.py":2030
 *         return "%02d:%02d:%02d" % (hours, minutes, seconds)
 *     else:
 *         return "%02d:%02d:%02d.%06d" % (hours, minutes, seconds, microseconds)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = PyTuple_New(7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_4 = 127;
    __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_hours, 2, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_u__5);
    __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_kp_u__5);
    __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_seconds, 2, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u__6);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__6);
    PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_kp_u__6);
    __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_microseconds, 6, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_5, 7, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "cytimes/cydatetime.py":2017
 * 
 * # Datetime.timedelta: conversion -----------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td_to_isoformat(td: datetime.timedelta) -> str:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.cydatetime.td_to_isoformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2033
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td_to_utcformat(td: datetime.timedelta) -> str:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_td_to_utcformat(PyDateTime_Delta *__pyx_v_td) {
  int __pyx_v_days;
  int __pyx_v_secs;
  int __pyx_v_hours;
  PyObject *__pyx_v_sign = NULL;
  int __pyx_v_minutes;
  int __pyx_v_seconds;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("td_to_utcformat", 1);

  /* "cytimes/cydatetime.py":2037
 * def td_to_utcformat(td: datetime.timedelta) -> str:
 *     """Convert timedelta to UTC format: '+HH:MM' `<'str'>`."""
 *     days: cython.int = td.day             # <<<<<<<<<<<<<<
 *     secs: cython.int = td.second
 *     hours: cython.int = secs // 3_600 % 24 + days * 24
 */
  __pyx_v_days = __pyx_f_7cpython_8datetime_9timedelta_3day_day(__pyx_v_td);

  /* "cytimes/cydatetime.py":2038
 *     """Convert timedelta to UTC format: '+HH:MM' `<'str'>`."""
 *     days: cython.int = td.day
 *     secs: cython.int = td.second             # <<<<<<<<<<<<<<
 *     hours: cython.int = secs // 3_600 % 24 + days * 24
 *     if hours < 0:
 */
  __pyx_v_secs = __pyx_f_7cpython_8datetime_9timedelta_6second_second(__pyx_v_td);

  /* "cytimes/cydatetime.py":2039
 *     days: cython.int = td.day
 *     secs: cython.int = td.second
 *     hours: cython.int = secs // 3_600 % 24 + days * 24             # <<<<<<<<<<<<<<
 *     if hours < 0:
 *         hours = -hours
 */
  __pyx_v_hours = (__Pyx_mod_long(__Pyx_div_long(__pyx_v_secs, 0xE10), 24) + (__pyx_v_days * 24));

  /* "cytimes/cydatetime.py":2040
 *     secs: cython.int = td.second
 *     hours: cython.int = secs // 3_600 % 24 + days * 24
 *     if hours < 0:             # <<<<<<<<<<<<<<
 *         hours = -hours
 *         sign = "-"
 */
  __pyx_t_1 = (__pyx_v_hours < 0);
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":2041
 *     hours: cython.int = secs // 3_600 % 24 + days * 24
 *     if hours < 0:
 *         hours = -hours             # <<<<<<<<<<<<<<
 *         sign = "-"
 *     else:
 */
    __pyx_v_hours = (-__pyx_v_hours);

    /* "cytimes/cydatetime.py":2042
 *     if hours < 0:
 *         hours = -hours
 *         sign = "-"             # <<<<<<<<<<<<<<
 *     else:
 *         sign = "+"
 */
    __Pyx_INCREF(__pyx_kp_u__4);
    __pyx_v_sign = __pyx_kp_u__4;

    /* "cytimes/cydatetime.py":2040
 *     secs: cython.int = td.second
 *     hours: cython.int = secs // 3_600 % 24 + days * 24
 *     if hours < 0:             # <<<<<<<<<<<<<<
 *         hours = -hours
 *         sign = "-"
 */
    goto __pyx_L3;
  }

  /* "cytimes/cydatetime.py":2044
 *         sign = "-"
 *     else:
 *         sign = "+"             # <<<<<<<<<<<<<<
 *     minutes: cython.int = secs // 60 % 60
 *     seconds: cython.int = secs % 60
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_kp_u__11);
    __pyx_v_sign = __pyx_kp_u__11;
  }
  __pyx_L3:;

  /* "cytimes/cydatetime.py":2045
 *     else:
 *         sign = "+"
 *     minutes: cython.int = secs // 60 % 60             # <<<<<<<<<<<<<<
 *     seconds: cython.int = secs % 60
 *     if seconds:
 */
  __pyx_v_minutes = __Pyx_mod_long(__Pyx_div_long(__pyx_v_secs, 60), 60);

  /* "cytimes/cydatetime.py":2046
 *         sign = "+"
 *     minutes: cython.int = secs // 60 % 60
 *     seconds: cython.int = secs % 60             # <<<<<<<<<<<<<<
 *     if seconds:
 *         return "%s%02d:%02d:%02d" % (sign, hours, minutes, seconds)
 */
  __pyx_v_seconds = __Pyx_mod_long(__pyx_v_secs, 60);

  /* "cytimes/cydatetime.py":2047
 *     minutes: cython.int = secs // 60 % 60
 *     seconds: cython.int = secs % 60
 *     if seconds:             # <<<<<<<<<<<<<<
 *         return "%s%02d:%02d:%02d" % (sign, hours, minutes, seconds)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_seconds != 0);
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":2048
 *     seconds: cython.int = secs % 60
 *     if seconds:
 *         return "%s%02d:%02d:%02d" % (sign, hours, minutes, seconds)             # <<<<<<<<<<<<<<
 *     else:
 *         return "%s%02d:%02d" % (sign, hours, minutes)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_4 = 127;
    __Pyx_INCREF(__pyx_v_sign);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_sign) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_sign) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_sign);
    __Pyx_GIVEREF(__pyx_v_sign);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_sign);
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_v_hours, 2, '0', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__5);
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__5);
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_v_seconds, 2, '0', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 6, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2047
 *     minutes: cython.int = secs // 60 % 60
 *     seconds: cython.int = secs % 60
 *     if seconds:             # <<<<<<<<<<<<<<
 *         return "%s%02d:%02d:%02d" % (sign, hours, minutes, seconds)
 *     else:
 */
  }

  /* "cytimes/cydatetime.py":2050
 *         return "%s%02d:%02d:%02d" % (sign, hours, minutes, seconds)
 *     else:
 *         return "%s%02d:%02d" % (sign, hours, minutes)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2050, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_4 = 127;
    __Pyx_INCREF(__pyx_v_sign);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_sign) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_sign) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_sign);
    __Pyx_GIVEREF(__pyx_v_sign);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_sign);
    __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_hours, 2, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2050, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__5);
    __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2050, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_5, 4, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2050, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "cytimes/cydatetime.py":2033
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td_to_utcformat(td: datetime.timedelta) -> str:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.cydatetime.td_to_utcformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sign);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2053
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

static double __pyx_f_7cytimes_10cydatetime_td_to_seconds(PyDateTime_Delta *__pyx_v_td) {
  double __pyx_v_microseconds;
  double __pyx_r;

  /* "cytimes/cydatetime.py":2058
 * def td_to_seconds(td: datetime.timedelta) -> cython.double:
 *     """Convert timedelta to total seconds `<'float'>`."""
 *     microseconds: cython.double = td_to_microseconds(td)             # <<<<<<<<<<<<<<
 *     return microseconds / 1_000_000
 * 
 */
  __pyx_v_microseconds = __pyx_f_7cytimes_10cydatetime_td_to_microseconds(__pyx_v_td);

  /* "cytimes/cydatetime.py":2059
 *     """Convert timedelta to total seconds `<'float'>`."""
 *     microseconds: cython.double = td_to_microseconds(td)
 *     return microseconds / 1_000_000             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_microseconds / 1000000.0);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":2053
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

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

/* "cytimes/cydatetime.py":2062
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_td_to_microseconds(PyDateTime_Delta *__pyx_v_td) {
  PY_LONG_LONG __pyx_v_days;
  PY_LONG_LONG __pyx_v_seconds;
  PY_LONG_LONG __pyx_v_microseconds;
  PY_LONG_LONG __pyx_r;

  /* "cytimes/cydatetime.py":2067
 * def td_to_microseconds(td: datetime.timedelta) -> cython.longlong:
 *     """Convert datetime.timedelta to total microseconds `<'int'>`."""
 *     days: cython.longlong = td.day             # <<<<<<<<<<<<<<
 *     seconds: cython.longlong = td.second
 *     microseconds: cython.longlong = td.microsecond
 */
  __pyx_v_days = __pyx_f_7cpython_8datetime_9timedelta_3day_day(__pyx_v_td);

  /* "cytimes/cydatetime.py":2068
 *     """Convert datetime.timedelta to total microseconds `<'int'>`."""
 *     days: cython.longlong = td.day
 *     seconds: cython.longlong = td.second             # <<<<<<<<<<<<<<
 *     microseconds: cython.longlong = td.microsecond
 *     return days * US_DAY + seconds * 1_000_000 + microseconds
 */
  __pyx_v_seconds = __pyx_f_7cpython_8datetime_9timedelta_6second_second(__pyx_v_td);

  /* "cytimes/cydatetime.py":2069
 *     days: cython.longlong = td.day
 *     seconds: cython.longlong = td.second
 *     microseconds: cython.longlong = td.microsecond             # <<<<<<<<<<<<<<
 *     return days * US_DAY + seconds * 1_000_000 + microseconds
 * 
 */
  __pyx_v_microseconds = __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(__pyx_v_td);

  /* "cytimes/cydatetime.py":2070
 *     seconds: cython.longlong = td.second
 *     microseconds: cython.longlong = td.microsecond
 *     return days * US_DAY + seconds * 1_000_000 + microseconds             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (((__pyx_v_days * __pyx_v_7cytimes_10cydatetime_US_DAY) + (__pyx_v_seconds * 0xF4240)) + __pyx_v_microseconds);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":2062
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(check=False)
 */

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

/* "cytimes/cydatetime.py":2073
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td_fr_td(td: datetime.timedelta) -> datetime.timedelta:
 */

static PyDateTime_Delta *__pyx_f_7cytimes_10cydatetime_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);

  /* "cytimes/cydatetime.py":2077
 * def td_fr_td(td: datetime.timedelta) -> datetime.timedelta:
 *     """Convert subclass of datetime.timedelta to `<'datetime.timedelta'>`."""
 *     return datetime.timedelta_new(td.day, td.second, td.microsecond)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __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(1, 2077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":2073
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td_fr_td(td: datetime.timedelta) -> datetime.timedelta:
 */

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

/* "cytimes/cydatetime.py":2080
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td_fr_seconds(seconds: cython.double) -> datetime.timedelta:
 */

static PyDateTime_Delta *__pyx_f_7cytimes_10cydatetime_td_fr_seconds(double __pyx_v_seconds) {
  PY_LONG_LONG __pyx_v_microseconds;
  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);

  /* "cytimes/cydatetime.py":2084
 * def td_fr_seconds(seconds: cython.double) -> datetime.timedelta:
 *     """Convert total seconds to `<'datetime.timedelta'>`."""
 *     microseconds: cython.longlong = int(seconds * 1_000_000)             # <<<<<<<<<<<<<<
 *     return td_fr_microseconds(microseconds)
 * 
 */
  __pyx_v_microseconds = ((PY_LONG_LONG)(__pyx_v_seconds * 1000000.0));

  /* "cytimes/cydatetime.py":2085
 *     """Convert total seconds to `<'datetime.timedelta'>`."""
 *     microseconds: cython.longlong = int(seconds * 1_000_000)
 *     return td_fr_microseconds(microseconds)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_td_fr_microseconds(__pyx_v_microseconds)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2085, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":2080
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td_fr_seconds(seconds: cython.double) -> datetime.timedelta:
 */

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

/* "cytimes/cydatetime.py":2088
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td_fr_microseconds(microseconds: cython.longlong) -> datetime.timedelta:
 */

static PyDateTime_Delta *__pyx_f_7cytimes_10cydatetime_td_fr_microseconds(PY_LONG_LONG __pyx_v_microseconds) {
  int __pyx_v_days;
  int __pyx_v_seconds;
  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_microseconds", 1);

  /* "cytimes/cydatetime.py":2093
 *     """Convert total microseconds to `<'datetime.timedelta'>`."""
 *     # Calculate days, seconds and microseconds
 *     days: cython.int = microseconds // US_DAY             # <<<<<<<<<<<<<<
 *     microseconds = microseconds % US_DAY
 *     seconds: cython.int = microseconds // 1_000_000
 */
  if (unlikely(__pyx_v_7cytimes_10cydatetime_US_DAY == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    __PYX_ERR(1, 2093, __pyx_L1_error)
  }
  else if (sizeof(PY_LONG_LONG) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_US_DAY == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_microseconds))) {
    PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
    __PYX_ERR(1, 2093, __pyx_L1_error)
  }
  __pyx_v_days = __Pyx_div_PY_LONG_LONG(__pyx_v_microseconds, __pyx_v_7cytimes_10cydatetime_US_DAY);

  /* "cytimes/cydatetime.py":2094
 *     # Calculate days, seconds and microseconds
 *     days: cython.int = microseconds // US_DAY
 *     microseconds = microseconds % US_DAY             # <<<<<<<<<<<<<<
 *     seconds: cython.int = microseconds // 1_000_000
 *     microseconds = microseconds % 1_000_000
 */
  if (unlikely(__pyx_v_7cytimes_10cydatetime_US_DAY == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    __PYX_ERR(1, 2094, __pyx_L1_error)
  }
  __pyx_v_microseconds = __Pyx_mod_PY_LONG_LONG(__pyx_v_microseconds, __pyx_v_7cytimes_10cydatetime_US_DAY);

  /* "cytimes/cydatetime.py":2095
 *     days: cython.int = microseconds // US_DAY
 *     microseconds = microseconds % US_DAY
 *     seconds: cython.int = microseconds // 1_000_000             # <<<<<<<<<<<<<<
 *     microseconds = microseconds % 1_000_000
 *     # Generate timedelta
 */
  __pyx_v_seconds = __Pyx_div_PY_LONG_LONG(__pyx_v_microseconds, 0xF4240);

  /* "cytimes/cydatetime.py":2096
 *     microseconds = microseconds % US_DAY
 *     seconds: cython.int = microseconds // 1_000_000
 *     microseconds = microseconds % 1_000_000             # <<<<<<<<<<<<<<
 *     # Generate timedelta
 *     return datetime.timedelta_new(days, seconds, microseconds)
 */
  __pyx_v_microseconds = __Pyx_mod_PY_LONG_LONG(__pyx_v_microseconds, 0xF4240);

  /* "cytimes/cydatetime.py":2098
 *     microseconds = microseconds % 1_000_000
 *     # Generate timedelta
 *     return datetime.timedelta_new(days, seconds, microseconds)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __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(1, 2098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":2088
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td_fr_microseconds(microseconds: cython.longlong) -> datetime.timedelta:
 */

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

/* "cytimes/cydatetime.py":2102
 * 
 * # Datetime.timedelta: arithmetic -----------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td_add(
 */

static PyDateTime_Delta *__pyx_f_7cytimes_10cydatetime_td_add(PyDateTime_Delta *__pyx_v_td, struct __pyx_opt_args_7cytimes_10cydatetime_td_add *__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
  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("td_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;
        }
      }
    }
  }

  /* "cytimes/cydatetime.py":2112
 *     """Add 'days', 'seconds' and 'microseconds' to `<'datetime.timedelta'>`.
 *     Equivalent to `timedelta + timedelta(d, s, us)`."""
 *     if days == 0 and seconds == 0 and microseconds == 0:             # <<<<<<<<<<<<<<
 *         return td
 *     return datetime.timedelta_new(
 */
  __pyx_t_2 = (__pyx_v_days == 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __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) {

    /* "cytimes/cydatetime.py":2113
 *     Equivalent to `timedelta + timedelta(d, s, us)`."""
 *     if days == 0 and seconds == 0 and microseconds == 0:
 *         return td             # <<<<<<<<<<<<<<
 *     return datetime.timedelta_new(
 *         td.day + days,
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_td);
    __pyx_r = __pyx_v_td;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2112
 *     """Add 'days', 'seconds' and 'microseconds' to `<'datetime.timedelta'>`.
 *     Equivalent to `timedelta + timedelta(d, s, us)`."""
 *     if days == 0 and seconds == 0 and microseconds == 0:             # <<<<<<<<<<<<<<
 *         return td
 *     return datetime.timedelta_new(
 */
  }

  /* "cytimes/cydatetime.py":2114
 *     if days == 0 and seconds == 0 and microseconds == 0:
 *         return td
 *     return datetime.timedelta_new(             # <<<<<<<<<<<<<<
 *         td.day + days,
 *         td.second + seconds,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":2117
 *         td.day + days,
 *         td.second + seconds,
 *         td.microsecond + microseconds,             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new((__pyx_f_7cpython_8datetime_9timedelta_3day_day(__pyx_v_td) + __pyx_v_days), (__pyx_f_7cpython_8datetime_9timedelta_6second_second(__pyx_v_td) + __pyx_v_seconds), (__pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(__pyx_v_td) + __pyx_v_microseconds))); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":2102
 * 
 * # Datetime.timedelta: arithmetic -----------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td_add(
 */

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

/* "cytimes/cydatetime.py":2121
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td_add_td(
 */

static PyDateTime_Delta *__pyx_f_7cytimes_10cydatetime_td_add_td(PyDateTime_Delta *__pyx_v_td_l, PyDateTime_Delta *__pyx_v_td_r) {
  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_add_td", 1);

  /* "cytimes/cydatetime.py":2129
 *     """Addition between datetime.timedeltas.
 *     Equivalent to `timedelta + timedelta`."""
 *     return datetime.timedelta_new(             # <<<<<<<<<<<<<<
 *         td_l.day + td_r.day,
 *         td_l.second + td_r.second,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":2132
 *         td_l.day + td_r.day,
 *         td_l.second + td_r.second,
 *         td_l.microsecond + td_r.microsecond,             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new((__pyx_f_7cpython_8datetime_9timedelta_3day_day(__pyx_v_td_l) + __pyx_f_7cpython_8datetime_9timedelta_3day_day(__pyx_v_td_r)), (__pyx_f_7cpython_8datetime_9timedelta_6second_second(__pyx_v_td_l) + __pyx_f_7cpython_8datetime_9timedelta_6second_second(__pyx_v_td_r)), (__pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(__pyx_v_td_l) + __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(__pyx_v_td_r)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":2121
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td_add_td(
 */

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

/* "cytimes/cydatetime.py":2136
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td_sub_td(
 */

static PyDateTime_Delta *__pyx_f_7cytimes_10cydatetime_td_sub_td(PyDateTime_Delta *__pyx_v_td_l, PyDateTime_Delta *__pyx_v_td_r) {
  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_sub_td", 1);

  /* "cytimes/cydatetime.py":2144
 *     """Substraction between datetime.timedeltas.
 *     Equivalent to `timedelta - timedelta`."""
 *     return datetime.timedelta_new(             # <<<<<<<<<<<<<<
 *         td_l.day - td_r.day,
 *         td_l.second - td_r.second,
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cytimes/cydatetime.py":2147
 *         td_l.day - td_r.day,
 *         td_l.second - td_r.second,
 *         td_l.microsecond - td_r.microsecond,             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new((__pyx_f_7cpython_8datetime_9timedelta_3day_day(__pyx_v_td_l) - __pyx_f_7cpython_8datetime_9timedelta_3day_day(__pyx_v_td_r)), (__pyx_f_7cpython_8datetime_9timedelta_6second_second(__pyx_v_td_l) - __pyx_f_7cpython_8datetime_9timedelta_6second_second(__pyx_v_td_r)), (__pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(__pyx_v_td_l) - __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(__pyx_v_td_r)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":2136
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td_sub_td(
 */

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

/* "cytimes/cydatetime.py":2153
 * # Datetime.tzinfo ======================================================================================
 * # Datetime.tzinfo: generate ----------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_tzinfo(offset: cython.int) -> datetime.tzinfo:
 */

static PyDateTime_TZInfo *__pyx_f_7cytimes_10cydatetime_gen_tzinfo(int __pyx_v_offset) {
  PyDateTime_TZInfo *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("gen_tzinfo", 1);

  /* "cytimes/cydatetime.py":2158
 *     """Generate a new `<'datetime.tzinfo'>` from offset in seconds."""
 *     # Validate offset
 *     if not -86_340 <= offset <= 86_340:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "Timezone expects offset -86,340...86,340 "
 */
  __pyx_t_1 = (-86340L <= __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)) {

    /* "cytimes/cydatetime.py":2161
 *         raise ValueError(
 *             "Timezone expects offset -86,340...86,340 "
 *             "in seconds, instead got: %d." % offset             # <<<<<<<<<<<<<<
 *         )
 *     # Generate tzinfo
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_Timezone_expects_offset_86_340_8, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cytimes/cydatetime.py":2159
 *     # Validate offset
 *     if not -86_340 <= offset <= 86_340:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Timezone expects offset -86,340...86,340 "
 *             "in seconds, instead got: %d." % offset
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2159, __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(1, 2159, __pyx_L1_error)

    /* "cytimes/cydatetime.py":2158
 *     """Generate a new `<'datetime.tzinfo'>` from offset in seconds."""
 *     # Validate offset
 *     if not -86_340 <= offset <= 86_340:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "Timezone expects offset -86,340...86,340 "
 */
  }

  /* "cytimes/cydatetime.py":2164
 *         )
 *     # Generate tzinfo
 *     return datetime.PyTimeZone_FromOffset(datetime.timedelta_new(0, offset, 0))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_timedelta_new(0, __pyx_v_offset, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTimeZone_FromOffset(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7cpython_8datetime_tzinfo))))) __PYX_ERR(1, 2164, __pyx_L1_error)
  __pyx_r = ((PyDateTime_TZInfo *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":2153
 * # Datetime.tzinfo ======================================================================================
 * # Datetime.tzinfo: generate ----------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_tzinfo(offset: cython.int) -> datetime.tzinfo:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.cydatetime.gen_tzinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2167
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_tzinfo_local(dt: datetime.datetime = None) -> datetime.tzinfo:
 */

static PyDateTime_TZInfo *__pyx_f_7cytimes_10cydatetime_gen_tzinfo_local(struct __pyx_opt_args_7cytimes_10cydatetime_gen_tzinfo_local *__pyx_optional_args) {

  /* "cytimes/cydatetime.py":2169
 * @cython.cfunc
 * @cython.inline(True)
 * def gen_tzinfo_local(dt: datetime.datetime = None) -> datetime.tzinfo:             # <<<<<<<<<<<<<<
 *     """Generate the local `<'datetime.tzinfo'>`.
 * 
 */
  PyDateTime_DateTime *__pyx_v_dt = ((PyDateTime_DateTime *)Py_None);
  double __pyx_v_ts;
  PyDateTime_TZInfo *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PY_LONG_LONG __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("gen_tzinfo_local", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_dt = __pyx_optional_args->dt;
    }
  }

  /* "cytimes/cydatetime.py":2175
 *     """
 *     # Get local timestamp
 *     if datetime.PyDateTime_Check(dt):             # <<<<<<<<<<<<<<
 *         if dt.tzinfo is None:
 *             ts = dt_to_posixts(dt)
 */
  __pyx_t_1 = PyDateTime_Check(((PyObject *)__pyx_v_dt));
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":2176
 *     # Get local timestamp
 *     if datetime.PyDateTime_Check(dt):
 *         if dt.tzinfo is None:             # <<<<<<<<<<<<<<
 *             ts = dt_to_posixts(dt)
 *         else:
 */
    __pyx_t_2 = __pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(__pyx_v_dt); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2176, __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) {

      /* "cytimes/cydatetime.py":2177
 *     if datetime.PyDateTime_Check(dt):
 *         if dt.tzinfo is None:
 *             ts = dt_to_posixts(dt)             # <<<<<<<<<<<<<<
 *         else:
 *             ts = td_to_seconds(dt_sub_dt(dt, EPOCH_UTC))
 */
      __pyx_t_3 = __pyx_f_7cytimes_10cydatetime_dt_to_posixts(__pyx_v_dt); if (unlikely(__pyx_t_3 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 2177, __pyx_L1_error)
      __pyx_v_ts = __pyx_t_3;

      /* "cytimes/cydatetime.py":2176
 *     # Get local timestamp
 *     if datetime.PyDateTime_Check(dt):
 *         if dt.tzinfo is None:             # <<<<<<<<<<<<<<
 *             ts = dt_to_posixts(dt)
 *         else:
 */
      goto __pyx_L4;
    }

    /* "cytimes/cydatetime.py":2179
 *             ts = dt_to_posixts(dt)
 *         else:
 *             ts = td_to_seconds(dt_sub_dt(dt, EPOCH_UTC))             # <<<<<<<<<<<<<<
 *     else:
 *         ts = unix_time()
 */
    /*else*/ {
      __pyx_t_2 = ((PyObject *)__pyx_v_7cytimes_10cydatetime_EPOCH_UTC);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_4 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt_sub_dt(__pyx_v_dt, ((PyDateTime_DateTime *)__pyx_t_2))); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_ts = __pyx_f_7cytimes_10cydatetime_td_to_seconds(((PyDateTime_Delta *)__pyx_t_4));
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_L4:;

    /* "cytimes/cydatetime.py":2175
 *     """
 *     # Get local timestamp
 *     if datetime.PyDateTime_Check(dt):             # <<<<<<<<<<<<<<
 *         if dt.tzinfo is None:
 *             ts = dt_to_posixts(dt)
 */
    goto __pyx_L3;
  }

  /* "cytimes/cydatetime.py":2181
 *             ts = td_to_seconds(dt_sub_dt(dt, EPOCH_UTC))
 *     else:
 *         ts = unix_time()             # <<<<<<<<<<<<<<
 *     # Generate tzinfo
 *     return gen_tzinfo(FN_TIME_LOCALTIME(ts).tm_gmtoff)  # type: ignore
 */
  /*else*/ {
    __pyx_v_ts = __pyx_f_7cpython_4time_time();
  }
  __pyx_L3:;

  /* "cytimes/cydatetime.py":2183
 *         ts = unix_time()
 *     # Generate tzinfo
 *     return gen_tzinfo(FN_TIME_LOCALTIME(ts).tm_gmtoff)  # type: ignore             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_ts); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_7cytimes_10cydatetime_FN_TIME_LOCALTIME);
  __pyx_t_5 = __pyx_v_7cytimes_10cydatetime_FN_TIME_LOCALTIME; __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_2};
    __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;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2183, __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_tm_gmtoff); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 2183, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_gen_tzinfo(__pyx_t_7)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = ((PyDateTime_TZInfo *)__pyx_t_5);
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":2167
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def gen_tzinfo_local(dt: datetime.datetime = None) -> datetime.tzinfo:
 */

  /* 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_AddTraceback("cytimes.cydatetime.gen_tzinfo_local", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2187
 * 
 * # Datetime.tzinfo: check types -------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static int __pyx_f_7cytimes_10cydatetime_is_tzinfo(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "cytimes/cydatetime.py":2193
 *     """Check if an object is type of datetime.tzinfo `<'bool'>`.
 *     Equivalent to `isinstance(obj, datetime.tzinfo)`."""
 *     return datetime.PyTZInfo_Check(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyTZInfo_Check(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":2187
 * 
 * # Datetime.tzinfo: check types -------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

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

/* "cytimes/cydatetime.py":2196
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static int __pyx_f_7cytimes_10cydatetime_is_tzinfo_exact(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "cytimes/cydatetime.py":2202
 *     """Check if an object is the exact type of datetime.tzinfo `<'bool'>`.
 *     Equivalent to `type(obj) is datetime.tzinfo`."""
 *     return datetime.PyTZInfo_CheckExact(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyTZInfo_CheckExact(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":2196
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

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

/* "cytimes/cydatetime.py":2206
 * 
 * # Datetime.tzinfo: access ------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def tzinfo_name(tzinfo: object, dt: datetime.datetime) -> str:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_tzinfo_name(PyObject *__pyx_v_tzinfo, PyDateTime_DateTime *__pyx_v_dt) {
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_v_res = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  char const *__pyx_t_12;
  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;
  PyObject *__pyx_t_18 = NULL;
  char const *__pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tzinfo_name", 1);

  /* "cytimes/cydatetime.py":2211
 *     """Access the 'tzname' `<'str'>`.
 *     Equivalent to `tzinfo.tzname(dt)`."""
 *     if tzinfo is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  __pyx_t_1 = (__pyx_v_tzinfo == Py_None);
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":2212
 *     Equivalent to `tzinfo.tzname(dt)`."""
 *     if tzinfo is None:
 *         return None             # <<<<<<<<<<<<<<
 *     try:
 *         name = tzinfo.tzname(dt)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2211
 *     """Access the 'tzname' `<'str'>`.
 *     Equivalent to `tzinfo.tzname(dt)`."""
 *     if tzinfo is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  }

  /* "cytimes/cydatetime.py":2213
 *     if tzinfo is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         name = tzinfo.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:*/ {

      /* "cytimes/cydatetime.py":2214
 *         return None
 *     try:
 *         name = tzinfo.tzname(dt)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *         if not datetime.PyTZInfo_Check(tzinfo):
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_tzinfo, __pyx_n_s_tzname); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 2214, __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(1, 2214, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __pyx_v_name = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "cytimes/cydatetime.py":2213
 *     if tzinfo is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         name = tzinfo.tzname(dt)
 *     except Exception as err:
 */
    }
    __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_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cytimes/cydatetime.py":2215
 *     try:
 *         name = tzinfo.tzname(dt)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         if not datetime.PyTZInfo_Check(tzinfo):
 *             raise TypeError(
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("cytimes.cydatetime.tzinfo_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 2215, __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:*/ {

        /* "cytimes/cydatetime.py":2216
 *         name = tzinfo.tzname(dt)
 *     except Exception as err:
 *         if not datetime.PyTZInfo_Check(tzinfo):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 "Expects <'datetime.tzinfo'>, instead got: %s" % type(tzinfo)
 */
        __pyx_t_1 = (!PyTZInfo_Check(__pyx_v_tzinfo));
        if (unlikely(__pyx_t_1)) {

          /* "cytimes/cydatetime.py":2218
 *         if not datetime.PyTZInfo_Check(tzinfo):
 *             raise TypeError(
 *                 "Expects <'datetime.tzinfo'>, instead got: %s" % type(tzinfo)             # <<<<<<<<<<<<<<
 *             ) from err
 *         raise err
 */
          __pyx_t_9 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_datetime_tzinfo_instead, ((PyObject *)Py_TYPE(__pyx_v_tzinfo))); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 2218, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_9);

          /* "cytimes/cydatetime.py":2217
 *     except Exception as err:
 *         if not datetime.PyTZInfo_Check(tzinfo):
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 "Expects <'datetime.tzinfo'>, instead got: %s" % type(tzinfo)
 *             ) from err
 */
          __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 2217, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "cytimes/cydatetime.py":2219
 *             raise TypeError(
 *                 "Expects <'datetime.tzinfo'>, instead got: %s" % type(tzinfo)
 *             ) from err             # <<<<<<<<<<<<<<
 *         raise err
 *     if name is None:
 */
          __Pyx_Raise(__pyx_t_10, 0, 0, __pyx_v_err);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __PYX_ERR(1, 2217, __pyx_L15_error)

          /* "cytimes/cydatetime.py":2216
 *         name = tzinfo.tzname(dt)
 *     except Exception as err:
 *         if not datetime.PyTZInfo_Check(tzinfo):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 "Expects <'datetime.tzinfo'>, instead got: %s" % type(tzinfo)
 */
        }

        /* "cytimes/cydatetime.py":2220
 *                 "Expects <'datetime.tzinfo'>, instead got: %s" % type(tzinfo)
 *             ) from err
 *         raise err             # <<<<<<<<<<<<<<
 *     if name is None:
 *         return None
 */
        __Pyx_Raise(__pyx_v_err, 0, 0, 0);
        __PYX_ERR(1, 2220, __pyx_L15_error)
      }

      /* "cytimes/cydatetime.py":2215
 *     try:
 *         name = tzinfo.tzname(dt)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         if not datetime.PyTZInfo_Check(tzinfo):
 *             raise TypeError(
 */
      /*finally:*/ {
        __pyx_L15_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
          __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_XGOTREF(__pyx_t_18);
          __pyx_t_8 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          }
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
          goto __pyx_L6_except_error;
        }
      }
    }
    goto __pyx_L6_except_error;

    /* "cytimes/cydatetime.py":2213
 *     if tzinfo is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         name = tzinfo.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_L9_try_end:;
  }

  /* "cytimes/cydatetime.py":2221
 *             ) from err
 *         raise err
 *     if name is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  __pyx_t_1 = (__pyx_v_name == Py_None);
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":2222
 *         raise err
 *     if name is None:
 *         return None             # <<<<<<<<<<<<<<
 *     try:
 *         res: str = name
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2221
 *             ) from err
 *         raise err
 *     if name is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  }

  /* "cytimes/cydatetime.py":2223
 *     if name is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         res: str = name
 *     except Exception as err:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_2);
    /*try:*/ {

      /* "cytimes/cydatetime.py":2224
 *         return None
 *     try:
 *         res: str = name             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *         raise TypeError(
 */
      if (!(likely(PyUnicode_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_name))) __PYX_ERR(1, 2224, __pyx_L23_error)
      __pyx_t_7 = __pyx_v_name;
      __Pyx_INCREF(__pyx_t_7);
      __pyx_v_res = ((PyObject*)__pyx_t_7);
      __pyx_t_7 = 0;

      /* "cytimes/cydatetime.py":2223
 *     if name is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         res: str = name
 *     except Exception as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L28_try_end;
    __pyx_L23_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cytimes/cydatetime.py":2225
 *     try:
 *         res: str = name
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "<'datetime.tzinfo'> tzname() must return 'None' "
 */
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_11) {
      __Pyx_AddTraceback("cytimes.cydatetime.tzinfo_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(1, 2225, __pyx_L25_except_error)
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":2228
 *         raise TypeError(
 *             "<'datetime.tzinfo'> tzname() must return 'None' "
 *             "or <'str'>, instead got: %s." % type(name)             # <<<<<<<<<<<<<<
 *         ) from err
 *     return res
 */
        __pyx_t_10 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_datetime_tzinfo_tzname_must_ret, ((PyObject *)Py_TYPE(__pyx_v_name))); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 2228, __pyx_L34_error)
        __Pyx_GOTREF(__pyx_t_10);

        /* "cytimes/cydatetime.py":2226
 *         res: str = name
 *     except Exception as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "<'datetime.tzinfo'> tzname() must return 'None' "
 *             "or <'str'>, instead got: %s." % type(name)
 */
        __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 2226, __pyx_L34_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "cytimes/cydatetime.py":2229
 *             "<'datetime.tzinfo'> tzname() must return 'None' "
 *             "or <'str'>, instead got: %s." % type(name)
 *         ) from err             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
        __Pyx_Raise(__pyx_t_9, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __PYX_ERR(1, 2226, __pyx_L34_error)
      }

      /* "cytimes/cydatetime.py":2225
 *     try:
 *         res: str = name
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "<'datetime.tzinfo'> tzname() must return 'None' "
 */
      /*finally:*/ {
        __pyx_L34_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_13);
          __pyx_t_11 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_19 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_XGIVEREF(__pyx_t_13);
            __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13);
          }
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_ErrRestore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
          __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0;
          __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_19;
          goto __pyx_L25_except_error;
        }
      }
    }
    goto __pyx_L25_except_error;

    /* "cytimes/cydatetime.py":2223
 *     if name is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         res: str = name
 *     except Exception as err:
 */
    __pyx_L25_except_error:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_2);
    goto __pyx_L1_error;
    __pyx_L28_try_end:;
  }

  /* "cytimes/cydatetime.py":2230
 *             "or <'str'>, instead got: %s." % type(name)
 *         ) from err
 *     return res             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":2206
 * 
 * # Datetime.tzinfo: access ------------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def tzinfo_name(tzinfo: object, dt: datetime.datetime) -> str:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cytimes.cydatetime.tzinfo_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2233
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def tzinfo_dst(tzinfo: object, dt: datetime.datetime) -> datetime.timedelta:
 */

static PyDateTime_Delta *__pyx_f_7cytimes_10cydatetime_tzinfo_dst(PyObject *__pyx_v_tzinfo, PyDateTime_DateTime *__pyx_v_dt) {
  PyObject *__pyx_v_offset = NULL;
  PyObject *__pyx_v_err = NULL;
  PyDateTime_Delta *__pyx_v_res = 0;
  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;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  char const *__pyx_t_12;
  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;
  PyObject *__pyx_t_18 = NULL;
  char const *__pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tzinfo_dst", 1);

  /* "cytimes/cydatetime.py":2238
 *     """Access the 'dst' `<'datetime.timedelta'>`.
 *     Equivalent to `tzinfo.dst(dt)`."""
 *     if tzinfo is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  __pyx_t_1 = (__pyx_v_tzinfo == Py_None);
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":2239
 *     Equivalent to `tzinfo.dst(dt)`."""
 *     if tzinfo is None:
 *         return None             # <<<<<<<<<<<<<<
 *     try:
 *         offset = tzinfo.dst(dt)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_r = ((PyDateTime_Delta *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2238
 *     """Access the 'dst' `<'datetime.timedelta'>`.
 *     Equivalent to `tzinfo.dst(dt)`."""
 *     if tzinfo is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  }

  /* "cytimes/cydatetime.py":2240
 *     if tzinfo is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         offset = tzinfo.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:*/ {

      /* "cytimes/cydatetime.py":2241
 *         return None
 *     try:
 *         offset = tzinfo.dst(dt)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *         if not datetime.PyTZInfo_Check(tzinfo):
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_tzinfo, __pyx_n_s_dst); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 2241, __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(1, 2241, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __pyx_v_offset = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "cytimes/cydatetime.py":2240
 *     if tzinfo is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         offset = tzinfo.dst(dt)
 *     except Exception as err:
 */
    }
    __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_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cytimes/cydatetime.py":2242
 *     try:
 *         offset = tzinfo.dst(dt)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         if not datetime.PyTZInfo_Check(tzinfo):
 *             raise TypeError(
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("cytimes.cydatetime.tzinfo_dst", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 2242, __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:*/ {

        /* "cytimes/cydatetime.py":2243
 *         offset = tzinfo.dst(dt)
 *     except Exception as err:
 *         if not datetime.PyTZInfo_Check(tzinfo):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 "Expects <'datetime.tzinfo'>, instead got: %s" % type(tzinfo)
 */
        __pyx_t_1 = (!PyTZInfo_Check(__pyx_v_tzinfo));
        if (unlikely(__pyx_t_1)) {

          /* "cytimes/cydatetime.py":2245
 *         if not datetime.PyTZInfo_Check(tzinfo):
 *             raise TypeError(
 *                 "Expects <'datetime.tzinfo'>, instead got: %s" % type(tzinfo)             # <<<<<<<<<<<<<<
 *             ) from err
 *         raise err
 */
          __pyx_t_9 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_datetime_tzinfo_instead, ((PyObject *)Py_TYPE(__pyx_v_tzinfo))); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 2245, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_9);

          /* "cytimes/cydatetime.py":2244
 *     except Exception as err:
 *         if not datetime.PyTZInfo_Check(tzinfo):
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 "Expects <'datetime.tzinfo'>, instead got: %s" % type(tzinfo)
 *             ) from err
 */
          __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 2244, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "cytimes/cydatetime.py":2246
 *             raise TypeError(
 *                 "Expects <'datetime.tzinfo'>, instead got: %s" % type(tzinfo)
 *             ) from err             # <<<<<<<<<<<<<<
 *         raise err
 *     if offset is None:
 */
          __Pyx_Raise(__pyx_t_10, 0, 0, __pyx_v_err);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __PYX_ERR(1, 2244, __pyx_L15_error)

          /* "cytimes/cydatetime.py":2243
 *         offset = tzinfo.dst(dt)
 *     except Exception as err:
 *         if not datetime.PyTZInfo_Check(tzinfo):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 "Expects <'datetime.tzinfo'>, instead got: %s" % type(tzinfo)
 */
        }

        /* "cytimes/cydatetime.py":2247
 *                 "Expects <'datetime.tzinfo'>, instead got: %s" % type(tzinfo)
 *             ) from err
 *         raise err             # <<<<<<<<<<<<<<
 *     if offset is None:
 *         return None
 */
        __Pyx_Raise(__pyx_v_err, 0, 0, 0);
        __PYX_ERR(1, 2247, __pyx_L15_error)
      }

      /* "cytimes/cydatetime.py":2242
 *     try:
 *         offset = tzinfo.dst(dt)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         if not datetime.PyTZInfo_Check(tzinfo):
 *             raise TypeError(
 */
      /*finally:*/ {
        __pyx_L15_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
          __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_XGOTREF(__pyx_t_18);
          __pyx_t_8 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          }
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
          goto __pyx_L6_except_error;
        }
      }
    }
    goto __pyx_L6_except_error;

    /* "cytimes/cydatetime.py":2240
 *     if tzinfo is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         offset = tzinfo.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_L9_try_end:;
  }

  /* "cytimes/cydatetime.py":2248
 *             ) from err
 *         raise err
 *     if offset is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  __pyx_t_1 = (__pyx_v_offset == Py_None);
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":2249
 *         raise err
 *     if offset is None:
 *         return None             # <<<<<<<<<<<<<<
 *     try:
 *         res: datetime.timedelta = offset
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_r = ((PyDateTime_Delta *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2248
 *             ) from err
 *         raise err
 *     if offset is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  }

  /* "cytimes/cydatetime.py":2250
 *     if offset is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         res: datetime.timedelta = offset
 *     except Exception as err:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_2);
    /*try:*/ {

      /* "cytimes/cydatetime.py":2251
 *         return None
 *     try:
 *         res: datetime.timedelta = offset             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *         raise TypeError(
 */
      if (!(likely(((__pyx_v_offset) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_offset, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(1, 2251, __pyx_L23_error)
      __pyx_t_7 = __pyx_v_offset;
      __Pyx_INCREF(__pyx_t_7);
      __pyx_v_res = ((PyDateTime_Delta *)__pyx_t_7);
      __pyx_t_7 = 0;

      /* "cytimes/cydatetime.py":2250
 *     if offset is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         res: datetime.timedelta = offset
 *     except Exception as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L28_try_end;
    __pyx_L23_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cytimes/cydatetime.py":2252
 *     try:
 *         res: datetime.timedelta = offset
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "<'datetime.tzinfo'> dst() must return 'None' "
 */
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_11) {
      __Pyx_AddTraceback("cytimes.cydatetime.tzinfo_dst", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(1, 2252, __pyx_L25_except_error)
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":2255
 *         raise TypeError(
 *             "<'datetime.tzinfo'> dst() must return 'None' "
 *             "or <'timedelta'>, instead got: %s." % type(offset)             # <<<<<<<<<<<<<<
 *         ) from err
 *     return res
 */
        __pyx_t_10 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_datetime_tzinfo_dst_must_return, ((PyObject *)Py_TYPE(__pyx_v_offset))); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 2255, __pyx_L34_error)
        __Pyx_GOTREF(__pyx_t_10);

        /* "cytimes/cydatetime.py":2253
 *         res: datetime.timedelta = offset
 *     except Exception as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "<'datetime.tzinfo'> dst() must return 'None' "
 *             "or <'timedelta'>, instead got: %s." % type(offset)
 */
        __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 2253, __pyx_L34_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "cytimes/cydatetime.py":2256
 *             "<'datetime.tzinfo'> dst() must return 'None' "
 *             "or <'timedelta'>, instead got: %s." % type(offset)
 *         ) from err             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
        __Pyx_Raise(__pyx_t_9, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __PYX_ERR(1, 2253, __pyx_L34_error)
      }

      /* "cytimes/cydatetime.py":2252
 *     try:
 *         res: datetime.timedelta = offset
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "<'datetime.tzinfo'> dst() must return 'None' "
 */
      /*finally:*/ {
        __pyx_L34_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_13);
          __pyx_t_11 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_19 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_XGIVEREF(__pyx_t_13);
            __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13);
          }
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_ErrRestore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
          __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0;
          __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_19;
          goto __pyx_L25_except_error;
        }
      }
    }
    goto __pyx_L25_except_error;

    /* "cytimes/cydatetime.py":2250
 *     if offset is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         res: datetime.timedelta = offset
 *     except Exception as err:
 */
    __pyx_L25_except_error:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_2);
    goto __pyx_L1_error;
    __pyx_L28_try_end:;
  }

  /* "cytimes/cydatetime.py":2257
 *             "or <'timedelta'>, instead got: %s." % type(offset)
 *         ) from err
 *     return res             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":2233
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def tzinfo_dst(tzinfo: object, dt: datetime.datetime) -> 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cytimes.cydatetime.tzinfo_dst", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_offset);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2260
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def tzinfo_utcoffset(tzinfo: object, dt: datetime.datetime) -> datetime.timedelta:
 */

static PyDateTime_Delta *__pyx_f_7cytimes_10cydatetime_tzinfo_utcoffset(PyObject *__pyx_v_tzinfo, PyDateTime_DateTime *__pyx_v_dt) {
  PyObject *__pyx_v_offset = NULL;
  PyObject *__pyx_v_err = NULL;
  PyDateTime_Delta *__pyx_v_res = 0;
  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;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  char const *__pyx_t_12;
  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;
  PyObject *__pyx_t_18 = NULL;
  char const *__pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tzinfo_utcoffset", 1);

  /* "cytimes/cydatetime.py":2265
 *     """Access the 'utcoffset' `<'datetime.timedelta'>`.
 *     Equivalent to `tzinfo.utcoffset(dt)`."""
 *     if tzinfo is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  __pyx_t_1 = (__pyx_v_tzinfo == Py_None);
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":2266
 *     Equivalent to `tzinfo.utcoffset(dt)`."""
 *     if tzinfo is None:
 *         return None             # <<<<<<<<<<<<<<
 *     try:
 *         offset = tzinfo.utcoffset(dt)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_r = ((PyDateTime_Delta *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2265
 *     """Access the 'utcoffset' `<'datetime.timedelta'>`.
 *     Equivalent to `tzinfo.utcoffset(dt)`."""
 *     if tzinfo is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  }

  /* "cytimes/cydatetime.py":2267
 *     if tzinfo is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         offset = tzinfo.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:*/ {

      /* "cytimes/cydatetime.py":2268
 *         return None
 *     try:
 *         offset = tzinfo.utcoffset(dt)             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *         if not datetime.PyTZInfo_Check(tzinfo):
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_tzinfo, __pyx_n_s_utcoffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 2268, __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(1, 2268, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __pyx_v_offset = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "cytimes/cydatetime.py":2267
 *     if tzinfo is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         offset = tzinfo.utcoffset(dt)
 *     except Exception as err:
 */
    }
    __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_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cytimes/cydatetime.py":2269
 *     try:
 *         offset = tzinfo.utcoffset(dt)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         if not datetime.PyTZInfo_Check(tzinfo):
 *             raise TypeError(
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("cytimes.cydatetime.tzinfo_utcoffset", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 2269, __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:*/ {

        /* "cytimes/cydatetime.py":2270
 *         offset = tzinfo.utcoffset(dt)
 *     except Exception as err:
 *         if not datetime.PyTZInfo_Check(tzinfo):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 "Expects <'datetime.tzinfo'>, instead got: %s" % type(tzinfo)
 */
        __pyx_t_1 = (!PyTZInfo_Check(__pyx_v_tzinfo));
        if (unlikely(__pyx_t_1)) {

          /* "cytimes/cydatetime.py":2272
 *         if not datetime.PyTZInfo_Check(tzinfo):
 *             raise TypeError(
 *                 "Expects <'datetime.tzinfo'>, instead got: %s" % type(tzinfo)             # <<<<<<<<<<<<<<
 *             ) from err
 *         raise err
 */
          __pyx_t_9 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_datetime_tzinfo_instead, ((PyObject *)Py_TYPE(__pyx_v_tzinfo))); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 2272, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_9);

          /* "cytimes/cydatetime.py":2271
 *     except Exception as err:
 *         if not datetime.PyTZInfo_Check(tzinfo):
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 "Expects <'datetime.tzinfo'>, instead got: %s" % type(tzinfo)
 *             ) from err
 */
          __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 2271, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "cytimes/cydatetime.py":2273
 *             raise TypeError(
 *                 "Expects <'datetime.tzinfo'>, instead got: %s" % type(tzinfo)
 *             ) from err             # <<<<<<<<<<<<<<
 *         raise err
 *     if offset is None:
 */
          __Pyx_Raise(__pyx_t_10, 0, 0, __pyx_v_err);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __PYX_ERR(1, 2271, __pyx_L15_error)

          /* "cytimes/cydatetime.py":2270
 *         offset = tzinfo.utcoffset(dt)
 *     except Exception as err:
 *         if not datetime.PyTZInfo_Check(tzinfo):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 "Expects <'datetime.tzinfo'>, instead got: %s" % type(tzinfo)
 */
        }

        /* "cytimes/cydatetime.py":2274
 *                 "Expects <'datetime.tzinfo'>, instead got: %s" % type(tzinfo)
 *             ) from err
 *         raise err             # <<<<<<<<<<<<<<
 *     if offset is None:
 *         return None
 */
        __Pyx_Raise(__pyx_v_err, 0, 0, 0);
        __PYX_ERR(1, 2274, __pyx_L15_error)
      }

      /* "cytimes/cydatetime.py":2269
 *     try:
 *         offset = tzinfo.utcoffset(dt)
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         if not datetime.PyTZInfo_Check(tzinfo):
 *             raise TypeError(
 */
      /*finally:*/ {
        __pyx_L15_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
          __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_XGOTREF(__pyx_t_18);
          __pyx_t_8 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          }
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
          goto __pyx_L6_except_error;
        }
      }
    }
    goto __pyx_L6_except_error;

    /* "cytimes/cydatetime.py":2267
 *     if tzinfo is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         offset = tzinfo.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_L9_try_end:;
  }

  /* "cytimes/cydatetime.py":2275
 *             ) from err
 *         raise err
 *     if offset is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  __pyx_t_1 = (__pyx_v_offset == Py_None);
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":2276
 *         raise err
 *     if offset is None:
 *         return None             # <<<<<<<<<<<<<<
 *     try:
 *         res: datetime.timedelta = offset
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_r = ((PyDateTime_Delta *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2275
 *             ) from err
 *         raise err
 *     if offset is None:             # <<<<<<<<<<<<<<
 *         return None
 *     try:
 */
  }

  /* "cytimes/cydatetime.py":2277
 *     if offset is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         res: datetime.timedelta = offset
 *     except Exception as err:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_2);
    /*try:*/ {

      /* "cytimes/cydatetime.py":2278
 *         return None
 *     try:
 *         res: datetime.timedelta = offset             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *         raise TypeError(
 */
      if (!(likely(((__pyx_v_offset) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_offset, __pyx_ptype_7cpython_8datetime_timedelta))))) __PYX_ERR(1, 2278, __pyx_L23_error)
      __pyx_t_7 = __pyx_v_offset;
      __Pyx_INCREF(__pyx_t_7);
      __pyx_v_res = ((PyDateTime_Delta *)__pyx_t_7);
      __pyx_t_7 = 0;

      /* "cytimes/cydatetime.py":2277
 *     if offset is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         res: datetime.timedelta = offset
 *     except Exception as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L28_try_end;
    __pyx_L23_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cytimes/cydatetime.py":2279
 *     try:
 *         res: datetime.timedelta = offset
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "<'datetime.tzinfo'> utcoffset() must return 'None' "
 */
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_11) {
      __Pyx_AddTraceback("cytimes.cydatetime.tzinfo_utcoffset", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(1, 2279, __pyx_L25_except_error)
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":2282
 *         raise TypeError(
 *             "<'datetime.tzinfo'> utcoffset() must return 'None' "
 *             "or <'timedelta'>, instead got: %s." % type(offset)             # <<<<<<<<<<<<<<
 *         ) from err
 *     return res
 */
        __pyx_t_10 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_datetime_tzinfo_utcoffset_must, ((PyObject *)Py_TYPE(__pyx_v_offset))); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 2282, __pyx_L34_error)
        __Pyx_GOTREF(__pyx_t_10);

        /* "cytimes/cydatetime.py":2280
 *         res: datetime.timedelta = offset
 *     except Exception as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "<'datetime.tzinfo'> utcoffset() must return 'None' "
 *             "or <'timedelta'>, instead got: %s." % type(offset)
 */
        __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 2280, __pyx_L34_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "cytimes/cydatetime.py":2283
 *             "<'datetime.tzinfo'> utcoffset() must return 'None' "
 *             "or <'timedelta'>, instead got: %s." % type(offset)
 *         ) from err             # <<<<<<<<<<<<<<
 *     return res
 * 
 */
        __Pyx_Raise(__pyx_t_9, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __PYX_ERR(1, 2280, __pyx_L34_error)
      }

      /* "cytimes/cydatetime.py":2279
 *     try:
 *         res: datetime.timedelta = offset
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "<'datetime.tzinfo'> utcoffset() must return 'None' "
 */
      /*finally:*/ {
        __pyx_L34_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_13);
          __pyx_t_11 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_19 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_err); __pyx_v_err = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_XGIVEREF(__pyx_t_13);
            __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13);
          }
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_ErrRestore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
          __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0;
          __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_19;
          goto __pyx_L25_except_error;
        }
      }
    }
    goto __pyx_L25_except_error;

    /* "cytimes/cydatetime.py":2277
 *     if offset is None:
 *         return None
 *     try:             # <<<<<<<<<<<<<<
 *         res: datetime.timedelta = offset
 *     except Exception as err:
 */
    __pyx_L25_except_error:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_3, __pyx_t_2);
    goto __pyx_L1_error;
    __pyx_L28_try_end:;
  }

  /* "cytimes/cydatetime.py":2284
 *             "or <'timedelta'>, instead got: %s." % type(offset)
 *         ) from err
 *     return res             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":2260
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def tzinfo_utcoffset(tzinfo: object, dt: datetime.datetime) -> 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cytimes.cydatetime.tzinfo_utcoffset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_offset);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2289
 * # numpy.datetime64 =====================================================================================
 * # numpy.datetime64: check types ------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static int __pyx_f_7cytimes_10cydatetime_is_dt64(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "cytimes/cydatetime.py":2295
 *     """Check if an object is type of numpy.datetime64 `<'bool'>`.
 *     Equivalent to `isinstance(obj, numpy.datetime64)`."""
 *     return np.is_datetime64_object(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_5numpy_is_datetime64_object(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":2289
 * # numpy.datetime64 =====================================================================================
 * # numpy.datetime64: check types ------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

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

/* "cytimes/cydatetime.py":2298
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def validate_dt64(obj: object):
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_validate_dt64(PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("validate_dt64", 1);

  /* "cytimes/cydatetime.py":2303
 *     """Validate if an object is type of `<'numpy.datetime64'>`.
 *     Raise `TypeError` if object type is incorrect."""
 *     if not np.is_datetime64_object(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'numpy.datetime64'>, " "instead got: %s %r." % (type(obj), obj)
 */
  __pyx_t_1 = (!__pyx_f_5numpy_is_datetime64_object(__pyx_v_obj));
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/cydatetime.py":2305
 *     if not np.is_datetime64_object(obj):
 *         raise TypeError(
 *             "Expects <'numpy.datetime64'>, " "instead got: %s %r." % (type(obj), obj)             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_4 = 127;
    __Pyx_INCREF(__pyx_kp_u_Expects_numpy_datetime64_instead);
    __pyx_t_3 += 43;
    __Pyx_GIVEREF(__pyx_kp_u_Expects_numpy_datetime64_instead);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Expects_numpy_datetime64_instead);
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(((PyObject *)Py_TYPE(__pyx_v_obj))), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__7);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__7);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__7);
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_obj), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__6);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__6);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__6);
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cytimes/cydatetime.py":2304
 *     Raise `TypeError` if object type is incorrect."""
 *     if not np.is_datetime64_object(obj):
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'numpy.datetime64'>, " "instead got: %s %r." % (type(obj), obj)
 *         )
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2304, __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(1, 2304, __pyx_L1_error)

    /* "cytimes/cydatetime.py":2303
 *     """Validate if an object is type of `<'numpy.datetime64'>`.
 *     Raise `TypeError` if object type is incorrect."""
 *     if not np.is_datetime64_object(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'numpy.datetime64'>, " "instead got: %s %r." % (type(obj), obj)
 */
  }

  /* "cytimes/cydatetime.py":2298
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def validate_dt64(obj: object):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.cydatetime.validate_dt64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2310
 * 
 * # numpy.datetime64: conversion -------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.cdivision(True)
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_dt64_to_isoformat(PyObject *__pyx_v_dt64) {
  PY_LONG_LONG __pyx_v_microseconds;
  __pyx_t_7cytimes_10cydatetime_ymd __pyx_v_ymd;
  __pyx_t_7cytimes_10cydatetime_hms __pyx_v_hms;
  unsigned int __pyx_v_microsecond;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PY_LONG_LONG __pyx_t_1;
  PY_LONG_LONG __pyx_t_2;
  PY_LONG_LONG __pyx_t_3;
  PY_LONG_LONG __pyx_t_4;
  int __pyx_t_5;
  unsigned int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64_to_isoformat", 1);

  /* "cytimes/cydatetime.py":2317
 *     '%Y-%m-%dT%H:%M:%S.f' `<'str'>`."""
 *     # Add back epoch seconds
 *     microseconds: cython.longlong = dt64_to_microseconds(dt64) + EPOCH_US             # <<<<<<<<<<<<<<
 *     microseconds = min(max(microseconds, DT_MIN_US), DT_MAX_US)
 *     # Calculate ymd
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_dt64_to_microseconds(__pyx_v_dt64); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 2317, __pyx_L1_error)
  __pyx_v_microseconds = (__pyx_t_1 + __pyx_v_7cytimes_10cydatetime_EPOCH_US);

  /* "cytimes/cydatetime.py":2318
 *     # Add back epoch seconds
 *     microseconds: cython.longlong = dt64_to_microseconds(dt64) + EPOCH_US
 *     microseconds = min(max(microseconds, DT_MIN_US), DT_MAX_US)             # <<<<<<<<<<<<<<
 *     # Calculate ymd
 *     ymd = ordinal_to_ymd(microseconds // US_DAY)
 */
  __pyx_t_1 = __pyx_v_7cytimes_10cydatetime_DT_MAX_US;
  __pyx_t_2 = __pyx_v_7cytimes_10cydatetime_DT_MIN_US;
  __pyx_t_3 = __pyx_v_microseconds;
  __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_microseconds = __pyx_t_4;

  /* "cytimes/cydatetime.py":2320
 *     microseconds = min(max(microseconds, DT_MIN_US), DT_MAX_US)
 *     # Calculate ymd
 *     ymd = ordinal_to_ymd(microseconds // US_DAY)             # <<<<<<<<<<<<<<
 *     # Calculate hms
 *     hms = microseconds_to_hms(microseconds)
 */
  __pyx_v_ymd = __pyx_f_7cytimes_10cydatetime_ordinal_to_ymd((__pyx_v_microseconds / __pyx_v_7cytimes_10cydatetime_US_DAY));

  /* "cytimes/cydatetime.py":2322
 *     ymd = ordinal_to_ymd(microseconds // US_DAY)
 *     # Calculate hms
 *     hms = microseconds_to_hms(microseconds)             # <<<<<<<<<<<<<<
 *     # Return isoformat
 *     # fmt: off
 */
  __pyx_v_hms = __pyx_f_7cytimes_10cydatetime_microseconds_to_hms(__pyx_v_microseconds);

  /* "cytimes/cydatetime.py":2325
 *     # Return isoformat
 *     # fmt: off
 *     microsecond: cython.uint = hms.microsecond             # <<<<<<<<<<<<<<
 *     if microsecond == 0:
 *         return "%04d-%02d-%02dT%02d:%02d:%02d" % (
 */
  __pyx_t_6 = __pyx_v_hms.microsecond;
  __pyx_v_microsecond = __pyx_t_6;

  /* "cytimes/cydatetime.py":2326
 *     # fmt: off
 *     microsecond: cython.uint = hms.microsecond
 *     if microsecond == 0:             # <<<<<<<<<<<<<<
 *         return "%04d-%02d-%02dT%02d:%02d:%02d" % (
 *             ymd.year, ymd.month, ymd.day,
 */
  __pyx_t_5 = (__pyx_v_microsecond == 0);
  if (__pyx_t_5) {

    /* "cytimes/cydatetime.py":2327
 *     microsecond: cython.uint = hms.microsecond
 *     if microsecond == 0:
 *         return "%04d-%02d-%02dT%02d:%02d:%02d" % (             # <<<<<<<<<<<<<<
 *             ymd.year, ymd.month, ymd.day,
 *             hms.hour, hms.minute, hms.second,
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = PyTuple_New(11); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 2327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = 0;
    __pyx_t_9 = 127;

    /* "cytimes/cydatetime.py":2328
 *     if microsecond == 0:
 *         return "%04d-%02d-%02dT%02d:%02d:%02d" % (
 *             ymd.year, ymd.month, ymd.day,             # <<<<<<<<<<<<<<
 *             hms.hour, hms.minute, hms.second,
 *         )
 */
    __pyx_t_10 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_ymd.year, 4, '0', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 2328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_kp_u__4);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__4);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_kp_u__4);
    __pyx_t_10 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_ymd.month, 2, '0', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 2328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_kp_u__4);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__4);
    PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_kp_u__4);
    __pyx_t_10 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_ymd.day, 2, '0', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 2328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_n_u_T);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_n_u_T);
    PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_n_u_T);

    /* "cytimes/cydatetime.py":2329
 *         return "%04d-%02d-%02dT%02d:%02d:%02d" % (
 *             ymd.year, ymd.month, ymd.day,
 *             hms.hour, hms.minute, hms.second,             # <<<<<<<<<<<<<<
 *         )
 *     else:
 */
    __pyx_t_10 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_hms.hour, 2, '0', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 2329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_7, 6, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_7, 7, __pyx_kp_u__5);
    __pyx_t_10 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_hms.minute, 2, '0', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 2329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_7, 8, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_7, 9, __pyx_kp_u__5);
    __pyx_t_10 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_hms.second, 2, '0', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 2329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_7, 10, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "cytimes/cydatetime.py":2327
 *     microsecond: cython.uint = hms.microsecond
 *     if microsecond == 0:
 *         return "%04d-%02d-%02dT%02d:%02d:%02d" % (             # <<<<<<<<<<<<<<
 *             ymd.year, ymd.month, ymd.day,
 *             hms.hour, hms.minute, hms.second,
 */
    __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_7, 11, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 2327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_r = ((PyObject*)__pyx_t_10);
    __pyx_t_10 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2326
 *     # fmt: off
 *     microsecond: cython.uint = hms.microsecond
 *     if microsecond == 0:             # <<<<<<<<<<<<<<
 *         return "%04d-%02d-%02dT%02d:%02d:%02d" % (
 *             ymd.year, ymd.month, ymd.day,
 */
  }

  /* "cytimes/cydatetime.py":2332
 *         )
 *     else:
 *         return "%04d-%02d-%02dT%02d:%02d:%02d.%06d" % (             # <<<<<<<<<<<<<<
 *             ymd.year, ymd.month, ymd.day,
 *             hms.hour, hms.minute, hms.second, microsecond,
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_10 = PyTuple_New(13); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 2332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 = 0;
    __pyx_t_9 = 127;

    /* "cytimes/cydatetime.py":2333
 *     else:
 *         return "%04d-%02d-%02dT%02d:%02d:%02d.%06d" % (
 *             ymd.year, ymd.month, ymd.day,             # <<<<<<<<<<<<<<
 *             hms.hour, hms.minute, hms.second, microsecond,
 *         )
 */
    __pyx_t_7 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_ymd.year, 4, '0', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 2333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u__4);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__4);
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_kp_u__4);
    __pyx_t_7 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_ymd.month, 2, '0', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 2333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u__4);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__4);
    PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_kp_u__4);
    __pyx_t_7 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_ymd.day, 2, '0', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 2333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_n_u_T);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_n_u_T);
    PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_n_u_T);

    /* "cytimes/cydatetime.py":2334
 *         return "%04d-%02d-%02dT%02d:%02d:%02d.%06d" % (
 *             ymd.year, ymd.month, ymd.day,
 *             hms.hour, hms.minute, hms.second, microsecond,             # <<<<<<<<<<<<<<
 *         )
 *     # fmt: on
 */
    __pyx_t_7 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_hms.hour, 2, '0', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 2334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_kp_u__5);
    __pyx_t_7 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_hms.minute, 2, '0', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 2334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 8, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_10, 9, __pyx_kp_u__5);
    __pyx_t_7 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_hms.second, 2, '0', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 2334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 10, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u__6);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__6);
    PyTuple_SET_ITEM(__pyx_t_10, 11, __pyx_kp_u__6);
    __pyx_t_7 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_microsecond, 6, '0', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 2334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 12, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "cytimes/cydatetime.py":2332
 *         )
 *     else:
 *         return "%04d-%02d-%02dT%02d:%02d:%02d.%06d" % (             # <<<<<<<<<<<<<<
 *             ymd.year, ymd.month, ymd.day,
 *             hms.hour, hms.minute, hms.second, microsecond,
 */
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_10, 13, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 2332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_r = ((PyObject*)__pyx_t_7);
    __pyx_t_7 = 0;
    goto __pyx_L0;
  }

  /* "cytimes/cydatetime.py":2310
 * 
 * # numpy.datetime64: conversion -------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.cdivision(True)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64_to_isoformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2339
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.cdivision(True)
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_dt64_to_isospaceformat(PyObject *__pyx_v_dt64) {
  PY_LONG_LONG __pyx_v_microseconds;
  __pyx_t_7cytimes_10cydatetime_ymd __pyx_v_ymd;
  __pyx_t_7cytimes_10cydatetime_hms __pyx_v_hms;
  unsigned int __pyx_v_microsecond;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PY_LONG_LONG __pyx_t_1;
  PY_LONG_LONG __pyx_t_2;
  PY_LONG_LONG __pyx_t_3;
  PY_LONG_LONG __pyx_t_4;
  int __pyx_t_5;
  unsigned int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64_to_isospaceformat", 1);

  /* "cytimes/cydatetime.py":2346
 *     as the seperator: '%Y-%m-%d %H:%M:%S.f' `<'str'>`."""
 *     # Add back epoch seconds
 *     microseconds: cython.longlong = dt64_to_microseconds(dt64) + EPOCH_US             # <<<<<<<<<<<<<<
 *     microseconds = min(max(microseconds, DT_MIN_US), DT_MAX_US)
 *     # Calculate ymd
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_dt64_to_microseconds(__pyx_v_dt64); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 2346, __pyx_L1_error)
  __pyx_v_microseconds = (__pyx_t_1 + __pyx_v_7cytimes_10cydatetime_EPOCH_US);

  /* "cytimes/cydatetime.py":2347
 *     # Add back epoch seconds
 *     microseconds: cython.longlong = dt64_to_microseconds(dt64) + EPOCH_US
 *     microseconds = min(max(microseconds, DT_MIN_US), DT_MAX_US)             # <<<<<<<<<<<<<<
 *     # Calculate ymd
 *     ymd = ordinal_to_ymd(microseconds // US_DAY)
 */
  __pyx_t_1 = __pyx_v_7cytimes_10cydatetime_DT_MAX_US;
  __pyx_t_2 = __pyx_v_7cytimes_10cydatetime_DT_MIN_US;
  __pyx_t_3 = __pyx_v_microseconds;
  __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_microseconds = __pyx_t_4;

  /* "cytimes/cydatetime.py":2349
 *     microseconds = min(max(microseconds, DT_MIN_US), DT_MAX_US)
 *     # Calculate ymd
 *     ymd = ordinal_to_ymd(microseconds // US_DAY)             # <<<<<<<<<<<<<<
 *     # Calculate hms
 *     hms = microseconds_to_hms(microseconds)
 */
  __pyx_v_ymd = __pyx_f_7cytimes_10cydatetime_ordinal_to_ymd((__pyx_v_microseconds / __pyx_v_7cytimes_10cydatetime_US_DAY));

  /* "cytimes/cydatetime.py":2351
 *     ymd = ordinal_to_ymd(microseconds // US_DAY)
 *     # Calculate hms
 *     hms = microseconds_to_hms(microseconds)             # <<<<<<<<<<<<<<
 *     # Return isoformat
 *     # fmt: off
 */
  __pyx_v_hms = __pyx_f_7cytimes_10cydatetime_microseconds_to_hms(__pyx_v_microseconds);

  /* "cytimes/cydatetime.py":2354
 *     # Return isoformat
 *     # fmt: off
 *     microsecond: cython.uint = hms.microsecond             # <<<<<<<<<<<<<<
 *     if microsecond == 0:
 *         return "%04d-%02d-%02d %02d:%02d:%02d" % (
 */
  __pyx_t_6 = __pyx_v_hms.microsecond;
  __pyx_v_microsecond = __pyx_t_6;

  /* "cytimes/cydatetime.py":2355
 *     # fmt: off
 *     microsecond: cython.uint = hms.microsecond
 *     if microsecond == 0:             # <<<<<<<<<<<<<<
 *         return "%04d-%02d-%02d %02d:%02d:%02d" % (
 *             ymd.year, ymd.month, ymd.day,
 */
  __pyx_t_5 = (__pyx_v_microsecond == 0);
  if (__pyx_t_5) {

    /* "cytimes/cydatetime.py":2356
 *     microsecond: cython.uint = hms.microsecond
 *     if microsecond == 0:
 *         return "%04d-%02d-%02d %02d:%02d:%02d" % (             # <<<<<<<<<<<<<<
 *             ymd.year, ymd.month, ymd.day,
 *             hms.hour, hms.minute, hms.second,
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = PyTuple_New(11); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 2356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = 0;
    __pyx_t_9 = 127;

    /* "cytimes/cydatetime.py":2357
 *     if microsecond == 0:
 *         return "%04d-%02d-%02d %02d:%02d:%02d" % (
 *             ymd.year, ymd.month, ymd.day,             # <<<<<<<<<<<<<<
 *             hms.hour, hms.minute, hms.second,
 *         )
 */
    __pyx_t_10 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_ymd.year, 4, '0', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 2357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_kp_u__4);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__4);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_kp_u__4);
    __pyx_t_10 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_ymd.month, 2, '0', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 2357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_kp_u__4);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__4);
    PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_kp_u__4);
    __pyx_t_10 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_ymd.day, 2, '0', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 2357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_kp_u__7);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__7);
    PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_kp_u__7);

    /* "cytimes/cydatetime.py":2358
 *         return "%04d-%02d-%02d %02d:%02d:%02d" % (
 *             ymd.year, ymd.month, ymd.day,
 *             hms.hour, hms.minute, hms.second,             # <<<<<<<<<<<<<<
 *         )
 *     else:
 */
    __pyx_t_10 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_hms.hour, 2, '0', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 2358, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_7, 6, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_7, 7, __pyx_kp_u__5);
    __pyx_t_10 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_hms.minute, 2, '0', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 2358, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_7, 8, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_7, 9, __pyx_kp_u__5);
    __pyx_t_10 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_hms.second, 2, '0', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 2358, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_7, 10, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "cytimes/cydatetime.py":2356
 *     microsecond: cython.uint = hms.microsecond
 *     if microsecond == 0:
 *         return "%04d-%02d-%02d %02d:%02d:%02d" % (             # <<<<<<<<<<<<<<
 *             ymd.year, ymd.month, ymd.day,
 *             hms.hour, hms.minute, hms.second,
 */
    __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_7, 11, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 2356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_r = ((PyObject*)__pyx_t_10);
    __pyx_t_10 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2355
 *     # fmt: off
 *     microsecond: cython.uint = hms.microsecond
 *     if microsecond == 0:             # <<<<<<<<<<<<<<
 *         return "%04d-%02d-%02d %02d:%02d:%02d" % (
 *             ymd.year, ymd.month, ymd.day,
 */
  }

  /* "cytimes/cydatetime.py":2361
 *         )
 *     else:
 *         return "%04d-%02d-%02d %02d:%02d:%02d.%06d" % (             # <<<<<<<<<<<<<<
 *             ymd.year, ymd.month, ymd.day,
 *             hms.hour, hms.minute, hms.second, microsecond,
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_10 = PyTuple_New(13); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 2361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 = 0;
    __pyx_t_9 = 127;

    /* "cytimes/cydatetime.py":2362
 *     else:
 *         return "%04d-%02d-%02d %02d:%02d:%02d.%06d" % (
 *             ymd.year, ymd.month, ymd.day,             # <<<<<<<<<<<<<<
 *             hms.hour, hms.minute, hms.second, microsecond,
 *         )
 */
    __pyx_t_7 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_ymd.year, 4, '0', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 2362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u__4);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__4);
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_kp_u__4);
    __pyx_t_7 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_ymd.month, 2, '0', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 2362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u__4);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__4);
    PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_kp_u__4);
    __pyx_t_7 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_ymd.day, 2, '0', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 2362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u__7);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__7);
    PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_kp_u__7);

    /* "cytimes/cydatetime.py":2363
 *         return "%04d-%02d-%02d %02d:%02d:%02d.%06d" % (
 *             ymd.year, ymd.month, ymd.day,
 *             hms.hour, hms.minute, hms.second, microsecond,             # <<<<<<<<<<<<<<
 *         )
 *     # fmt: on
 */
    __pyx_t_7 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_hms.hour, 2, '0', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 2363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_kp_u__5);
    __pyx_t_7 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_hms.minute, 2, '0', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 2363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 8, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u__5);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__5);
    PyTuple_SET_ITEM(__pyx_t_10, 9, __pyx_kp_u__5);
    __pyx_t_7 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_hms.second, 2, '0', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 2363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 10, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u__6);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__6);
    PyTuple_SET_ITEM(__pyx_t_10, 11, __pyx_kp_u__6);
    __pyx_t_7 = __Pyx_PyUnicode_From_unsigned_int(__pyx_v_microsecond, 6, '0', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 2363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 12, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "cytimes/cydatetime.py":2361
 *         )
 *     else:
 *         return "%04d-%02d-%02d %02d:%02d:%02d.%06d" % (             # <<<<<<<<<<<<<<
 *             ymd.year, ymd.month, ymd.day,
 *             hms.hour, hms.minute, hms.second, microsecond,
 */
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_10, 13, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 2361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_r = ((PyObject*)__pyx_t_7);
    __pyx_t_7 = 0;
    goto __pyx_L0;
  }

  /* "cytimes/cydatetime.py":2339
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.cdivision(True)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64_to_isospaceformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2368
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64_to_int(
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_dt64_to_int(PyObject *__pyx_v_dt64, PyObject *__pyx_v_unit) {
  PY_LONG_LONG __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64_to_int", 1);

  /* "cytimes/cydatetime.py":2381
 *     is smaller than the target time 'unit'.
 *     """
 *     if unit == "ns":             # <<<<<<<<<<<<<<
 *         return dt64_to_nanoseconds(dt64)
 *     elif unit == "us":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ns, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 2381, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":2382
 *     """
 *     if unit == "ns":
 *         return dt64_to_nanoseconds(dt64)             # <<<<<<<<<<<<<<
 *     elif unit == "us":
 *         return dt64_to_microseconds(dt64)
 */
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_dt64_to_nanoseconds(__pyx_v_dt64); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 2382, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2381
 *     is smaller than the target time 'unit'.
 *     """
 *     if unit == "ns":             # <<<<<<<<<<<<<<
 *         return dt64_to_nanoseconds(dt64)
 *     elif unit == "us":
 */
  }

  /* "cytimes/cydatetime.py":2383
 *     if unit == "ns":
 *         return dt64_to_nanoseconds(dt64)
 *     elif unit == "us":             # <<<<<<<<<<<<<<
 *         return dt64_to_microseconds(dt64)
 *     elif unit == "ms":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_us, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 2383, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":2384
 *         return dt64_to_nanoseconds(dt64)
 *     elif unit == "us":
 *         return dt64_to_microseconds(dt64)             # <<<<<<<<<<<<<<
 *     elif unit == "ms":
 *         return dt64_to_milliseconds(dt64)
 */
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_dt64_to_microseconds(__pyx_v_dt64); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 2384, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2383
 *     if unit == "ns":
 *         return dt64_to_nanoseconds(dt64)
 *     elif unit == "us":             # <<<<<<<<<<<<<<
 *         return dt64_to_microseconds(dt64)
 *     elif unit == "ms":
 */
  }

  /* "cytimes/cydatetime.py":2385
 *     elif unit == "us":
 *         return dt64_to_microseconds(dt64)
 *     elif unit == "ms":             # <<<<<<<<<<<<<<
 *         return dt64_to_milliseconds(dt64)
 *     elif unit == "s":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ms, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 2385, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":2386
 *         return dt64_to_microseconds(dt64)
 *     elif unit == "ms":
 *         return dt64_to_milliseconds(dt64)             # <<<<<<<<<<<<<<
 *     elif unit == "s":
 *         return dt64_to_seconds(dt64)
 */
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_dt64_to_milliseconds(__pyx_v_dt64); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 2386, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2385
 *     elif unit == "us":
 *         return dt64_to_microseconds(dt64)
 *     elif unit == "ms":             # <<<<<<<<<<<<<<
 *         return dt64_to_milliseconds(dt64)
 *     elif unit == "s":
 */
  }

  /* "cytimes/cydatetime.py":2387
 *     elif unit == "ms":
 *         return dt64_to_milliseconds(dt64)
 *     elif unit == "s":             # <<<<<<<<<<<<<<
 *         return dt64_to_seconds(dt64)
 *     elif unit == "m":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_s, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 2387, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":2388
 *         return dt64_to_milliseconds(dt64)
 *     elif unit == "s":
 *         return dt64_to_seconds(dt64)             # <<<<<<<<<<<<<<
 *     elif unit == "m":
 *         return dt64_to_minutes(dt64)
 */
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_dt64_to_seconds(__pyx_v_dt64); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 2388, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2387
 *     elif unit == "ms":
 *         return dt64_to_milliseconds(dt64)
 *     elif unit == "s":             # <<<<<<<<<<<<<<
 *         return dt64_to_seconds(dt64)
 *     elif unit == "m":
 */
  }

  /* "cytimes/cydatetime.py":2389
 *     elif unit == "s":
 *         return dt64_to_seconds(dt64)
 *     elif unit == "m":             # <<<<<<<<<<<<<<
 *         return dt64_to_minutes(dt64)
 *     elif unit == "h":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_m, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 2389, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":2390
 *         return dt64_to_seconds(dt64)
 *     elif unit == "m":
 *         return dt64_to_minutes(dt64)             # <<<<<<<<<<<<<<
 *     elif unit == "h":
 *         return dt64_to_hours(dt64)
 */
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_dt64_to_minutes(__pyx_v_dt64); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 2390, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2389
 *     elif unit == "s":
 *         return dt64_to_seconds(dt64)
 *     elif unit == "m":             # <<<<<<<<<<<<<<
 *         return dt64_to_minutes(dt64)
 *     elif unit == "h":
 */
  }

  /* "cytimes/cydatetime.py":2391
 *     elif unit == "m":
 *         return dt64_to_minutes(dt64)
 *     elif unit == "h":             # <<<<<<<<<<<<<<
 *         return dt64_to_hours(dt64)
 *     elif unit == "D" or unit == "d":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_h, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 2391, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":2392
 *         return dt64_to_minutes(dt64)
 *     elif unit == "h":
 *         return dt64_to_hours(dt64)             # <<<<<<<<<<<<<<
 *     elif unit == "D" or unit == "d":
 *         return dt64_to_days(dt64)
 */
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_dt64_to_hours(__pyx_v_dt64); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 2392, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2391
 *     elif unit == "m":
 *         return dt64_to_minutes(dt64)
 *     elif unit == "h":             # <<<<<<<<<<<<<<
 *         return dt64_to_hours(dt64)
 *     elif unit == "D" or unit == "d":
 */
  }

  /* "cytimes/cydatetime.py":2393
 *     elif unit == "h":
 *         return dt64_to_hours(dt64)
 *     elif unit == "D" or unit == "d":             # <<<<<<<<<<<<<<
 *         return dt64_to_days(dt64)
 *     else:
 */
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_D, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 2393, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_d, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 2393, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (likely(__pyx_t_1)) {

    /* "cytimes/cydatetime.py":2394
 *         return dt64_to_hours(dt64)
 *     elif unit == "D" or unit == "d":
 *         return dt64_to_days(dt64)             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_dt64_to_days(__pyx_v_dt64); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 2394, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2393
 *     elif unit == "h":
 *         return dt64_to_hours(dt64)
 *     elif unit == "D" or unit == "d":             # <<<<<<<<<<<<<<
 *         return dt64_to_days(dt64)
 *     else:
 */
  }

  /* "cytimes/cydatetime.py":2396
 *         return dt64_to_days(dt64)
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Does not support conversion of "
 *             "<'numpy.datetime64'> to time unit: %r." % unit
 */
  /*else*/ {

    /* "cytimes/cydatetime.py":2398
 *         raise ValueError(
 *             "Does not support conversion of "
 *             "<'numpy.datetime64'> to time unit: %r." % unit             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Does_not_support_conversion_of_n, __pyx_v_unit); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2398, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "cytimes/cydatetime.py":2396
 *         return dt64_to_days(dt64)
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Does not support conversion of "
 *             "<'numpy.datetime64'> to time unit: %r." % unit
 */
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2396, __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(1, 2396, __pyx_L1_error)
  }

  /* "cytimes/cydatetime.py":2368
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64_to_int(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2402
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64_to_days(dt64: object) -> cython.longlong:
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_dt64_to_days(PyObject *__pyx_v_dt64) {
  npy_datetime __pyx_v_val;
  NPY_DATETIMEUNIT __pyx_v_unit;
  PY_LONG_LONG __pyx_r;
  __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("dt64_to_days", 1);

  /* "cytimes/cydatetime.py":2412
 *     """
 *     # Access value & unit
 *     validate_dt64(dt64)             # <<<<<<<<<<<<<<
 *     val: np.npy_datetime = np.get_datetime64_value(dt64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(dt64)
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_dt64(__pyx_v_dt64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":2413
 *     # Access value & unit
 *     validate_dt64(dt64)
 *     val: np.npy_datetime = np.get_datetime64_value(dt64)             # <<<<<<<<<<<<<<
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(dt64)
 * 
 */
  __pyx_v_val = __pyx_f_5numpy_get_datetime64_value(__pyx_v_dt64);

  /* "cytimes/cydatetime.py":2414
 *     validate_dt64(dt64)
 *     val: np.npy_datetime = np.get_datetime64_value(dt64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(dt64)             # <<<<<<<<<<<<<<
 * 
 *     # Conversion
 */
  __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_v_dt64);

  /* "cytimes/cydatetime.py":2418
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // NS_DAY
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2419
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // NS_DAY             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // US_DAY
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_DAY == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2419, __pyx_L1_error)
    }
    else if (sizeof(npy_datetime) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_DAY == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2419, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_DAY);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2418
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // NS_DAY
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":2420
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // NS_DAY
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val // US_DAY
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2421
 *         return val // NS_DAY
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // US_DAY             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 86_400_000
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_US_DAY == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2421, __pyx_L1_error)
    }
    else if (sizeof(npy_datetime) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_US_DAY == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2421, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_US_DAY);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2420
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // NS_DAY
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val // US_DAY
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":2422
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // US_DAY
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val // 86_400_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2423
 *         return val // US_DAY
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 86_400_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 86_400
 */
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, 0x5265C00);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2422
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // US_DAY
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val // 86_400_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":2424
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 86_400_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val // 86_400
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2425
 *         return val // 86_400_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 86_400             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val // 1_440
 */
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, 0x15180);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2424
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 86_400_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val // 86_400
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":2426
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 86_400
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val // 1_440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2427
 *         return val // 86_400
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val // 1_440             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val // 24
 */
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, 0x5A0);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2426
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 86_400
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val // 1_440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":2428
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val // 1_440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val // 24
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2429
 *         return val // 1_440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val // 24             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val
 */
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, 24);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2428
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val // 1_440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val // 24
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":2430
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val // 24
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2431
 *         return val // 24
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __pyx_r = __pyx_v_val;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2430
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val // 24
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":2433
 *         return val
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // NS_DAY // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2434
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // NS_DAY // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_DAY // 1_000_000
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_DAY == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2434, __pyx_L1_error)
    }
    else if (sizeof(npy_datetime) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_DAY == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2434, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_datetime(__Pyx_div_npy_datetime(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_DAY), 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2433
 *         return val
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // NS_DAY // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":2435
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // NS_DAY // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // NS_DAY // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2436
 *         return val // NS_DAY // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_DAY // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // NS_DAY // 1_000_000_000
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_DAY == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2436, __pyx_L1_error)
    }
    else if (sizeof(npy_datetime) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_DAY == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2436, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_datetime(__Pyx_div_npy_datetime(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_DAY), 0xF4240);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2435
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // NS_DAY // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // NS_DAY // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":2437
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_DAY // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // NS_DAY // 1_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2438
 *         return val // NS_DAY // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // NS_DAY // 1_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_DAY == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2438, __pyx_L1_error)
    }
    else if (sizeof(npy_datetime) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_DAY == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2438, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_datetime(__Pyx_div_npy_datetime(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_DAY), 0x3B9ACA00);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2437
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_DAY // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // NS_DAY // 1_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":2442
 *     raise ValueError(
 *         "Unsupported <'numpy.datetime64'> time unit "
 *         "to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_numpy_datetime64_tim, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":2440
 *         return val // NS_DAY // 1_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'numpy.datetime64'> time unit "
 *         "to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2440, __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(1, 2440, __pyx_L1_error)

  /* "cytimes/cydatetime.py":2402
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64_to_days(dt64: object) -> cython.longlong:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64_to_days", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2446
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64_to_hours(dt64: object) -> cython.longlong:
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_dt64_to_hours(PyObject *__pyx_v_dt64) {
  npy_datetime __pyx_v_val;
  NPY_DATETIMEUNIT __pyx_v_unit;
  PY_LONG_LONG __pyx_r;
  __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("dt64_to_hours", 1);

  /* "cytimes/cydatetime.py":2456
 *     """
 *     # Access value & unit
 *     validate_dt64(dt64)             # <<<<<<<<<<<<<<
 *     val: np.npy_datetime = np.get_datetime64_value(dt64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(dt64)
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_dt64(__pyx_v_dt64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":2457
 *     # Access value & unit
 *     validate_dt64(dt64)
 *     val: np.npy_datetime = np.get_datetime64_value(dt64)             # <<<<<<<<<<<<<<
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(dt64)
 * 
 */
  __pyx_v_val = __pyx_f_5numpy_get_datetime64_value(__pyx_v_dt64);

  /* "cytimes/cydatetime.py":2458
 *     validate_dt64(dt64)
 *     val: np.npy_datetime = np.get_datetime64_value(dt64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(dt64)             # <<<<<<<<<<<<<<
 * 
 *     # Conversion
 */
  __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_v_dt64);

  /* "cytimes/cydatetime.py":2462
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // NS_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2463
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // NS_HOUR             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // US_HOUR
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_HOUR == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2463, __pyx_L1_error)
    }
    else if (sizeof(npy_datetime) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_HOUR == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2463, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_HOUR);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2462
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // NS_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":2464
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // NS_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val // US_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2465
 *         return val // NS_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // US_HOUR             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 3_600_000
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_US_HOUR == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2465, __pyx_L1_error)
    }
    else if (sizeof(npy_datetime) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_US_HOUR == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2465, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_US_HOUR);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2464
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // NS_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val // US_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":2466
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // US_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val // 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2467
 *         return val // US_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 3_600_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 3_600
 */
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, 0x36EE80);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2466
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // US_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val // 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":2468
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val // 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2469
 *         return val // 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 3_600             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val // 60
 */
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, 0xE10);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2468
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val // 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":2470
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2471
 *         return val // 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val // 60             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val
 */
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, 60);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2470
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":2472
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2473
 *         return val // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * 24
 */
    __pyx_r = __pyx_v_val;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2472
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":2474
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * 24
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2475
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * 24             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __pyx_r = (__pyx_v_val * 24);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2474
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * 24
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":2477
 *         return val * 24
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // NS_HOUR // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2478
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // NS_HOUR // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_HOUR // 1_000_000
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_HOUR == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2478, __pyx_L1_error)
    }
    else if (sizeof(npy_datetime) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_HOUR == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2478, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_datetime(__Pyx_div_npy_datetime(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_HOUR), 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2477
 *         return val * 24
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // NS_HOUR // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":2479
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // NS_HOUR // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // NS_HOUR // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2480
 *         return val // NS_HOUR // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_HOUR // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // NS_HOUR // 1_000_000_000
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_HOUR == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2480, __pyx_L1_error)
    }
    else if (sizeof(npy_datetime) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_HOUR == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2480, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_datetime(__Pyx_div_npy_datetime(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_HOUR), 0xF4240);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2479
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // NS_HOUR // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // NS_HOUR // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":2481
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_HOUR // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // NS_HOUR // 1_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2482
 *         return val // NS_HOUR // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // NS_HOUR // 1_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_HOUR == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2482, __pyx_L1_error)
    }
    else if (sizeof(npy_datetime) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_HOUR == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2482, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_datetime(__Pyx_div_npy_datetime(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_HOUR), 0x3B9ACA00);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2481
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_HOUR // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // NS_HOUR // 1_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":2486
 *     raise ValueError(
 *         "Unsupported <'numpy.datetime64'> time unit "
 *         "to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_numpy_datetime64_tim, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":2484
 *         return val // NS_HOUR // 1_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'numpy.datetime64'> time unit "
 *         "to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2484, __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(1, 2484, __pyx_L1_error)

  /* "cytimes/cydatetime.py":2446
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64_to_hours(dt64: object) -> cython.longlong:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64_to_hours", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2490
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64_to_minutes(dt64: object) -> cython.longlong:
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_dt64_to_minutes(PyObject *__pyx_v_dt64) {
  npy_datetime __pyx_v_val;
  NPY_DATETIMEUNIT __pyx_v_unit;
  PY_LONG_LONG __pyx_r;
  __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("dt64_to_minutes", 1);

  /* "cytimes/cydatetime.py":2500
 *     """
 *     # Access value & unit
 *     validate_dt64(dt64)             # <<<<<<<<<<<<<<
 *     val: np.npy_datetime = np.get_datetime64_value(dt64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(dt64)
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_dt64(__pyx_v_dt64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":2501
 *     # Access value & unit
 *     validate_dt64(dt64)
 *     val: np.npy_datetime = np.get_datetime64_value(dt64)             # <<<<<<<<<<<<<<
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(dt64)
 * 
 */
  __pyx_v_val = __pyx_f_5numpy_get_datetime64_value(__pyx_v_dt64);

  /* "cytimes/cydatetime.py":2502
 *     validate_dt64(dt64)
 *     val: np.npy_datetime = np.get_datetime64_value(dt64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(dt64)             # <<<<<<<<<<<<<<
 * 
 *     # Conversion
 */
  __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_v_dt64);

  /* "cytimes/cydatetime.py":2506
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // NS_MINUTE
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2507
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // NS_MINUTE             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 60_000_000
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_MINUTE == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2507, __pyx_L1_error)
    }
    else if (sizeof(npy_datetime) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_MINUTE == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2507, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_MINUTE);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2506
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // NS_MINUTE
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":2508
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // NS_MINUTE
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val // 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2509
 *         return val // NS_MINUTE
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 60_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 60_000
 */
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, 0x3938700);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2508
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // NS_MINUTE
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val // 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":2510
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val // 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2511
 *         return val // 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 60_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 60
 */
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, 0xEA60);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2510
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val // 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":2512
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2513
 *         return val // 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 60             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val
 */
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, 60);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2512
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":2514
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2515
 *         return val // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 60
 */
    __pyx_r = __pyx_v_val;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2514
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":2516
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2517
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 60             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * 1_440
 */
    __pyx_r = (__pyx_v_val * 60);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2516
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":2518
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * 1_440
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2519
 *         return val * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * 1_440             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __pyx_r = (__pyx_v_val * 0x5A0);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2518
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * 1_440
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":2521
 *         return val * 1_440
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // NS_MINUTE // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2522
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // NS_MINUTE // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_MINUTE // 1_000_000
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_MINUTE == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2522, __pyx_L1_error)
    }
    else if (sizeof(npy_datetime) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_MINUTE == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2522, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_datetime(__Pyx_div_npy_datetime(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_MINUTE), 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2521
 *         return val * 1_440
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // NS_MINUTE // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":2523
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // NS_MINUTE // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // NS_MINUTE // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2524
 *         return val // NS_MINUTE // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_MINUTE // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // NS_MINUTE // 1_000_000_000
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_MINUTE == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2524, __pyx_L1_error)
    }
    else if (sizeof(npy_datetime) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_MINUTE == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2524, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_datetime(__Pyx_div_npy_datetime(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_MINUTE), 0xF4240);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2523
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // NS_MINUTE // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // NS_MINUTE // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":2525
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_MINUTE // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // NS_MINUTE // 1_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2526
 *         return val // NS_MINUTE // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // NS_MINUTE // 1_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_MINUTE == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2526, __pyx_L1_error)
    }
    else if (sizeof(npy_datetime) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_MINUTE == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2526, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_datetime(__Pyx_div_npy_datetime(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_MINUTE), 0x3B9ACA00);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2525
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_MINUTE // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // NS_MINUTE // 1_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":2530
 *     raise ValueError(
 *         "Unsupported <'numpy.datetime64'> time unit "
 *         "to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_numpy_datetime64_tim, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":2528
 *         return val // NS_MINUTE // 1_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'numpy.datetime64'> time unit "
 *         "to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2528, __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(1, 2528, __pyx_L1_error)

  /* "cytimes/cydatetime.py":2490
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64_to_minutes(dt64: object) -> cython.longlong:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64_to_minutes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2534
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64_to_seconds(dt64: object) -> cython.longlong:
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_dt64_to_seconds(PyObject *__pyx_v_dt64) {
  npy_datetime __pyx_v_val;
  NPY_DATETIMEUNIT __pyx_v_unit;
  PY_LONG_LONG __pyx_r;
  __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("dt64_to_seconds", 1);

  /* "cytimes/cydatetime.py":2544
 *     """
 *     # Access value & unit
 *     validate_dt64(dt64)             # <<<<<<<<<<<<<<
 *     val: np.npy_datetime = np.get_datetime64_value(dt64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(dt64)
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_dt64(__pyx_v_dt64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":2545
 *     # Access value & unit
 *     validate_dt64(dt64)
 *     val: np.npy_datetime = np.get_datetime64_value(dt64)             # <<<<<<<<<<<<<<
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(dt64)
 * 
 */
  __pyx_v_val = __pyx_f_5numpy_get_datetime64_value(__pyx_v_dt64);

  /* "cytimes/cydatetime.py":2546
 *     validate_dt64(dt64)
 *     val: np.npy_datetime = np.get_datetime64_value(dt64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(dt64)             # <<<<<<<<<<<<<<
 * 
 *     # Conversion
 */
  __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_v_dt64);

  /* "cytimes/cydatetime.py":2550
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2551
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 1_000_000
 */
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, 0x3B9ACA00);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2550
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":2552
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2553
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 1_000
 */
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, 0xF4240);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2552
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":2554
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2555
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val
 */
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2554
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":2556
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2557
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60
 */
    __pyx_r = __pyx_v_val;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2556
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":2558
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2559
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 3_600
 */
    __pyx_r = (__pyx_v_val * 60);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2558
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":2560
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2561
 *         return val * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 3_600             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * 86_400
 */
    __pyx_r = (__pyx_v_val * 0xE10);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2560
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":2562
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * 86_400
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2563
 *         return val * 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * 86_400             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __pyx_r = (__pyx_v_val * 0x15180);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2562
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * 86_400
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":2565
 *         return val * 86_400
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2566
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000_000_000 // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000 // 1_000_000
 */
    __pyx_r = __Pyx_div_npy_datetime(__Pyx_div_npy_datetime(__pyx_v_val, 0x3B9ACA00), 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2565
 *         return val * 86_400
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":2567
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000_000_000 // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2568
 *         return val // 1_000_000_000 // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000 // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // 1_000_000_000 // 1_000_000_000
 */
    __pyx_r = __Pyx_div_npy_datetime(__Pyx_div_npy_datetime(__pyx_v_val, 0x3B9ACA00), 0xF4240);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2567
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000_000_000 // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":2569
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000 // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2570
 *         return val // 1_000_000_000 // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // 1_000_000_000 // 1_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    __pyx_r = __Pyx_div_npy_datetime(__Pyx_div_npy_datetime(__pyx_v_val, 0x3B9ACA00), 0x3B9ACA00);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2569
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000 // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":2574
 *     raise ValueError(
 *         "Unsupported <'numpy.datetime64'> time unit "
 *         "to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_numpy_datetime64_tim, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":2572
 *         return val // 1_000_000_000 // 1_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'numpy.datetime64'> time unit "
 *         "to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2572, __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(1, 2572, __pyx_L1_error)

  /* "cytimes/cydatetime.py":2534
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64_to_seconds(dt64: object) -> cython.longlong:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64_to_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2578
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64_to_milliseconds(dt64: object) -> cython.longlong:
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_dt64_to_milliseconds(PyObject *__pyx_v_dt64) {
  npy_datetime __pyx_v_val;
  NPY_DATETIMEUNIT __pyx_v_unit;
  PY_LONG_LONG __pyx_r;
  __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("dt64_to_milliseconds", 1);

  /* "cytimes/cydatetime.py":2588
 *     """
 *     # Access value & unit
 *     validate_dt64(dt64)             # <<<<<<<<<<<<<<
 *     val: np.npy_datetime = np.get_datetime64_value(dt64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(dt64)
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_dt64(__pyx_v_dt64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":2589
 *     # Access value & unit
 *     validate_dt64(dt64)
 *     val: np.npy_datetime = np.get_datetime64_value(dt64)             # <<<<<<<<<<<<<<
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(dt64)
 * 
 */
  __pyx_v_val = __pyx_f_5numpy_get_datetime64_value(__pyx_v_dt64);

  /* "cytimes/cydatetime.py":2590
 *     validate_dt64(dt64)
 *     val: np.npy_datetime = np.get_datetime64_value(dt64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(dt64)             # <<<<<<<<<<<<<<
 * 
 *     # Conversion
 */
  __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_v_dt64);

  /* "cytimes/cydatetime.py":2594
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2595
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 1_000
 */
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, 0xF4240);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2594
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":2596
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2597
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val
 */
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2596
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":2598
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2599
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000
 */
    __pyx_r = __pyx_v_val;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2598
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":2600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2601
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60_000
 */
    __pyx_r = (__pyx_v_val * 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":2602
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2603
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 3_600_000
 */
    __pyx_r = (__pyx_v_val * 0xEA60);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2602
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":2604
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2605
 *         return val * 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 3_600_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * 86_400_000
 */
    __pyx_r = (__pyx_v_val * 0x36EE80);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2604
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":2606
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * 86_400_000
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2607
 *         return val * 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * 86_400_000             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __pyx_r = (__pyx_v_val * 0x5265C00);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2606
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * 86_400_000
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":2609
 *         return val * 86_400_000
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2610
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000 // 1_000
 */
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, 0x3B9ACA00);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2609
 *         return val * 86_400_000
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":2611
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2612
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000 // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // 1_000_000_000 // 1_000_000
 */
    __pyx_r = __Pyx_div_npy_datetime(__Pyx_div_npy_datetime(__pyx_v_val, 0x3B9ACA00), 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2611
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":2613
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000 // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2614
 *         return val // 1_000_000_000 // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // 1_000_000_000 // 1_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    __pyx_r = __Pyx_div_npy_datetime(__Pyx_div_npy_datetime(__pyx_v_val, 0x3B9ACA00), 0xF4240);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2613
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000 // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":2618
 *     raise ValueError(
 *         "Unsupported <'numpy.datetime64'> time unit "
 *         "to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_numpy_datetime64_tim, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":2616
 *         return val // 1_000_000_000 // 1_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'numpy.datetime64'> time unit "
 *         "to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2616, __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(1, 2616, __pyx_L1_error)

  /* "cytimes/cydatetime.py":2578
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64_to_milliseconds(dt64: object) -> cython.longlong:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64_to_milliseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2622
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64_to_microseconds(dt64: object) -> cython.longlong:
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_dt64_to_microseconds(PyObject *__pyx_v_dt64) {
  npy_datetime __pyx_v_val;
  NPY_DATETIMEUNIT __pyx_v_unit;
  PY_LONG_LONG __pyx_r;
  __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("dt64_to_microseconds", 1);

  /* "cytimes/cydatetime.py":2632
 *     """
 *     # Access value & unit
 *     validate_dt64(dt64)             # <<<<<<<<<<<<<<
 *     val: np.npy_datetime = np.get_datetime64_value(dt64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(dt64)
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_dt64(__pyx_v_dt64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":2633
 *     # Access value & unit
 *     validate_dt64(dt64)
 *     val: np.npy_datetime = np.get_datetime64_value(dt64)             # <<<<<<<<<<<<<<
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(dt64)
 * 
 */
  __pyx_v_val = __pyx_f_5numpy_get_datetime64_value(__pyx_v_dt64);

  /* "cytimes/cydatetime.py":2634
 *     validate_dt64(dt64)
 *     val: np.npy_datetime = np.get_datetime64_value(dt64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(dt64)             # <<<<<<<<<<<<<<
 * 
 *     # Conversion
 */
  __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_v_dt64);

  /* "cytimes/cydatetime.py":2638
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2639
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val
 */
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2638
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":2640
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2641
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * 1_000
 */
    __pyx_r = __pyx_v_val;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2640
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":2642
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2643
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000_000
 */
    __pyx_r = (__pyx_v_val * 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2642
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":2644
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2645
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60_000_000
 */
    __pyx_r = (__pyx_v_val * 0xF4240);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2644
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":2646
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2647
 *         return val * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR
 */
    __pyx_r = (__pyx_v_val * 0x3938700);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2646
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":2648
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * US_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2649
 *         return val * 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * US_DAY
 */
    __pyx_r = (__pyx_v_val * __pyx_v_7cytimes_10cydatetime_US_HOUR);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2648
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * US_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":2650
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * US_DAY
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2651
 *         return val * US_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * US_DAY             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __pyx_r = (__pyx_v_val * __pyx_v_7cytimes_10cydatetime_US_DAY);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2650
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * US_DAY
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":2653
 *         return val * US_DAY
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2654
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000
 */
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, 0xF4240);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2653
 *         return val * US_DAY
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":2655
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2656
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // 1_000_000_000 // 1_000
 */
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, 0x3B9ACA00);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2655
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":2657
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2658
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // 1_000_000_000 // 1_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    __pyx_r = __Pyx_div_npy_datetime(__Pyx_div_npy_datetime(__pyx_v_val, 0x3B9ACA00), 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2657
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":2662
 *     raise ValueError(
 *         "Unsupported <'numpy.datetime64'> time unit "
 *         "to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_numpy_datetime64_tim, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":2660
 *         return val // 1_000_000_000 // 1_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'numpy.datetime64'> time unit "
 *         "to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2660, __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(1, 2660, __pyx_L1_error)

  /* "cytimes/cydatetime.py":2622
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64_to_microseconds(dt64: object) -> cython.longlong:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64_to_microseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2666
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64_to_nanoseconds(dt64: object) -> cython.longlong:
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_dt64_to_nanoseconds(PyObject *__pyx_v_dt64) {
  npy_datetime __pyx_v_val;
  NPY_DATETIMEUNIT __pyx_v_unit;
  PY_LONG_LONG __pyx_r;
  __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("dt64_to_nanoseconds", 1);

  /* "cytimes/cydatetime.py":2676
 *     """
 *     # Access value & unit
 *     validate_dt64(dt64)             # <<<<<<<<<<<<<<
 *     val: np.npy_datetime = np.get_datetime64_value(dt64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(dt64)
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_dt64(__pyx_v_dt64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":2677
 *     # Access value & unit
 *     validate_dt64(dt64)
 *     val: np.npy_datetime = np.get_datetime64_value(dt64)             # <<<<<<<<<<<<<<
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(dt64)
 * 
 */
  __pyx_v_val = __pyx_f_5numpy_get_datetime64_value(__pyx_v_dt64);

  /* "cytimes/cydatetime.py":2678
 *     validate_dt64(dt64)
 *     val: np.npy_datetime = np.get_datetime64_value(dt64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(dt64)             # <<<<<<<<<<<<<<
 * 
 *     # Conversion
 */
  __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_v_dt64);

  /* "cytimes/cydatetime.py":2682
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2683
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val * 1_000
 */
    __pyx_r = __pyx_v_val;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2682
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":2684
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2685
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val * 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * 1_000_000
 */
    __pyx_r = (__pyx_v_val * 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2684
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":2686
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2687
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000_000_000
 */
    __pyx_r = (__pyx_v_val * 0xF4240);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2686
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":2688
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val * 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2689
 *         return val * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * NS_MINUTE
 */
    __pyx_r = (__pyx_v_val * 0x3B9ACA00);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2688
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val * 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":2690
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * NS_MINUTE
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2691
 *         return val * 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * NS_MINUTE             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * NS_HOUR
 */
    __pyx_r = (__pyx_v_val * __pyx_v_7cytimes_10cydatetime_NS_MINUTE);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2690
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * NS_MINUTE
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":2692
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * NS_MINUTE
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * NS_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2693
 *         return val * NS_MINUTE
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * NS_HOUR             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * NS_DAY
 */
    __pyx_r = (__pyx_v_val * __pyx_v_7cytimes_10cydatetime_NS_HOUR);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2692
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * NS_MINUTE
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * NS_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":2694
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * NS_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * NS_DAY
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2695
 *         return val * NS_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * NS_DAY             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __pyx_r = (__pyx_v_val * __pyx_v_7cytimes_10cydatetime_NS_DAY);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2694
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * NS_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * NS_DAY
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":2697
 *         return val * NS_DAY
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2698
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000
 */
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2697
 *         return val * NS_DAY
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":2699
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2700
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // 1_000_000_000
 */
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, 0xF4240);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2699
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":2701
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2702
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // 1_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    __pyx_r = __Pyx_div_npy_datetime(__pyx_v_val, 0x3B9ACA00);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2701
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":2706
 *     raise ValueError(
 *         "Unsupported <'numpy.datetime64'> time unit "
 *         "to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_numpy_datetime64_tim, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":2704
 *         return val // 1_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'numpy.datetime64'> time unit "
 *         "to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2704, __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(1, 2704, __pyx_L1_error)

  /* "cytimes/cydatetime.py":2666
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64_to_nanoseconds(dt64: object) -> cython.longlong:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64_to_nanoseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2710
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64_to_date(dt64: object) -> datetime.date:
 */

static PyDateTime_Date *__pyx_f_7cytimes_10cydatetime_dt64_to_date(PyObject *__pyx_v_dt64) {
  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("dt64_to_date", 1);

  /* "cytimes/cydatetime.py":2723
 *     unit is smaller than 'day (D)'.
 *     """
 *     return date_fr_ordinal(dt64_to_days(dt64) + EPOCH_DAY)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_dt64_to_days(__pyx_v_dt64); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 2723, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_date_fr_ordinal((__pyx_t_1 + __pyx_v_7cytimes_10cydatetime_EPOCH_DAY))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":2710
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64_to_date(dt64: object) -> datetime.date:
 */

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

/* "cytimes/cydatetime.py":2726
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64_to_dt(dt64: object) -> datetime.datetime:
 */

static PyDateTime_DateTime *__pyx_f_7cytimes_10cydatetime_dt64_to_dt(PyObject *__pyx_v_dt64) {
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PY_LONG_LONG __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_microseconds __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64_to_dt", 1);

  /* "cytimes/cydatetime.py":2739
 *     unit is smaller than 'microsecond (us)'.
 *     """
 *     return dt_fr_microseconds(dt64_to_microseconds(dt64), None, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_dt64_to_microseconds(__pyx_v_dt64); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 2739, __pyx_L1_error)
  __pyx_t_3.__pyx_n = 2;
  __pyx_t_3.tzinfo = ((PyDateTime_TZInfo *)Py_None);
  __pyx_t_3.fold = 0;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt_fr_microseconds(__pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":2726
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64_to_dt(dt64: object) -> datetime.datetime:
 */

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

/* "cytimes/cydatetime.py":2742
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64_to_time(dt64: object) -> datetime.time:
 */

static PyDateTime_Time *__pyx_f_7cytimes_10cydatetime_dt64_to_time(PyObject *__pyx_v_dt64) {
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PY_LONG_LONG __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7cytimes_10cydatetime_time_fr_microseconds __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64_to_time", 1);

  /* "cytimes/cydatetime.py":2755
 *     datetime64, all other information will be discarded.
 *     """
 *     return time_fr_microseconds(dt64_to_microseconds(dt64), None, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_dt64_to_microseconds(__pyx_v_dt64); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 2755, __pyx_L1_error)
  __pyx_t_3.__pyx_n = 2;
  __pyx_t_3.tzinfo = ((PyDateTime_TZInfo *)Py_None);
  __pyx_t_3.fold = 0;
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_time_fr_microseconds(__pyx_t_1, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_Time *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":2742
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64_to_time(dt64: object) -> datetime.time:
 */

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

/* "cytimes/cydatetime.py":2760
 * # numpy.timedelta64 ====================================================================================
 * # numpy.timedelta64: check types -----------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static int __pyx_f_7cytimes_10cydatetime_is_td64(PyObject *__pyx_v_obj) {
  int __pyx_r;

  /* "cytimes/cydatetime.py":2767
 *     Equivalent to `isinstance(obj, numpy.timedelta64)`.
 *     """
 *     return np.is_timedelta64_object(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_5numpy_is_timedelta64_object(__pyx_v_obj);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":2760
 * # numpy.timedelta64 ====================================================================================
 * # numpy.timedelta64: check types -----------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

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

/* "cytimes/cydatetime.py":2770
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def validate_td64(obj: object):
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_validate_td64(PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("validate_td64", 1);

  /* "cytimes/cydatetime.py":2775
 *     """Validate if an object is type of `<'numpy.timedelta64'>`.
 *     Raise `TypeError` if the object type is incorrect."""
 *     if not np.is_timedelta64_object(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'numpy.timedelta64'>, " "instead got: %s %r." % (type(obj), obj)
 */
  __pyx_t_1 = (!__pyx_f_5numpy_is_timedelta64_object(__pyx_v_obj));
  if (unlikely(__pyx_t_1)) {

    /* "cytimes/cydatetime.py":2777
 *     if not np.is_timedelta64_object(obj):
 *         raise TypeError(
 *             "Expects <'numpy.timedelta64'>, " "instead got: %s %r." % (type(obj), obj)             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2777, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_4 = 127;
    __Pyx_INCREF(__pyx_kp_u_Expects_numpy_timedelta64_instea);
    __pyx_t_3 += 44;
    __Pyx_GIVEREF(__pyx_kp_u_Expects_numpy_timedelta64_instea);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Expects_numpy_timedelta64_instea);
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(((PyObject *)Py_TYPE(__pyx_v_obj))), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2777, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__7);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__7);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__7);
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_obj), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2777, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__6);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__6);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__6);
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2777, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cytimes/cydatetime.py":2776
 *     Raise `TypeError` if the object type is incorrect."""
 *     if not np.is_timedelta64_object(obj):
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'numpy.timedelta64'>, " "instead got: %s %r." % (type(obj), obj)
 *         )
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2776, __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(1, 2776, __pyx_L1_error)

    /* "cytimes/cydatetime.py":2775
 *     """Validate if an object is type of `<'numpy.timedelta64'>`.
 *     Raise `TypeError` if the object type is incorrect."""
 *     if not np.is_timedelta64_object(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'numpy.timedelta64'>, " "instead got: %s %r." % (type(obj), obj)
 */
  }

  /* "cytimes/cydatetime.py":2770
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def validate_td64(obj: object):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.cydatetime.validate_td64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2782
 * 
 * # numpy.timedelta64: conversion ------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.cdivision(True)
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_td64_to_isoformat(PyObject *__pyx_v_td64) {
  PY_LONG_LONG __pyx_v_us;
  int __pyx_v_negate;
  PY_LONG_LONG __pyx_v_hours;
  PY_LONG_LONG __pyx_v_minutes;
  PY_LONG_LONG __pyx_v_seconds;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PY_LONG_LONG __pyx_t_1;
  int __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("td64_to_isoformat", 1);

  /* "cytimes/cydatetime.py":2787
 * def td64_to_isoformat(td64: object) -> str:
 *     """Convert numpy.timedelta64 to ISO format: '%H:%M:%S.f' `<'str'>`."""
 *     us: cython.longlong = td64_to_microseconds(td64)             # <<<<<<<<<<<<<<
 *     negate: cython.bint = us < 0
 *     us = abs(us)
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_td64_to_microseconds(__pyx_v_td64); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 2787, __pyx_L1_error)
  __pyx_v_us = __pyx_t_1;

  /* "cytimes/cydatetime.py":2788
 *     """Convert numpy.timedelta64 to ISO format: '%H:%M:%S.f' `<'str'>`."""
 *     us: cython.longlong = td64_to_microseconds(td64)
 *     negate: cython.bint = us < 0             # <<<<<<<<<<<<<<
 *     us = abs(us)
 *     hours = us // US_HOUR
 */
  __pyx_v_negate = (__pyx_v_us < 0);

  /* "cytimes/cydatetime.py":2789
 *     us: cython.longlong = td64_to_microseconds(td64)
 *     negate: cython.bint = us < 0
 *     us = abs(us)             # <<<<<<<<<<<<<<
 *     hours = us // US_HOUR
 *     us %= US_HOUR
 */
  __pyx_t_1 = __Pyx_abs_longlong(__pyx_v_us); 
  __pyx_v_us = __pyx_t_1;

  /* "cytimes/cydatetime.py":2790
 *     negate: cython.bint = us < 0
 *     us = abs(us)
 *     hours = us // US_HOUR             # <<<<<<<<<<<<<<
 *     us %= US_HOUR
 *     minutes = us // 60_000_000
 */
  __pyx_v_hours = (__pyx_v_us / __pyx_v_7cytimes_10cydatetime_US_HOUR);

  /* "cytimes/cydatetime.py":2791
 *     us = abs(us)
 *     hours = us // US_HOUR
 *     us %= US_HOUR             # <<<<<<<<<<<<<<
 *     minutes = us // 60_000_000
 *     us %= 60_000_000
 */
  __pyx_v_us = (__pyx_v_us % __pyx_v_7cytimes_10cydatetime_US_HOUR);

  /* "cytimes/cydatetime.py":2792
 *     hours = us // US_HOUR
 *     us %= US_HOUR
 *     minutes = us // 60_000_000             # <<<<<<<<<<<<<<
 *     us %= 60_000_000
 *     seconds = us // 1_000_000
 */
  __pyx_v_minutes = (__pyx_v_us / 0x3938700);

  /* "cytimes/cydatetime.py":2793
 *     us %= US_HOUR
 *     minutes = us // 60_000_000
 *     us %= 60_000_000             # <<<<<<<<<<<<<<
 *     seconds = us // 1_000_000
 *     us %= 1_000_000
 */
  __pyx_v_us = (__pyx_v_us % 0x3938700);

  /* "cytimes/cydatetime.py":2794
 *     minutes = us // 60_000_000
 *     us %= 60_000_000
 *     seconds = us // 1_000_000             # <<<<<<<<<<<<<<
 *     us %= 1_000_000
 *     if us == 0:
 */
  __pyx_v_seconds = (__pyx_v_us / 0xF4240);

  /* "cytimes/cydatetime.py":2795
 *     us %= 60_000_000
 *     seconds = us // 1_000_000
 *     us %= 1_000_000             # <<<<<<<<<<<<<<
 *     if us == 0:
 *         if negate:
 */
  __pyx_v_us = (__pyx_v_us % 0xF4240);

  /* "cytimes/cydatetime.py":2796
 *     seconds = us // 1_000_000
 *     us %= 1_000_000
 *     if us == 0:             # <<<<<<<<<<<<<<
 *         if negate:
 *             return "-%02d:%02d:%02d" % (hours, minutes, seconds)
 */
  __pyx_t_2 = (__pyx_v_us == 0);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2797
 *     us %= 1_000_000
 *     if us == 0:
 *         if negate:             # <<<<<<<<<<<<<<
 *             return "-%02d:%02d:%02d" % (hours, minutes, seconds)
 *         else:
 */
    if (__pyx_v_negate) {

      /* "cytimes/cydatetime.py":2798
 *     if us == 0:
 *         if negate:
 *             return "-%02d:%02d:%02d" % (hours, minutes, seconds)             # <<<<<<<<<<<<<<
 *         else:
 *             return "%02d:%02d:%02d" % (hours, minutes, seconds)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2798, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = 0;
      __pyx_t_5 = 127;
      __Pyx_INCREF(__pyx_kp_u__4);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u__4);
      __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_hours, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 2798, __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__5);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__5);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__5);
      __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 2798, __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__5);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__5);
      PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__5);
      __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_seconds, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 2798, __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(1, 2798, __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;

      /* "cytimes/cydatetime.py":2797
 *     us %= 1_000_000
 *     if us == 0:
 *         if negate:             # <<<<<<<<<<<<<<
 *             return "-%02d:%02d:%02d" % (hours, minutes, seconds)
 *         else:
 */
    }

    /* "cytimes/cydatetime.py":2800
 *             return "-%02d:%02d:%02d" % (hours, minutes, seconds)
 *         else:
 *             return "%02d:%02d:%02d" % (hours, minutes, seconds)             # <<<<<<<<<<<<<<
 *     else:
 *         if negate:
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 2800, __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(1, 2800, __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__5);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__5);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_kp_u__5);
      __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2800, __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__5);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__5);
      PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_kp_u__5);
      __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_seconds, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2800, __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_t_3 = __Pyx_PyUnicode_Join(__pyx_t_6, 5, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2800, __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;
    }

    /* "cytimes/cydatetime.py":2796
 *     seconds = us // 1_000_000
 *     us %= 1_000_000
 *     if us == 0:             # <<<<<<<<<<<<<<
 *         if negate:
 *             return "-%02d:%02d:%02d" % (hours, minutes, seconds)
 */
  }

  /* "cytimes/cydatetime.py":2802
 *             return "%02d:%02d:%02d" % (hours, minutes, seconds)
 *     else:
 *         if negate:             # <<<<<<<<<<<<<<
 *             return "-%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)
 *         else:
 */
  /*else*/ {
    if (__pyx_v_negate) {

      /* "cytimes/cydatetime.py":2803
 *     else:
 *         if negate:
 *             return "-%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)             # <<<<<<<<<<<<<<
 *         else:
 *             return "%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2803, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = 0;
      __pyx_t_5 = 127;
      __Pyx_INCREF(__pyx_kp_u__4);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u__4);
      __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_hours, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 2803, __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__5);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__5);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__5);
      __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 2803, __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__5);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__5);
      PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__5);
      __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_seconds, 2, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 2803, __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_INCREF(__pyx_kp_u__6);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__6);
      PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_kp_u__6);
      __pyx_t_6 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_us, 6, '0', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 2803, __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, 7, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 8, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 2803, __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;

      /* "cytimes/cydatetime.py":2802
 *             return "%02d:%02d:%02d" % (hours, minutes, seconds)
 *     else:
 *         if negate:             # <<<<<<<<<<<<<<
 *             return "-%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)
 *         else:
 */
    }

    /* "cytimes/cydatetime.py":2805
 *             return "-%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)
 *         else:
 *             return "%02d:%02d:%02d.%06d" % (hours, minutes, seconds, us)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 2805, __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(1, 2805, __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__5);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__5);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_kp_u__5);
      __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_minutes, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2805, __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__5);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__5);
      PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_kp_u__5);
      __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_seconds, 2, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2805, __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__6);
      __pyx_t_4 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__6);
      PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_kp_u__6);
      __pyx_t_3 = __Pyx_PyUnicode_From_PY_LONG_LONG(__pyx_v_us, 6, '0', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2805, __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(1, 2805, __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;
    }
  }

  /* "cytimes/cydatetime.py":2782
 * 
 * # numpy.timedelta64: conversion ------------------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.cdivision(True)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cytimes.cydatetime.td64_to_isoformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2808
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64_to_int(
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_td64_to_int(PyObject *__pyx_v_td64, PyObject *__pyx_v_unit) {
  PY_LONG_LONG __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("td64_to_int", 1);

  /* "cytimes/cydatetime.py":2821
 *     is smaller than the target time 'unit'.
 *     """
 *     if unit == "ns":             # <<<<<<<<<<<<<<
 *         return td64_to_nanoseconds(td64)
 *     elif unit == "us":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ns, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 2821, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":2822
 *     """
 *     if unit == "ns":
 *         return td64_to_nanoseconds(td64)             # <<<<<<<<<<<<<<
 *     elif unit == "us":
 *         return td64_to_microseconds(td64)
 */
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_td64_to_nanoseconds(__pyx_v_td64); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 2822, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2821
 *     is smaller than the target time 'unit'.
 *     """
 *     if unit == "ns":             # <<<<<<<<<<<<<<
 *         return td64_to_nanoseconds(td64)
 *     elif unit == "us":
 */
  }

  /* "cytimes/cydatetime.py":2823
 *     if unit == "ns":
 *         return td64_to_nanoseconds(td64)
 *     elif unit == "us":             # <<<<<<<<<<<<<<
 *         return td64_to_microseconds(td64)
 *     elif unit == "ms":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_us, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 2823, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":2824
 *         return td64_to_nanoseconds(td64)
 *     elif unit == "us":
 *         return td64_to_microseconds(td64)             # <<<<<<<<<<<<<<
 *     elif unit == "ms":
 *         return td64_to_milliseconds(td64)
 */
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_td64_to_microseconds(__pyx_v_td64); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 2824, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2823
 *     if unit == "ns":
 *         return td64_to_nanoseconds(td64)
 *     elif unit == "us":             # <<<<<<<<<<<<<<
 *         return td64_to_microseconds(td64)
 *     elif unit == "ms":
 */
  }

  /* "cytimes/cydatetime.py":2825
 *     elif unit == "us":
 *         return td64_to_microseconds(td64)
 *     elif unit == "ms":             # <<<<<<<<<<<<<<
 *         return td64_to_milliseconds(td64)
 *     elif unit == "s":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ms, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 2825, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":2826
 *         return td64_to_microseconds(td64)
 *     elif unit == "ms":
 *         return td64_to_milliseconds(td64)             # <<<<<<<<<<<<<<
 *     elif unit == "s":
 *         return td64_to_seconds(td64)
 */
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_td64_to_milliseconds(__pyx_v_td64); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 2826, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2825
 *     elif unit == "us":
 *         return td64_to_microseconds(td64)
 *     elif unit == "ms":             # <<<<<<<<<<<<<<
 *         return td64_to_milliseconds(td64)
 *     elif unit == "s":
 */
  }

  /* "cytimes/cydatetime.py":2827
 *     elif unit == "ms":
 *         return td64_to_milliseconds(td64)
 *     elif unit == "s":             # <<<<<<<<<<<<<<
 *         return td64_to_seconds(td64)
 *     elif unit == "m":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_s, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 2827, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":2828
 *         return td64_to_milliseconds(td64)
 *     elif unit == "s":
 *         return td64_to_seconds(td64)             # <<<<<<<<<<<<<<
 *     elif unit == "m":
 *         return td64_to_minutes(td64)
 */
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_td64_to_seconds(__pyx_v_td64); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 2828, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2827
 *     elif unit == "ms":
 *         return td64_to_milliseconds(td64)
 *     elif unit == "s":             # <<<<<<<<<<<<<<
 *         return td64_to_seconds(td64)
 *     elif unit == "m":
 */
  }

  /* "cytimes/cydatetime.py":2829
 *     elif unit == "s":
 *         return td64_to_seconds(td64)
 *     elif unit == "m":             # <<<<<<<<<<<<<<
 *         return td64_to_minutes(td64)
 *     elif unit == "h":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_m, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 2829, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":2830
 *         return td64_to_seconds(td64)
 *     elif unit == "m":
 *         return td64_to_minutes(td64)             # <<<<<<<<<<<<<<
 *     elif unit == "h":
 *         return td64_to_hours(td64)
 */
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_td64_to_minutes(__pyx_v_td64); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 2830, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2829
 *     elif unit == "s":
 *         return td64_to_seconds(td64)
 *     elif unit == "m":             # <<<<<<<<<<<<<<
 *         return td64_to_minutes(td64)
 *     elif unit == "h":
 */
  }

  /* "cytimes/cydatetime.py":2831
 *     elif unit == "m":
 *         return td64_to_minutes(td64)
 *     elif unit == "h":             # <<<<<<<<<<<<<<
 *         return td64_to_hours(td64)
 *     elif unit == "D" or unit == "d":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_h, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 2831, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":2832
 *         return td64_to_minutes(td64)
 *     elif unit == "h":
 *         return td64_to_hours(td64)             # <<<<<<<<<<<<<<
 *     elif unit == "D" or unit == "d":
 *         return td64_to_days(td64)
 */
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_td64_to_hours(__pyx_v_td64); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 2832, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2831
 *     elif unit == "m":
 *         return td64_to_minutes(td64)
 *     elif unit == "h":             # <<<<<<<<<<<<<<
 *         return td64_to_hours(td64)
 *     elif unit == "D" or unit == "d":
 */
  }

  /* "cytimes/cydatetime.py":2833
 *     elif unit == "h":
 *         return td64_to_hours(td64)
 *     elif unit == "D" or unit == "d":             # <<<<<<<<<<<<<<
 *         return td64_to_days(td64)
 *     else:
 */
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_D, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 2833, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_d, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 2833, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (likely(__pyx_t_1)) {

    /* "cytimes/cydatetime.py":2834
 *         return td64_to_hours(td64)
 *     elif unit == "D" or unit == "d":
 *         return td64_to_days(td64)             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_td64_to_days(__pyx_v_td64); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 2834, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2833
 *     elif unit == "h":
 *         return td64_to_hours(td64)
 *     elif unit == "D" or unit == "d":             # <<<<<<<<<<<<<<
 *         return td64_to_days(td64)
 *     else:
 */
  }

  /* "cytimes/cydatetime.py":2836
 *         return td64_to_days(td64)
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Does not support conversion of "
 *             "<'numpy.timedelta64'> to time unit: %r." % unit
 */
  /*else*/ {

    /* "cytimes/cydatetime.py":2838
 *         raise ValueError(
 *             "Does not support conversion of "
 *             "<'numpy.timedelta64'> to time unit: %r." % unit             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Does_not_support_conversion_of_n_2, __pyx_v_unit); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "cytimes/cydatetime.py":2836
 *         return td64_to_days(td64)
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Does not support conversion of "
 *             "<'numpy.timedelta64'> to time unit: %r." % unit
 */
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 2836, __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(1, 2836, __pyx_L1_error)
  }

  /* "cytimes/cydatetime.py":2808
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64_to_int(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.cydatetime.td64_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2842
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64_to_days(td64: object) -> cython.longlong:
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_td64_to_days(PyObject *__pyx_v_td64) {
  npy_timedelta __pyx_v_val;
  NPY_DATETIMEUNIT __pyx_v_unit;
  PY_LONG_LONG __pyx_r;
  __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("td64_to_days", 1);

  /* "cytimes/cydatetime.py":2852
 *     """
 *     # Access value & unit
 *     validate_td64(td64)             # <<<<<<<<<<<<<<
 *     val: np.npy_timedelta = np.get_timedelta64_value(td64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(td64)
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_td64(__pyx_v_td64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":2853
 *     # Access value & unit
 *     validate_td64(td64)
 *     val: np.npy_timedelta = np.get_timedelta64_value(td64)             # <<<<<<<<<<<<<<
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(td64)
 * 
 */
  __pyx_v_val = __pyx_f_5numpy_get_timedelta64_value(__pyx_v_td64);

  /* "cytimes/cydatetime.py":2854
 *     validate_td64(td64)
 *     val: np.npy_timedelta = np.get_timedelta64_value(td64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(td64)             # <<<<<<<<<<<<<<
 * 
 *     # Conversion
 */
  __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_v_td64);

  /* "cytimes/cydatetime.py":2858
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // NS_DAY
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2859
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // NS_DAY             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // US_DAY
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_DAY == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2859, __pyx_L1_error)
    }
    else if (sizeof(npy_timedelta) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_DAY == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2859, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_DAY);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2858
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // NS_DAY
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":2860
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // NS_DAY
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val // US_DAY
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2861
 *         return val // NS_DAY
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // US_DAY             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 86_400_000
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_US_DAY == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2861, __pyx_L1_error)
    }
    else if (sizeof(npy_timedelta) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_US_DAY == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2861, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_US_DAY);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2860
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // NS_DAY
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val // US_DAY
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":2862
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // US_DAY
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val // 86_400_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2863
 *         return val // US_DAY
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 86_400_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 86_400
 */
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, 0x5265C00);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2862
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // US_DAY
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val // 86_400_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":2864
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 86_400_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val // 86_400
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2865
 *         return val // 86_400_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 86_400             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val // 1_440
 */
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, 0x15180);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2864
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 86_400_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val // 86_400
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":2866
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 86_400
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val // 1_440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2867
 *         return val // 86_400
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val // 1_440             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val // 24
 */
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, 0x5A0);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2866
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 86_400
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val // 1_440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":2868
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val // 1_440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val // 24
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2869
 *         return val // 1_440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val // 24             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val
 */
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, 24);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2868
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val // 1_440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val // 24
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":2870
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val // 24
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2871
 *         return val // 24
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __pyx_r = __pyx_v_val;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2870
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val // 24
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":2873
 *         return val
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // NS_DAY // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2874
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // NS_DAY // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_DAY // 1_000_000
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_DAY == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2874, __pyx_L1_error)
    }
    else if (sizeof(npy_timedelta) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_DAY == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2874, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_timedelta(__Pyx_div_npy_timedelta(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_DAY), 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2873
 *         return val
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // NS_DAY // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":2875
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // NS_DAY // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // NS_DAY // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2876
 *         return val // NS_DAY // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_DAY // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // NS_DAY // 1_000_000_000
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_DAY == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2876, __pyx_L1_error)
    }
    else if (sizeof(npy_timedelta) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_DAY == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2876, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_timedelta(__Pyx_div_npy_timedelta(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_DAY), 0xF4240);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2875
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // NS_DAY // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // NS_DAY // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":2877
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_DAY // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // NS_DAY // 1_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2878
 *         return val // NS_DAY // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // NS_DAY // 1_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_DAY == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2878, __pyx_L1_error)
    }
    else if (sizeof(npy_timedelta) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_DAY == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2878, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_timedelta(__Pyx_div_npy_timedelta(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_DAY), 0x3B9ACA00);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2877
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_DAY // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // NS_DAY // 1_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":2882
 *     raise ValueError(
 *         "Unsupported <'numpy.timedelta64'> time unit "
 *         "to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_numpy_timedelta64_ti, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":2880
 *         return val // NS_DAY // 1_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'numpy.timedelta64'> time unit "
 *         "to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2880, __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(1, 2880, __pyx_L1_error)

  /* "cytimes/cydatetime.py":2842
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64_to_days(td64: object) -> cython.longlong:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.td64_to_days", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2886
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64_to_hours(td64: object) -> cython.longlong:
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_td64_to_hours(PyObject *__pyx_v_td64) {
  npy_timedelta __pyx_v_val;
  NPY_DATETIMEUNIT __pyx_v_unit;
  PY_LONG_LONG __pyx_r;
  __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("td64_to_hours", 1);

  /* "cytimes/cydatetime.py":2896
 *     """
 *     # Access value & unit
 *     validate_td64(td64)             # <<<<<<<<<<<<<<
 *     val: np.npy_timedelta = np.get_timedelta64_value(td64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(td64)
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_td64(__pyx_v_td64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":2897
 *     # Access value & unit
 *     validate_td64(td64)
 *     val: np.npy_timedelta = np.get_timedelta64_value(td64)             # <<<<<<<<<<<<<<
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(td64)
 * 
 */
  __pyx_v_val = __pyx_f_5numpy_get_timedelta64_value(__pyx_v_td64);

  /* "cytimes/cydatetime.py":2898
 *     validate_td64(td64)
 *     val: np.npy_timedelta = np.get_timedelta64_value(td64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(td64)             # <<<<<<<<<<<<<<
 * 
 *     # Conversion
 */
  __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_v_td64);

  /* "cytimes/cydatetime.py":2902
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // NS_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2903
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // NS_HOUR             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // US_HOUR
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_HOUR == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2903, __pyx_L1_error)
    }
    else if (sizeof(npy_timedelta) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_HOUR == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2903, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_HOUR);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2902
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // NS_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":2904
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // NS_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val // US_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2905
 *         return val // NS_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // US_HOUR             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 3_600_000
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_US_HOUR == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2905, __pyx_L1_error)
    }
    else if (sizeof(npy_timedelta) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_US_HOUR == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2905, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_US_HOUR);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2904
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // NS_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val // US_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":2906
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // US_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val // 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2907
 *         return val // US_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 3_600_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 3_600
 */
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, 0x36EE80);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2906
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // US_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val // 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":2908
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val // 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2909
 *         return val // 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 3_600             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val // 60
 */
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, 0xE10);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2908
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val // 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":2910
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2911
 *         return val // 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val // 60             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val
 */
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, 60);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2910
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":2912
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2913
 *         return val // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * 24
 */
    __pyx_r = __pyx_v_val;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2912
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":2914
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * 24
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2915
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * 24             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __pyx_r = (__pyx_v_val * 24);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2914
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * 24
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":2917
 *         return val * 24
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // NS_HOUR // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2918
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // NS_HOUR // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_HOUR // 1_000_000
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_HOUR == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2918, __pyx_L1_error)
    }
    else if (sizeof(npy_timedelta) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_HOUR == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2918, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_timedelta(__Pyx_div_npy_timedelta(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_HOUR), 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2917
 *         return val * 24
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // NS_HOUR // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":2919
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // NS_HOUR // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // NS_HOUR // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2920
 *         return val // NS_HOUR // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_HOUR // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // NS_HOUR // 1_000_000_000
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_HOUR == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2920, __pyx_L1_error)
    }
    else if (sizeof(npy_timedelta) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_HOUR == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2920, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_timedelta(__Pyx_div_npy_timedelta(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_HOUR), 0xF4240);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2919
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // NS_HOUR // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // NS_HOUR // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":2921
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_HOUR // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // NS_HOUR // 1_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2922
 *         return val // NS_HOUR // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // NS_HOUR // 1_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_HOUR == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2922, __pyx_L1_error)
    }
    else if (sizeof(npy_timedelta) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_HOUR == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2922, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_timedelta(__Pyx_div_npy_timedelta(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_HOUR), 0x3B9ACA00);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2921
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_HOUR // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // NS_HOUR // 1_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":2926
 *     raise ValueError(
 *         "Unsupported <'numpy.timedelta64'> time unit "
 *         "to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2926, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_numpy_timedelta64_ti, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2926, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":2924
 *         return val // NS_HOUR // 1_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'numpy.timedelta64'> time unit "
 *         "to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2924, __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(1, 2924, __pyx_L1_error)

  /* "cytimes/cydatetime.py":2886
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64_to_hours(td64: object) -> cython.longlong:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.td64_to_hours", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2930
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64_to_minutes(td64: object) -> cython.longlong:
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_td64_to_minutes(PyObject *__pyx_v_td64) {
  npy_timedelta __pyx_v_val;
  NPY_DATETIMEUNIT __pyx_v_unit;
  PY_LONG_LONG __pyx_r;
  __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("td64_to_minutes", 1);

  /* "cytimes/cydatetime.py":2940
 *     """
 *     # Access value & unit
 *     validate_td64(td64)             # <<<<<<<<<<<<<<
 *     val: np.npy_timedelta = np.get_timedelta64_value(td64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(td64)
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_td64(__pyx_v_td64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":2941
 *     # Access value & unit
 *     validate_td64(td64)
 *     val: np.npy_timedelta = np.get_timedelta64_value(td64)             # <<<<<<<<<<<<<<
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(td64)
 * 
 */
  __pyx_v_val = __pyx_f_5numpy_get_timedelta64_value(__pyx_v_td64);

  /* "cytimes/cydatetime.py":2942
 *     validate_td64(td64)
 *     val: np.npy_timedelta = np.get_timedelta64_value(td64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(td64)             # <<<<<<<<<<<<<<
 * 
 *     # Conversion
 */
  __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_v_td64);

  /* "cytimes/cydatetime.py":2946
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // NS_MINUTE
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2947
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // NS_MINUTE             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 60_000_000
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_MINUTE == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2947, __pyx_L1_error)
    }
    else if (sizeof(npy_timedelta) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_MINUTE == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2947, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_MINUTE);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2946
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // NS_MINUTE
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":2948
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // NS_MINUTE
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val // 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2949
 *         return val // NS_MINUTE
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 60_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 60_000
 */
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, 0x3938700);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2948
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // NS_MINUTE
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val // 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":2950
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val // 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2951
 *         return val // 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 60_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 60
 */
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, 0xEA60);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2950
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val // 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":2952
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2953
 *         return val // 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 60             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val
 */
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, 60);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2952
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":2954
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2955
 *         return val // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 60
 */
    __pyx_r = __pyx_v_val;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2954
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":2956
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2957
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 60             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * 1_440
 */
    __pyx_r = (__pyx_v_val * 60);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2956
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":2958
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * 1_440
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2959
 *         return val * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * 1_440             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __pyx_r = (__pyx_v_val * 0x5A0);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2958
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * 1_440
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":2961
 *         return val * 1_440
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // NS_MINUTE // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2962
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // NS_MINUTE // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_MINUTE // 1_000_000
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_MINUTE == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2962, __pyx_L1_error)
    }
    else if (sizeof(npy_timedelta) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_MINUTE == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2962, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_timedelta(__Pyx_div_npy_timedelta(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_MINUTE), 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2961
 *         return val * 1_440
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // NS_MINUTE // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":2963
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // NS_MINUTE // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // NS_MINUTE // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2964
 *         return val // NS_MINUTE // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_MINUTE // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // NS_MINUTE // 1_000_000_000
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_MINUTE == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2964, __pyx_L1_error)
    }
    else if (sizeof(npy_timedelta) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_MINUTE == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2964, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_timedelta(__Pyx_div_npy_timedelta(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_MINUTE), 0xF4240);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2963
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // NS_MINUTE // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // NS_MINUTE // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":2965
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_MINUTE // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // NS_MINUTE // 1_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2966
 *         return val // NS_MINUTE // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // NS_MINUTE // 1_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    if (unlikely(__pyx_v_7cytimes_10cydatetime_NS_MINUTE == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(1, 2966, __pyx_L1_error)
    }
    else if (sizeof(npy_timedelta) == sizeof(long) && (!(((PY_LONG_LONG)-1) > 0)) && unlikely(__pyx_v_7cytimes_10cydatetime_NS_MINUTE == (PY_LONG_LONG)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_val))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(1, 2966, __pyx_L1_error)
    }
    __pyx_r = __Pyx_div_npy_timedelta(__Pyx_div_npy_timedelta(__pyx_v_val, __pyx_v_7cytimes_10cydatetime_NS_MINUTE), 0x3B9ACA00);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2965
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // NS_MINUTE // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // NS_MINUTE // 1_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":2970
 *     raise ValueError(
 *         "Unsupported <'numpy.timedelta64'> time unit "
 *         "to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_numpy_timedelta64_ti, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":2968
 *         return val // NS_MINUTE // 1_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'numpy.timedelta64'> time unit "
 *         "to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2968, __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(1, 2968, __pyx_L1_error)

  /* "cytimes/cydatetime.py":2930
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64_to_minutes(td64: object) -> cython.longlong:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.td64_to_minutes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":2974
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64_to_seconds(td64: object) -> cython.longlong:
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_td64_to_seconds(PyObject *__pyx_v_td64) {
  npy_timedelta __pyx_v_val;
  NPY_DATETIMEUNIT __pyx_v_unit;
  PY_LONG_LONG __pyx_r;
  __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("td64_to_seconds", 1);

  /* "cytimes/cydatetime.py":2984
 *     """
 *     # Access value & unit
 *     validate_td64(td64)             # <<<<<<<<<<<<<<
 *     val: np.npy_timedelta = np.get_timedelta64_value(td64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(td64)
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_td64(__pyx_v_td64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":2985
 *     # Access value & unit
 *     validate_td64(td64)
 *     val: np.npy_timedelta = np.get_timedelta64_value(td64)             # <<<<<<<<<<<<<<
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(td64)
 * 
 */
  __pyx_v_val = __pyx_f_5numpy_get_timedelta64_value(__pyx_v_td64);

  /* "cytimes/cydatetime.py":2986
 *     validate_td64(td64)
 *     val: np.npy_timedelta = np.get_timedelta64_value(td64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(td64)             # <<<<<<<<<<<<<<
 * 
 *     # Conversion
 */
  __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_v_td64);

  /* "cytimes/cydatetime.py":2990
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2991
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 1_000_000
 */
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, 0x3B9ACA00);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2990
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":2992
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2993
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 1_000
 */
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, 0xF4240);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2992
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":2994
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2995
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val
 */
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2994
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":2996
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2997
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60
 */
    __pyx_r = __pyx_v_val;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2996
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":2998
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":2999
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 3_600
 */
    __pyx_r = (__pyx_v_val * 60);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":2998
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":3000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3001
 *         return val * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 3_600             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * 86_400
 */
    __pyx_r = (__pyx_v_val * 0xE10);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":3002
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * 86_400
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3003
 *         return val * 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * 86_400             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __pyx_r = (__pyx_v_val * 0x15180);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3002
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * 86_400
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":3005
 *         return val * 86_400
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3006
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000_000_000 // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000 // 1_000_000
 */
    __pyx_r = __Pyx_div_npy_timedelta(__Pyx_div_npy_timedelta(__pyx_v_val, 0x3B9ACA00), 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3005
 *         return val * 86_400
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":3007
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000_000_000 // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3008
 *         return val // 1_000_000_000 // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000 // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // 1_000_000_000 // 1_000_000_000
 */
    __pyx_r = __Pyx_div_npy_timedelta(__Pyx_div_npy_timedelta(__pyx_v_val, 0x3B9ACA00), 0xF4240);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3007
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000_000_000 // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":3009
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000 // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3010
 *         return val // 1_000_000_000 // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // 1_000_000_000 // 1_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    __pyx_r = __Pyx_div_npy_timedelta(__Pyx_div_npy_timedelta(__pyx_v_val, 0x3B9ACA00), 0x3B9ACA00);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3009
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000 // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":3014
 *     raise ValueError(
 *         "Unsupported <'numpy.timedelta64'> time unit "
 *         "to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_numpy_timedelta64_ti, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3012
 *         return val // 1_000_000_000 // 1_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'numpy.timedelta64'> time unit "
 *         "to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3012, __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(1, 3012, __pyx_L1_error)

  /* "cytimes/cydatetime.py":2974
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64_to_seconds(td64: object) -> cython.longlong:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.td64_to_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":3018
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64_to_milliseconds(td64: object) -> cython.longlong:
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_td64_to_milliseconds(PyObject *__pyx_v_td64) {
  npy_timedelta __pyx_v_val;
  NPY_DATETIMEUNIT __pyx_v_unit;
  PY_LONG_LONG __pyx_r;
  __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("td64_to_milliseconds", 1);

  /* "cytimes/cydatetime.py":3028
 *     """
 *     # Access value & unit
 *     validate_td64(td64)             # <<<<<<<<<<<<<<
 *     val: np.npy_timedelta = np.get_timedelta64_value(td64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(td64)
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_td64(__pyx_v_td64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3029
 *     # Access value & unit
 *     validate_td64(td64)
 *     val: np.npy_timedelta = np.get_timedelta64_value(td64)             # <<<<<<<<<<<<<<
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(td64)
 * 
 */
  __pyx_v_val = __pyx_f_5numpy_get_timedelta64_value(__pyx_v_td64);

  /* "cytimes/cydatetime.py":3030
 *     validate_td64(td64)
 *     val: np.npy_timedelta = np.get_timedelta64_value(td64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(td64)             # <<<<<<<<<<<<<<
 * 
 *     # Conversion
 */
  __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_v_td64);

  /* "cytimes/cydatetime.py":3034
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3035
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 1_000
 */
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, 0xF4240);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3034
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":3036
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3037
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val
 */
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3036
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":3038
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3039
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000
 */
    __pyx_r = __pyx_v_val;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3038
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":3040
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3041
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60_000
 */
    __pyx_r = (__pyx_v_val * 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3040
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":3042
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3043
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 3_600_000
 */
    __pyx_r = (__pyx_v_val * 0xEA60);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3042
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":3044
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3045
 *         return val * 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 3_600_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * 86_400_000
 */
    __pyx_r = (__pyx_v_val * 0x36EE80);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3044
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":3046
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * 86_400_000
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3047
 *         return val * 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * 86_400_000             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __pyx_r = (__pyx_v_val * 0x5265C00);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3046
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * 86_400_000
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":3049
 *         return val * 86_400_000
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3050
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000 // 1_000
 */
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, 0x3B9ACA00);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3049
 *         return val * 86_400_000
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":3051
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3052
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000 // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // 1_000_000_000 // 1_000_000
 */
    __pyx_r = __Pyx_div_npy_timedelta(__Pyx_div_npy_timedelta(__pyx_v_val, 0x3B9ACA00), 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3051
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":3053
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000 // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3054
 *         return val // 1_000_000_000 // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // 1_000_000_000 // 1_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    __pyx_r = __Pyx_div_npy_timedelta(__Pyx_div_npy_timedelta(__pyx_v_val, 0x3B9ACA00), 0xF4240);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3053
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000 // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":3058
 *     raise ValueError(
 *         "Unsupported <'numpy.timedelta64'> time unit "
 *         "to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3058, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_numpy_timedelta64_ti, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3058, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3056
 *         return val // 1_000_000_000 // 1_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'numpy.timedelta64'> time unit "
 *         "to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3056, __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(1, 3056, __pyx_L1_error)

  /* "cytimes/cydatetime.py":3018
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64_to_milliseconds(td64: object) -> cython.longlong:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.td64_to_milliseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":3062
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64_to_microseconds(td64: object) -> cython.longlong:
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_td64_to_microseconds(PyObject *__pyx_v_td64) {
  npy_timedelta __pyx_v_val;
  NPY_DATETIMEUNIT __pyx_v_unit;
  PY_LONG_LONG __pyx_r;
  __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("td64_to_microseconds", 1);

  /* "cytimes/cydatetime.py":3072
 *     """
 *     # Access value & unit
 *     validate_td64(td64)             # <<<<<<<<<<<<<<
 *     val: np.npy_timedelta = np.get_timedelta64_value(td64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(td64)
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_td64(__pyx_v_td64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3073
 *     # Access value & unit
 *     validate_td64(td64)
 *     val: np.npy_timedelta = np.get_timedelta64_value(td64)             # <<<<<<<<<<<<<<
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(td64)
 * 
 */
  __pyx_v_val = __pyx_f_5numpy_get_timedelta64_value(__pyx_v_td64);

  /* "cytimes/cydatetime.py":3074
 *     validate_td64(td64)
 *     val: np.npy_timedelta = np.get_timedelta64_value(td64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(td64)             # <<<<<<<<<<<<<<
 * 
 *     # Conversion
 */
  __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_v_td64);

  /* "cytimes/cydatetime.py":3078
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3079
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val
 */
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3078
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":3080
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3081
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * 1_000
 */
    __pyx_r = __pyx_v_val;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3080
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":3082
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3083
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000_000
 */
    __pyx_r = (__pyx_v_val * 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3082
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":3084
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3085
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60_000_000
 */
    __pyx_r = (__pyx_v_val * 0xF4240);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3084
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":3086
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3087
 *         return val * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR
 */
    __pyx_r = (__pyx_v_val * 0x3938700);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3086
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":3088
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * US_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3089
 *         return val * 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * US_DAY
 */
    __pyx_r = (__pyx_v_val * __pyx_v_7cytimes_10cydatetime_US_HOUR);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3088
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * US_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":3090
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * US_DAY
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3091
 *         return val * US_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * US_DAY             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __pyx_r = (__pyx_v_val * __pyx_v_7cytimes_10cydatetime_US_DAY);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3090
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * US_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * US_DAY
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":3093
 *         return val * US_DAY
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3094
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000
 */
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, 0xF4240);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3093
 *         return val * US_DAY
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":3095
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3096
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // 1_000_000_000 // 1_000
 */
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, 0x3B9ACA00);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3095
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":3097
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3098
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // 1_000_000_000 // 1_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    __pyx_r = __Pyx_div_npy_timedelta(__Pyx_div_npy_timedelta(__pyx_v_val, 0x3B9ACA00), 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3097
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000 // 1_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":3102
 *     raise ValueError(
 *         "Unsupported <'numpy.timedelta64'> time unit "
 *         "to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_numpy_timedelta64_ti, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3100
 *         return val // 1_000_000_000 // 1_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'numpy.timedelta64'> time unit "
 *         "to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3100, __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(1, 3100, __pyx_L1_error)

  /* "cytimes/cydatetime.py":3062
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64_to_microseconds(td64: object) -> cython.longlong:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.td64_to_microseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":3106
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64_to_nanoseconds(td64: object) -> cython.longlong:
 */

static PY_LONG_LONG __pyx_f_7cytimes_10cydatetime_td64_to_nanoseconds(PyObject *__pyx_v_td64) {
  npy_timedelta __pyx_v_val;
  NPY_DATETIMEUNIT __pyx_v_unit;
  PY_LONG_LONG __pyx_r;
  __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("td64_to_nanoseconds", 1);

  /* "cytimes/cydatetime.py":3116
 *     """
 *     # Access value & unit
 *     validate_td64(td64)             # <<<<<<<<<<<<<<
 *     val: np.npy_timedelta = np.get_timedelta64_value(td64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(td64)
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_td64(__pyx_v_td64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3117
 *     # Access value & unit
 *     validate_td64(td64)
 *     val: np.npy_timedelta = np.get_timedelta64_value(td64)             # <<<<<<<<<<<<<<
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(td64)
 * 
 */
  __pyx_v_val = __pyx_f_5numpy_get_timedelta64_value(__pyx_v_td64);

  /* "cytimes/cydatetime.py":3118
 *     validate_td64(td64)
 *     val: np.npy_timedelta = np.get_timedelta64_value(td64)
 *     unit: np.NPY_DATETIMEUNIT = np.get_datetime64_unit(td64)             # <<<<<<<<<<<<<<
 * 
 *     # Conversion
 */
  __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_v_td64);

  /* "cytimes/cydatetime.py":3122
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3123
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val * 1_000
 */
    __pyx_r = __pyx_v_val;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3122
 *     # Conversion
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":3124
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3125
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val * 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * 1_000_000
 */
    __pyx_r = (__pyx_v_val * 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3124
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return val
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":3126
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3127
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000_000_000
 */
    __pyx_r = (__pyx_v_val * 0xF4240);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3126
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return val * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return val * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":3128
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val * 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3129
 *         return val * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * NS_MINUTE
 */
    __pyx_r = (__pyx_v_val * 0x3B9ACA00);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3128
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return val * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return val * 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":3130
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * NS_MINUTE
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3131
 *         return val * 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * NS_MINUTE             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * NS_HOUR
 */
    __pyx_r = (__pyx_v_val * __pyx_v_7cytimes_10cydatetime_NS_MINUTE);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3130
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return val * 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return val * NS_MINUTE
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":3132
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * NS_MINUTE
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * NS_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3133
 *         return val * NS_MINUTE
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * NS_HOUR             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * NS_DAY
 */
    __pyx_r = (__pyx_v_val * __pyx_v_7cytimes_10cydatetime_NS_HOUR);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3132
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return val * NS_MINUTE
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return val * NS_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":3134
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * NS_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * NS_DAY
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3135
 *         return val * NS_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return val * NS_DAY             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __pyx_r = (__pyx_v_val * __pyx_v_7cytimes_10cydatetime_NS_DAY);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3134
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return val * NS_HOUR
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return val * NS_DAY
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":3137
 *         return val * NS_DAY
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3138
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000
 */
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, 0x3E8);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3137
 *         return val * NS_DAY
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":3139
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3140
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // 1_000_000_000
 */
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, 0xF4240);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3139
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return val // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":3141
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3142
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return val // 1_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    __pyx_r = __Pyx_div_npy_timedelta(__pyx_v_val, 0x3B9ACA00);
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3141
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return val // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return val // 1_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":3146
 *     raise ValueError(
 *         "Unsupported <'numpy.timedelta64'> time unit "
 *         "to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_numpy_timedelta64_ti, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3144
 *         return val // 1_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'numpy.timedelta64'> time unit "
 *         "to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3144, __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(1, 3144, __pyx_L1_error)

  /* "cytimes/cydatetime.py":3106
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64_to_nanoseconds(td64: object) -> cython.longlong:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.td64_to_nanoseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":3150
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64_to_td(td64: object) -> datetime.timedelta:
 */

static PyDateTime_Delta *__pyx_f_7cytimes_10cydatetime_td64_to_td(PyObject *__pyx_v_td64) {
  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("td64_to_td", 1);

  /* "cytimes/cydatetime.py":3158
 *     Percision will be lost if the timedelta64
 *     unit is smaller than 'microsecond (us)'."""
 *     return td_fr_microseconds(td64_to_microseconds(td64))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_td64_to_microseconds(__pyx_v_td64); if (unlikely(__pyx_t_1 == ((PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(1, 3158, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_td_fr_microseconds(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":3150
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64_to_td(td64: object) -> datetime.timedelta:
 */

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

/* "cytimes/cydatetime.py":3163
 * # numpy.ndarray[dateimte64] ============================================================================
 * # numpy.ndarray[dateimte64]: type checks ---------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static int __pyx_f_7cytimes_10cydatetime_is_dt64array(PyArrayObject *__pyx_v_arr) {
  int __pyx_r;

  /* "cytimes/cydatetime.py":3169
 *     """Check if a ndarray is dtype of datetime64 `<'bool'>`.
 *     Equivalent to `isinstance(arr.dtype, np.dtypes.DateTime64DType)`."""
 *     return np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_DATETIME             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (PyArray_TYPE(__pyx_v_arr) == NPY_DATETIME);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":3163
 * # numpy.ndarray[dateimte64] ============================================================================
 * # numpy.ndarray[dateimte64]: type checks ---------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

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

/* "cytimes/cydatetime.py":3172
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def validate_dt64array(arr: np.ndarray):
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_validate_dt64array(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("validate_dt64array", 1);

  /* "cytimes/cydatetime.py":3177
 *     """Validate if a ndarray is dtype of datetime64.
 *     Raise `TypeError` if dtype is incorrect."""
 *     if not is_dt64array(arr):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'ndarray[datetime64]'>, "
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_is_dt64array(__pyx_v_arr); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 3177, __pyx_L1_error)
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {

    /* "cytimes/cydatetime.py":3180
 *         raise TypeError(
 *             "Expects <'ndarray[datetime64]'>, "
 *             "instead got: <'ndarray[%s]'>." % (arr.dtype)             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_ndarray_datetime64_inste, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cytimes/cydatetime.py":3178
 *     Raise `TypeError` if dtype is incorrect."""
 *     if not is_dt64array(arr):
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'ndarray[datetime64]'>, "
 *             "instead got: <'ndarray[%s]'>." % (arr.dtype)
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3178, __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(1, 3178, __pyx_L1_error)

    /* "cytimes/cydatetime.py":3177
 *     """Validate if a ndarray is dtype of datetime64.
 *     Raise `TypeError` if dtype is incorrect."""
 *     if not is_dt64array(arr):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'ndarray[datetime64]'>, "
 */
  }

  /* "cytimes/cydatetime.py":3172
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def validate_dt64array(arr: np.ndarray):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.cydatetime.validate_dt64array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":3184
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def get_dt64array_unit(arr: np.ndarray) -> str:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_get_dt64array_unit(PyArrayObject *__pyx_v_arr) {
  NPY_DATETIMEUNIT __pyx_v_unit;
  Py_ssize_t __pyx_v_ndim;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_dt64array_unit", 1);

  /* "cytimes/cydatetime.py":3190
 *     such as: 'D', 's', 'ms', 'us', 'ns', etc `<'str'>`."""
 *     # Validate array
 *     validate_dt64array(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_dt64array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3194
 *     # Get time unit
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim             # <<<<<<<<<<<<<<
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 */
  __pyx_v_ndim = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr);

  /* "cytimes/cydatetime.py":3195
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return parse_dt64array_unit(arr)
 */
  switch (__pyx_v_ndim) {
    case 1:

    /* "cytimes/cydatetime.py":3196
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return parse_dt64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]) == 0);
    if (__pyx_t_2) {

      /* "cytimes/cydatetime.py":3197
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 *             return parse_dt64array_unit(arr)             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_parse_dt64array_unit(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3197, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3196
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return parse_dt64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0])
 */
    }

    /* "cytimes/cydatetime.py":3198
 *         if arr.shape[0] == 0:
 *             return parse_dt64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0])             # <<<<<<<<<<<<<<
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 */
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_arr), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3195
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return parse_dt64array_unit(arr)
 */
    break;
    case 2:

    /* "cytimes/cydatetime.py":3200
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return parse_dt64array_unit(arr)
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3201
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 *             return parse_dt64array_unit(arr)             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_parse_dt64array_unit(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3201, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3200
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return parse_dt64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3202
 *         if arr.shape[1] == 0:
 *             return parse_dt64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3199
 *             return parse_dt64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:             # <<<<<<<<<<<<<<
 *         if arr.shape[1] == 0:
 *             return parse_dt64array_unit(arr)
 */
    break;
    case 3:

    /* "cytimes/cydatetime.py":3204
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return parse_dt64array_unit(arr)
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3205
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 *             return parse_dt64array_unit(arr)             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_parse_dt64array_unit(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3205, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3204
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return parse_dt64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3206
 *         if arr.shape[2] == 0:
 *             return parse_dt64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3203
 *             return parse_dt64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:             # <<<<<<<<<<<<<<
 *         if arr.shape[2] == 0:
 *             return parse_dt64array_unit(arr)
 */
    break;
    case 4:

    /* "cytimes/cydatetime.py":3208
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return parse_dt64array_unit(arr)
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3209
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 *             return parse_dt64array_unit(arr)             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_parse_dt64array_unit(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3209, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3208
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return parse_dt64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3210
 *         if arr.shape[3] == 0:
 *             return parse_dt64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__14); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3207
 *             return parse_dt64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:             # <<<<<<<<<<<<<<
 *         if arr.shape[3] == 0:
 *             return parse_dt64array_unit(arr)
 */
    break;
    default:

    /* "cytimes/cydatetime.py":3214
 *         raise ValueError(
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Only_support_ndarray_with_up_to, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3212
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3212, __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(1, 3212, __pyx_L1_error)
    break;
  }

  /* "cytimes/cydatetime.py":3218
 * 
 *     # Match unit: common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         return "ns"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3219
 *     # Match unit: common
 *     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;

    /* "cytimes/cydatetime.py":3218
 * 
 *     # Match unit: common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         return "ns"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
  }

  /* "cytimes/cydatetime.py":3220
 *     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_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3221
 *         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;

    /* "cytimes/cydatetime.py":3220
 *     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:
 */
  }

  /* "cytimes/cydatetime.py":3222
 *     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_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3223
 *         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;

    /* "cytimes/cydatetime.py":3222
 *     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:
 */
  }

  /* "cytimes/cydatetime.py":3224
 *     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_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3225
 *         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;

    /* "cytimes/cydatetime.py":3224
 *     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:
 */
  }

  /* "cytimes/cydatetime.py":3226
 *     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_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3227
 *         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;

    /* "cytimes/cydatetime.py":3226
 *     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:
 */
  }

  /* "cytimes/cydatetime.py":3228
 *     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_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3229
 *         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;

    /* "cytimes/cydatetime.py":3228
 *     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:
 */
  }

  /* "cytimes/cydatetime.py":3230
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         return "h"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:             # <<<<<<<<<<<<<<
 *         return "D"
 *     # Match unit: uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3231
 *         return "h"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 *         return "D"             # <<<<<<<<<<<<<<
 *     # Match unit: uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_D);
    __pyx_r = __pyx_n_u_D;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3230
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         return "h"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:             # <<<<<<<<<<<<<<
 *         return "D"
 *     # Match unit: uncommon
 */
  }

  /* "cytimes/cydatetime.py":3233
 *         return "D"
 *     # Match unit: uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:             # <<<<<<<<<<<<<<
 *         return "ps"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3234
 *     # Match unit: uncommon
 *     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;

    /* "cytimes/cydatetime.py":3233
 *         return "D"
 *     # Match unit: uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:             # <<<<<<<<<<<<<<
 *         return "ps"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:
 */
  }

  /* "cytimes/cydatetime.py":3235
 *     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_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3236
 *         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;

    /* "cytimes/cydatetime.py":3235
 *     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:
 */
  }

  /* "cytimes/cydatetime.py":3237
 *     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_Y:
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3238
 *         return "fs"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:
 *         return "as"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:
 *         return "Y"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_as);
    __pyx_r = __pyx_n_u_as;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3237
 *     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_Y:
 */
  }

  /* "cytimes/cydatetime.py":3239
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:
 *         return "as"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:             # <<<<<<<<<<<<<<
 *         return "Y"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3240
 *         return "as"
 *     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;

    /* "cytimes/cydatetime.py":3239
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:
 *         return "as"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:             # <<<<<<<<<<<<<<
 *         return "Y"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 */
  }

  /* "cytimes/cydatetime.py":3241
 *     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_2 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3242
 *         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;

    /* "cytimes/cydatetime.py":3241
 *     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:
 */
  }

  /* "cytimes/cydatetime.py":3243
 *     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_B:
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3244
 *         return "M"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:
 *         return "W"             # <<<<<<<<<<<<<<
 *     # if unit == np.NPY_DATETIMEUNIT.NPY_FR_B:
 *     #     return "B"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_W);
    __pyx_r = __pyx_n_u_W;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3243
 *     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_B:
 */
  }

  /* "cytimes/cydatetime.py":3247
 *     # if unit == np.NPY_DATETIMEUNIT.NPY_FR_B:
 *     #     return "B"
 *     raise ValueError("Unknown <'ndarray[datetime64]'> time unit: %d." % unit)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unknown_ndarray_datetime64_time, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3247, __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(1, 3247, __pyx_L1_error)

  /* "cytimes/cydatetime.py":3184
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def get_dt64array_unit(arr: np.ndarray) -> str:
 */

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

/* "cytimes/cydatetime.py":3250
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def parse_dt64array_unit(arr: np.ndarray) -> str:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_parse_dt64array_unit(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_v_dtype_str = NULL;
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_dt64array_unit", 1);

  /* "cytimes/cydatetime.py":3255
 *     """Prase the time unit of the `<'ndarray[datetime64]'>`
 *     from 'ndarray.dtype.str' `<'str'>`."""
 *     dtype_str = arr.dtype.str             # <<<<<<<<<<<<<<
 *     unit: str = str_substr(dtype_str, 4, str_len(dtype_str) - 1)
 *     if not 1 <= str_len(unit) <= 2:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dtype_str = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/cydatetime.py":3256
 *     from 'ndarray.dtype.str' `<'str'>`."""
 *     dtype_str = arr.dtype.str
 *     unit: str = str_substr(dtype_str, 4, str_len(dtype_str) - 1)             # <<<<<<<<<<<<<<
 *     if not 1 <= str_len(unit) <= 2:
 *         raise ValueError(
 */
  __pyx_t_2 = PyUnicode_Substring(__pyx_v_dtype_str, 4, (PyUnicode_GET_LENGTH(__pyx_v_dtype_str) - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_unit = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/cydatetime.py":3257
 *     dtype_str = arr.dtype.str
 *     unit: str = str_substr(dtype_str, 4, str_len(dtype_str) - 1)
 *     if not 1 <= str_len(unit) <= 2:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "Unable to parse <'ndarray[datetime64]'> "
 */
  __pyx_t_3 = PyUnicode_GET_LENGTH(__pyx_v_unit);
  __pyx_t_4 = (1 <= __pyx_t_3);
  if (__pyx_t_4) {
    __pyx_t_4 = (__pyx_t_3 <= 2);
  }
  __pyx_t_5 = (!__pyx_t_4);
  if (unlikely(__pyx_t_5)) {

    /* "cytimes/cydatetime.py":3260
 *         raise ValueError(
 *             "Unable to parse <'ndarray[datetime64]'> "
 *             "time unit from: '%s'." % dtype_str             # <<<<<<<<<<<<<<
 *         )
 *     return unit
 */
    __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Unable_to_parse_ndarray_datetime, __pyx_v_dtype_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cytimes/cydatetime.py":3258
 *     unit: str = str_substr(dtype_str, 4, str_len(dtype_str) - 1)
 *     if not 1 <= str_len(unit) <= 2:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Unable to parse <'ndarray[datetime64]'> "
 *             "time unit from: '%s'." % dtype_str
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3258, __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(1, 3258, __pyx_L1_error)

    /* "cytimes/cydatetime.py":3257
 *     dtype_str = arr.dtype.str
 *     unit: str = str_substr(dtype_str, 4, str_len(dtype_str) - 1)
 *     if not 1 <= str_len(unit) <= 2:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "Unable to parse <'ndarray[datetime64]'> "
 */
  }

  /* "cytimes/cydatetime.py":3262
 *             "time unit from: '%s'." % dtype_str
 *         )
 *     return unit             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_unit);
  __pyx_r = __pyx_v_unit;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":3250
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def parse_dt64array_unit(arr: np.ndarray) -> str:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.cydatetime.parse_dt64array_unit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dtype_str);
  __Pyx_XDECREF(__pyx_v_unit);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":3266
 * 
 * # numpy.ndarray[dateimte64]: conversion ----------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64array_to_int(
 */

static PyArrayObject *__pyx_f_7cytimes_10cydatetime_dt64array_to_int(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_unit) {
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64array_to_int", 1);

  /* "cytimes/cydatetime.py":3279
 *     unit is smaller than the target time 'unit'.
 *     """
 *     if unit == "ns":             # <<<<<<<<<<<<<<
 *         return dt64array_to_nanoseconds(arr)
 *     elif unit == "us":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ns, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 3279, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":3280
 *     """
 *     if unit == "ns":
 *         return dt64array_to_nanoseconds(arr)             # <<<<<<<<<<<<<<
 *     elif unit == "us":
 *         return dt64array_to_microseconds(arr)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt64array_to_nanoseconds(__pyx_v_arr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3279
 *     unit is smaller than the target time 'unit'.
 *     """
 *     if unit == "ns":             # <<<<<<<<<<<<<<
 *         return dt64array_to_nanoseconds(arr)
 *     elif unit == "us":
 */
  }

  /* "cytimes/cydatetime.py":3281
 *     if unit == "ns":
 *         return dt64array_to_nanoseconds(arr)
 *     elif unit == "us":             # <<<<<<<<<<<<<<
 *         return dt64array_to_microseconds(arr)
 *     elif unit == "ms":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_us, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 3281, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":3282
 *         return dt64array_to_nanoseconds(arr)
 *     elif unit == "us":
 *         return dt64array_to_microseconds(arr)             # <<<<<<<<<<<<<<
 *     elif unit == "ms":
 *         return dt64array_to_milliseconds(arr)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt64array_to_microseconds(__pyx_v_arr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3281
 *     if unit == "ns":
 *         return dt64array_to_nanoseconds(arr)
 *     elif unit == "us":             # <<<<<<<<<<<<<<
 *         return dt64array_to_microseconds(arr)
 *     elif unit == "ms":
 */
  }

  /* "cytimes/cydatetime.py":3283
 *     elif unit == "us":
 *         return dt64array_to_microseconds(arr)
 *     elif unit == "ms":             # <<<<<<<<<<<<<<
 *         return dt64array_to_milliseconds(arr)
 *     elif unit == "s":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ms, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 3283, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":3284
 *         return dt64array_to_microseconds(arr)
 *     elif unit == "ms":
 *         return dt64array_to_milliseconds(arr)             # <<<<<<<<<<<<<<
 *     elif unit == "s":
 *         return dt64array_to_seconds(arr)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt64array_to_milliseconds(__pyx_v_arr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3283
 *     elif unit == "us":
 *         return dt64array_to_microseconds(arr)
 *     elif unit == "ms":             # <<<<<<<<<<<<<<
 *         return dt64array_to_milliseconds(arr)
 *     elif unit == "s":
 */
  }

  /* "cytimes/cydatetime.py":3285
 *     elif unit == "ms":
 *         return dt64array_to_milliseconds(arr)
 *     elif unit == "s":             # <<<<<<<<<<<<<<
 *         return dt64array_to_seconds(arr)
 *     elif unit == "m":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_s, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 3285, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":3286
 *         return dt64array_to_milliseconds(arr)
 *     elif unit == "s":
 *         return dt64array_to_seconds(arr)             # <<<<<<<<<<<<<<
 *     elif unit == "m":
 *         return dt64array_to_minutes(arr)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt64array_to_seconds(__pyx_v_arr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3285
 *     elif unit == "ms":
 *         return dt64array_to_milliseconds(arr)
 *     elif unit == "s":             # <<<<<<<<<<<<<<
 *         return dt64array_to_seconds(arr)
 *     elif unit == "m":
 */
  }

  /* "cytimes/cydatetime.py":3287
 *     elif unit == "s":
 *         return dt64array_to_seconds(arr)
 *     elif unit == "m":             # <<<<<<<<<<<<<<
 *         return dt64array_to_minutes(arr)
 *     elif unit == "h":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_m, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 3287, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":3288
 *         return dt64array_to_seconds(arr)
 *     elif unit == "m":
 *         return dt64array_to_minutes(arr)             # <<<<<<<<<<<<<<
 *     elif unit == "h":
 *         return dt64array_to_hours(arr)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt64array_to_minutes(__pyx_v_arr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3287
 *     elif unit == "s":
 *         return dt64array_to_seconds(arr)
 *     elif unit == "m":             # <<<<<<<<<<<<<<
 *         return dt64array_to_minutes(arr)
 *     elif unit == "h":
 */
  }

  /* "cytimes/cydatetime.py":3289
 *     elif unit == "m":
 *         return dt64array_to_minutes(arr)
 *     elif unit == "h":             # <<<<<<<<<<<<<<
 *         return dt64array_to_hours(arr)
 *     elif unit == "D" or unit == "d":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_h, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 3289, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":3290
 *         return dt64array_to_minutes(arr)
 *     elif unit == "h":
 *         return dt64array_to_hours(arr)             # <<<<<<<<<<<<<<
 *     elif unit == "D" or unit == "d":
 *         return dt64array_to_days(arr)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt64array_to_hours(__pyx_v_arr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3289
 *     elif unit == "m":
 *         return dt64array_to_minutes(arr)
 *     elif unit == "h":             # <<<<<<<<<<<<<<
 *         return dt64array_to_hours(arr)
 *     elif unit == "D" or unit == "d":
 */
  }

  /* "cytimes/cydatetime.py":3291
 *     elif unit == "h":
 *         return dt64array_to_hours(arr)
 *     elif unit == "D" or unit == "d":             # <<<<<<<<<<<<<<
 *         return dt64array_to_days(arr)
 *     else:
 */
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_D, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 3291, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_d, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 3291, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (likely(__pyx_t_1)) {

    /* "cytimes/cydatetime.py":3292
 *         return dt64array_to_hours(arr)
 *     elif unit == "D" or unit == "d":
 *         return dt64array_to_days(arr)             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt64array_to_days(__pyx_v_arr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3291
 *     elif unit == "h":
 *         return dt64array_to_hours(arr)
 *     elif unit == "D" or unit == "d":             # <<<<<<<<<<<<<<
 *         return dt64array_to_days(arr)
 *     else:
 */
  }

  /* "cytimes/cydatetime.py":3294
 *         return dt64array_to_days(arr)
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Does not support conversion of "
 *             "<'ndarray[datetime64]'> to time unit: %r." % unit
 */
  /*else*/ {

    /* "cytimes/cydatetime.py":3296
 *         raise ValueError(
 *             "Does not support conversion of "
 *             "<'ndarray[datetime64]'> to time unit: %r." % unit             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Does_not_support_conversion_of_n_3, __pyx_v_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cytimes/cydatetime.py":3294
 *         return dt64array_to_days(arr)
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Does not support conversion of "
 *             "<'ndarray[datetime64]'> to time unit: %r." % unit
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(1, 3294, __pyx_L1_error)
  }

  /* "cytimes/cydatetime.py":3266
 * 
 * # numpy.ndarray[dateimte64]: conversion ----------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64array_to_int(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64array_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":3300
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64array_to_days(arr: np.ndarray) -> np.ndarray:
 */

static PyArrayObject *__pyx_f_7cytimes_10cydatetime_dt64array_to_days(PyArrayObject *__pyx_v_arr) {
  NPY_DATETIMEUNIT __pyx_v_unit;
  Py_ssize_t __pyx_v_ndim;
  PyArrayObject *__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("dt64array_to_days", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/cydatetime.py":3310
 *     """
 *     # Validate array
 *     validate_dt64array(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_dt64array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3314
 *     # Get time unit
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim             # <<<<<<<<<<<<<<
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 */
  __pyx_v_ndim = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr);

  /* "cytimes/cydatetime.py":3315
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
  switch (__pyx_v_ndim) {
    case 1:

    /* "cytimes/cydatetime.py":3316
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]) == 0);
    if (__pyx_t_2) {

      /* "cytimes/cydatetime.py":3317
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3316
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    }

    /* "cytimes/cydatetime.py":3318
 *         if arr.shape[0] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])             # <<<<<<<<<<<<<<
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 */
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_arr), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3315
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
    break;
    case 2:

    /* "cytimes/cydatetime.py":3320
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3321
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3320
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3322
 *         if arr.shape[1] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3322, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3319
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:             # <<<<<<<<<<<<<<
 *         if arr.shape[1] == 0:
 *             return arr
 */
    break;
    case 3:

    /* "cytimes/cydatetime.py":3324
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3325
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3324
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3326
 *         if arr.shape[2] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3323
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:             # <<<<<<<<<<<<<<
 *         if arr.shape[2] == 0:
 *             return arr
 */
    break;
    case 4:

    /* "cytimes/cydatetime.py":3328
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3329
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3328
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3330
 *         if arr.shape[3] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__14); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3330, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3327
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:             # <<<<<<<<<<<<<<
 *         if arr.shape[3] == 0:
 *             return arr
 */
    break;
    default:

    /* "cytimes/cydatetime.py":3334
 *         raise ValueError(
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Only_support_ndarray_with_up_to, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3332
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3332, __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(1, 3332, __pyx_L1_error)
    break;
  }

  /* "cytimes/cydatetime.py":3338
 * 
 *     # Conversion
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)             # <<<<<<<<<<<<<<
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 */
  __pyx_t_1 = PyArray_Cast(__pyx_v_arr, NPY_INT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3338, __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(1, 3338, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3340
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3341
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 86_400_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 86_400_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0x4e94914f0000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3341, __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(1, 3341, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3340
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":3342
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 86_400_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3343
 *         return arr // 86_400_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 86_400_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 86_400_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_86400000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3343, __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(1, 3343, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3342
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 86_400_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":3344
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 86_400_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3345
 *         return arr // 86_400_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 86_400_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 86_400
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_86400000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3345, __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(1, 3345, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3344
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 86_400_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":3346
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 86_400_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr // 86_400
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3347
 *         return arr // 86_400_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 86_400             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr // 1_440
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_86400); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3347, __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(1, 3347, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3346
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 86_400_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr // 86_400
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":3348
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 86_400
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr // 1_440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3349
 *         return arr // 86_400
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr // 1_440             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr // 24
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1440); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3349, __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(1, 3349, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3348
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 86_400
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr // 1_440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":3350
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr // 1_440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr // 24
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3351
 *         return arr // 1_440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr // 24             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_24); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3351, __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(1, 3351, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3350
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr // 1_440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr // 24
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":3352
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr // 24
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3353
 *         return arr // 24
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3352
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr // 24
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":3355
 *         return arr
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3356
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 86_400_000_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 86_400_000_000_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0x132f4579c980000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3356, __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(1, 3356, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3355
 *         return arr
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":3357
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 86_400_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3358
 *         return arr // 86_400_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 86_400_000_000_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 86_400_000_000_000_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0x4af0a763bb1c00000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3358, __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(1, 3358, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3357
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 86_400_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":3359
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 86_400_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000_000_000_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3360
 *         return arr // 86_400_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 86_400_000_000_000_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0x124bc0ddd92e56000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3360, __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(1, 3360, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3359
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 86_400_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000_000_000_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":3364
 *     raise ValueError(
 *         "Unsupported <'ndarray[datetime64]'> "
 *         "time unit to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_ndarray_datetime64_t, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3362
 *         return arr // 86_400_000_000_000_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'ndarray[datetime64]'> "
 *         "time unit to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3362, __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(1, 3362, __pyx_L1_error)

  /* "cytimes/cydatetime.py":3300
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64array_to_days(arr: np.ndarray) -> np.ndarray:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64array_to_days", __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;
}

/* "cytimes/cydatetime.py":3368
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64array_to_hours(arr: np.ndarray) -> np.ndarray:
 */

static PyArrayObject *__pyx_f_7cytimes_10cydatetime_dt64array_to_hours(PyArrayObject *__pyx_v_arr) {
  NPY_DATETIMEUNIT __pyx_v_unit;
  Py_ssize_t __pyx_v_ndim;
  PyArrayObject *__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("dt64array_to_hours", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/cydatetime.py":3378
 *     """
 *     # Validate array
 *     validate_dt64array(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_dt64array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3382
 *     # Get time unit
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim             # <<<<<<<<<<<<<<
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 */
  __pyx_v_ndim = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr);

  /* "cytimes/cydatetime.py":3383
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
  switch (__pyx_v_ndim) {
    case 1:

    /* "cytimes/cydatetime.py":3384
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]) == 0);
    if (__pyx_t_2) {

      /* "cytimes/cydatetime.py":3385
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3384
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    }

    /* "cytimes/cydatetime.py":3386
 *         if arr.shape[0] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])             # <<<<<<<<<<<<<<
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 */
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_arr), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3383
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
    break;
    case 2:

    /* "cytimes/cydatetime.py":3388
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3389
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3388
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3390
 *         if arr.shape[1] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3387
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:             # <<<<<<<<<<<<<<
 *         if arr.shape[1] == 0:
 *             return arr
 */
    break;
    case 3:

    /* "cytimes/cydatetime.py":3392
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3393
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3392
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3394
 *         if arr.shape[2] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3394, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3391
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:             # <<<<<<<<<<<<<<
 *         if arr.shape[2] == 0:
 *             return arr
 */
    break;
    case 4:

    /* "cytimes/cydatetime.py":3396
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3397
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3396
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3398
 *         if arr.shape[3] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__14); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3398, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3395
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:             # <<<<<<<<<<<<<<
 *         if arr.shape[3] == 0:
 *             return arr
 */
    break;
    default:

    /* "cytimes/cydatetime.py":3402
 *         raise ValueError(
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Only_support_ndarray_with_up_to, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3400
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3400, __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(1, 3400, __pyx_L1_error)
    break;
  }

  /* "cytimes/cydatetime.py":3406
 * 
 *     # Conversion
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)             # <<<<<<<<<<<<<<
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 */
  __pyx_t_1 = PyArray_Cast(__pyx_v_arr, NPY_INT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3406, __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(1, 3406, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3408
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3409
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 3_600_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 3_600_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_3600000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3409, __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(1, 3409, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3408
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":3410
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 3_600_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3411
 *         return arr // 3_600_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 3_600_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 3_600_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_3600000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3411, __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(1, 3411, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3410
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 3_600_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":3412
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 3_600_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3413
 *         return arr // 3_600_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 3_600_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 3_600
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_3600000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3413, __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(1, 3413, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3412
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 3_600_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":3414
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr // 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3415
 *         return arr // 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 3_600             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr // 60
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_3600); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3415, __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(1, 3415, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3414
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr // 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":3416
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3417
 *         return arr // 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr // 60             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_60); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3417, __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(1, 3417, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3416
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":3418
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3419
 *         return arr // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 24
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3418
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":3420
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 24
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3421
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 24             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_24); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3421, __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(1, 3421, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3420
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 24
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":3423
 *         return arr * 24
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3424
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 3_600_000_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 3_600_000_000_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0xcca2e51310000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3424, __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(1, 3424, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3423
 *         return arr * 24
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":3425
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 3_600_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3426
 *         return arr // 3_600_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 3_600_000_000_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 3_600_000_000_000_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0x31f5c4ed27680000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3426, __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(1, 3426, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3425
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 3_600_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":3427
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 3_600_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000_000_000_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3428
 *         return arr // 3_600_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 3_600_000_000_000_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0xc328093e61ee400000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3428, __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(1, 3428, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3427
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 3_600_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000_000_000_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":3432
 *     raise ValueError(
 *         "Unsupported <'ndarray[datetime64]'> "
 *         "time unit to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_ndarray_datetime64_t, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3430
 *         return arr // 3_600_000_000_000_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'ndarray[datetime64]'> "
 *         "time unit to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3430, __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(1, 3430, __pyx_L1_error)

  /* "cytimes/cydatetime.py":3368
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64array_to_hours(arr: np.ndarray) -> np.ndarray:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64array_to_hours", __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;
}

/* "cytimes/cydatetime.py":3436
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64array_to_minutes(arr: np.ndarray) -> np.ndarray:
 */

static PyArrayObject *__pyx_f_7cytimes_10cydatetime_dt64array_to_minutes(PyArrayObject *__pyx_v_arr) {
  NPY_DATETIMEUNIT __pyx_v_unit;
  Py_ssize_t __pyx_v_ndim;
  PyArrayObject *__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("dt64array_to_minutes", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/cydatetime.py":3446
 *     """
 *     # Validate array
 *     validate_dt64array(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_dt64array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3450
 *     # Get time unit
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim             # <<<<<<<<<<<<<<
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 */
  __pyx_v_ndim = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr);

  /* "cytimes/cydatetime.py":3451
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
  switch (__pyx_v_ndim) {
    case 1:

    /* "cytimes/cydatetime.py":3452
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]) == 0);
    if (__pyx_t_2) {

      /* "cytimes/cydatetime.py":3453
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3452
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    }

    /* "cytimes/cydatetime.py":3454
 *         if arr.shape[0] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])             # <<<<<<<<<<<<<<
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 */
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_arr), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3454, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3451
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
    break;
    case 2:

    /* "cytimes/cydatetime.py":3456
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3457
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3456
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3458
 *         if arr.shape[1] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3455
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:             # <<<<<<<<<<<<<<
 *         if arr.shape[1] == 0:
 *             return arr
 */
    break;
    case 3:

    /* "cytimes/cydatetime.py":3460
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3461
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3460
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3462
 *         if arr.shape[2] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3459
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:             # <<<<<<<<<<<<<<
 *         if arr.shape[2] == 0:
 *             return arr
 */
    break;
    case 4:

    /* "cytimes/cydatetime.py":3464
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3465
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3464
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3466
 *         if arr.shape[3] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__14); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3466, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3463
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:             # <<<<<<<<<<<<<<
 *         if arr.shape[3] == 0:
 *             return arr
 */
    break;
    default:

    /* "cytimes/cydatetime.py":3470
 *         raise ValueError(
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3470, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Only_support_ndarray_with_up_to, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3470, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3468
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3468, __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(1, 3468, __pyx_L1_error)
    break;
  }

  /* "cytimes/cydatetime.py":3474
 * 
 *     # Conversion
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)             # <<<<<<<<<<<<<<
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 */
  __pyx_t_1 = PyArray_Cast(__pyx_v_arr, NPY_INT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3474, __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(1, 3474, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3476
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3477
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 60_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 60_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_60000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3477, __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(1, 3477, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3476
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":3478
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 60_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3479
 *         return arr // 60_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 60_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 60_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_60000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3479, __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(1, 3479, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3478
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 60_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":3480
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3481
 *         return arr // 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 60_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 60
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_60000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3481, __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(1, 3481, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3480
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":3482
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3483
 *         return arr // 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 60             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_60); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3483, __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(1, 3483, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3482
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":3484
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3485
 *         return arr // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 60
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3484
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":3486
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3487
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 60             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 1_440
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_60); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3487, __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(1, 3487, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3486
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":3488
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 1_440
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3489
 *         return arr * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 1_440             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_1440); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3489, __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(1, 3489, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3488
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 1_440
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":3491
 *         return arr * 1_440
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3492
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 60_000_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 60_000_000_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0x3691d6afc000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3492, __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(1, 3492, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3491
 *         return arr * 1_440
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":3493
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 60_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3494
 *         return arr // 60_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 60_000_000_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 60_000_000_000_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0xd529ae9e860000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3494, __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(1, 3494, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3493
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 60_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":3495
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 60_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000_000_000_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3496
 *         return arr // 60_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 60_000_000_000_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0x340aad21b3b700000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3496, __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(1, 3496, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3495
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 60_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000_000_000_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":3500
 *     raise ValueError(
 *         "Unsupported <'ndarray[datetime64]'> "
 *         "time unit to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_ndarray_datetime64_t, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3498
 *         return arr // 60_000_000_000_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'ndarray[datetime64]'> "
 *         "time unit to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3498, __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(1, 3498, __pyx_L1_error)

  /* "cytimes/cydatetime.py":3436
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64array_to_minutes(arr: np.ndarray) -> np.ndarray:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64array_to_minutes", __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;
}

/* "cytimes/cydatetime.py":3504
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64array_to_seconds(arr: np.ndarray) -> np.ndarray:
 */

static PyArrayObject *__pyx_f_7cytimes_10cydatetime_dt64array_to_seconds(PyArrayObject *__pyx_v_arr) {
  NPY_DATETIMEUNIT __pyx_v_unit;
  Py_ssize_t __pyx_v_ndim;
  PyArrayObject *__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("dt64array_to_seconds", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/cydatetime.py":3514
 *     """
 *     # Validate array
 *     validate_dt64array(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_dt64array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3518
 *     # Get time unit
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim             # <<<<<<<<<<<<<<
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 */
  __pyx_v_ndim = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr);

  /* "cytimes/cydatetime.py":3519
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
  switch (__pyx_v_ndim) {
    case 1:

    /* "cytimes/cydatetime.py":3520
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]) == 0);
    if (__pyx_t_2) {

      /* "cytimes/cydatetime.py":3521
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3520
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    }

    /* "cytimes/cydatetime.py":3522
 *         if arr.shape[0] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])             # <<<<<<<<<<<<<<
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 */
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_arr), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3519
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
    break;
    case 2:

    /* "cytimes/cydatetime.py":3524
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3525
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3524
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3526
 *         if arr.shape[1] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3523
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:             # <<<<<<<<<<<<<<
 *         if arr.shape[1] == 0:
 *             return arr
 */
    break;
    case 3:

    /* "cytimes/cydatetime.py":3528
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3529
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3528
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3530
 *         if arr.shape[2] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3527
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:             # <<<<<<<<<<<<<<
 *         if arr.shape[2] == 0:
 *             return arr
 */
    break;
    case 4:

    /* "cytimes/cydatetime.py":3532
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3533
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3532
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3534
 *         if arr.shape[3] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__14); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3531
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:             # <<<<<<<<<<<<<<
 *         if arr.shape[3] == 0:
 *             return arr
 */
    break;
    default:

    /* "cytimes/cydatetime.py":3538
 *         raise ValueError(
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Only_support_ndarray_with_up_to, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3536
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3536, __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(1, 3536, __pyx_L1_error)
    break;
  }

  /* "cytimes/cydatetime.py":3542
 * 
 *     # Conversion
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)             # <<<<<<<<<<<<<<
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 */
  __pyx_t_1 = PyArray_Cast(__pyx_v_arr, NPY_INT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3542, __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(1, 3542, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3544
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3545
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 1_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 1_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3545, __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(1, 3545, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3544
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":3546
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3547
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 1_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3547, __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(1, 3547, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3546
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":3548
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3549
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3549, __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(1, 3549, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3548
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":3550
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3551
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3550
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":3552
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3553
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_60); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3553, __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(1, 3553, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3552
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":3554
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr * 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3555
 *         return arr * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 86_400
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_3600); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3555, __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(1, 3555, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3554
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr * 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":3556
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 86_400
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3557
 *         return arr * 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 86_400             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_86400); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3557, __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(1, 3557, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3556
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 86_400
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":3559
 *         return arr * 86_400
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3560
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3560, __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(1, 3560, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3559
 *         return arr * 86_400
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":3561
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3562
 *         return arr // 1_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 1_000_000_000_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0x38d7ea4c68000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3562, __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(1, 3562, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3561
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":3563
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3564
 *         return arr // 1_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 1_000_000_000_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0xde0b6b3a7640000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3564, __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(1, 3564, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3563
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":3568
 *     raise ValueError(
 *         "Unsupported <'ndarray[datetime64]'> "
 *         "time unit to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_ndarray_datetime64_t, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3566
 *         return arr // 1_000_000_000_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'ndarray[datetime64]'> "
 *         "time unit to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3566, __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(1, 3566, __pyx_L1_error)

  /* "cytimes/cydatetime.py":3504
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64array_to_seconds(arr: np.ndarray) -> np.ndarray:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64array_to_seconds", __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;
}

/* "cytimes/cydatetime.py":3572
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64array_to_milliseconds(arr: np.ndarray) -> np.ndarray:
 */

static PyArrayObject *__pyx_f_7cytimes_10cydatetime_dt64array_to_milliseconds(PyArrayObject *__pyx_v_arr) {
  NPY_DATETIMEUNIT __pyx_v_unit;
  Py_ssize_t __pyx_v_ndim;
  PyArrayObject *__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("dt64array_to_milliseconds", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/cydatetime.py":3582
 *     """
 *     # Validate array
 *     validate_dt64array(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_dt64array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3586
 *     # Get time unit
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim             # <<<<<<<<<<<<<<
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 */
  __pyx_v_ndim = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr);

  /* "cytimes/cydatetime.py":3587
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
  switch (__pyx_v_ndim) {
    case 1:

    /* "cytimes/cydatetime.py":3588
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]) == 0);
    if (__pyx_t_2) {

      /* "cytimes/cydatetime.py":3589
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3588
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    }

    /* "cytimes/cydatetime.py":3590
 *         if arr.shape[0] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])             # <<<<<<<<<<<<<<
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 */
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_arr), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3587
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
    break;
    case 2:

    /* "cytimes/cydatetime.py":3592
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3593
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3592
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3594
 *         if arr.shape[1] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3591
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:             # <<<<<<<<<<<<<<
 *         if arr.shape[1] == 0:
 *             return arr
 */
    break;
    case 3:

    /* "cytimes/cydatetime.py":3596
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3597
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3596
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3598
 *         if arr.shape[2] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3595
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:             # <<<<<<<<<<<<<<
 *         if arr.shape[2] == 0:
 *             return arr
 */
    break;
    case 4:

    /* "cytimes/cydatetime.py":3600
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3601
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3600
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3602
 *         if arr.shape[3] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__14); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3599
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:             # <<<<<<<<<<<<<<
 *         if arr.shape[3] == 0:
 *             return arr
 */
    break;
    default:

    /* "cytimes/cydatetime.py":3606
 *         raise ValueError(
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Only_support_ndarray_with_up_to, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3604
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3604, __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(1, 3604, __pyx_L1_error)
    break;
  }

  /* "cytimes/cydatetime.py":3610
 * 
 *     # Conversion
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)             # <<<<<<<<<<<<<<
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 */
  __pyx_t_1 = PyArray_Cast(__pyx_v_arr, NPY_INT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3610, __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(1, 3610, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3612
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3613
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 1_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3613, __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(1, 3613, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3612
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":3614
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3615
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3615, __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(1, 3615, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3614
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":3616
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3617
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3616
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":3618
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3619
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_1000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3619, __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(1, 3619, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3618
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":3620
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr * 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3621
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_60000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3621, __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(1, 3621, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3620
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr * 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":3622
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr * 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3623
 *         return arr * 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 86_400_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_3600000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3623, __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(1, 3623, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3622
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr * 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":3624
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 86_400_000
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3625
 *         return arr * 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 86_400_000             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_86400000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3625, __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(1, 3625, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3624
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 86_400_000
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":3627
 *         return arr * 86_400_000
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3628
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3628, __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(1, 3628, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3627
 *         return arr * 86_400_000
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":3629
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3630
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 1_000_000_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3630, __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(1, 3630, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3629
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":3631
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3632
 *         return arr // 1_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 1_000_000_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0x38d7ea4c68000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3632, __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(1, 3632, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3631
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":3636
 *     raise ValueError(
 *         "Unsupported <'ndarray[datetime64]'> "
 *         "time unit to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_ndarray_datetime64_t, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3634
 *         return arr // 1_000_000_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'ndarray[datetime64]'> "
 *         "time unit to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3634, __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(1, 3634, __pyx_L1_error)

  /* "cytimes/cydatetime.py":3572
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64array_to_milliseconds(arr: np.ndarray) -> np.ndarray:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64array_to_milliseconds", __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;
}

/* "cytimes/cydatetime.py":3640
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64array_to_microseconds(arr: np.ndarray) -> np.ndarray:
 */

static PyArrayObject *__pyx_f_7cytimes_10cydatetime_dt64array_to_microseconds(PyArrayObject *__pyx_v_arr) {
  NPY_DATETIMEUNIT __pyx_v_unit;
  Py_ssize_t __pyx_v_ndim;
  PyArrayObject *__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("dt64array_to_microseconds", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/cydatetime.py":3650
 *     """
 *     # Validate array
 *     validate_dt64array(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_dt64array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3654
 *     # Get time unit
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim             # <<<<<<<<<<<<<<
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 */
  __pyx_v_ndim = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr);

  /* "cytimes/cydatetime.py":3655
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
  switch (__pyx_v_ndim) {
    case 1:

    /* "cytimes/cydatetime.py":3656
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]) == 0);
    if (__pyx_t_2) {

      /* "cytimes/cydatetime.py":3657
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3656
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    }

    /* "cytimes/cydatetime.py":3658
 *         if arr.shape[0] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])             # <<<<<<<<<<<<<<
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 */
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_arr), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3655
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
    break;
    case 2:

    /* "cytimes/cydatetime.py":3660
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3661
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3660
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3662
 *         if arr.shape[1] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3659
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:             # <<<<<<<<<<<<<<
 *         if arr.shape[1] == 0:
 *             return arr
 */
    break;
    case 3:

    /* "cytimes/cydatetime.py":3664
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3665
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3664
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3666
 *         if arr.shape[2] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3663
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:             # <<<<<<<<<<<<<<
 *         if arr.shape[2] == 0:
 *             return arr
 */
    break;
    case 4:

    /* "cytimes/cydatetime.py":3668
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3669
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3668
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3670
 *         if arr.shape[3] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__14); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3667
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:             # <<<<<<<<<<<<<<
 *         if arr.shape[3] == 0:
 *             return arr
 */
    break;
    default:

    /* "cytimes/cydatetime.py":3674
 *         raise ValueError(
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Only_support_ndarray_with_up_to, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3672
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3672, __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(1, 3672, __pyx_L1_error)
    break;
  }

  /* "cytimes/cydatetime.py":3678
 * 
 *     # Conversion
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)             # <<<<<<<<<<<<<<
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 */
  __pyx_t_1 = PyArray_Cast(__pyx_v_arr, NPY_INT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 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(1, 3678, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3680
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3681
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3681, __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(1, 3681, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3680
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":3682
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3683
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr * 1_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3682
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":3684
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3685
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr * 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_1000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3685, __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(1, 3685, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3684
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":3686
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3687
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_1000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3687, __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(1, 3687, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3686
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":3688
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr * 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3689
 *         return arr * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_60000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3689, __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(1, 3689, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3688
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr * 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":3690
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr * 3_600_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3691
 *         return arr * 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 86_400_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_3600000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3691, __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(1, 3691, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3690
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr * 3_600_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":3692
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 86_400_000_000
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3693
 *         return arr * 3_600_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 86_400_000_000             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_86400000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3693, __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(1, 3693, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3692
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 86_400_000_000
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":3695
 *         return arr * 86_400_000_000
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3696
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3696, __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(1, 3696, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3695
 *         return arr * 86_400_000_000
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":3697
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3698
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 1_000_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3698, __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(1, 3698, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3697
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":3699
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3700
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 1_000_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3700, __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(1, 3700, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3699
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":3704
 *     raise ValueError(
 *         "Unsupported <'ndarray[datetime64]'> "
 *         "time unit to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_ndarray_datetime64_t, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3702
 *         return arr // 1_000_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'ndarray[datetime64]'> "
 *         "time unit to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3702, __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(1, 3702, __pyx_L1_error)

  /* "cytimes/cydatetime.py":3640
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64array_to_microseconds(arr: np.ndarray) -> np.ndarray:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64array_to_microseconds", __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;
}

/* "cytimes/cydatetime.py":3708
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64array_to_nanoseconds(arr: np.ndarray) -> np.ndarray:
 */

static PyArrayObject *__pyx_f_7cytimes_10cydatetime_dt64array_to_nanoseconds(PyArrayObject *__pyx_v_arr) {
  NPY_DATETIMEUNIT __pyx_v_unit;
  Py_ssize_t __pyx_v_ndim;
  PyArrayObject *__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("dt64array_to_nanoseconds", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/cydatetime.py":3718
 *     """
 *     # Validate array
 *     validate_dt64array(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_dt64array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3722
 *     # Get time unit
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim             # <<<<<<<<<<<<<<
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 */
  __pyx_v_ndim = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr);

  /* "cytimes/cydatetime.py":3723
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
  switch (__pyx_v_ndim) {
    case 1:

    /* "cytimes/cydatetime.py":3724
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]) == 0);
    if (__pyx_t_2) {

      /* "cytimes/cydatetime.py":3725
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3724
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    }

    /* "cytimes/cydatetime.py":3726
 *         if arr.shape[0] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])             # <<<<<<<<<<<<<<
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 */
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_arr), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3723
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
    break;
    case 2:

    /* "cytimes/cydatetime.py":3728
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3729
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3728
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3730
 *         if arr.shape[1] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3730, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3727
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:             # <<<<<<<<<<<<<<
 *         if arr.shape[1] == 0:
 *             return arr
 */
    break;
    case 3:

    /* "cytimes/cydatetime.py":3732
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3733
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3732
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3734
 *         if arr.shape[2] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3731
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:             # <<<<<<<<<<<<<<
 *         if arr.shape[2] == 0:
 *             return arr
 */
    break;
    case 4:

    /* "cytimes/cydatetime.py":3736
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3737
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3736
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3738
 *         if arr.shape[3] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__14); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3738, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3735
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:             # <<<<<<<<<<<<<<
 *         if arr.shape[3] == 0:
 *             return arr
 */
    break;
    default:

    /* "cytimes/cydatetime.py":3742
 *         raise ValueError(
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3742, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Only_support_ndarray_with_up_to, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3742, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3740
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3740, __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(1, 3740, __pyx_L1_error)
    break;
  }

  /* "cytimes/cydatetime.py":3746
 * 
 *     # Conversion
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)             # <<<<<<<<<<<<<<
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 */
  __pyx_t_1 = PyArray_Cast(__pyx_v_arr, NPY_INT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3746, __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(1, 3746, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3748
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3749
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr * 1_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3748
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":3750
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3751
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr * 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr * 1_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_1000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3751, __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(1, 3751, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3750
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":3752
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3753
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr * 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_1000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3753, __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(1, 3753, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3752
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":3754
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr * 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3755
 *         return arr * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_1000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3755, __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(1, 3755, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3754
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr * 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":3756
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr * 60_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3757
 *         return arr * 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_60000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3757, __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(1, 3757, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3756
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr * 60_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":3758
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr * 3_600_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3759
 *         return arr * 60_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 86_400_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_3600000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3759, __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(1, 3759, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3758
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr * 3_600_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":3760
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 86_400_000_000_000
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3761
 *         return arr * 3_600_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 86_400_000_000_000             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_0x4e94914f0000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3761, __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(1, 3761, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3760
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 86_400_000_000_000
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":3763
 *         return arr * 86_400_000_000_000
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3764
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3764, __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(1, 3764, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3763
 *         return arr * 86_400_000_000_000
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":3765
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3766
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 1_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3766, __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(1, 3766, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3765
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":3767
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3768
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 1_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3768, __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(1, 3768, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3767
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":3772
 *     raise ValueError(
 *         "Unsupported <'ndarray[datetime64]'> "
 *         "time unit to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_ndarray_datetime64_t, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3770
 *         return arr // 1_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'ndarray[datetime64]'> "
 *         "time unit to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3770, __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(1, 3770, __pyx_L1_error)

  /* "cytimes/cydatetime.py":3708
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64array_to_nanoseconds(arr: np.ndarray) -> np.ndarray:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64array_to_nanoseconds", __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;
}

/* "cytimes/cydatetime.py":3776
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64array_to_ordinals(arr: np.ndarray) -> np.ndarray:
 */

static PyArrayObject *__pyx_f_7cytimes_10cydatetime_dt64array_to_ordinals(PyArrayObject *__pyx_v_arr) {
  PyArrayObject *__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("dt64array_to_ordinals", 1);

  /* "cytimes/cydatetime.py":3785
 *     unit is smaller than 'day (D)'.
 *     """
 *     return dt64array_to_days(arr) + 719_163             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt64array_to_days(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_int_719163); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 3785, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":3776
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64array_to_ordinals(arr: np.ndarray) -> np.ndarray:
 */

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

/* "cytimes/cydatetime.py":3788
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64array_to_timestamps(arr: np.ndarray) -> np.ndarray:
 */

static PyArrayObject *__pyx_f_7cytimes_10cydatetime_dt64array_to_timestamps(PyArrayObject *__pyx_v_arr) {
  PyArrayObject *__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("dt64array_to_timestamps", 1);

  /* "cytimes/cydatetime.py":3797
 *     unit is smaller than 'microseconds (us)'.
 *     """
 *     return dt64array_to_microseconds(arr) / 1_000_000             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt64array_to_microseconds(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_int_1000000); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 3797, __pyx_L1_error)
  __pyx_r = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":3788
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64array_to_timestamps(arr: np.ndarray) -> np.ndarray:
 */

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

/* "cytimes/cydatetime.py":3802
 * # numpy.ndarray[timedelta64] ===========================================================================
 * # numpy.ndarray[timedelta64]: check types --------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static int __pyx_f_7cytimes_10cydatetime_is_td64array(PyArrayObject *__pyx_v_arr) {
  int __pyx_r;

  /* "cytimes/cydatetime.py":3809
 *     Equivalent to `isinstance(arr.dtype, np.dtypes.TimeDelta64DType)`.
 *     """
 *     return np.PyArray_TYPE(arr) == np.NPY_TYPES.NPY_TIMEDELTA             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (PyArray_TYPE(__pyx_v_arr) == NPY_TIMEDELTA);
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":3802
 * # numpy.ndarray[timedelta64] ===========================================================================
 * # numpy.ndarray[timedelta64]: check types --------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

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

/* "cytimes/cydatetime.py":3812
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def validate_td64array(arr: np.ndarray):
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_validate_td64array(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("validate_td64array", 1);

  /* "cytimes/cydatetime.py":3817
 *     """Validate if a ndarray is dtype of timedelta64.
 *     Raise `TypeError` if dtype is incorrect."""
 *     if not is_td64array(arr):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'ndarray[timedelta64]'>, "
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_is_td64array(__pyx_v_arr); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 3817, __pyx_L1_error)
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {

    /* "cytimes/cydatetime.py":3820
 *         raise TypeError(
 *             "Expects <'ndarray[timedelta64]'>, "
 *             "instead got: <'ndarray[%s]'>." % (arr.dtype)             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3820, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_ndarray_timedelta64_inst, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3820, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cytimes/cydatetime.py":3818
 *     Raise `TypeError` if dtype is incorrect."""
 *     if not is_td64array(arr):
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'ndarray[timedelta64]'>, "
 *             "instead got: <'ndarray[%s]'>." % (arr.dtype)
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3818, __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(1, 3818, __pyx_L1_error)

    /* "cytimes/cydatetime.py":3817
 *     """Validate if a ndarray is dtype of timedelta64.
 *     Raise `TypeError` if dtype is incorrect."""
 *     if not is_td64array(arr):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'ndarray[timedelta64]'>, "
 */
  }

  /* "cytimes/cydatetime.py":3812
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def validate_td64array(arr: np.ndarray):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.cydatetime.validate_td64array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":3824
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def get_td64array_unit(arr: np.ndarray) -> str:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_get_td64array_unit(PyArrayObject *__pyx_v_arr) {
  NPY_DATETIMEUNIT __pyx_v_unit;
  Py_ssize_t __pyx_v_ndim;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_td64array_unit", 1);

  /* "cytimes/cydatetime.py":3830
 *     such as: 'D', 's', 'ms', 'us', 'ns', etc `<'str'>`."""
 *     # Validate array
 *     validate_td64array(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_td64array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3834
 *     # Get time unit
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim             # <<<<<<<<<<<<<<
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 */
  __pyx_v_ndim = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr);

  /* "cytimes/cydatetime.py":3835
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return parse_td64array_unit(arr)
 */
  switch (__pyx_v_ndim) {
    case 1:

    /* "cytimes/cydatetime.py":3836
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return parse_td64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]) == 0);
    if (__pyx_t_2) {

      /* "cytimes/cydatetime.py":3837
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 *             return parse_td64array_unit(arr)             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_parse_td64array_unit(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3836
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return parse_td64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0])
 */
    }

    /* "cytimes/cydatetime.py":3838
 *         if arr.shape[0] == 0:
 *             return parse_td64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0])             # <<<<<<<<<<<<<<
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 */
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_arr), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3835
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return parse_td64array_unit(arr)
 */
    break;
    case 2:

    /* "cytimes/cydatetime.py":3840
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return parse_td64array_unit(arr)
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3841
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 *             return parse_td64array_unit(arr)             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_parse_td64array_unit(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3841, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3840
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return parse_td64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3842
 *         if arr.shape[1] == 0:
 *             return parse_td64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3842, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3839
 *             return parse_td64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:             # <<<<<<<<<<<<<<
 *         if arr.shape[1] == 0:
 *             return parse_td64array_unit(arr)
 */
    break;
    case 3:

    /* "cytimes/cydatetime.py":3844
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return parse_td64array_unit(arr)
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3845
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 *             return parse_td64array_unit(arr)             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_parse_td64array_unit(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3845, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3844
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return parse_td64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3846
 *         if arr.shape[2] == 0:
 *             return parse_td64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3846, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3843
 *             return parse_td64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:             # <<<<<<<<<<<<<<
 *         if arr.shape[2] == 0:
 *             return parse_td64array_unit(arr)
 */
    break;
    case 4:

    /* "cytimes/cydatetime.py":3848
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return parse_td64array_unit(arr)
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3849
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 *             return parse_td64array_unit(arr)             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_parse_td64array_unit(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3849, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3848
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return parse_td64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3850
 *         if arr.shape[3] == 0:
 *             return parse_td64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__14); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3850, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3847
 *             return parse_td64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:             # <<<<<<<<<<<<<<
 *         if arr.shape[3] == 0:
 *             return parse_td64array_unit(arr)
 */
    break;
    default:

    /* "cytimes/cydatetime.py":3854
 *         raise ValueError(
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3854, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Only_support_ndarray_with_up_to, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3854, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3852
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3852, __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(1, 3852, __pyx_L1_error)
    break;
  }

  /* "cytimes/cydatetime.py":3858
 * 
 *     # Match unit: common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         return "ns"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3859
 *     # Match unit: common
 *     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;

    /* "cytimes/cydatetime.py":3858
 * 
 *     # Match unit: common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:             # <<<<<<<<<<<<<<
 *         return "ns"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:
 */
  }

  /* "cytimes/cydatetime.py":3860
 *     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_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3861
 *         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;

    /* "cytimes/cydatetime.py":3860
 *     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:
 */
  }

  /* "cytimes/cydatetime.py":3862
 *     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_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3863
 *         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;

    /* "cytimes/cydatetime.py":3862
 *     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:
 */
  }

  /* "cytimes/cydatetime.py":3864
 *     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_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3865
 *         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;

    /* "cytimes/cydatetime.py":3864
 *     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:
 */
  }

  /* "cytimes/cydatetime.py":3866
 *     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_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3867
 *         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;

    /* "cytimes/cydatetime.py":3866
 *     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:
 */
  }

  /* "cytimes/cydatetime.py":3868
 *     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_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3869
 *         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;

    /* "cytimes/cydatetime.py":3868
 *     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:
 */
  }

  /* "cytimes/cydatetime.py":3870
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         return "h"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:             # <<<<<<<<<<<<<<
 *         return "D"
 *     # Match unit: uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3871
 *         return "h"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:
 *         return "D"             # <<<<<<<<<<<<<<
 *     # Match unit: uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_D);
    __pyx_r = __pyx_n_u_D;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3870
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:
 *         return "h"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:             # <<<<<<<<<<<<<<
 *         return "D"
 *     # Match unit: uncommon
 */
  }

  /* "cytimes/cydatetime.py":3873
 *         return "D"
 *     # Match unit: uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:             # <<<<<<<<<<<<<<
 *         return "ps"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3874
 *     # Match unit: uncommon
 *     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;

    /* "cytimes/cydatetime.py":3873
 *         return "D"
 *     # Match unit: uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:             # <<<<<<<<<<<<<<
 *         return "ps"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:
 */
  }

  /* "cytimes/cydatetime.py":3875
 *     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_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3876
 *         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;

    /* "cytimes/cydatetime.py":3875
 *     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:
 */
  }

  /* "cytimes/cydatetime.py":3877
 *     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_Y:
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3878
 *         return "fs"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:
 *         return "as"             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:
 *         return "Y"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_as);
    __pyx_r = __pyx_n_u_as;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3877
 *     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_Y:
 */
  }

  /* "cytimes/cydatetime.py":3879
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:
 *         return "as"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:             # <<<<<<<<<<<<<<
 *         return "Y"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_Y);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3880
 *         return "as"
 *     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;

    /* "cytimes/cydatetime.py":3879
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:
 *         return "as"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_Y:             # <<<<<<<<<<<<<<
 *         return "Y"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_M:
 */
  }

  /* "cytimes/cydatetime.py":3881
 *     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_2 = (__pyx_v_unit == NPY_FR_M);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3882
 *         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;

    /* "cytimes/cydatetime.py":3881
 *     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:
 */
  }

  /* "cytimes/cydatetime.py":3883
 *     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_B:
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_W);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3884
 *         return "M"
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_W:
 *         return "W"             # <<<<<<<<<<<<<<
 *     # if unit == np.NPY_DATETIMEUNIT.NPY_FR_B:
 *     #     return "B"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_u_W);
    __pyx_r = __pyx_n_u_W;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3883
 *     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_B:
 */
  }

  /* "cytimes/cydatetime.py":3887
 *     # if unit == np.NPY_DATETIMEUNIT.NPY_FR_B:
 *     #     return "B"
 *     raise ValueError("Unknown <'ndarray[timedelta64]'> time unit: %d." % unit)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unknown_ndarray_timedelta64_time, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3887, __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(1, 3887, __pyx_L1_error)

  /* "cytimes/cydatetime.py":3824
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def get_td64array_unit(arr: np.ndarray) -> str:
 */

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

/* "cytimes/cydatetime.py":3890
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def parse_td64array_unit(arr: np.ndarray) -> str:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_parse_td64array_unit(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_v_dtype_str = NULL;
  PyObject *__pyx_v_unit = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_td64array_unit", 1);

  /* "cytimes/cydatetime.py":3895
 *     """Prase the time unit of the `<'ndarray[timedelta64]'>`
 *     from 'ndarray.dtype.str' `<'str'>`."""
 *     dtype_str = arr.dtype.str             # <<<<<<<<<<<<<<
 *     unit: str = str_substr(dtype_str, 4, str_len(dtype_str) - 1)
 *     if not 1 <= str_len(unit) <= 2:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dtype_str = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytimes/cydatetime.py":3896
 *     from 'ndarray.dtype.str' `<'str'>`."""
 *     dtype_str = arr.dtype.str
 *     unit: str = str_substr(dtype_str, 4, str_len(dtype_str) - 1)             # <<<<<<<<<<<<<<
 *     if not 1 <= str_len(unit) <= 2:
 *         raise ValueError(
 */
  __pyx_t_2 = PyUnicode_Substring(__pyx_v_dtype_str, 4, (PyUnicode_GET_LENGTH(__pyx_v_dtype_str) - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_unit = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytimes/cydatetime.py":3897
 *     dtype_str = arr.dtype.str
 *     unit: str = str_substr(dtype_str, 4, str_len(dtype_str) - 1)
 *     if not 1 <= str_len(unit) <= 2:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "Unable to parse <'ndarray[timedelta64]'> "
 */
  __pyx_t_3 = PyUnicode_GET_LENGTH(__pyx_v_unit);
  __pyx_t_4 = (1 <= __pyx_t_3);
  if (__pyx_t_4) {
    __pyx_t_4 = (__pyx_t_3 <= 2);
  }
  __pyx_t_5 = (!__pyx_t_4);
  if (unlikely(__pyx_t_5)) {

    /* "cytimes/cydatetime.py":3900
 *         raise ValueError(
 *             "Unable to parse <'ndarray[timedelta64]'> "
 *             "time unit from: '%s'." % dtype_str             # <<<<<<<<<<<<<<
 *         )
 *     return unit
 */
    __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Unable_to_parse_ndarray_timedelt, __pyx_v_dtype_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cytimes/cydatetime.py":3898
 *     unit: str = str_substr(dtype_str, 4, str_len(dtype_str) - 1)
 *     if not 1 <= str_len(unit) <= 2:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Unable to parse <'ndarray[timedelta64]'> "
 *             "time unit from: '%s'." % dtype_str
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3898, __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(1, 3898, __pyx_L1_error)

    /* "cytimes/cydatetime.py":3897
 *     dtype_str = arr.dtype.str
 *     unit: str = str_substr(dtype_str, 4, str_len(dtype_str) - 1)
 *     if not 1 <= str_len(unit) <= 2:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "Unable to parse <'ndarray[timedelta64]'> "
 */
  }

  /* "cytimes/cydatetime.py":3902
 *             "time unit from: '%s'." % dtype_str
 *         )
 *     return unit             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_unit);
  __pyx_r = __pyx_v_unit;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":3890
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def parse_td64array_unit(arr: np.ndarray) -> str:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytimes.cydatetime.parse_td64array_unit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dtype_str);
  __Pyx_XDECREF(__pyx_v_unit);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":3906
 * 
 * # numpy.ndarray[timedelta64]: conversion ---------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64array_to_int(
 */

static PyArrayObject *__pyx_f_7cytimes_10cydatetime_td64array_to_int(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_unit) {
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("td64array_to_int", 1);

  /* "cytimes/cydatetime.py":3919
 *     unit is smaller than the target time 'unit'.
 *     """
 *     if unit == "ns":             # <<<<<<<<<<<<<<
 *         return td64array_to_nanoseconds(arr)
 *     elif unit == "us":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ns, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 3919, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":3920
 *     """
 *     if unit == "ns":
 *         return td64array_to_nanoseconds(arr)             # <<<<<<<<<<<<<<
 *     elif unit == "us":
 *         return td64array_to_microseconds(arr)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_td64array_to_nanoseconds(__pyx_v_arr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3920, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3919
 *     unit is smaller than the target time 'unit'.
 *     """
 *     if unit == "ns":             # <<<<<<<<<<<<<<
 *         return td64array_to_nanoseconds(arr)
 *     elif unit == "us":
 */
  }

  /* "cytimes/cydatetime.py":3921
 *     if unit == "ns":
 *         return td64array_to_nanoseconds(arr)
 *     elif unit == "us":             # <<<<<<<<<<<<<<
 *         return td64array_to_microseconds(arr)
 *     elif unit == "ms":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_us, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 3921, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":3922
 *         return td64array_to_nanoseconds(arr)
 *     elif unit == "us":
 *         return td64array_to_microseconds(arr)             # <<<<<<<<<<<<<<
 *     elif unit == "ms":
 *         return td64array_to_milliseconds(arr)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_td64array_to_microseconds(__pyx_v_arr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3921
 *     if unit == "ns":
 *         return td64array_to_nanoseconds(arr)
 *     elif unit == "us":             # <<<<<<<<<<<<<<
 *         return td64array_to_microseconds(arr)
 *     elif unit == "ms":
 */
  }

  /* "cytimes/cydatetime.py":3923
 *     elif unit == "us":
 *         return td64array_to_microseconds(arr)
 *     elif unit == "ms":             # <<<<<<<<<<<<<<
 *         return td64array_to_milliseconds(arr)
 *     elif unit == "s":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ms, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 3923, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":3924
 *         return td64array_to_microseconds(arr)
 *     elif unit == "ms":
 *         return td64array_to_milliseconds(arr)             # <<<<<<<<<<<<<<
 *     elif unit == "s":
 *         return td64array_to_seconds(arr)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_td64array_to_milliseconds(__pyx_v_arr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3923
 *     elif unit == "us":
 *         return td64array_to_microseconds(arr)
 *     elif unit == "ms":             # <<<<<<<<<<<<<<
 *         return td64array_to_milliseconds(arr)
 *     elif unit == "s":
 */
  }

  /* "cytimes/cydatetime.py":3925
 *     elif unit == "ms":
 *         return td64array_to_milliseconds(arr)
 *     elif unit == "s":             # <<<<<<<<<<<<<<
 *         return td64array_to_seconds(arr)
 *     elif unit == "m":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_s, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 3925, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":3926
 *         return td64array_to_milliseconds(arr)
 *     elif unit == "s":
 *         return td64array_to_seconds(arr)             # <<<<<<<<<<<<<<
 *     elif unit == "m":
 *         return td64array_to_minutes(arr)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_td64array_to_seconds(__pyx_v_arr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3926, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3925
 *     elif unit == "ms":
 *         return td64array_to_milliseconds(arr)
 *     elif unit == "s":             # <<<<<<<<<<<<<<
 *         return td64array_to_seconds(arr)
 *     elif unit == "m":
 */
  }

  /* "cytimes/cydatetime.py":3927
 *     elif unit == "s":
 *         return td64array_to_seconds(arr)
 *     elif unit == "m":             # <<<<<<<<<<<<<<
 *         return td64array_to_minutes(arr)
 *     elif unit == "h":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_m, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 3927, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":3928
 *         return td64array_to_seconds(arr)
 *     elif unit == "m":
 *         return td64array_to_minutes(arr)             # <<<<<<<<<<<<<<
 *     elif unit == "h":
 *         return td64array_to_hours(arr)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_td64array_to_minutes(__pyx_v_arr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3928, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3927
 *     elif unit == "s":
 *         return td64array_to_seconds(arr)
 *     elif unit == "m":             # <<<<<<<<<<<<<<
 *         return td64array_to_minutes(arr)
 *     elif unit == "h":
 */
  }

  /* "cytimes/cydatetime.py":3929
 *     elif unit == "m":
 *         return td64array_to_minutes(arr)
 *     elif unit == "h":             # <<<<<<<<<<<<<<
 *         return td64array_to_hours(arr)
 *     elif unit == "D" or unit == "d":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_h, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 3929, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":3930
 *         return td64array_to_minutes(arr)
 *     elif unit == "h":
 *         return td64array_to_hours(arr)             # <<<<<<<<<<<<<<
 *     elif unit == "D" or unit == "d":
 *         return td64array_to_days(arr)
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_td64array_to_hours(__pyx_v_arr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3930, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3929
 *     elif unit == "m":
 *         return td64array_to_minutes(arr)
 *     elif unit == "h":             # <<<<<<<<<<<<<<
 *         return td64array_to_hours(arr)
 *     elif unit == "D" or unit == "d":
 */
  }

  /* "cytimes/cydatetime.py":3931
 *     elif unit == "h":
 *         return td64array_to_hours(arr)
 *     elif unit == "D" or unit == "d":             # <<<<<<<<<<<<<<
 *         return td64array_to_days(arr)
 *     else:
 */
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_D, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 3931, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_d, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 3931, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (likely(__pyx_t_1)) {

    /* "cytimes/cydatetime.py":3932
 *         return td64array_to_hours(arr)
 *     elif unit == "D" or unit == "d":
 *         return td64array_to_days(arr)             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_td64array_to_days(__pyx_v_arr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3931
 *     elif unit == "h":
 *         return td64array_to_hours(arr)
 *     elif unit == "D" or unit == "d":             # <<<<<<<<<<<<<<
 *         return td64array_to_days(arr)
 *     else:
 */
  }

  /* "cytimes/cydatetime.py":3934
 *         return td64array_to_days(arr)
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Does not support conversion of "
 *             "<'ndarray[timedelta64]'> to time unit: %r." % unit
 */
  /*else*/ {

    /* "cytimes/cydatetime.py":3936
 *         raise ValueError(
 *             "Does not support conversion of "
 *             "<'ndarray[timedelta64]'> to time unit: %r." % unit             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Does_not_support_conversion_of_n_4, __pyx_v_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3936, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cytimes/cydatetime.py":3934
 *         return td64array_to_days(arr)
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Does not support conversion of "
 *             "<'ndarray[timedelta64]'> to time unit: %r." % unit
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3934, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(1, 3934, __pyx_L1_error)
  }

  /* "cytimes/cydatetime.py":3906
 * 
 * # numpy.ndarray[timedelta64]: conversion ---------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64array_to_int(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.cydatetime.td64array_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":3940
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64array_to_days(arr: np.ndarray) -> np.ndarray:
 */

static PyArrayObject *__pyx_f_7cytimes_10cydatetime_td64array_to_days(PyArrayObject *__pyx_v_arr) {
  NPY_DATETIMEUNIT __pyx_v_unit;
  Py_ssize_t __pyx_v_ndim;
  PyArrayObject *__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("td64array_to_days", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/cydatetime.py":3950
 *     """
 *     # Validate array
 *     validate_td64array(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_td64array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3954
 *     # Get time unit
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim             # <<<<<<<<<<<<<<
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 */
  __pyx_v_ndim = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr);

  /* "cytimes/cydatetime.py":3955
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
  switch (__pyx_v_ndim) {
    case 1:

    /* "cytimes/cydatetime.py":3956
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]) == 0);
    if (__pyx_t_2) {

      /* "cytimes/cydatetime.py":3957
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3956
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    }

    /* "cytimes/cydatetime.py":3958
 *         if arr.shape[0] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])             # <<<<<<<<<<<<<<
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 */
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_arr), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3958, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3955
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
    break;
    case 2:

    /* "cytimes/cydatetime.py":3960
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3961
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3960
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3962
 *         if arr.shape[1] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3962, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3959
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:             # <<<<<<<<<<<<<<
 *         if arr.shape[1] == 0:
 *             return arr
 */
    break;
    case 3:

    /* "cytimes/cydatetime.py":3964
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3965
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3964
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3966
 *         if arr.shape[2] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3966, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3963
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:             # <<<<<<<<<<<<<<
 *         if arr.shape[2] == 0:
 *             return arr
 */
    break;
    case 4:

    /* "cytimes/cydatetime.py":3968
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":3969
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":3968
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":3970
 *         if arr.shape[3] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__14); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3967
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:             # <<<<<<<<<<<<<<
 *         if arr.shape[3] == 0:
 *             return arr
 */
    break;
    default:

    /* "cytimes/cydatetime.py":3974
 *         raise ValueError(
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3974, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Only_support_ndarray_with_up_to, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3974, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":3972
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3972, __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(1, 3972, __pyx_L1_error)
    break;
  }

  /* "cytimes/cydatetime.py":3978
 * 
 *     # Conversion
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)             # <<<<<<<<<<<<<<
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 */
  __pyx_t_1 = PyArray_Cast(__pyx_v_arr, NPY_INT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3978, __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(1, 3978, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":3980
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3981
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 86_400_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 86_400_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0x4e94914f0000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3981, __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(1, 3981, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3980
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":3982
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 86_400_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3983
 *         return arr // 86_400_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 86_400_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 86_400_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_86400000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3983, __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(1, 3983, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3982
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 86_400_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":3984
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 86_400_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3985
 *         return arr // 86_400_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 86_400_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 86_400
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_86400000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3985, __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(1, 3985, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3984
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 86_400_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":3986
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 86_400_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr // 86_400
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3987
 *         return arr // 86_400_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 86_400             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr // 1_440
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_86400); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3987, __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(1, 3987, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3986
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 86_400_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr // 86_400
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":3988
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 86_400
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr // 1_440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3989
 *         return arr // 86_400
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr // 1_440             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr // 24
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1440); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3989, __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(1, 3989, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3988
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 86_400
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr // 1_440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":3990
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr // 1_440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr // 24
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3991
 *         return arr // 1_440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr // 24             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_24); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3991, __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(1, 3991, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3990
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr // 1_440
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr // 24
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":3992
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr // 24
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3993
 *         return arr // 24
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3992
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr // 24
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":3995
 *         return arr
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3996
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 86_400_000_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 86_400_000_000_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0x132f4579c980000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3996, __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(1, 3996, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3995
 *         return arr
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":3997
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 86_400_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":3998
 *         return arr // 86_400_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 86_400_000_000_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 86_400_000_000_000_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0x4af0a763bb1c00000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3998, __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(1, 3998, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3997
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 86_400_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":3999
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 86_400_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000_000_000_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4000
 *         return arr // 86_400_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 86_400_000_000_000_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0x124bc0ddd92e56000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4000, __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(1, 4000, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":3999
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 86_400_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 86_400_000_000_000_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":4004
 *     raise ValueError(
 *         "Unsupported <'ndarray[timedelta64]'> "
 *         "time unit to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_ndarray_timedelta64, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4002
 *         return arr // 86_400_000_000_000_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'ndarray[timedelta64]'> "
 *         "time unit to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4002, __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(1, 4002, __pyx_L1_error)

  /* "cytimes/cydatetime.py":3940
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64array_to_days(arr: np.ndarray) -> np.ndarray:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.td64array_to_days", __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;
}

/* "cytimes/cydatetime.py":4008
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64array_to_hours(arr: np.ndarray) -> np.ndarray:
 */

static PyArrayObject *__pyx_f_7cytimes_10cydatetime_td64array_to_hours(PyArrayObject *__pyx_v_arr) {
  NPY_DATETIMEUNIT __pyx_v_unit;
  Py_ssize_t __pyx_v_ndim;
  PyArrayObject *__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("td64array_to_hours", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/cydatetime.py":4018
 *     """
 *     # Validate array
 *     validate_td64array(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_td64array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4022
 *     # Get time unit
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim             # <<<<<<<<<<<<<<
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 */
  __pyx_v_ndim = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr);

  /* "cytimes/cydatetime.py":4023
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
  switch (__pyx_v_ndim) {
    case 1:

    /* "cytimes/cydatetime.py":4024
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]) == 0);
    if (__pyx_t_2) {

      /* "cytimes/cydatetime.py":4025
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4024
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    }

    /* "cytimes/cydatetime.py":4026
 *         if arr.shape[0] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])             # <<<<<<<<<<<<<<
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 */
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_arr), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4026, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4023
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
    break;
    case 2:

    /* "cytimes/cydatetime.py":4028
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":4029
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4028
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 */
    }

    /* "cytimes/cydatetime.py":4030
 *         if arr.shape[1] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4027
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:             # <<<<<<<<<<<<<<
 *         if arr.shape[1] == 0:
 *             return arr
 */
    break;
    case 3:

    /* "cytimes/cydatetime.py":4032
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":4033
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4032
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":4034
 *         if arr.shape[2] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4034, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4031
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:             # <<<<<<<<<<<<<<
 *         if arr.shape[2] == 0:
 *             return arr
 */
    break;
    case 4:

    /* "cytimes/cydatetime.py":4036
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":4037
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4036
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":4038
 *         if arr.shape[3] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__14); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4038, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4035
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:             # <<<<<<<<<<<<<<
 *         if arr.shape[3] == 0:
 *             return arr
 */
    break;
    default:

    /* "cytimes/cydatetime.py":4042
 *         raise ValueError(
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4042, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Only_support_ndarray_with_up_to, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4042, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4040
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4040, __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(1, 4040, __pyx_L1_error)
    break;
  }

  /* "cytimes/cydatetime.py":4046
 * 
 *     # Conversion
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)             # <<<<<<<<<<<<<<
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 */
  __pyx_t_1 = PyArray_Cast(__pyx_v_arr, NPY_INT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4046, __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(1, 4046, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4048
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4049
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 3_600_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 3_600_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_3600000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4049, __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(1, 4049, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4048
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":4050
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 3_600_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4051
 *         return arr // 3_600_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 3_600_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 3_600_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_3600000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4051, __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(1, 4051, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4050
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 3_600_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":4052
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 3_600_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4053
 *         return arr // 3_600_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 3_600_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 3_600
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_3600000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 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(1, 4053, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4052
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 3_600_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":4054
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr // 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4055
 *         return arr // 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 3_600             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr // 60
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_3600); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4055, __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(1, 4055, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4054
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr // 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":4056
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4057
 *         return arr // 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr // 60             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_60); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4057, __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(1, 4057, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4056
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":4058
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4059
 *         return arr // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 24
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4058
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":4060
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 24
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4061
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 24             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_24); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4061, __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(1, 4061, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4060
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 24
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":4063
 *         return arr * 24
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4064
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 3_600_000_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 3_600_000_000_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0xcca2e51310000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4064, __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(1, 4064, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4063
 *         return arr * 24
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":4065
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 3_600_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4066
 *         return arr // 3_600_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 3_600_000_000_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 3_600_000_000_000_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0x31f5c4ed27680000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4066, __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(1, 4066, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4065
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 3_600_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":4067
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 3_600_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000_000_000_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4068
 *         return arr // 3_600_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 3_600_000_000_000_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0xc328093e61ee400000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4068, __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(1, 4068, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4067
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 3_600_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 3_600_000_000_000_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":4072
 *     raise ValueError(
 *         "Unsupported <'ndarray[timedelta64]'> "
 *         "time unit to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_ndarray_timedelta64, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4070
 *         return arr // 3_600_000_000_000_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'ndarray[timedelta64]'> "
 *         "time unit to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4070, __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(1, 4070, __pyx_L1_error)

  /* "cytimes/cydatetime.py":4008
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64array_to_hours(arr: np.ndarray) -> np.ndarray:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.td64array_to_hours", __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;
}

/* "cytimes/cydatetime.py":4076
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64array_to_minutes(arr: np.ndarray) -> np.ndarray:
 */

static PyArrayObject *__pyx_f_7cytimes_10cydatetime_td64array_to_minutes(PyArrayObject *__pyx_v_arr) {
  NPY_DATETIMEUNIT __pyx_v_unit;
  Py_ssize_t __pyx_v_ndim;
  PyArrayObject *__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("td64array_to_minutes", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/cydatetime.py":4086
 *     """
 *     # Validate array
 *     validate_td64array(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_td64array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4090
 *     # Get time unit
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim             # <<<<<<<<<<<<<<
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 */
  __pyx_v_ndim = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr);

  /* "cytimes/cydatetime.py":4091
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
  switch (__pyx_v_ndim) {
    case 1:

    /* "cytimes/cydatetime.py":4092
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]) == 0);
    if (__pyx_t_2) {

      /* "cytimes/cydatetime.py":4093
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4092
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    }

    /* "cytimes/cydatetime.py":4094
 *         if arr.shape[0] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])             # <<<<<<<<<<<<<<
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 */
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_arr), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4091
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
    break;
    case 2:

    /* "cytimes/cydatetime.py":4096
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":4097
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4096
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 */
    }

    /* "cytimes/cydatetime.py":4098
 *         if arr.shape[1] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4098, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4095
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:             # <<<<<<<<<<<<<<
 *         if arr.shape[1] == 0:
 *             return arr
 */
    break;
    case 3:

    /* "cytimes/cydatetime.py":4100
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":4101
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4100
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":4102
 *         if arr.shape[2] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4099
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:             # <<<<<<<<<<<<<<
 *         if arr.shape[2] == 0:
 *             return arr
 */
    break;
    case 4:

    /* "cytimes/cydatetime.py":4104
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":4105
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4104
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":4106
 *         if arr.shape[3] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__14); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4103
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:             # <<<<<<<<<<<<<<
 *         if arr.shape[3] == 0:
 *             return arr
 */
    break;
    default:

    /* "cytimes/cydatetime.py":4110
 *         raise ValueError(
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Only_support_ndarray_with_up_to, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4108
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4108, __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(1, 4108, __pyx_L1_error)
    break;
  }

  /* "cytimes/cydatetime.py":4114
 * 
 *     # Conversion
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)             # <<<<<<<<<<<<<<
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 */
  __pyx_t_1 = PyArray_Cast(__pyx_v_arr, NPY_INT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4114, __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(1, 4114, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4116
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4117
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 60_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 60_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_60000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4117, __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(1, 4117, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4116
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":4118
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 60_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4119
 *         return arr // 60_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 60_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 60_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_60000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4119, __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(1, 4119, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4118
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 60_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":4120
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4121
 *         return arr // 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 60_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 60
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_60000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4121, __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(1, 4121, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4120
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":4122
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4123
 *         return arr // 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 60             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_60); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4123, __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(1, 4123, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4122
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":4124
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4125
 *         return arr // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 60
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4124
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr // 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":4126
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4127
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 60             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 1_440
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_60); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4127, __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(1, 4127, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4126
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":4128
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 1_440
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4129
 *         return arr * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 1_440             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_1440); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4129, __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(1, 4129, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4128
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 1_440
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":4131
 *         return arr * 1_440
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4132
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 60_000_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 60_000_000_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0x3691d6afc000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4132, __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(1, 4132, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4131
 *         return arr * 1_440
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":4133
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 60_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4134
 *         return arr // 60_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 60_000_000_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 60_000_000_000_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0xd529ae9e860000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4134, __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(1, 4134, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4133
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 60_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":4135
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 60_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000_000_000_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4136
 *         return arr // 60_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 60_000_000_000_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0x340aad21b3b700000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4136, __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(1, 4136, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4135
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 60_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 60_000_000_000_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":4140
 *     raise ValueError(
 *         "Unsupported <'ndarray[timedelta64]'> "
 *         "time unit to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_ndarray_timedelta64, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4138
 *         return arr // 60_000_000_000_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'ndarray[timedelta64]'> "
 *         "time unit to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4138, __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(1, 4138, __pyx_L1_error)

  /* "cytimes/cydatetime.py":4076
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64array_to_minutes(arr: np.ndarray) -> np.ndarray:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.td64array_to_minutes", __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;
}

/* "cytimes/cydatetime.py":4144
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64array_to_seconds(arr: np.ndarray) -> np.ndarray:
 */

static PyArrayObject *__pyx_f_7cytimes_10cydatetime_td64array_to_seconds(PyArrayObject *__pyx_v_arr) {
  NPY_DATETIMEUNIT __pyx_v_unit;
  Py_ssize_t __pyx_v_ndim;
  PyArrayObject *__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("td64array_to_seconds", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/cydatetime.py":4154
 *     """
 *     # Validate array
 *     validate_td64array(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_td64array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4158
 *     # Get time unit
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim             # <<<<<<<<<<<<<<
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 */
  __pyx_v_ndim = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr);

  /* "cytimes/cydatetime.py":4159
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
  switch (__pyx_v_ndim) {
    case 1:

    /* "cytimes/cydatetime.py":4160
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]) == 0);
    if (__pyx_t_2) {

      /* "cytimes/cydatetime.py":4161
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4160
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    }

    /* "cytimes/cydatetime.py":4162
 *         if arr.shape[0] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])             # <<<<<<<<<<<<<<
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 */
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_arr), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4159
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
    break;
    case 2:

    /* "cytimes/cydatetime.py":4164
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":4165
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4164
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 */
    }

    /* "cytimes/cydatetime.py":4166
 *         if arr.shape[1] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4163
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:             # <<<<<<<<<<<<<<
 *         if arr.shape[1] == 0:
 *             return arr
 */
    break;
    case 3:

    /* "cytimes/cydatetime.py":4168
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":4169
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4168
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":4170
 *         if arr.shape[2] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4167
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:             # <<<<<<<<<<<<<<
 *         if arr.shape[2] == 0:
 *             return arr
 */
    break;
    case 4:

    /* "cytimes/cydatetime.py":4172
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":4173
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4172
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":4174
 *         if arr.shape[3] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__14); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4171
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:             # <<<<<<<<<<<<<<
 *         if arr.shape[3] == 0:
 *             return arr
 */
    break;
    default:

    /* "cytimes/cydatetime.py":4178
 *         raise ValueError(
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Only_support_ndarray_with_up_to, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4176
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4176, __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(1, 4176, __pyx_L1_error)
    break;
  }

  /* "cytimes/cydatetime.py":4182
 * 
 *     # Conversion
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)             # <<<<<<<<<<<<<<
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 */
  __pyx_t_1 = PyArray_Cast(__pyx_v_arr, NPY_INT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4182, __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(1, 4182, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4184
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4185
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 1_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 1_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4185, __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(1, 4185, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4184
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":4186
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4187
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 1_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 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(1, 4187, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4186
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":4188
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4189
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4189, __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(1, 4189, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4188
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":4190
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4191
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4190
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":4192
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4193
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_60); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4193, __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(1, 4193, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4192
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":4194
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr * 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4195
 *         return arr * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 86_400
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_3600); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4195, __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(1, 4195, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4194
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr * 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":4196
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 86_400
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4197
 *         return arr * 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 86_400             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_86400); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4197, __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(1, 4197, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4196
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 86_400
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":4199
 *         return arr * 86_400
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4200
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4200, __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(1, 4200, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4199
 *         return arr * 86_400
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":4201
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4202
 *         return arr // 1_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 1_000_000_000_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0x38d7ea4c68000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4202, __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(1, 4202, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4201
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":4203
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4204
 *         return arr // 1_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 1_000_000_000_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0xde0b6b3a7640000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4204, __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(1, 4204, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4203
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":4208
 *     raise ValueError(
 *         "Unsupported <'ndarray[timedelta64]'> "
 *         "time unit to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_ndarray_timedelta64, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4206
 *         return arr // 1_000_000_000_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'ndarray[timedelta64]'> "
 *         "time unit to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4206, __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(1, 4206, __pyx_L1_error)

  /* "cytimes/cydatetime.py":4144
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64array_to_seconds(arr: np.ndarray) -> np.ndarray:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.td64array_to_seconds", __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;
}

/* "cytimes/cydatetime.py":4212
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64array_to_milliseconds(arr: np.ndarray) -> np.ndarray:
 */

static PyArrayObject *__pyx_f_7cytimes_10cydatetime_td64array_to_milliseconds(PyArrayObject *__pyx_v_arr) {
  NPY_DATETIMEUNIT __pyx_v_unit;
  Py_ssize_t __pyx_v_ndim;
  PyArrayObject *__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("td64array_to_milliseconds", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/cydatetime.py":4222
 *     """
 *     # Validate array
 *     validate_td64array(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_td64array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4226
 *     # Get time unit
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim             # <<<<<<<<<<<<<<
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 */
  __pyx_v_ndim = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr);

  /* "cytimes/cydatetime.py":4227
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
  switch (__pyx_v_ndim) {
    case 1:

    /* "cytimes/cydatetime.py":4228
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]) == 0);
    if (__pyx_t_2) {

      /* "cytimes/cydatetime.py":4229
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4228
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    }

    /* "cytimes/cydatetime.py":4230
 *         if arr.shape[0] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])             # <<<<<<<<<<<<<<
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 */
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_arr), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4227
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
    break;
    case 2:

    /* "cytimes/cydatetime.py":4232
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":4233
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4232
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 */
    }

    /* "cytimes/cydatetime.py":4234
 *         if arr.shape[1] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4231
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:             # <<<<<<<<<<<<<<
 *         if arr.shape[1] == 0:
 *             return arr
 */
    break;
    case 3:

    /* "cytimes/cydatetime.py":4236
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":4237
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4236
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":4238
 *         if arr.shape[2] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4235
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:             # <<<<<<<<<<<<<<
 *         if arr.shape[2] == 0:
 *             return arr
 */
    break;
    case 4:

    /* "cytimes/cydatetime.py":4240
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":4241
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4240
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":4242
 *         if arr.shape[3] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__14); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4239
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:             # <<<<<<<<<<<<<<
 *         if arr.shape[3] == 0:
 *             return arr
 */
    break;
    default:

    /* "cytimes/cydatetime.py":4246
 *         raise ValueError(
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Only_support_ndarray_with_up_to, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4244
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4244, __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(1, 4244, __pyx_L1_error)
    break;
  }

  /* "cytimes/cydatetime.py":4250
 * 
 *     # Conversion
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)             # <<<<<<<<<<<<<<
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 */
  __pyx_t_1 = PyArray_Cast(__pyx_v_arr, NPY_INT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4250, __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(1, 4250, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4252
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4253
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 1_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4253, __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(1, 4253, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4252
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":4254
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4255
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4255, __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(1, 4255, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4254
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":4256
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4257
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4256
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":4258
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4259
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_1000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4259, __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(1, 4259, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4258
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":4260
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr * 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4261
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_60000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4261, __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(1, 4261, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4260
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr * 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":4262
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr * 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4263
 *         return arr * 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 86_400_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_3600000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4263, __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(1, 4263, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4262
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr * 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":4264
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 86_400_000
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4265
 *         return arr * 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 86_400_000             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_86400000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4265, __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(1, 4265, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4264
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 86_400_000
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":4267
 *         return arr * 86_400_000
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4268
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4268, __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(1, 4268, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4267
 *         return arr * 86_400_000
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":4269
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4270
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 1_000_000_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4270, __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(1, 4270, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4269
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":4271
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4272
 *         return arr // 1_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 1_000_000_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_0x38d7ea4c68000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4272, __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(1, 4272, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4271
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":4276
 *     raise ValueError(
 *         "Unsupported <'ndarray[timedelta64]'> "
 *         "time unit to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_ndarray_timedelta64, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4274
 *         return arr // 1_000_000_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'ndarray[timedelta64]'> "
 *         "time unit to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4274, __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(1, 4274, __pyx_L1_error)

  /* "cytimes/cydatetime.py":4212
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64array_to_milliseconds(arr: np.ndarray) -> np.ndarray:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.td64array_to_milliseconds", __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;
}

/* "cytimes/cydatetime.py":4280
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64array_to_microseconds(arr: np.ndarray) -> np.ndarray:
 */

static PyArrayObject *__pyx_f_7cytimes_10cydatetime_td64array_to_microseconds(PyArrayObject *__pyx_v_arr) {
  NPY_DATETIMEUNIT __pyx_v_unit;
  Py_ssize_t __pyx_v_ndim;
  PyArrayObject *__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("td64array_to_microseconds", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/cydatetime.py":4290
 *     """
 *     # Validate array
 *     validate_td64array(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_td64array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4294
 *     # Get time unit
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim             # <<<<<<<<<<<<<<
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 */
  __pyx_v_ndim = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr);

  /* "cytimes/cydatetime.py":4295
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
  switch (__pyx_v_ndim) {
    case 1:

    /* "cytimes/cydatetime.py":4296
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]) == 0);
    if (__pyx_t_2) {

      /* "cytimes/cydatetime.py":4297
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4296
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    }

    /* "cytimes/cydatetime.py":4298
 *         if arr.shape[0] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])             # <<<<<<<<<<<<<<
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 */
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_arr), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4295
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
    break;
    case 2:

    /* "cytimes/cydatetime.py":4300
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":4301
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4300
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 */
    }

    /* "cytimes/cydatetime.py":4302
 *         if arr.shape[1] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4299
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:             # <<<<<<<<<<<<<<
 *         if arr.shape[1] == 0:
 *             return arr
 */
    break;
    case 3:

    /* "cytimes/cydatetime.py":4304
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":4305
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4304
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":4306
 *         if arr.shape[2] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4303
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:             # <<<<<<<<<<<<<<
 *         if arr.shape[2] == 0:
 *             return arr
 */
    break;
    case 4:

    /* "cytimes/cydatetime.py":4308
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":4309
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4308
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":4310
 *         if arr.shape[3] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__14); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4307
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:             # <<<<<<<<<<<<<<
 *         if arr.shape[3] == 0:
 *             return arr
 */
    break;
    default:

    /* "cytimes/cydatetime.py":4314
 *         raise ValueError(
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Only_support_ndarray_with_up_to, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4312
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4312, __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(1, 4312, __pyx_L1_error)
    break;
  }

  /* "cytimes/cydatetime.py":4318
 * 
 *     # Conversion
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)             # <<<<<<<<<<<<<<
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 */
  __pyx_t_1 = PyArray_Cast(__pyx_v_arr, NPY_INT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4318, __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(1, 4318, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4320
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4321
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4321, __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(1, 4321, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4320
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":4322
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4323
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr * 1_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4322
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":4324
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4325
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr * 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_1000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4325, __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(1, 4325, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4324
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":4326
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4327
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_1000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4327, __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(1, 4327, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4326
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":4328
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr * 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4329
 *         return arr * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_60000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4329, __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(1, 4329, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4328
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr * 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":4330
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr * 3_600_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4331
 *         return arr * 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 86_400_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_3600000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4331, __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(1, 4331, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4330
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr * 3_600_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":4332
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 86_400_000_000
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4333
 *         return arr * 3_600_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 86_400_000_000             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_86400000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4333, __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(1, 4333, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4332
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 86_400_000_000
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":4335
 *         return arr * 86_400_000_000
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4336
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4336, __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(1, 4336, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4335
 *         return arr * 86_400_000_000
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":4337
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4338
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 1_000_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4338, __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(1, 4338, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4337
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":4339
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4340
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 1_000_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4340, __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(1, 4340, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4339
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":4344
 *     raise ValueError(
 *         "Unsupported <'ndarray[timedelta64]'> "
 *         "time unit to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_ndarray_timedelta64, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4342
 *         return arr // 1_000_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'ndarray[timedelta64]'> "
 *         "time unit to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4342, __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(1, 4342, __pyx_L1_error)

  /* "cytimes/cydatetime.py":4280
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64array_to_microseconds(arr: np.ndarray) -> np.ndarray:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.td64array_to_microseconds", __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;
}

/* "cytimes/cydatetime.py":4348
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64array_to_nanoseconds(arr: np.ndarray) -> np.ndarray:
 */

static PyArrayObject *__pyx_f_7cytimes_10cydatetime_td64array_to_nanoseconds(PyArrayObject *__pyx_v_arr) {
  NPY_DATETIMEUNIT __pyx_v_unit;
  Py_ssize_t __pyx_v_ndim;
  PyArrayObject *__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("td64array_to_nanoseconds", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);

  /* "cytimes/cydatetime.py":4358
 *     """
 *     # Validate array
 *     validate_td64array(arr)             # <<<<<<<<<<<<<<
 * 
 *     # Get time unit
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_validate_td64array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4362
 *     # Get time unit
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim             # <<<<<<<<<<<<<<
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 */
  __pyx_v_ndim = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr);

  /* "cytimes/cydatetime.py":4363
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
  switch (__pyx_v_ndim) {
    case 1:

    /* "cytimes/cydatetime.py":4364
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    __pyx_t_2 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_arr)[0]) == 0);
    if (__pyx_t_2) {

      /* "cytimes/cydatetime.py":4365
 *     if ndim == 1:
 *         if arr.shape[0] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4364
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:
 *         if arr.shape[0] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 */
    }

    /* "cytimes/cydatetime.py":4366
 *         if arr.shape[0] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])             # <<<<<<<<<<<<<<
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 */
    __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_arr), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4363
 *     unit: np.NPY_DATETIMEUNIT
 *     ndim: cython.Py_ssize_t = arr.ndim
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if arr.shape[0] == 0:
 *             return arr
 */
    break;
    case 2:

    /* "cytimes/cydatetime.py":4368
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":4369
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4368
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:
 *         if arr.shape[1] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 */
    }

    /* "cytimes/cydatetime.py":4370
 *         if arr.shape[1] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4367
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0])
 *     elif ndim == 2:             # <<<<<<<<<<<<<<
 *         if arr.shape[1] == 0:
 *             return arr
 */
    break;
    case 3:

    /* "cytimes/cydatetime.py":4372
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":4373
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4372
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":4374
 *         if arr.shape[2] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4371
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0])
 *     elif ndim == 3:             # <<<<<<<<<<<<<<
 *         if arr.shape[2] == 0:
 *             return arr
 */
    break;
    case 4:

    /* "cytimes/cydatetime.py":4376
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = 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) {

      /* "cytimes/cydatetime.py":4377
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 *             return arr             # <<<<<<<<<<<<<<
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;

      /* "cytimes/cydatetime.py":4376
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:             # <<<<<<<<<<<<<<
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 */
    }

    /* "cytimes/cydatetime.py":4378
 *         if arr.shape[3] == 0:
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_tuple__14); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_unit = __pyx_f_5numpy_get_datetime64_unit(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4375
 *             return arr
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])
 *     elif ndim == 4:             # <<<<<<<<<<<<<<
 *         if arr.shape[3] == 0:
 *             return arr
 */
    break;
    default:

    /* "cytimes/cydatetime.py":4382
 *         raise ValueError(
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Only_support_ndarray_with_up_to, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4380
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Only support <'ndarray'> with up to 4 "
 *             "dimensions, instead got: %d." % ndim
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4380, __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(1, 4380, __pyx_L1_error)
    break;
  }

  /* "cytimes/cydatetime.py":4386
 * 
 *     # Conversion
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)             # <<<<<<<<<<<<<<
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 */
  __pyx_t_1 = PyArray_Cast(__pyx_v_arr, NPY_INT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4386, __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(1, 4386, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4388
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ns);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4389
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr * 1_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4388
 *     arr = np.PyArray_Cast(arr, np.NPY_TYPES.NPY_INT64)
 *     # . common
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond             # <<<<<<<<<<<<<<
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 */
  }

  /* "cytimes/cydatetime.py":4390
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_us);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4391
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr * 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr * 1_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_1000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4391, __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(1, 4391, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4390
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ns:  # nanosecond
 *         return arr
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond             # <<<<<<<<<<<<<<
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 */
  }

  /* "cytimes/cydatetime.py":4392
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ms);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4393
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr * 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_1000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4393, __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(1, 4393, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4392
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_us:  # microsecond
 *         return arr * 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond             # <<<<<<<<<<<<<<
 *         return arr * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 */
  }

  /* "cytimes/cydatetime.py":4394
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr * 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_s);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4395
 *         return arr * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_1000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4395, __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(1, 4395, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4394
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ms:  # millisecond
 *         return arr * 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second             # <<<<<<<<<<<<<<
 *         return arr * 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 */
  }

  /* "cytimes/cydatetime.py":4396
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr * 60_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_m);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4397
 *         return arr * 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_60000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4397, __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(1, 4397, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4396
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_s:  # second
 *         return arr * 1_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute             # <<<<<<<<<<<<<<
 *         return arr * 60_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 */
  }

  /* "cytimes/cydatetime.py":4398
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr * 3_600_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_h);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4399
 *         return arr * 60_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 86_400_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_3600000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4399, __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(1, 4399, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4398
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_m:  # minute
 *         return arr * 60_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour             # <<<<<<<<<<<<<<
 *         return arr * 3_600_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 */
  }

  /* "cytimes/cydatetime.py":4400
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 86_400_000_000_000
 *     # . uncommon
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_D);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4401
 *         return arr * 3_600_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day
 *         return arr * 86_400_000_000_000             # <<<<<<<<<<<<<<
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_arr), __pyx_int_0x4e94914f0000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4401, __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(1, 4401, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4400
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_h:  # hour
 *         return arr * 3_600_000_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_D:  # day             # <<<<<<<<<<<<<<
 *         return arr * 86_400_000_000_000
 *     # . uncommon
 */
  }

  /* "cytimes/cydatetime.py":4403
 *         return arr * 86_400_000_000_000
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_ps);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4404
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4404, __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(1, 4404, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4403
 *         return arr * 86_400_000_000_000
 *     # . uncommon
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 */
  }

  /* "cytimes/cydatetime.py":4405
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_fs);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4406
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000             # <<<<<<<<<<<<<<
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 1_000_000_000
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4406, __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(1, 4406, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4405
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_ps:  # picosecond
 *         return arr // 1_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 */
  }

  /* "cytimes/cydatetime.py":4407
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000
 *     # . unsupported
 */
  __pyx_t_2 = (__pyx_v_unit == NPY_FR_as);
  if (__pyx_t_2) {

    /* "cytimes/cydatetime.py":4408
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond
 *         return arr // 1_000_000_000             # <<<<<<<<<<<<<<
 *     # . unsupported
 *     raise ValueError(
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_1 = PyNumber_FloorDivide(((PyObject *)__pyx_v_arr), __pyx_int_1000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4408, __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(1, 4408, __pyx_L1_error)
    __pyx_r = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4407
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_fs:  # femtosecond
 *         return arr // 1_000_000
 *     if unit == np.NPY_DATETIMEUNIT.NPY_FR_as:  # attosecond             # <<<<<<<<<<<<<<
 *         return arr // 1_000_000_000
 *     # . unsupported
 */
  }

  /* "cytimes/cydatetime.py":4412
 *     raise ValueError(
 *         "Unsupported <'ndarray[timedelta64]'> "
 *         "time unit to perform conversion: %d." % unit             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_NPY_DATETIMEUNIT(__pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unsupported_ndarray_timedelta64, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4410
 *         return arr // 1_000_000_000
 *     # . unsupported
 *     raise ValueError(             # <<<<<<<<<<<<<<
 *         "Unsupported <'ndarray[timedelta64]'> "
 *         "time unit to perform conversion: %d." % unit
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4410, __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(1, 4410, __pyx_L1_error)

  /* "cytimes/cydatetime.py":4348
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64array_to_nanoseconds(arr: np.ndarray) -> np.ndarray:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytimes.cydatetime.td64array_to_nanoseconds", __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;
}

/* "cytimes/cydatetime.py":4418
 * # pandas.Series[datetime64] ============================================================================
 * # pandas.Series[datetime64] check types ----------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static int __pyx_f_7cytimes_10cydatetime_is_dt64series(PyObject *__pyx_v_obj) {
  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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_dt64series", 1);

  /* "cytimes/cydatetime.py":4426
 *     Equivalent to `isinstance(s.dtype, (np.dtypes.DateTime64DType, pandas.DatetimeTZDtype))`.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *         return isinstance(obj, typeref.SERIES) and isinstance(
 *             obj.dtype, (typeref.DT64_ARRAY, typeref.DT64TZ_ARRAY)
 */
  {
    __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/cydatetime.py":4427
 *     """
 *     try:
 *         return isinstance(obj, typeref.SERIES) and isinstance(             # <<<<<<<<<<<<<<
 *             obj.dtype, (typeref.DT64_ARRAY, typeref.DT64TZ_ARRAY)
 *         )
 */
      __pyx_t_5 = __pyx_v_7cytimes_7typeref_SERIES;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 4427, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
      } else {
        __pyx_t_4 = __pyx_t_6;
        goto __pyx_L9_bool_binop_done;
      }

      /* "cytimes/cydatetime.py":4428
 *     try:
 *         return isinstance(obj, typeref.SERIES) and isinstance(
 *             obj.dtype, (typeref.DT64_ARRAY, typeref.DT64TZ_ARRAY)             # <<<<<<<<<<<<<<
 *         )
 *     except Exception:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 4428, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_7cytimes_7typeref_DT64_ARRAY);
      __pyx_t_7 = __pyx_v_7cytimes_7typeref_DT64_ARRAY;
      __Pyx_INCREF(__pyx_v_7cytimes_7typeref_DT64TZ_ARRAY);
      __pyx_t_8 = __pyx_v_7cytimes_7typeref_DT64TZ_ARRAY;

      /* "cytimes/cydatetime.py":4427
 *     """
 *     try:
 *         return isinstance(obj, typeref.SERIES) and isinstance(             # <<<<<<<<<<<<<<
 *             obj.dtype, (typeref.DT64_ARRAY, typeref.DT64TZ_ARRAY)
 *         )
 */
      __pyx_t_9 = PyObject_IsInstance(__pyx_t_5, __pyx_t_7); 
      if (!__pyx_t_9) {
      } else {
        __pyx_t_6 = __pyx_t_9;
        goto __pyx_L11_bool_binop_done;
      }

      /* "cytimes/cydatetime.py":4428
 *     try:
 *         return isinstance(obj, typeref.SERIES) and isinstance(
 *             obj.dtype, (typeref.DT64_ARRAY, typeref.DT64TZ_ARRAY)             # <<<<<<<<<<<<<<
 *         )
 *     except Exception:
 */
      __pyx_t_9 = PyObject_IsInstance(__pyx_t_5, __pyx_t_8); 
      __pyx_t_6 = __pyx_t_9;
      __pyx_L11_bool_binop_done:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_4 = __pyx_t_6;
      __pyx_L9_bool_binop_done:;
      __pyx_r = __pyx_t_4;
      goto __pyx_L7_try_return;

      /* "cytimes/cydatetime.py":4426
 *     Equivalent to `isinstance(s.dtype, (np.dtypes.DateTime64DType, pandas.DatetimeTZDtype))`.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *         return isinstance(obj, typeref.SERIES) and isinstance(
 *             obj.dtype, (typeref.DT64_ARRAY, typeref.DT64TZ_ARRAY)
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cytimes/cydatetime.py":4430
 *             obj.dtype, (typeref.DT64_ARRAY, typeref.DT64TZ_ARRAY)
 *         )
 *     except Exception:             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
    __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_10) {
      __Pyx_AddTraceback("cytimes.cydatetime.is_dt64series", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 4430, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);

      /* "cytimes/cydatetime.py":4431
 *         )
 *     except Exception:
 *         return False             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_r = 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;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;

    /* "cytimes/cydatetime.py":4426
 *     Equivalent to `isinstance(s.dtype, (np.dtypes.DateTime64DType, pandas.DatetimeTZDtype))`.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *         return isinstance(obj, typeref.SERIES) and isinstance(
 *             obj.dtype, (typeref.DT64_ARRAY, typeref.DT64TZ_ARRAY)
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "cytimes/cydatetime.py":4418
 * # pandas.Series[datetime64] ============================================================================
 * # pandas.Series[datetime64] check types ----------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cytimes.cydatetime.is_dt64series", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4434
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def validate_dt64series(obj: object):
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_validate_dt64series(PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("validate_dt64series", 1);

  /* "cytimes/cydatetime.py":4439
 *     """Validate if an object is dtype of <'Series[datetime64]'>.
 *     Raise `TypeError` if dtype is incorrect."""
 *     if not is_dt64series(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_is_dt64series(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 4439, __pyx_L1_error)
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {

    /* "cytimes/cydatetime.py":4444
 *             % (
 *                 "<'Series[%s]'>" % (obj.dtype)
 *                 if isinstance(obj, typeref.SERIES)             # <<<<<<<<<<<<<<
 *                 else type(obj)
 *             )
 */
    __pyx_t_4 = __pyx_v_7cytimes_7typeref_SERIES;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_2 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 4444, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "cytimes/cydatetime.py":4443
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 *                 "<'Series[%s]'>" % (obj.dtype)             # <<<<<<<<<<<<<<
 *                 if isinstance(obj, typeref.SERIES)
 *                 else type(obj)
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4443, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Series_s, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 4443, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {

      /* "cytimes/cydatetime.py":4445
 *                 "<'Series[%s]'>" % (obj.dtype)
 *                 if isinstance(obj, typeref.SERIES)
 *                 else type(obj)             # <<<<<<<<<<<<<<
 *             )
 *         )
 */
      __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_obj)));
      __pyx_t_3 = ((PyObject *)Py_TYPE(__pyx_v_obj));
    }

    /* "cytimes/cydatetime.py":4442
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (             # <<<<<<<<<<<<<<
 *                 "<'Series[%s]'>" % (obj.dtype)
 *                 if isinstance(obj, typeref.SERIES)
 */
    __pyx_t_5 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_Series_datetime64_instea, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 4442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cytimes/cydatetime.py":4440
 *     Raise `TypeError` if dtype is incorrect."""
 *     if not is_dt64series(obj):
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 4440, __pyx_L1_error)

    /* "cytimes/cydatetime.py":4439
 *     """Validate if an object is dtype of <'Series[datetime64]'>.
 *     Raise `TypeError` if dtype is incorrect."""
 *     if not is_dt64series(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
  }

  /* "cytimes/cydatetime.py":4434
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def validate_dt64series(obj: object):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.cydatetime.validate_dt64series", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4450
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def get_dt64series_arr(s: Series) -> np.ndarray:
 */

static PyArrayObject *__pyx_f_7cytimes_10cydatetime_get_dt64series_arr(PyObject *__pyx_v_s) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_err = NULL;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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("get_dt64series_arr", 1);

  /* "cytimes/cydatetime.py":4454
 * def get_dt64series_arr(s: Series) -> np.ndarray:
 *     """Get `<'Series[datetime64]'>` underlying data `<'ndarray'>`."""
 *     try:             # <<<<<<<<<<<<<<
 *         arr: np.ndarray = s.values
 *     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/cydatetime.py":4455
 *     """Get `<'Series[datetime64]'>` underlying data `<'ndarray'>`."""
 *     try:
 *         arr: np.ndarray = s.values             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *         raise TypeError(
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4455, __pyx_L3_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(1, 4455, __pyx_L3_error)
      __pyx_v_arr = ((PyArrayObject *)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "cytimes/cydatetime.py":4454
 * def get_dt64series_arr(s: Series) -> np.ndarray:
 *     """Get `<'Series[datetime64]'>` underlying data `<'ndarray'>`."""
 *     try:             # <<<<<<<<<<<<<<
 *         arr: np.ndarray = s.values
 *     except Exception as err:
 */
    }
    __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;

    /* "cytimes/cydatetime.py":4456
 *     try:
 *         arr: np.ndarray = s.values
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_5) {
      __Pyx_AddTraceback("cytimes.cydatetime.get_dt64series_arr", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 4456, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":4461
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)             # <<<<<<<<<<<<<<
 *                 else type(s)
 *             )
 */
        __pyx_t_9 = __pyx_v_7cytimes_7typeref_SERIES;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_s, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 4461, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {

          /* "cytimes/cydatetime.py":4460
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)             # <<<<<<<<<<<<<<
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 4460, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Series_s, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4460, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_8 = __pyx_t_11;
          __pyx_t_11 = 0;
        } else {

          /* "cytimes/cydatetime.py":4462
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)             # <<<<<<<<<<<<<<
 *             )
 *         ) from err
 */
          __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_s)));
          __pyx_t_8 = ((PyObject *)Py_TYPE(__pyx_v_s));
        }

        /* "cytimes/cydatetime.py":4459
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (             # <<<<<<<<<<<<<<
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 */
        __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_Series_datetime64_instea, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4459, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cytimes/cydatetime.py":4457
 *         arr: np.ndarray = s.values
 *     except Exception as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 4457, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cytimes/cydatetime.py":4464
 *                 else type(s)
 *             )
 *         ) from err             # <<<<<<<<<<<<<<
 *     return arr
 * 
 */
        __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(1, 4457, __pyx_L14_error)
      }

      /* "cytimes/cydatetime.py":4456
 *     try:
 *         arr: np.ndarray = s.values
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
      /*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_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_5 = __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_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/cydatetime.py":4454
 * def get_dt64series_arr(s: Series) -> np.ndarray:
 *     """Get `<'Series[datetime64]'>` underlying data `<'ndarray'>`."""
 *     try:             # <<<<<<<<<<<<<<
 *         arr: np.ndarray = s.values
 *     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_L8_try_end:;
  }

  /* "cytimes/cydatetime.py":4465
 *             )
 *         ) from err
 *     return arr             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __pyx_r = __pyx_v_arr;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":4450
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def get_dt64series_arr(s: Series) -> np.ndarray:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.cydatetime.get_dt64series_arr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4468
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def get_dt64series_unit(s: Series) -> str:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_get_dt64series_unit(PyObject *__pyx_v_s) {
  PyArrayObject *__pyx_v_arr = 0;
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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("get_dt64series_unit", 1);

  /* "cytimes/cydatetime.py":4473
 *     """Get the time unit of the `<'Series[datetime64]'>`,
 *     such as: 'D', 's', 'ms', 'us', 'ns', etc `<'str'>`."""
 *     arr: np.ndarray = get_dt64series_arr(s)             # <<<<<<<<<<<<<<
 *     try:
 *         return get_dt64array_unit(arr)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_get_dt64series_arr(__pyx_v_s)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4474
 *     such as: 'D', 's', 'ms', 'us', 'ns', etc `<'str'>`."""
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         return get_dt64array_unit(arr)
 *     except TypeError 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:*/ {

      /* "cytimes/cydatetime.py":4475
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:
 *         return get_dt64array_unit(arr)             # <<<<<<<<<<<<<<
 *     except TypeError as err:
 *         raise TypeError(
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_get_dt64array_unit(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4475, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      goto __pyx_L7_try_return;

      /* "cytimes/cydatetime.py":4474
 *     such as: 'D', 's', 'ms', 'us', 'ns', etc `<'str'>`."""
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         return get_dt64array_unit(arr)
 *     except TypeError as err:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4476
 *     try:
 *         return get_dt64array_unit(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("cytimes.cydatetime.get_dt64series_unit", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 4476, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":4481
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)             # <<<<<<<<<<<<<<
 *                 else type(s)
 *             )
 */
        __pyx_t_9 = __pyx_v_7cytimes_7typeref_SERIES;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_s, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 4481, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {

          /* "cytimes/cydatetime.py":4480
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)             # <<<<<<<<<<<<<<
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 4480, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Series_s, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4480, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_8 = __pyx_t_11;
          __pyx_t_11 = 0;
        } else {

          /* "cytimes/cydatetime.py":4482
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)             # <<<<<<<<<<<<<<
 *             )
 *         ) from err
 */
          __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_s)));
          __pyx_t_8 = ((PyObject *)Py_TYPE(__pyx_v_s));
        }

        /* "cytimes/cydatetime.py":4479
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (             # <<<<<<<<<<<<<<
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 */
        __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_Series_datetime64_instea, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4479, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cytimes/cydatetime.py":4477
 *         return get_dt64array_unit(arr)
 *     except TypeError as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 4477, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cytimes/cydatetime.py":4484
 *                 else type(s)
 *             )
 *         ) from err             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(1, 4477, __pyx_L14_error)
      }

      /* "cytimes/cydatetime.py":4476
 *     try:
 *         return get_dt64array_unit(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
      /*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_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_5 = __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_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/cydatetime.py":4474
 *     such as: 'D', 's', 'ms', 'us', 'ns', etc `<'str'>`."""
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         return get_dt64array_unit(arr)
 *     except TypeError 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;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L0;
  }

  /* "cytimes/cydatetime.py":4468
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def get_dt64series_unit(s: Series) -> str:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.cydatetime.get_dt64series_unit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4488
 * 
 * # pandas.Series[datetime64] conversion -----------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64series_to_int(
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_dt64series_to_int(PyObject *__pyx_v_s, PyObject *__pyx_v_unit) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dt64series_to_int", 1);

  /* "cytimes/cydatetime.py":4501
 *     unit is smaller than the target time 'unit'.
 *     """
 *     if unit == "ns":             # <<<<<<<<<<<<<<
 *         return dt64series_to_nanoseconds(s)
 *     elif unit == "us":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ns, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 4501, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":4502
 *     """
 *     if unit == "ns":
 *         return dt64series_to_nanoseconds(s)             # <<<<<<<<<<<<<<
 *     elif unit == "us":
 *         return dt64series_to_microseconds(s)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_dt64series_to_nanoseconds(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4501
 *     unit is smaller than the target time 'unit'.
 *     """
 *     if unit == "ns":             # <<<<<<<<<<<<<<
 *         return dt64series_to_nanoseconds(s)
 *     elif unit == "us":
 */
  }

  /* "cytimes/cydatetime.py":4503
 *     if unit == "ns":
 *         return dt64series_to_nanoseconds(s)
 *     elif unit == "us":             # <<<<<<<<<<<<<<
 *         return dt64series_to_microseconds(s)
 *     elif unit == "ms":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_us, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 4503, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":4504
 *         return dt64series_to_nanoseconds(s)
 *     elif unit == "us":
 *         return dt64series_to_microseconds(s)             # <<<<<<<<<<<<<<
 *     elif unit == "ms":
 *         return dt64series_to_milliseconds(s)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_dt64series_to_microseconds(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4503
 *     if unit == "ns":
 *         return dt64series_to_nanoseconds(s)
 *     elif unit == "us":             # <<<<<<<<<<<<<<
 *         return dt64series_to_microseconds(s)
 *     elif unit == "ms":
 */
  }

  /* "cytimes/cydatetime.py":4505
 *     elif unit == "us":
 *         return dt64series_to_microseconds(s)
 *     elif unit == "ms":             # <<<<<<<<<<<<<<
 *         return dt64series_to_milliseconds(s)
 *     elif unit == "s":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ms, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 4505, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":4506
 *         return dt64series_to_microseconds(s)
 *     elif unit == "ms":
 *         return dt64series_to_milliseconds(s)             # <<<<<<<<<<<<<<
 *     elif unit == "s":
 *         return dt64series_to_seconds(s)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_dt64series_to_milliseconds(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4505
 *     elif unit == "us":
 *         return dt64series_to_microseconds(s)
 *     elif unit == "ms":             # <<<<<<<<<<<<<<
 *         return dt64series_to_milliseconds(s)
 *     elif unit == "s":
 */
  }

  /* "cytimes/cydatetime.py":4507
 *     elif unit == "ms":
 *         return dt64series_to_milliseconds(s)
 *     elif unit == "s":             # <<<<<<<<<<<<<<
 *         return dt64series_to_seconds(s)
 *     elif unit == "m":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_s, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 4507, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":4508
 *         return dt64series_to_milliseconds(s)
 *     elif unit == "s":
 *         return dt64series_to_seconds(s)             # <<<<<<<<<<<<<<
 *     elif unit == "m":
 *         return dt64series_to_minutes(s)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_dt64series_to_seconds(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4507
 *     elif unit == "ms":
 *         return dt64series_to_milliseconds(s)
 *     elif unit == "s":             # <<<<<<<<<<<<<<
 *         return dt64series_to_seconds(s)
 *     elif unit == "m":
 */
  }

  /* "cytimes/cydatetime.py":4509
 *     elif unit == "s":
 *         return dt64series_to_seconds(s)
 *     elif unit == "m":             # <<<<<<<<<<<<<<
 *         return dt64series_to_minutes(s)
 *     elif unit == "h":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_m, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 4509, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":4510
 *         return dt64series_to_seconds(s)
 *     elif unit == "m":
 *         return dt64series_to_minutes(s)             # <<<<<<<<<<<<<<
 *     elif unit == "h":
 *         return dt64series_to_hours(s)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_dt64series_to_minutes(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4509
 *     elif unit == "s":
 *         return dt64series_to_seconds(s)
 *     elif unit == "m":             # <<<<<<<<<<<<<<
 *         return dt64series_to_minutes(s)
 *     elif unit == "h":
 */
  }

  /* "cytimes/cydatetime.py":4511
 *     elif unit == "m":
 *         return dt64series_to_minutes(s)
 *     elif unit == "h":             # <<<<<<<<<<<<<<
 *         return dt64series_to_hours(s)
 *     elif unit == "D" or unit == "d":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_h, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 4511, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":4512
 *         return dt64series_to_minutes(s)
 *     elif unit == "h":
 *         return dt64series_to_hours(s)             # <<<<<<<<<<<<<<
 *     elif unit == "D" or unit == "d":
 *         return dt64series_to_days(s)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_dt64series_to_hours(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4512, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4511
 *     elif unit == "m":
 *         return dt64series_to_minutes(s)
 *     elif unit == "h":             # <<<<<<<<<<<<<<
 *         return dt64series_to_hours(s)
 *     elif unit == "D" or unit == "d":
 */
  }

  /* "cytimes/cydatetime.py":4513
 *     elif unit == "h":
 *         return dt64series_to_hours(s)
 *     elif unit == "D" or unit == "d":             # <<<<<<<<<<<<<<
 *         return dt64series_to_days(s)
 *     else:
 */
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_D, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 4513, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_d, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 4513, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (likely(__pyx_t_1)) {

    /* "cytimes/cydatetime.py":4514
 *         return dt64series_to_hours(s)
 *     elif unit == "D" or unit == "d":
 *         return dt64series_to_days(s)             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_dt64series_to_days(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4513
 *     elif unit == "h":
 *         return dt64series_to_hours(s)
 *     elif unit == "D" or unit == "d":             # <<<<<<<<<<<<<<
 *         return dt64series_to_days(s)
 *     else:
 */
  }

  /* "cytimes/cydatetime.py":4516
 *         return dt64series_to_days(s)
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Does not support conversion of "
 *             "<'Series[datetime64]'> to time unit: %r." % unit
 */
  /*else*/ {

    /* "cytimes/cydatetime.py":4518
 *         raise ValueError(
 *             "Does not support conversion of "
 *             "<'Series[datetime64]'> to time unit: %r." % unit             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Does_not_support_conversion_of_S, __pyx_v_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cytimes/cydatetime.py":4516
 *         return dt64series_to_days(s)
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Does not support conversion of "
 *             "<'Series[datetime64]'> to time unit: %r." % unit
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(1, 4516, __pyx_L1_error)
  }

  /* "cytimes/cydatetime.py":4488
 * 
 * # pandas.Series[datetime64] conversion -----------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64series_to_int(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64series_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4522
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64series_to_days(s: Series) -> object:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_dt64series_to_days(PyObject *__pyx_v_s) {
  PyArrayObject *__pyx_v_arr = 0;
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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("dt64series_to_days", 1);

  /* "cytimes/cydatetime.py":4531
 *     unit is smaller than 'day (D)'.
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)             # <<<<<<<<<<<<<<
 *     try:
 *         arr = dt64array_to_days(arr)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_get_dt64series_arr(__pyx_v_s)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4532
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_days(arr)
 *     except TypeError 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:*/ {

      /* "cytimes/cydatetime.py":4533
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:
 *         arr = dt64array_to_days(arr)             # <<<<<<<<<<<<<<
 *     except TypeError as err:
 *         raise TypeError(
 */
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt64array_to_days(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4533, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cytimes/cydatetime.py":4532
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_days(arr)
 *     except TypeError as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4534
 *     try:
 *         arr = dt64array_to_days(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("cytimes.cydatetime.dt64series_to_days", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 4534, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":4539
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)             # <<<<<<<<<<<<<<
 *                 else type(s)
 *             )
 */
        __pyx_t_9 = __pyx_v_7cytimes_7typeref_SERIES;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_s, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 4539, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {

          /* "cytimes/cydatetime.py":4538
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)             # <<<<<<<<<<<<<<
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 4538, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Series_s, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4538, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_8 = __pyx_t_11;
          __pyx_t_11 = 0;
        } else {

          /* "cytimes/cydatetime.py":4540
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)             # <<<<<<<<<<<<<<
 *             )
 *         ) from err
 */
          __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_s)));
          __pyx_t_8 = ((PyObject *)Py_TYPE(__pyx_v_s));
        }

        /* "cytimes/cydatetime.py":4537
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (             # <<<<<<<<<<<<<<
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 */
        __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_Series_datetime64_instea, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4537, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cytimes/cydatetime.py":4535
 *         arr = dt64array_to_days(arr)
 *     except TypeError as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 4535, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cytimes/cydatetime.py":4542
 *                 else type(s)
 *             )
 *         ) from err             # <<<<<<<<<<<<<<
 *     return typeref.SERIES(arr, index=s.index, name=s.name)
 * 
 */
        __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(1, 4535, __pyx_L14_error)
      }

      /* "cytimes/cydatetime.py":4534
 *     try:
 *         arr = dt64array_to_days(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
      /*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_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_5 = __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_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/cydatetime.py":4532
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_days(arr)
 *     except TypeError 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;
    __pyx_L8_try_end:;
  }

  /* "cytimes/cydatetime.py":4543
 *             )
 *         ) from err
 *     return typeref.SERIES(arr, index=s.index, name=s.name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 4543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(1, 4543, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_index, __pyx_t_1) < 0) __PYX_ERR(1, 4543, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_name, __pyx_t_1) < 0) __PYX_ERR(1, 4543, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_7cytimes_7typeref_SERIES, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":4522
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64series_to_days(s: Series) -> object:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64series_to_days", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4546
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64series_to_hours(s: Series) -> object:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_dt64series_to_hours(PyObject *__pyx_v_s) {
  PyArrayObject *__pyx_v_arr = 0;
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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("dt64series_to_hours", 1);

  /* "cytimes/cydatetime.py":4555
 *     unit is smaller than 'hour (H)'.
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)             # <<<<<<<<<<<<<<
 *     try:
 *         arr = dt64array_to_hours(arr)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_get_dt64series_arr(__pyx_v_s)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4556
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_hours(arr)
 *     except TypeError 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:*/ {

      /* "cytimes/cydatetime.py":4557
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:
 *         arr = dt64array_to_hours(arr)             # <<<<<<<<<<<<<<
 *     except TypeError as err:
 *         raise TypeError(
 */
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt64array_to_hours(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4557, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cytimes/cydatetime.py":4556
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_hours(arr)
 *     except TypeError as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4558
 *     try:
 *         arr = dt64array_to_hours(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("cytimes.cydatetime.dt64series_to_hours", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 4558, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":4563
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)             # <<<<<<<<<<<<<<
 *                 else type(s)
 *             )
 */
        __pyx_t_9 = __pyx_v_7cytimes_7typeref_SERIES;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_s, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 4563, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {

          /* "cytimes/cydatetime.py":4562
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)             # <<<<<<<<<<<<<<
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 4562, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Series_s, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4562, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_8 = __pyx_t_11;
          __pyx_t_11 = 0;
        } else {

          /* "cytimes/cydatetime.py":4564
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)             # <<<<<<<<<<<<<<
 *             )
 *         ) from err
 */
          __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_s)));
          __pyx_t_8 = ((PyObject *)Py_TYPE(__pyx_v_s));
        }

        /* "cytimes/cydatetime.py":4561
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (             # <<<<<<<<<<<<<<
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 */
        __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_Series_datetime64_instea, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4561, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cytimes/cydatetime.py":4559
 *         arr = dt64array_to_hours(arr)
 *     except TypeError as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 4559, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cytimes/cydatetime.py":4566
 *                 else type(s)
 *             )
 *         ) from err             # <<<<<<<<<<<<<<
 *     return typeref.SERIES(arr, index=s.index, name=s.name)
 * 
 */
        __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(1, 4559, __pyx_L14_error)
      }

      /* "cytimes/cydatetime.py":4558
 *     try:
 *         arr = dt64array_to_hours(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
      /*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_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_5 = __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_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/cydatetime.py":4556
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_hours(arr)
 *     except TypeError 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;
    __pyx_L8_try_end:;
  }

  /* "cytimes/cydatetime.py":4567
 *             )
 *         ) from err
 *     return typeref.SERIES(arr, index=s.index, name=s.name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 4567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(1, 4567, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_index, __pyx_t_1) < 0) __PYX_ERR(1, 4567, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_name, __pyx_t_1) < 0) __PYX_ERR(1, 4567, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_7cytimes_7typeref_SERIES, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":4546
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64series_to_hours(s: Series) -> object:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64series_to_hours", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4570
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64series_to_minutes(s: Series) -> object:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_dt64series_to_minutes(PyObject *__pyx_v_s) {
  PyArrayObject *__pyx_v_arr = 0;
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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("dt64series_to_minutes", 1);

  /* "cytimes/cydatetime.py":4579
 *     unit is smaller than 'minute (m)'.
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)             # <<<<<<<<<<<<<<
 *     try:
 *         arr = dt64array_to_minutes(arr)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_get_dt64series_arr(__pyx_v_s)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4580
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_minutes(arr)
 *     except TypeError 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:*/ {

      /* "cytimes/cydatetime.py":4581
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:
 *         arr = dt64array_to_minutes(arr)             # <<<<<<<<<<<<<<
 *     except TypeError as err:
 *         raise TypeError(
 */
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt64array_to_minutes(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4581, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cytimes/cydatetime.py":4580
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_minutes(arr)
 *     except TypeError as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4582
 *     try:
 *         arr = dt64array_to_minutes(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("cytimes.cydatetime.dt64series_to_minutes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 4582, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":4587
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)             # <<<<<<<<<<<<<<
 *                 else type(s)
 *             )
 */
        __pyx_t_9 = __pyx_v_7cytimes_7typeref_SERIES;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_s, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 4587, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {

          /* "cytimes/cydatetime.py":4586
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)             # <<<<<<<<<<<<<<
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 4586, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Series_s, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4586, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_8 = __pyx_t_11;
          __pyx_t_11 = 0;
        } else {

          /* "cytimes/cydatetime.py":4588
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)             # <<<<<<<<<<<<<<
 *             )
 *         ) from err
 */
          __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_s)));
          __pyx_t_8 = ((PyObject *)Py_TYPE(__pyx_v_s));
        }

        /* "cytimes/cydatetime.py":4585
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (             # <<<<<<<<<<<<<<
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 */
        __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_Series_datetime64_instea, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4585, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cytimes/cydatetime.py":4583
 *         arr = dt64array_to_minutes(arr)
 *     except TypeError as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 4583, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cytimes/cydatetime.py":4590
 *                 else type(s)
 *             )
 *         ) from err             # <<<<<<<<<<<<<<
 *     return typeref.SERIES(arr, index=s.index, name=s.name)
 * 
 */
        __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(1, 4583, __pyx_L14_error)
      }

      /* "cytimes/cydatetime.py":4582
 *     try:
 *         arr = dt64array_to_minutes(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
      /*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_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_5 = __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_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/cydatetime.py":4580
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_minutes(arr)
 *     except TypeError 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;
    __pyx_L8_try_end:;
  }

  /* "cytimes/cydatetime.py":4591
 *             )
 *         ) from err
 *     return typeref.SERIES(arr, index=s.index, name=s.name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 4591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(1, 4591, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_index, __pyx_t_1) < 0) __PYX_ERR(1, 4591, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_name, __pyx_t_1) < 0) __PYX_ERR(1, 4591, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_7cytimes_7typeref_SERIES, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":4570
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64series_to_minutes(s: Series) -> object:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64series_to_minutes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4594
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64series_to_seconds(s: Series) -> object:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_dt64series_to_seconds(PyObject *__pyx_v_s) {
  PyArrayObject *__pyx_v_arr = 0;
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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("dt64series_to_seconds", 1);

  /* "cytimes/cydatetime.py":4603
 *     unit is smaller than 'second (s)'.
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)             # <<<<<<<<<<<<<<
 *     try:
 *         arr = dt64array_to_seconds(arr)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_get_dt64series_arr(__pyx_v_s)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4604
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_seconds(arr)
 *     except TypeError 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:*/ {

      /* "cytimes/cydatetime.py":4605
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:
 *         arr = dt64array_to_seconds(arr)             # <<<<<<<<<<<<<<
 *     except TypeError as err:
 *         raise TypeError(
 */
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt64array_to_seconds(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4605, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cytimes/cydatetime.py":4604
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_seconds(arr)
 *     except TypeError as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4606
 *     try:
 *         arr = dt64array_to_seconds(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("cytimes.cydatetime.dt64series_to_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 4606, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":4611
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)             # <<<<<<<<<<<<<<
 *                 else type(s)
 *             )
 */
        __pyx_t_9 = __pyx_v_7cytimes_7typeref_SERIES;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_s, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 4611, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {

          /* "cytimes/cydatetime.py":4610
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)             # <<<<<<<<<<<<<<
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 4610, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Series_s, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4610, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_8 = __pyx_t_11;
          __pyx_t_11 = 0;
        } else {

          /* "cytimes/cydatetime.py":4612
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)             # <<<<<<<<<<<<<<
 *             )
 *         ) from err
 */
          __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_s)));
          __pyx_t_8 = ((PyObject *)Py_TYPE(__pyx_v_s));
        }

        /* "cytimes/cydatetime.py":4609
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (             # <<<<<<<<<<<<<<
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 */
        __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_Series_datetime64_instea, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4609, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cytimes/cydatetime.py":4607
 *         arr = dt64array_to_seconds(arr)
 *     except TypeError as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 4607, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cytimes/cydatetime.py":4614
 *                 else type(s)
 *             )
 *         ) from err             # <<<<<<<<<<<<<<
 *     return typeref.SERIES(arr, index=s.index, name=s.name)
 * 
 */
        __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(1, 4607, __pyx_L14_error)
      }

      /* "cytimes/cydatetime.py":4606
 *     try:
 *         arr = dt64array_to_seconds(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
      /*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_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_5 = __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_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/cydatetime.py":4604
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_seconds(arr)
 *     except TypeError 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;
    __pyx_L8_try_end:;
  }

  /* "cytimes/cydatetime.py":4615
 *             )
 *         ) from err
 *     return typeref.SERIES(arr, index=s.index, name=s.name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 4615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(1, 4615, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_index, __pyx_t_1) < 0) __PYX_ERR(1, 4615, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_name, __pyx_t_1) < 0) __PYX_ERR(1, 4615, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_7cytimes_7typeref_SERIES, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":4594
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64series_to_seconds(s: Series) -> object:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64series_to_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4618
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64series_to_milliseconds(s: Series) -> object:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_dt64series_to_milliseconds(PyObject *__pyx_v_s) {
  PyArrayObject *__pyx_v_arr = 0;
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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("dt64series_to_milliseconds", 1);

  /* "cytimes/cydatetime.py":4627
 *     unit is smaller than 'millisecond (ms)'.
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)             # <<<<<<<<<<<<<<
 *     try:
 *         arr = dt64array_to_milliseconds(arr)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_get_dt64series_arr(__pyx_v_s)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4628
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_milliseconds(arr)
 *     except TypeError 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:*/ {

      /* "cytimes/cydatetime.py":4629
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:
 *         arr = dt64array_to_milliseconds(arr)             # <<<<<<<<<<<<<<
 *     except TypeError as err:
 *         raise TypeError(
 */
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt64array_to_milliseconds(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4629, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cytimes/cydatetime.py":4628
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_milliseconds(arr)
 *     except TypeError as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4630
 *     try:
 *         arr = dt64array_to_milliseconds(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("cytimes.cydatetime.dt64series_to_milliseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 4630, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":4635
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)             # <<<<<<<<<<<<<<
 *                 else type(s)
 *             )
 */
        __pyx_t_9 = __pyx_v_7cytimes_7typeref_SERIES;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_s, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 4635, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {

          /* "cytimes/cydatetime.py":4634
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)             # <<<<<<<<<<<<<<
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 4634, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Series_s, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4634, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_8 = __pyx_t_11;
          __pyx_t_11 = 0;
        } else {

          /* "cytimes/cydatetime.py":4636
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)             # <<<<<<<<<<<<<<
 *             )
 *         ) from err
 */
          __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_s)));
          __pyx_t_8 = ((PyObject *)Py_TYPE(__pyx_v_s));
        }

        /* "cytimes/cydatetime.py":4633
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (             # <<<<<<<<<<<<<<
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 */
        __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_Series_datetime64_instea, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4633, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cytimes/cydatetime.py":4631
 *         arr = dt64array_to_milliseconds(arr)
 *     except TypeError as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 4631, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cytimes/cydatetime.py":4638
 *                 else type(s)
 *             )
 *         ) from err             # <<<<<<<<<<<<<<
 *     return typeref.SERIES(arr, index=s.index, name=s.name)
 * 
 */
        __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(1, 4631, __pyx_L14_error)
      }

      /* "cytimes/cydatetime.py":4630
 *     try:
 *         arr = dt64array_to_milliseconds(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
      /*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_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_5 = __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_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/cydatetime.py":4628
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_milliseconds(arr)
 *     except TypeError 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;
    __pyx_L8_try_end:;
  }

  /* "cytimes/cydatetime.py":4639
 *             )
 *         ) from err
 *     return typeref.SERIES(arr, index=s.index, name=s.name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 4639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(1, 4639, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_index, __pyx_t_1) < 0) __PYX_ERR(1, 4639, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_name, __pyx_t_1) < 0) __PYX_ERR(1, 4639, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_7cytimes_7typeref_SERIES, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":4618
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64series_to_milliseconds(s: Series) -> object:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64series_to_milliseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4642
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64series_to_microseconds(s: Series) -> object:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_dt64series_to_microseconds(PyObject *__pyx_v_s) {
  PyArrayObject *__pyx_v_arr = 0;
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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("dt64series_to_microseconds", 1);

  /* "cytimes/cydatetime.py":4651
 *     unit is smaller than 'microsecond (us)'.
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)             # <<<<<<<<<<<<<<
 *     try:
 *         arr = dt64array_to_microseconds(arr)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_get_dt64series_arr(__pyx_v_s)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4652
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_microseconds(arr)
 *     except TypeError 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:*/ {

      /* "cytimes/cydatetime.py":4653
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:
 *         arr = dt64array_to_microseconds(arr)             # <<<<<<<<<<<<<<
 *     except TypeError as err:
 *         raise TypeError(
 */
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt64array_to_microseconds(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4653, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cytimes/cydatetime.py":4652
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_microseconds(arr)
 *     except TypeError as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4654
 *     try:
 *         arr = dt64array_to_microseconds(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("cytimes.cydatetime.dt64series_to_microseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 4654, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":4659
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)             # <<<<<<<<<<<<<<
 *                 else type(s)
 *             )
 */
        __pyx_t_9 = __pyx_v_7cytimes_7typeref_SERIES;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_s, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 4659, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {

          /* "cytimes/cydatetime.py":4658
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)             # <<<<<<<<<<<<<<
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 4658, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Series_s, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4658, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_8 = __pyx_t_11;
          __pyx_t_11 = 0;
        } else {

          /* "cytimes/cydatetime.py":4660
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)             # <<<<<<<<<<<<<<
 *             )
 *         ) from err
 */
          __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_s)));
          __pyx_t_8 = ((PyObject *)Py_TYPE(__pyx_v_s));
        }

        /* "cytimes/cydatetime.py":4657
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (             # <<<<<<<<<<<<<<
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 */
        __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_Series_datetime64_instea, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4657, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cytimes/cydatetime.py":4655
 *         arr = dt64array_to_microseconds(arr)
 *     except TypeError as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 4655, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cytimes/cydatetime.py":4662
 *                 else type(s)
 *             )
 *         ) from err             # <<<<<<<<<<<<<<
 *     return typeref.SERIES(arr, index=s.index, name=s.name)
 * 
 */
        __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(1, 4655, __pyx_L14_error)
      }

      /* "cytimes/cydatetime.py":4654
 *     try:
 *         arr = dt64array_to_microseconds(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
      /*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_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_5 = __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_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/cydatetime.py":4652
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_microseconds(arr)
 *     except TypeError 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;
    __pyx_L8_try_end:;
  }

  /* "cytimes/cydatetime.py":4663
 *             )
 *         ) from err
 *     return typeref.SERIES(arr, index=s.index, name=s.name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 4663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(1, 4663, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_index, __pyx_t_1) < 0) __PYX_ERR(1, 4663, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_name, __pyx_t_1) < 0) __PYX_ERR(1, 4663, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_7cytimes_7typeref_SERIES, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":4642
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64series_to_microseconds(s: Series) -> object:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64series_to_microseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4666
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64series_to_nanoseconds(s: Series) -> object:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_dt64series_to_nanoseconds(PyObject *__pyx_v_s) {
  PyArrayObject *__pyx_v_arr = 0;
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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("dt64series_to_nanoseconds", 1);

  /* "cytimes/cydatetime.py":4675
 *     unit is smaller than 'nanosecond (ns)'.
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)             # <<<<<<<<<<<<<<
 *     try:
 *         arr = dt64array_to_nanoseconds(arr)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_get_dt64series_arr(__pyx_v_s)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4676
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_nanoseconds(arr)
 *     except TypeError 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:*/ {

      /* "cytimes/cydatetime.py":4677
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:
 *         arr = dt64array_to_nanoseconds(arr)             # <<<<<<<<<<<<<<
 *     except TypeError as err:
 *         raise TypeError(
 */
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt64array_to_nanoseconds(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4677, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cytimes/cydatetime.py":4676
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_nanoseconds(arr)
 *     except TypeError as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4678
 *     try:
 *         arr = dt64array_to_nanoseconds(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("cytimes.cydatetime.dt64series_to_nanoseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 4678, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":4683
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)             # <<<<<<<<<<<<<<
 *                 else type(s)
 *             )
 */
        __pyx_t_9 = __pyx_v_7cytimes_7typeref_SERIES;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_s, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 4683, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {

          /* "cytimes/cydatetime.py":4682
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)             # <<<<<<<<<<<<<<
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 4682, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Series_s, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4682, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_8 = __pyx_t_11;
          __pyx_t_11 = 0;
        } else {

          /* "cytimes/cydatetime.py":4684
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)             # <<<<<<<<<<<<<<
 *             )
 *         ) from err
 */
          __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_s)));
          __pyx_t_8 = ((PyObject *)Py_TYPE(__pyx_v_s));
        }

        /* "cytimes/cydatetime.py":4681
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (             # <<<<<<<<<<<<<<
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 */
        __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_Series_datetime64_instea, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4681, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cytimes/cydatetime.py":4679
 *         arr = dt64array_to_nanoseconds(arr)
 *     except TypeError as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 4679, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cytimes/cydatetime.py":4686
 *                 else type(s)
 *             )
 *         ) from err             # <<<<<<<<<<<<<<
 *     return typeref.SERIES(arr, index=s.index, name=s.name)
 * 
 */
        __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(1, 4679, __pyx_L14_error)
      }

      /* "cytimes/cydatetime.py":4678
 *     try:
 *         arr = dt64array_to_nanoseconds(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
      /*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_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_5 = __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_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/cydatetime.py":4676
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_nanoseconds(arr)
 *     except TypeError 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;
    __pyx_L8_try_end:;
  }

  /* "cytimes/cydatetime.py":4687
 *             )
 *         ) from err
 *     return typeref.SERIES(arr, index=s.index, name=s.name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 4687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(1, 4687, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_index, __pyx_t_1) < 0) __PYX_ERR(1, 4687, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_name, __pyx_t_1) < 0) __PYX_ERR(1, 4687, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_7cytimes_7typeref_SERIES, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":4666
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64series_to_nanoseconds(s: Series) -> object:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64series_to_nanoseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4690
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64series_to_ordinals(s: Series) -> object:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_dt64series_to_ordinals(PyObject *__pyx_v_s) {
  PyArrayObject *__pyx_v_arr = 0;
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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("dt64series_to_ordinals", 1);

  /* "cytimes/cydatetime.py":4699
 *     unit is smaller than 'day (D)'.
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)             # <<<<<<<<<<<<<<
 *     try:
 *         arr = dt64array_to_ordinals(arr)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_get_dt64series_arr(__pyx_v_s)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4700
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_ordinals(arr)
 *     except TypeError 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:*/ {

      /* "cytimes/cydatetime.py":4701
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:
 *         arr = dt64array_to_ordinals(arr)             # <<<<<<<<<<<<<<
 *     except TypeError as err:
 *         raise TypeError(
 */
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt64array_to_ordinals(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4701, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cytimes/cydatetime.py":4700
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_ordinals(arr)
 *     except TypeError as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4702
 *     try:
 *         arr = dt64array_to_ordinals(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("cytimes.cydatetime.dt64series_to_ordinals", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 4702, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":4707
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)             # <<<<<<<<<<<<<<
 *                 else type(s)
 *             )
 */
        __pyx_t_9 = __pyx_v_7cytimes_7typeref_SERIES;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_s, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 4707, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {

          /* "cytimes/cydatetime.py":4706
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)             # <<<<<<<<<<<<<<
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 4706, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Series_s, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4706, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_8 = __pyx_t_11;
          __pyx_t_11 = 0;
        } else {

          /* "cytimes/cydatetime.py":4708
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)             # <<<<<<<<<<<<<<
 *             )
 *         ) from err
 */
          __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_s)));
          __pyx_t_8 = ((PyObject *)Py_TYPE(__pyx_v_s));
        }

        /* "cytimes/cydatetime.py":4705
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (             # <<<<<<<<<<<<<<
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 */
        __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_Series_datetime64_instea, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4705, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cytimes/cydatetime.py":4703
 *         arr = dt64array_to_ordinals(arr)
 *     except TypeError as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 4703, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cytimes/cydatetime.py":4710
 *                 else type(s)
 *             )
 *         ) from err             # <<<<<<<<<<<<<<
 *     return typeref.SERIES(arr, index=s.index, name=s.name)
 * 
 */
        __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(1, 4703, __pyx_L14_error)
      }

      /* "cytimes/cydatetime.py":4702
 *     try:
 *         arr = dt64array_to_ordinals(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
      /*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_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_5 = __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_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/cydatetime.py":4700
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_ordinals(arr)
 *     except TypeError 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;
    __pyx_L8_try_end:;
  }

  /* "cytimes/cydatetime.py":4711
 *             )
 *         ) from err
 *     return typeref.SERIES(arr, index=s.index, name=s.name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 4711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(1, 4711, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_index, __pyx_t_1) < 0) __PYX_ERR(1, 4711, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_name, __pyx_t_1) < 0) __PYX_ERR(1, 4711, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_7cytimes_7typeref_SERIES, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":4690
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64series_to_ordinals(s: Series) -> object:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64series_to_ordinals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4714
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64series_to_timestamps(s: Series) -> object:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_dt64series_to_timestamps(PyObject *__pyx_v_s) {
  PyArrayObject *__pyx_v_arr = 0;
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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("dt64series_to_timestamps", 1);

  /* "cytimes/cydatetime.py":4723
 *     unit is smaller than 'microseconds (us)'.
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)             # <<<<<<<<<<<<<<
 *     try:
 *         arr = dt64array_to_timestamps(arr)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_get_dt64series_arr(__pyx_v_s)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4724
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_timestamps(arr)
 *     except TypeError 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:*/ {

      /* "cytimes/cydatetime.py":4725
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:
 *         arr = dt64array_to_timestamps(arr)             # <<<<<<<<<<<<<<
 *     except TypeError as err:
 *         raise TypeError(
 */
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_dt64array_to_timestamps(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4725, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cytimes/cydatetime.py":4724
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_timestamps(arr)
 *     except TypeError as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4726
 *     try:
 *         arr = dt64array_to_timestamps(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("cytimes.cydatetime.dt64series_to_timestamps", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 4726, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":4731
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)             # <<<<<<<<<<<<<<
 *                 else type(s)
 *             )
 */
        __pyx_t_9 = __pyx_v_7cytimes_7typeref_SERIES;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_s, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 4731, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {

          /* "cytimes/cydatetime.py":4730
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)             # <<<<<<<<<<<<<<
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 4730, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Series_s, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4730, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_8 = __pyx_t_11;
          __pyx_t_11 = 0;
        } else {

          /* "cytimes/cydatetime.py":4732
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)             # <<<<<<<<<<<<<<
 *             )
 *         ) from err
 */
          __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_s)));
          __pyx_t_8 = ((PyObject *)Py_TYPE(__pyx_v_s));
        }

        /* "cytimes/cydatetime.py":4729
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (             # <<<<<<<<<<<<<<
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 */
        __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_Series_datetime64_instea, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4729, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cytimes/cydatetime.py":4727
 *         arr = dt64array_to_timestamps(arr)
 *     except TypeError as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 *             % (
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 4727, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cytimes/cydatetime.py":4734
 *                 else type(s)
 *             )
 *         ) from err             # <<<<<<<<<<<<<<
 *     return typeref.SERIES(arr, index=s.index, name=s.name)
 * 
 */
        __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(1, 4727, __pyx_L14_error)
      }

      /* "cytimes/cydatetime.py":4726
 *     try:
 *         arr = dt64array_to_timestamps(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[datetime64]'>, instead got: %s."
 */
      /*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_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_5 = __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_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/cydatetime.py":4724
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = dt64array_to_timestamps(arr)
 *     except TypeError 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;
    __pyx_L8_try_end:;
  }

  /* "cytimes/cydatetime.py":4735
 *             )
 *         ) from err
 *     return typeref.SERIES(arr, index=s.index, name=s.name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 4735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(1, 4735, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_index, __pyx_t_1) < 0) __PYX_ERR(1, 4735, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_name, __pyx_t_1) < 0) __PYX_ERR(1, 4735, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_7cytimes_7typeref_SERIES, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":4714
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def dt64series_to_timestamps(s: Series) -> object:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.cydatetime.dt64series_to_timestamps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4740
 * # pandas.Series[timedelta64] ============================================================================
 * # pandas.Series[timedelta64]: check types ---------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

static int __pyx_f_7cytimes_10cydatetime_is_td64series(PyObject *__pyx_v_obj) {
  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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_td64series", 1);

  /* "cytimes/cydatetime.py":4746
 *     """Check if an object is dtype of <'Series[timedelta64]'> `<'bool'>`.
 *     Equivalent to `isinstance(s.dtype, np.dtypes.TimeDelta64DType)`."""
 *     try:             # <<<<<<<<<<<<<<
 *         return isinstance(obj, typeref.SERIES) and isinstance(
 *             obj.dtype, typeref.TD64_ARRAY
 */
  {
    __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/cydatetime.py":4747
 *     Equivalent to `isinstance(s.dtype, np.dtypes.TimeDelta64DType)`."""
 *     try:
 *         return isinstance(obj, typeref.SERIES) and isinstance(             # <<<<<<<<<<<<<<
 *             obj.dtype, typeref.TD64_ARRAY
 *         )
 */
      __pyx_t_5 = __pyx_v_7cytimes_7typeref_SERIES;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 4747, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
      } else {
        __pyx_t_4 = __pyx_t_6;
        goto __pyx_L9_bool_binop_done;
      }

      /* "cytimes/cydatetime.py":4748
 *     try:
 *         return isinstance(obj, typeref.SERIES) and isinstance(
 *             obj.dtype, typeref.TD64_ARRAY             # <<<<<<<<<<<<<<
 *         )
 *     except Exception:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 4748, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __pyx_v_7cytimes_7typeref_TD64_ARRAY;
      __Pyx_INCREF(__pyx_t_7);

      /* "cytimes/cydatetime.py":4747
 *     Equivalent to `isinstance(s.dtype, np.dtypes.TimeDelta64DType)`."""
 *     try:
 *         return isinstance(obj, typeref.SERIES) and isinstance(             # <<<<<<<<<<<<<<
 *             obj.dtype, typeref.TD64_ARRAY
 *         )
 */
      __pyx_t_6 = PyObject_IsInstance(__pyx_t_5, __pyx_t_7); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 4747, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_4 = __pyx_t_6;
      __pyx_L9_bool_binop_done:;
      __pyx_r = __pyx_t_4;
      goto __pyx_L7_try_return;

      /* "cytimes/cydatetime.py":4746
 *     """Check if an object is dtype of <'Series[timedelta64]'> `<'bool'>`.
 *     Equivalent to `isinstance(s.dtype, np.dtypes.TimeDelta64DType)`."""
 *     try:             # <<<<<<<<<<<<<<
 *         return isinstance(obj, typeref.SERIES) and isinstance(
 *             obj.dtype, typeref.TD64_ARRAY
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cytimes/cydatetime.py":4750
 *             obj.dtype, typeref.TD64_ARRAY
 *         )
 *     except Exception:             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("cytimes.cydatetime.is_td64series", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(1, 4750, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_9);

      /* "cytimes/cydatetime.py":4751
 *         )
 *     except Exception:
 *         return False             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_r = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;

    /* "cytimes/cydatetime.py":4746
 *     """Check if an object is dtype of <'Series[timedelta64]'> `<'bool'>`.
 *     Equivalent to `isinstance(s.dtype, np.dtypes.TimeDelta64DType)`."""
 *     try:             # <<<<<<<<<<<<<<
 *         return isinstance(obj, typeref.SERIES) and isinstance(
 *             obj.dtype, typeref.TD64_ARRAY
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "cytimes/cydatetime.py":4740
 * # pandas.Series[timedelta64] ============================================================================
 * # pandas.Series[timedelta64]: check types ---------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * @cython.exceptval(-1, check=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("cytimes.cydatetime.is_td64series", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4754
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def validate_td64series(obj: Series):
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_validate_td64series(PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("validate_td64series", 1);

  /* "cytimes/cydatetime.py":4759
 *     """Validate if an object is dtype of <'Series[timedelta64]'>.
 *     Raise `TypeError` if dtype is incorrect."""
 *     if not is_td64series(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 */
  __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_is_td64series(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 4759, __pyx_L1_error)
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {

    /* "cytimes/cydatetime.py":4764
 *             % (
 *                 "<'Series[%s]'>" % (obj.dtype)
 *                 if isinstance(obj, typeref.SERIES)             # <<<<<<<<<<<<<<
 *                 else type(obj)
 *             )
 */
    __pyx_t_4 = __pyx_v_7cytimes_7typeref_SERIES;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_2 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 4764, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "cytimes/cydatetime.py":4763
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (
 *                 "<'Series[%s]'>" % (obj.dtype)             # <<<<<<<<<<<<<<
 *                 if isinstance(obj, typeref.SERIES)
 *                 else type(obj)
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4763, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Series_s, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 4763, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_3 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {

      /* "cytimes/cydatetime.py":4765
 *                 "<'Series[%s]'>" % (obj.dtype)
 *                 if isinstance(obj, typeref.SERIES)
 *                 else type(obj)             # <<<<<<<<<<<<<<
 *             )
 *         )
 */
      __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_obj)));
      __pyx_t_3 = ((PyObject *)Py_TYPE(__pyx_v_obj));
    }

    /* "cytimes/cydatetime.py":4762
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (             # <<<<<<<<<<<<<<
 *                 "<'Series[%s]'>" % (obj.dtype)
 *                 if isinstance(obj, typeref.SERIES)
 */
    __pyx_t_5 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_Series_timedelta64_inste, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 4762, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cytimes/cydatetime.py":4760
 *     Raise `TypeError` if dtype is incorrect."""
 *     if not is_td64series(obj):
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4760, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 4760, __pyx_L1_error)

    /* "cytimes/cydatetime.py":4759
 *     """Validate if an object is dtype of <'Series[timedelta64]'>.
 *     Raise `TypeError` if dtype is incorrect."""
 *     if not is_td64series(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 */
  }

  /* "cytimes/cydatetime.py":4754
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def validate_td64series(obj: Series):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.cydatetime.validate_td64series", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4770
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def get_td64series_arr(s: Series) -> np.ndarray:
 */

static PyArrayObject *__pyx_f_7cytimes_10cydatetime_get_td64series_arr(PyObject *__pyx_v_s) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_err = NULL;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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("get_td64series_arr", 1);

  /* "cytimes/cydatetime.py":4774
 * def get_td64series_arr(s: Series) -> np.ndarray:
 *     """Get `<'Series[timedelta64]'>` underlying data `<'ndarray'>`."""
 *     try:             # <<<<<<<<<<<<<<
 *         arr: np.ndarray = s.values
 *     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/cydatetime.py":4775
 *     """Get `<'Series[timedelta64]'>` underlying data `<'ndarray'>`."""
 *     try:
 *         arr: np.ndarray = s.values             # <<<<<<<<<<<<<<
 *     except Exception as err:
 *         raise TypeError(
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4775, __pyx_L3_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(1, 4775, __pyx_L3_error)
      __pyx_v_arr = ((PyArrayObject *)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "cytimes/cydatetime.py":4774
 * def get_td64series_arr(s: Series) -> np.ndarray:
 *     """Get `<'Series[timedelta64]'>` underlying data `<'ndarray'>`."""
 *     try:             # <<<<<<<<<<<<<<
 *         arr: np.ndarray = s.values
 *     except Exception as err:
 */
    }
    __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;

    /* "cytimes/cydatetime.py":4776
 *     try:
 *         arr: np.ndarray = s.values
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
    if (__pyx_t_5) {
      __Pyx_AddTraceback("cytimes.cydatetime.get_td64series_arr", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 4776, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":4781
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)             # <<<<<<<<<<<<<<
 *                 else type(s)
 *             )
 */
        __pyx_t_9 = __pyx_v_7cytimes_7typeref_SERIES;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_s, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 4781, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {

          /* "cytimes/cydatetime.py":4780
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)             # <<<<<<<<<<<<<<
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 4780, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Series_s, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4780, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_8 = __pyx_t_11;
          __pyx_t_11 = 0;
        } else {

          /* "cytimes/cydatetime.py":4782
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)             # <<<<<<<<<<<<<<
 *             )
 *         ) from err
 */
          __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_s)));
          __pyx_t_8 = ((PyObject *)Py_TYPE(__pyx_v_s));
        }

        /* "cytimes/cydatetime.py":4779
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (             # <<<<<<<<<<<<<<
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 */
        __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_Series_timedelta64_inste, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4779, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cytimes/cydatetime.py":4777
 *         arr: np.ndarray = s.values
 *     except Exception as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 4777, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cytimes/cydatetime.py":4784
 *                 else type(s)
 *             )
 *         ) from err             # <<<<<<<<<<<<<<
 *     return arr
 * 
 */
        __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(1, 4777, __pyx_L14_error)
      }

      /* "cytimes/cydatetime.py":4776
 *     try:
 *         arr: np.ndarray = s.values
 *     except Exception as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 */
      /*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_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_5 = __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_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/cydatetime.py":4774
 * def get_td64series_arr(s: Series) -> np.ndarray:
 *     """Get `<'Series[timedelta64]'>` underlying data `<'ndarray'>`."""
 *     try:             # <<<<<<<<<<<<<<
 *         arr: np.ndarray = s.values
 *     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_L8_try_end:;
  }

  /* "cytimes/cydatetime.py":4785
 *             )
 *         ) from err
 *     return arr             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __pyx_r = __pyx_v_arr;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":4770
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def get_td64series_arr(s: Series) -> np.ndarray:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.cydatetime.get_td64series_arr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4788
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def get_td64series_unit(s: Series) -> str:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_get_td64series_unit(PyObject *__pyx_v_s) {
  PyArrayObject *__pyx_v_arr = 0;
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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("get_td64series_unit", 1);

  /* "cytimes/cydatetime.py":4793
 *     """Get the time unit of the `<'Series[timedelta64]'>`,
 *     such as: 'D', 's', 'ms', 'us', 'ns', etc `<'str'>`."""
 *     arr: np.ndarray = get_td64series_arr(s)             # <<<<<<<<<<<<<<
 *     try:
 *         return get_td64array_unit(arr)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_get_td64series_arr(__pyx_v_s)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4794
 *     such as: 'D', 's', 'ms', 'us', 'ns', etc `<'str'>`."""
 *     arr: np.ndarray = get_td64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         return get_td64array_unit(arr)
 *     except TypeError 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:*/ {

      /* "cytimes/cydatetime.py":4795
 *     arr: np.ndarray = get_td64series_arr(s)
 *     try:
 *         return get_td64array_unit(arr)             # <<<<<<<<<<<<<<
 *     except TypeError as err:
 *         raise TypeError(
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_7cytimes_10cydatetime_get_td64array_unit(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4795, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      goto __pyx_L7_try_return;

      /* "cytimes/cydatetime.py":4794
 *     such as: 'D', 's', 'ms', 'us', 'ns', etc `<'str'>`."""
 *     arr: np.ndarray = get_td64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         return get_td64array_unit(arr)
 *     except TypeError as err:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4796
 *     try:
 *         return get_td64array_unit(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("cytimes.cydatetime.get_td64series_unit", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 4796, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":4801
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)             # <<<<<<<<<<<<<<
 *                 else type(s)
 *             )
 */
        __pyx_t_9 = __pyx_v_7cytimes_7typeref_SERIES;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_s, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 4801, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {

          /* "cytimes/cydatetime.py":4800
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)             # <<<<<<<<<<<<<<
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 4800, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Series_s, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4800, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_8 = __pyx_t_11;
          __pyx_t_11 = 0;
        } else {

          /* "cytimes/cydatetime.py":4802
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)             # <<<<<<<<<<<<<<
 *             )
 *         ) from err
 */
          __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_s)));
          __pyx_t_8 = ((PyObject *)Py_TYPE(__pyx_v_s));
        }

        /* "cytimes/cydatetime.py":4799
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (             # <<<<<<<<<<<<<<
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 */
        __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_Series_timedelta64_inste, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4799, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cytimes/cydatetime.py":4797
 *         return get_td64array_unit(arr)
 *     except TypeError as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 4797, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cytimes/cydatetime.py":4804
 *                 else type(s)
 *             )
 *         ) from err             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(1, 4797, __pyx_L14_error)
      }

      /* "cytimes/cydatetime.py":4796
 *     try:
 *         return get_td64array_unit(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 */
      /*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_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_5 = __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_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/cydatetime.py":4794
 *     such as: 'D', 's', 'ms', 'us', 'ns', etc `<'str'>`."""
 *     arr: np.ndarray = get_td64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         return get_td64array_unit(arr)
 *     except TypeError 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;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L0;
  }

  /* "cytimes/cydatetime.py":4788
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def get_td64series_unit(s: Series) -> str:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.cydatetime.get_td64series_unit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4808
 * 
 * # pandas.Series[timedelta64]: conversion ----------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64series_to_int(
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_td64series_to_int(PyObject *__pyx_v_s, PyObject *__pyx_v_unit) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("td64series_to_int", 1);

  /* "cytimes/cydatetime.py":4821
 *     unit is smaller than the target time 'unit'.
 *     """
 *     if unit == "ns":             # <<<<<<<<<<<<<<
 *         return td64series_to_nanoseconds(s)
 *     elif unit == "us":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ns, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 4821, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":4822
 *     """
 *     if unit == "ns":
 *         return td64series_to_nanoseconds(s)             # <<<<<<<<<<<<<<
 *     elif unit == "us":
 *         return td64series_to_microseconds(s)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_td64series_to_nanoseconds(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4821
 *     unit is smaller than the target time 'unit'.
 *     """
 *     if unit == "ns":             # <<<<<<<<<<<<<<
 *         return td64series_to_nanoseconds(s)
 *     elif unit == "us":
 */
  }

  /* "cytimes/cydatetime.py":4823
 *     if unit == "ns":
 *         return td64series_to_nanoseconds(s)
 *     elif unit == "us":             # <<<<<<<<<<<<<<
 *         return td64series_to_microseconds(s)
 *     elif unit == "ms":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_us, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 4823, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":4824
 *         return td64series_to_nanoseconds(s)
 *     elif unit == "us":
 *         return td64series_to_microseconds(s)             # <<<<<<<<<<<<<<
 *     elif unit == "ms":
 *         return td64series_to_milliseconds(s)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_td64series_to_microseconds(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4823
 *     if unit == "ns":
 *         return td64series_to_nanoseconds(s)
 *     elif unit == "us":             # <<<<<<<<<<<<<<
 *         return td64series_to_microseconds(s)
 *     elif unit == "ms":
 */
  }

  /* "cytimes/cydatetime.py":4825
 *     elif unit == "us":
 *         return td64series_to_microseconds(s)
 *     elif unit == "ms":             # <<<<<<<<<<<<<<
 *         return td64series_to_milliseconds(s)
 *     elif unit == "s":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_ms, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 4825, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":4826
 *         return td64series_to_microseconds(s)
 *     elif unit == "ms":
 *         return td64series_to_milliseconds(s)             # <<<<<<<<<<<<<<
 *     elif unit == "s":
 *         return td64series_to_seconds(s)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_td64series_to_milliseconds(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4825
 *     elif unit == "us":
 *         return td64series_to_microseconds(s)
 *     elif unit == "ms":             # <<<<<<<<<<<<<<
 *         return td64series_to_milliseconds(s)
 *     elif unit == "s":
 */
  }

  /* "cytimes/cydatetime.py":4827
 *     elif unit == "ms":
 *         return td64series_to_milliseconds(s)
 *     elif unit == "s":             # <<<<<<<<<<<<<<
 *         return td64series_to_seconds(s)
 *     elif unit == "m":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_s, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 4827, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":4828
 *         return td64series_to_milliseconds(s)
 *     elif unit == "s":
 *         return td64series_to_seconds(s)             # <<<<<<<<<<<<<<
 *     elif unit == "m":
 *         return td64series_to_minutes(s)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_td64series_to_seconds(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4828, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4827
 *     elif unit == "ms":
 *         return td64series_to_milliseconds(s)
 *     elif unit == "s":             # <<<<<<<<<<<<<<
 *         return td64series_to_seconds(s)
 *     elif unit == "m":
 */
  }

  /* "cytimes/cydatetime.py":4829
 *     elif unit == "s":
 *         return td64series_to_seconds(s)
 *     elif unit == "m":             # <<<<<<<<<<<<<<
 *         return td64series_to_minutes(s)
 *     elif unit == "h":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_m, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 4829, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":4830
 *         return td64series_to_seconds(s)
 *     elif unit == "m":
 *         return td64series_to_minutes(s)             # <<<<<<<<<<<<<<
 *     elif unit == "h":
 *         return td64series_to_hours(s)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_td64series_to_minutes(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4829
 *     elif unit == "s":
 *         return td64series_to_seconds(s)
 *     elif unit == "m":             # <<<<<<<<<<<<<<
 *         return td64series_to_minutes(s)
 *     elif unit == "h":
 */
  }

  /* "cytimes/cydatetime.py":4831
 *     elif unit == "m":
 *         return td64series_to_minutes(s)
 *     elif unit == "h":             # <<<<<<<<<<<<<<
 *         return td64series_to_hours(s)
 *     elif unit == "D" or unit == "d":
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_h, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 4831, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cytimes/cydatetime.py":4832
 *         return td64series_to_minutes(s)
 *     elif unit == "h":
 *         return td64series_to_hours(s)             # <<<<<<<<<<<<<<
 *     elif unit == "D" or unit == "d":
 *         return td64series_to_days(s)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_td64series_to_hours(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4832, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4831
 *     elif unit == "m":
 *         return td64series_to_minutes(s)
 *     elif unit == "h":             # <<<<<<<<<<<<<<
 *         return td64series_to_hours(s)
 *     elif unit == "D" or unit == "d":
 */
  }

  /* "cytimes/cydatetime.py":4833
 *     elif unit == "h":
 *         return td64series_to_hours(s)
 *     elif unit == "D" or unit == "d":             # <<<<<<<<<<<<<<
 *         return td64series_to_days(s)
 *     else:
 */
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_D, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 4833, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_unit, __pyx_n_u_d, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 4833, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (likely(__pyx_t_1)) {

    /* "cytimes/cydatetime.py":4834
 *         return td64series_to_hours(s)
 *     elif unit == "D" or unit == "d":
 *         return td64series_to_days(s)             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7cytimes_10cydatetime_td64series_to_days(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4834, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":4833
 *     elif unit == "h":
 *         return td64series_to_hours(s)
 *     elif unit == "D" or unit == "d":             # <<<<<<<<<<<<<<
 *         return td64series_to_days(s)
 *     else:
 */
  }

  /* "cytimes/cydatetime.py":4836
 *         return td64series_to_days(s)
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Does not support conversion of "
 *             "<'Series[timedelta64]'> to time unit: %r." % unit
 */
  /*else*/ {

    /* "cytimes/cydatetime.py":4838
 *         raise ValueError(
 *             "Does not support conversion of "
 *             "<'Series[timedelta64]'> to time unit: %r." % unit             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Does_not_support_conversion_of_S_2, __pyx_v_unit); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cytimes/cydatetime.py":4836
 *         return td64series_to_days(s)
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Does not support conversion of "
 *             "<'Series[timedelta64]'> to time unit: %r." % unit
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4836, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(1, 4836, __pyx_L1_error)
  }

  /* "cytimes/cydatetime.py":4808
 * 
 * # pandas.Series[timedelta64]: conversion ----------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64series_to_int(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytimes.cydatetime.td64series_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4842
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64series_to_days(s: Series) -> object:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_td64series_to_days(PyObject *__pyx_v_s) {
  PyArrayObject *__pyx_v_arr = 0;
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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("td64series_to_days", 1);

  /* "cytimes/cydatetime.py":4851
 *     unit is smaller than 'day (D)'.
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)             # <<<<<<<<<<<<<<
 *     try:
 *         arr = td64array_to_days(arr)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_get_dt64series_arr(__pyx_v_s)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4852
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = td64array_to_days(arr)
 *     except TypeError 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:*/ {

      /* "cytimes/cydatetime.py":4853
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:
 *         arr = td64array_to_days(arr)             # <<<<<<<<<<<<<<
 *     except TypeError as err:
 *         raise TypeError(
 */
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_td64array_to_days(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4853, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cytimes/cydatetime.py":4852
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = td64array_to_days(arr)
 *     except TypeError as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4854
 *     try:
 *         arr = td64array_to_days(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("cytimes.cydatetime.td64series_to_days", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 4854, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":4859
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)             # <<<<<<<<<<<<<<
 *                 else type(s)
 *             )
 */
        __pyx_t_9 = __pyx_v_7cytimes_7typeref_SERIES;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_s, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 4859, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {

          /* "cytimes/cydatetime.py":4858
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)             # <<<<<<<<<<<<<<
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 4858, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Series_s, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4858, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_8 = __pyx_t_11;
          __pyx_t_11 = 0;
        } else {

          /* "cytimes/cydatetime.py":4860
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)             # <<<<<<<<<<<<<<
 *             )
 *         ) from err
 */
          __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_s)));
          __pyx_t_8 = ((PyObject *)Py_TYPE(__pyx_v_s));
        }

        /* "cytimes/cydatetime.py":4857
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (             # <<<<<<<<<<<<<<
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 */
        __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_Series_timedelta64_inste, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4857, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cytimes/cydatetime.py":4855
 *         arr = td64array_to_days(arr)
 *     except TypeError as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 4855, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cytimes/cydatetime.py":4862
 *                 else type(s)
 *             )
 *         ) from err             # <<<<<<<<<<<<<<
 *     return typeref.SERIES(arr, index=s.index, name=s.name)
 * 
 */
        __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(1, 4855, __pyx_L14_error)
      }

      /* "cytimes/cydatetime.py":4854
 *     try:
 *         arr = td64array_to_days(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 */
      /*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_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_5 = __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_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/cydatetime.py":4852
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = td64array_to_days(arr)
 *     except TypeError 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;
    __pyx_L8_try_end:;
  }

  /* "cytimes/cydatetime.py":4863
 *             )
 *         ) from err
 *     return typeref.SERIES(arr, index=s.index, name=s.name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 4863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(1, 4863, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_index, __pyx_t_1) < 0) __PYX_ERR(1, 4863, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_name, __pyx_t_1) < 0) __PYX_ERR(1, 4863, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_7cytimes_7typeref_SERIES, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":4842
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64series_to_days(s: Series) -> object:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.cydatetime.td64series_to_days", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4866
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64series_to_hours(s: Series) -> object:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_td64series_to_hours(PyObject *__pyx_v_s) {
  PyArrayObject *__pyx_v_arr = 0;
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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("td64series_to_hours", 1);

  /* "cytimes/cydatetime.py":4875
 *     unit is smaller than 'hour (h)'.
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)             # <<<<<<<<<<<<<<
 *     try:
 *         arr = td64array_to_hours(arr)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_get_dt64series_arr(__pyx_v_s)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4876
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = td64array_to_hours(arr)
 *     except TypeError 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:*/ {

      /* "cytimes/cydatetime.py":4877
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:
 *         arr = td64array_to_hours(arr)             # <<<<<<<<<<<<<<
 *     except TypeError as err:
 *         raise TypeError(
 */
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_td64array_to_hours(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4877, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cytimes/cydatetime.py":4876
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = td64array_to_hours(arr)
 *     except TypeError as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4878
 *     try:
 *         arr = td64array_to_hours(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("cytimes.cydatetime.td64series_to_hours", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 4878, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":4883
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)             # <<<<<<<<<<<<<<
 *                 else type(s)
 *             )
 */
        __pyx_t_9 = __pyx_v_7cytimes_7typeref_SERIES;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_s, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 4883, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {

          /* "cytimes/cydatetime.py":4882
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)             # <<<<<<<<<<<<<<
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 4882, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Series_s, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4882, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_8 = __pyx_t_11;
          __pyx_t_11 = 0;
        } else {

          /* "cytimes/cydatetime.py":4884
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)             # <<<<<<<<<<<<<<
 *             )
 *         ) from err
 */
          __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_s)));
          __pyx_t_8 = ((PyObject *)Py_TYPE(__pyx_v_s));
        }

        /* "cytimes/cydatetime.py":4881
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (             # <<<<<<<<<<<<<<
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 */
        __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_Series_timedelta64_inste, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4881, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cytimes/cydatetime.py":4879
 *         arr = td64array_to_hours(arr)
 *     except TypeError as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 4879, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cytimes/cydatetime.py":4886
 *                 else type(s)
 *             )
 *         ) from err             # <<<<<<<<<<<<<<
 *     return typeref.SERIES(arr, index=s.index, name=s.name)
 * 
 */
        __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(1, 4879, __pyx_L14_error)
      }

      /* "cytimes/cydatetime.py":4878
 *     try:
 *         arr = td64array_to_hours(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 */
      /*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_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_5 = __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_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/cydatetime.py":4876
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = td64array_to_hours(arr)
 *     except TypeError 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;
    __pyx_L8_try_end:;
  }

  /* "cytimes/cydatetime.py":4887
 *             )
 *         ) from err
 *     return typeref.SERIES(arr, index=s.index, name=s.name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 4887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(1, 4887, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_index, __pyx_t_1) < 0) __PYX_ERR(1, 4887, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_name, __pyx_t_1) < 0) __PYX_ERR(1, 4887, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_7cytimes_7typeref_SERIES, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":4866
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64series_to_hours(s: Series) -> object:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.cydatetime.td64series_to_hours", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4890
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64series_to_minutes(s: Series) -> object:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_td64series_to_minutes(PyObject *__pyx_v_s) {
  PyArrayObject *__pyx_v_arr = 0;
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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("td64series_to_minutes", 1);

  /* "cytimes/cydatetime.py":4899
 *     unit is smaller than 'minute (m)'.
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)             # <<<<<<<<<<<<<<
 *     try:
 *         arr = td64array_to_minutes(arr)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_get_dt64series_arr(__pyx_v_s)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4900
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = td64array_to_minutes(arr)
 *     except TypeError 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:*/ {

      /* "cytimes/cydatetime.py":4901
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:
 *         arr = td64array_to_minutes(arr)             # <<<<<<<<<<<<<<
 *     except TypeError as err:
 *         raise TypeError(
 */
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_td64array_to_minutes(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4901, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cytimes/cydatetime.py":4900
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = td64array_to_minutes(arr)
 *     except TypeError as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4902
 *     try:
 *         arr = td64array_to_minutes(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("cytimes.cydatetime.td64series_to_minutes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 4902, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":4907
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)             # <<<<<<<<<<<<<<
 *                 else type(s)
 *             )
 */
        __pyx_t_9 = __pyx_v_7cytimes_7typeref_SERIES;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_s, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 4907, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {

          /* "cytimes/cydatetime.py":4906
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)             # <<<<<<<<<<<<<<
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 4906, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Series_s, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4906, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_8 = __pyx_t_11;
          __pyx_t_11 = 0;
        } else {

          /* "cytimes/cydatetime.py":4908
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)             # <<<<<<<<<<<<<<
 *             )
 *         ) from err
 */
          __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_s)));
          __pyx_t_8 = ((PyObject *)Py_TYPE(__pyx_v_s));
        }

        /* "cytimes/cydatetime.py":4905
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (             # <<<<<<<<<<<<<<
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 */
        __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_Series_timedelta64_inste, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4905, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cytimes/cydatetime.py":4903
 *         arr = td64array_to_minutes(arr)
 *     except TypeError as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 4903, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cytimes/cydatetime.py":4910
 *                 else type(s)
 *             )
 *         ) from err             # <<<<<<<<<<<<<<
 *     return typeref.SERIES(arr, index=s.index, name=s.name)
 * 
 */
        __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(1, 4903, __pyx_L14_error)
      }

      /* "cytimes/cydatetime.py":4902
 *     try:
 *         arr = td64array_to_minutes(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 */
      /*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_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_5 = __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_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/cydatetime.py":4900
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = td64array_to_minutes(arr)
 *     except TypeError 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;
    __pyx_L8_try_end:;
  }

  /* "cytimes/cydatetime.py":4911
 *             )
 *         ) from err
 *     return typeref.SERIES(arr, index=s.index, name=s.name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 4911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(1, 4911, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_index, __pyx_t_1) < 0) __PYX_ERR(1, 4911, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_name, __pyx_t_1) < 0) __PYX_ERR(1, 4911, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_7cytimes_7typeref_SERIES, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":4890
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64series_to_minutes(s: Series) -> object:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.cydatetime.td64series_to_minutes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4914
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64series_to_seconds(s: Series) -> object:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_td64series_to_seconds(PyObject *__pyx_v_s) {
  PyArrayObject *__pyx_v_arr = 0;
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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("td64series_to_seconds", 1);

  /* "cytimes/cydatetime.py":4923
 *     unit is smaller than 'second (s)'.
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)             # <<<<<<<<<<<<<<
 *     try:
 *         arr = td64array_to_seconds(arr)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_get_dt64series_arr(__pyx_v_s)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4924
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = td64array_to_seconds(arr)
 *     except TypeError 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:*/ {

      /* "cytimes/cydatetime.py":4925
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:
 *         arr = td64array_to_seconds(arr)             # <<<<<<<<<<<<<<
 *     except TypeError as err:
 *         raise TypeError(
 */
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_td64array_to_seconds(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4925, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cytimes/cydatetime.py":4924
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = td64array_to_seconds(arr)
 *     except TypeError as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4926
 *     try:
 *         arr = td64array_to_seconds(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("cytimes.cydatetime.td64series_to_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 4926, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":4931
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)             # <<<<<<<<<<<<<<
 *                 else type(s)
 *             )
 */
        __pyx_t_9 = __pyx_v_7cytimes_7typeref_SERIES;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_s, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 4931, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {

          /* "cytimes/cydatetime.py":4930
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)             # <<<<<<<<<<<<<<
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 4930, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Series_s, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4930, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_8 = __pyx_t_11;
          __pyx_t_11 = 0;
        } else {

          /* "cytimes/cydatetime.py":4932
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)             # <<<<<<<<<<<<<<
 *             )
 *         ) from err
 */
          __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_s)));
          __pyx_t_8 = ((PyObject *)Py_TYPE(__pyx_v_s));
        }

        /* "cytimes/cydatetime.py":4929
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (             # <<<<<<<<<<<<<<
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 */
        __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_Series_timedelta64_inste, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4929, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cytimes/cydatetime.py":4927
 *         arr = td64array_to_seconds(arr)
 *     except TypeError as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 4927, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cytimes/cydatetime.py":4934
 *                 else type(s)
 *             )
 *         ) from err             # <<<<<<<<<<<<<<
 *     return typeref.SERIES(arr, index=s.index, name=s.name)
 * 
 */
        __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(1, 4927, __pyx_L14_error)
      }

      /* "cytimes/cydatetime.py":4926
 *     try:
 *         arr = td64array_to_seconds(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 */
      /*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_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_5 = __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_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/cydatetime.py":4924
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = td64array_to_seconds(arr)
 *     except TypeError 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;
    __pyx_L8_try_end:;
  }

  /* "cytimes/cydatetime.py":4935
 *             )
 *         ) from err
 *     return typeref.SERIES(arr, index=s.index, name=s.name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 4935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(1, 4935, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_index, __pyx_t_1) < 0) __PYX_ERR(1, 4935, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_name, __pyx_t_1) < 0) __PYX_ERR(1, 4935, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_7cytimes_7typeref_SERIES, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":4914
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64series_to_seconds(s: Series) -> object:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.cydatetime.td64series_to_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4938
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64series_to_milliseconds(s: Series) -> object:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_td64series_to_milliseconds(PyObject *__pyx_v_s) {
  PyArrayObject *__pyx_v_arr = 0;
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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("td64series_to_milliseconds", 1);

  /* "cytimes/cydatetime.py":4947
 *     unit is smaller than 'millisecond (ms)'.
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)             # <<<<<<<<<<<<<<
 *     try:
 *         arr = td64array_to_milliseconds(arr)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_get_dt64series_arr(__pyx_v_s)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4948
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = td64array_to_milliseconds(arr)
 *     except TypeError 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:*/ {

      /* "cytimes/cydatetime.py":4949
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:
 *         arr = td64array_to_milliseconds(arr)             # <<<<<<<<<<<<<<
 *     except TypeError as err:
 *         raise TypeError(
 */
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_td64array_to_milliseconds(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4949, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cytimes/cydatetime.py":4948
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = td64array_to_milliseconds(arr)
 *     except TypeError as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4950
 *     try:
 *         arr = td64array_to_milliseconds(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("cytimes.cydatetime.td64series_to_milliseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 4950, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":4955
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)             # <<<<<<<<<<<<<<
 *                 else type(s)
 *             )
 */
        __pyx_t_9 = __pyx_v_7cytimes_7typeref_SERIES;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_s, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 4955, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {

          /* "cytimes/cydatetime.py":4954
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)             # <<<<<<<<<<<<<<
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 4954, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Series_s, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4954, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_8 = __pyx_t_11;
          __pyx_t_11 = 0;
        } else {

          /* "cytimes/cydatetime.py":4956
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)             # <<<<<<<<<<<<<<
 *             )
 *         ) from err
 */
          __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_s)));
          __pyx_t_8 = ((PyObject *)Py_TYPE(__pyx_v_s));
        }

        /* "cytimes/cydatetime.py":4953
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (             # <<<<<<<<<<<<<<
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 */
        __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_Series_timedelta64_inste, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4953, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cytimes/cydatetime.py":4951
 *         arr = td64array_to_milliseconds(arr)
 *     except TypeError as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 4951, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cytimes/cydatetime.py":4958
 *                 else type(s)
 *             )
 *         ) from err             # <<<<<<<<<<<<<<
 *     return typeref.SERIES(arr, index=s.index, name=s.name)
 * 
 */
        __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(1, 4951, __pyx_L14_error)
      }

      /* "cytimes/cydatetime.py":4950
 *     try:
 *         arr = td64array_to_milliseconds(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 */
      /*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_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_5 = __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_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/cydatetime.py":4948
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = td64array_to_milliseconds(arr)
 *     except TypeError 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;
    __pyx_L8_try_end:;
  }

  /* "cytimes/cydatetime.py":4959
 *             )
 *         ) from err
 *     return typeref.SERIES(arr, index=s.index, name=s.name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 4959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(1, 4959, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_index, __pyx_t_1) < 0) __PYX_ERR(1, 4959, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_name, __pyx_t_1) < 0) __PYX_ERR(1, 4959, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_7cytimes_7typeref_SERIES, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":4938
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64series_to_milliseconds(s: Series) -> object:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.cydatetime.td64series_to_milliseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4962
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64series_to_microseconds(s: Series) -> object:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_td64series_to_microseconds(PyObject *__pyx_v_s) {
  PyArrayObject *__pyx_v_arr = 0;
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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("td64series_to_microseconds", 1);

  /* "cytimes/cydatetime.py":4971
 *     unit is smaller than 'microsecond (us)'.
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)             # <<<<<<<<<<<<<<
 *     try:
 *         arr = td64array_to_microseconds(arr)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_get_dt64series_arr(__pyx_v_s)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4972
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = td64array_to_microseconds(arr)
 *     except TypeError 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:*/ {

      /* "cytimes/cydatetime.py":4973
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:
 *         arr = td64array_to_microseconds(arr)             # <<<<<<<<<<<<<<
 *     except TypeError as err:
 *         raise TypeError(
 */
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_td64array_to_microseconds(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4973, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cytimes/cydatetime.py":4972
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = td64array_to_microseconds(arr)
 *     except TypeError as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4974
 *     try:
 *         arr = td64array_to_microseconds(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("cytimes.cydatetime.td64series_to_microseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 4974, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":4979
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)             # <<<<<<<<<<<<<<
 *                 else type(s)
 *             )
 */
        __pyx_t_9 = __pyx_v_7cytimes_7typeref_SERIES;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_s, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 4979, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {

          /* "cytimes/cydatetime.py":4978
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)             # <<<<<<<<<<<<<<
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 4978, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Series_s, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4978, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_8 = __pyx_t_11;
          __pyx_t_11 = 0;
        } else {

          /* "cytimes/cydatetime.py":4980
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)             # <<<<<<<<<<<<<<
 *             )
 *         ) from err
 */
          __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_s)));
          __pyx_t_8 = ((PyObject *)Py_TYPE(__pyx_v_s));
        }

        /* "cytimes/cydatetime.py":4977
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (             # <<<<<<<<<<<<<<
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 */
        __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_Series_timedelta64_inste, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4977, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cytimes/cydatetime.py":4975
 *         arr = td64array_to_microseconds(arr)
 *     except TypeError as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 4975, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cytimes/cydatetime.py":4982
 *                 else type(s)
 *             )
 *         ) from err             # <<<<<<<<<<<<<<
 *     return typeref.SERIES(arr, index=s.index, name=s.name)
 * 
 */
        __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(1, 4975, __pyx_L14_error)
      }

      /* "cytimes/cydatetime.py":4974
 *     try:
 *         arr = td64array_to_microseconds(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 */
      /*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_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_5 = __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_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/cydatetime.py":4972
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = td64array_to_microseconds(arr)
 *     except TypeError 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;
    __pyx_L8_try_end:;
  }

  /* "cytimes/cydatetime.py":4983
 *             )
 *         ) from err
 *     return typeref.SERIES(arr, index=s.index, name=s.name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 4983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(1, 4983, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_index, __pyx_t_1) < 0) __PYX_ERR(1, 4983, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_name, __pyx_t_1) < 0) __PYX_ERR(1, 4983, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_7cytimes_7typeref_SERIES, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":4962
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64series_to_microseconds(s: Series) -> object:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.cydatetime.td64series_to_microseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":4986
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64series_to_nanoseconds(s: Series) -> object:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_td64series_to_nanoseconds(PyObject *__pyx_v_s) {
  PyArrayObject *__pyx_v_arr = 0;
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  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("td64series_to_nanoseconds", 1);

  /* "cytimes/cydatetime.py":4995
 *     unit is smaller than 'nanosecond (ns)'.
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)             # <<<<<<<<<<<<<<
 *     try:
 *         arr = td64array_to_nanoseconds(arr)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_get_dt64series_arr(__pyx_v_s)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytimes/cydatetime.py":4996
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = td64array_to_nanoseconds(arr)
 *     except TypeError 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:*/ {

      /* "cytimes/cydatetime.py":4997
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:
 *         arr = td64array_to_nanoseconds(arr)             # <<<<<<<<<<<<<<
 *     except TypeError as err:
 *         raise TypeError(
 */
      __pyx_t_1 = ((PyObject *)__pyx_f_7cytimes_10cydatetime_td64array_to_nanoseconds(__pyx_v_arr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4997, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_arr, ((PyArrayObject *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cytimes/cydatetime.py":4996
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = td64array_to_nanoseconds(arr)
 *     except TypeError as err:
 */
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytimes/cydatetime.py":4998
 *     try:
 *         arr = td64array_to_nanoseconds(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("cytimes.cydatetime.td64series_to_nanoseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 4998, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_err = __pyx_t_6;
      /*try:*/ {

        /* "cytimes/cydatetime.py":5003
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)             # <<<<<<<<<<<<<<
 *                 else type(s)
 *             )
 */
        __pyx_t_9 = __pyx_v_7cytimes_7typeref_SERIES;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_10 = PyObject_IsInstance(__pyx_v_s, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 5003, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_10) {

          /* "cytimes/cydatetime.py":5002
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (
 *                 "<'Series[%s]'>" % (s.dtype)             # <<<<<<<<<<<<<<
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 5002, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Series_s, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 5002, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_8 = __pyx_t_11;
          __pyx_t_11 = 0;
        } else {

          /* "cytimes/cydatetime.py":5004
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 *                 else type(s)             # <<<<<<<<<<<<<<
 *             )
 *         ) from err
 */
          __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_s)));
          __pyx_t_8 = ((PyObject *)Py_TYPE(__pyx_v_s));
        }

        /* "cytimes/cydatetime.py":5001
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (             # <<<<<<<<<<<<<<
 *                 "<'Series[%s]'>" % (s.dtype)
 *                 if isinstance(s, typeref.SERIES)
 */
        __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expects_Series_timedelta64_inste, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 5001, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cytimes/cydatetime.py":4999
 *         arr = td64array_to_nanoseconds(arr)
 *     except TypeError as err:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 *             % (
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 4999, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cytimes/cydatetime.py":5006
 *                 else type(s)
 *             )
 *         ) from err             # <<<<<<<<<<<<<<
 *     return typeref.SERIES(arr, index=s.index, name=s.name)
 * 
 */
        __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_err);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(1, 4999, __pyx_L14_error)
      }

      /* "cytimes/cydatetime.py":4998
 *     try:
 *         arr = td64array_to_nanoseconds(arr)
 *     except TypeError as err:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             "Expects <'Series[timedelta64]'>, instead got: %s."
 */
      /*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_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 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_5 = __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_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "cytimes/cydatetime.py":4996
 *     """
 *     arr: np.ndarray = get_dt64series_arr(s)
 *     try:             # <<<<<<<<<<<<<<
 *         arr = td64array_to_nanoseconds(arr)
 *     except TypeError 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;
    __pyx_L8_try_end:;
  }

  /* "cytimes/cydatetime.py":5007
 *             )
 *         ) from err
 *     return typeref.SERIES(arr, index=s.index, name=s.name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 5007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  __Pyx_GIVEREF((PyObject *)__pyx_v_arr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_arr))) __PYX_ERR(1, 5007, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 5007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_index, __pyx_t_1) < 0) __PYX_ERR(1, 5007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_name, __pyx_t_1) < 0) __PYX_ERR(1, 5007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_7cytimes_7typeref_SERIES, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytimes/cydatetime.py":4986
 * 
 * 
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64series_to_nanoseconds(s: Series) -> object:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cytimes.cydatetime.td64series_to_nanoseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytimes/cydatetime.py":5011
 * 
 * # pandas.Series[timedelta64]: adjustment ----------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64series_adjust_unit(s: Series, unit: Literal["s", "ms", "us", "ns"]) -> object:
 */

static PyObject *__pyx_f_7cytimes_10cydatetime_td64series_adjust_unit(PyObject *__pyx_v_s, PyObject *__pyx_v_unit) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("td64series_adjust_unit", 1);

  /* "cytimes/cydatetime.py":5016
 *     """Adjust Series[timedelta64] to the target time 'unit' `<'Series[timedelta64]'>`."""
 *     # Validate target unit
 *     if not set_contains(TD_UNIT_ADJUSTMENT, unit):             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "Cannot adjust <'Series[timedelta64]'> to unit: %r. "
 */
  __pyx_t_1 = __pyx_v_7cytimes_10cydatetime_TD_UNIT_ADJUSTMENT;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PySet_Contains(__pyx_t_1, __pyx_v_unit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 5016, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (!__pyx_t_2);
  if (unlikely(__pyx_t_3)) {

    /* "cytimes/cydatetime.py":5019
 *         raise ValueError(
 *             "Cannot adjust <'Series[timedelta64]'> to unit: %r. "
 *             "Supported units are <'str'>: ['s', 'ms', 'us', 'ns']." % unit             # <<<<<<<<<<<<<<
 *         )
 *     # Already is target unit
 */
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Cannot_adjust_Series_timedelta64, __pyx_v_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5019, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cytimes/cydatetime.py":5017
 *     # Validate target unit
 *     if not set_contains(TD_UNIT_ADJUSTMENT, unit):
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Cannot adjust <'Series[timedelta64]'> to unit: %r. "
 *             "Supported units are <'str'>: ['s', 'ms', 'us', 'ns']." % unit
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(1, 5017, __pyx_L1_error)

    /* "cytimes/cydatetime.py":5016
 *     """Adjust Series[timedelta64] to the target time 'unit' `<'Series[timedelta64]'>`."""
 *     # Validate target unit
 *     if not set_contains(TD_UNIT_ADJUSTMENT, unit):             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "Cannot adjust <'Series[timedelta64]'> to unit: %r. "
 */
  }

  /* "cytimes/cydatetime.py":5022
 *         )
 *     # Already is target unit
 *     if get_td64series_unit(s) == unit:             # <<<<<<<<<<<<<<
 *         return s
 *     # Convert to target unit
 */
  __pyx_t_4 = __pyx_f_7cytimes_10cydatetime_get_td64series_unit(__pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5022, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_v_unit, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 5022, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_3) {

    /* "cytimes/cydatetime.py":5023
 *     # Already is target unit
 *     if get_td64series_unit(s) == unit:
 *         return s             # <<<<<<<<<<<<<<
 *     # Convert to target unit
 *     if isinstance(s, typeref.TIMEDELTAINDEX):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_s);
    __pyx_r = __pyx_v_s;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":5022
 *         )
 *     # Already is target unit
 *     if get_td64series_unit(s) == unit:             # <<<<<<<<<<<<<<
 *         return s
 *     # Convert to target unit
 */
  }

  /* "cytimes/cydatetime.py":5025
 *         return s
 *     # Convert to target unit
 *     if isinstance(s, typeref.TIMEDELTAINDEX):             # <<<<<<<<<<<<<<
 *         return s.as_unit(unit)
 *     else:
 */
  __pyx_t_4 = __pyx_v_7cytimes_7typeref_TIMEDELTAINDEX;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_s, __pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 5025, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_3) {

    /* "cytimes/cydatetime.py":5026
 *     # Convert to target unit
 *     if isinstance(s, typeref.TIMEDELTAINDEX):
 *         return s.as_unit(unit)             # <<<<<<<<<<<<<<
 *     else:
 *         return s.dt.as_unit(unit)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_as_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5026, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __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_v_unit};
      __pyx_t_4 = __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;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5026, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "cytimes/cydatetime.py":5025
 *         return s
 *     # Convert to target unit
 *     if isinstance(s, typeref.TIMEDELTAINDEX):             # <<<<<<<<<<<<<<
 *         return s.as_unit(unit)
 *     else:
 */
  }

  /* "cytimes/cydatetime.py":5028
 *         return s.as_unit(unit)
 *     else:
 *         return s.dt.as_unit(unit)             # <<<<<<<<<<<<<<
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5028, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_as_unit); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5028, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_unit};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5028, __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/cydatetime.py":5011
 * 
 * # pandas.Series[timedelta64]: adjustment ----------------------------------------------------------------
 * @cython.cfunc             # <<<<<<<<<<<<<<
 * @cython.inline(True)
 * def td64series_adjust_unit(s: Series, unit: Literal["s", "ms", "us", "ns"]) -> object:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytimes.cydatetime.td64series_adjust_unit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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_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_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
    {&__pyx_kp_u_Cannot_adjust_Series_timedelta64, __pyx_k_Cannot_adjust_Series_timedelta64, sizeof(__pyx_k_Cannot_adjust_Series_timedelta64), 0, 1, 0, 0},
    {&__pyx_n_u_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 1, 0, 1},
    {&__pyx_n_s_DAYS_BR_MONTH, __pyx_k_DAYS_BR_MONTH, sizeof(__pyx_k_DAYS_BR_MONTH), 0, 0, 1, 1},
    {&__pyx_n_s_DAYS_BR_QUARTER, __pyx_k_DAYS_BR_QUARTER, sizeof(__pyx_k_DAYS_BR_QUARTER), 0, 0, 1, 1},
    {&__pyx_n_s_DAYS_BR_QUARTER_NDARRAY, __pyx_k_DAYS_BR_QUARTER_NDARRAY, sizeof(__pyx_k_DAYS_BR_QUARTER_NDARRAY), 0, 0, 1, 1},
    {&__pyx_n_s_DAYS_IN_MONTH, __pyx_k_DAYS_IN_MONTH, sizeof(__pyx_k_DAYS_IN_MONTH), 0, 0, 1, 1},
    {&__pyx_n_s_DAYS_IN_QUARTER, __pyx_k_DAYS_IN_QUARTER, sizeof(__pyx_k_DAYS_IN_QUARTER), 0, 0, 1, 1},
    {&__pyx_n_s_DT_MAX_US, __pyx_k_DT_MAX_US, sizeof(__pyx_k_DT_MAX_US), 0, 0, 1, 1},
    {&__pyx_n_s_DT_MIN_US, __pyx_k_DT_MIN_US, sizeof(__pyx_k_DT_MIN_US), 0, 0, 1, 1},
    {&__pyx_kp_u_Does_not_support_conversion_of_S, __pyx_k_Does_not_support_conversion_of_S, sizeof(__pyx_k_Does_not_support_conversion_of_S), 0, 1, 0, 0},
    {&__pyx_kp_u_Does_not_support_conversion_of_S_2, __pyx_k_Does_not_support_conversion_of_S_2, sizeof(__pyx_k_Does_not_support_conversion_of_S_2), 0, 1, 0, 0},
    {&__pyx_kp_u_Does_not_support_conversion_of_n, __pyx_k_Does_not_support_conversion_of_n, sizeof(__pyx_k_Does_not_support_conversion_of_n), 0, 1, 0, 0},
    {&__pyx_kp_u_Does_not_support_conversion_of_n_2, __pyx_k_Does_not_support_conversion_of_n_2, sizeof(__pyx_k_Does_not_support_conversion_of_n_2), 0, 1, 0, 0},
    {&__pyx_kp_u_Does_not_support_conversion_of_n_3, __pyx_k_Does_not_support_conversion_of_n_3, sizeof(__pyx_k_Does_not_support_conversion_of_n_3), 0, 1, 0, 0},
    {&__pyx_kp_u_Does_not_support_conversion_of_n_4, __pyx_k_Does_not_support_conversion_of_n_4, sizeof(__pyx_k_Does_not_support_conversion_of_n_4), 0, 1, 0, 0},
    {&__pyx_n_s_EPOCH_DAY, __pyx_k_EPOCH_DAY, sizeof(__pyx_k_EPOCH_DAY), 0, 0, 1, 1},
    {&__pyx_n_s_EPOCH_SEC, __pyx_k_EPOCH_SEC, sizeof(__pyx_k_EPOCH_SEC), 0, 0, 1, 1},
    {&__pyx_n_s_EPOCH_US, __pyx_k_EPOCH_US, sizeof(__pyx_k_EPOCH_US), 0, 0, 1, 1},
    {&__pyx_n_s_EPOCH_UTC, __pyx_k_EPOCH_UTC, sizeof(__pyx_k_EPOCH_UTC), 0, 0, 1, 1},
    {&__pyx_kp_u_Expects_Series_datetime64_instea, __pyx_k_Expects_Series_datetime64_instea, sizeof(__pyx_k_Expects_Series_datetime64_instea), 0, 1, 0, 0},
    {&__pyx_kp_u_Expects_Series_timedelta64_inste, __pyx_k_Expects_Series_timedelta64_inste, sizeof(__pyx_k_Expects_Series_timedelta64_inste), 0, 1, 0, 0},
    {&__pyx_kp_u_Expects_datetime_tzinfo_instead, __pyx_k_Expects_datetime_tzinfo_instead, sizeof(__pyx_k_Expects_datetime_tzinfo_instead), 0, 1, 0, 0},
    {&__pyx_kp_u_Expects_ndarray_datetime64_inste, __pyx_k_Expects_ndarray_datetime64_inste, sizeof(__pyx_k_Expects_ndarray_datetime64_inste), 0, 1, 0, 0},
    {&__pyx_kp_u_Expects_ndarray_timedelta64_inst, __pyx_k_Expects_ndarray_timedelta64_inst, sizeof(__pyx_k_Expects_ndarray_timedelta64_inst), 0, 1, 0, 0},
    {&__pyx_kp_u_Expects_numpy_datetime64_instead, __pyx_k_Expects_numpy_datetime64_instead, sizeof(__pyx_k_Expects_numpy_datetime64_instead), 0, 1, 0, 0},
    {&__pyx_kp_u_Expects_numpy_timedelta64_instea, __pyx_k_Expects_numpy_timedelta64_instea, sizeof(__pyx_k_Expects_numpy_timedelta64_instea), 0, 1, 0, 0},
    {&__pyx_n_s_FN_TIME_LOCALTIME, __pyx_k_FN_TIME_LOCALTIME, sizeof(__pyx_k_FN_TIME_LOCALTIME), 0, 0, 1, 1},
    {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 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_s_MONTH_TO_QUARTER, __pyx_k_MONTH_TO_QUARTER, sizeof(__pyx_k_MONTH_TO_QUARTER), 0, 0, 1, 1},
    {&__pyx_n_s_NS_DAY, __pyx_k_NS_DAY, sizeof(__pyx_k_NS_DAY), 0, 0, 1, 1},
    {&__pyx_n_s_NS_HOUR, __pyx_k_NS_HOUR, sizeof(__pyx_k_NS_HOUR), 0, 0, 1, 1},
    {&__pyx_n_s_NS_MINUTE, __pyx_k_NS_MINUTE, sizeof(__pyx_k_NS_MINUTE), 0, 0, 1, 1},
    {&__pyx_kp_u_Only_support_ndarray_with_up_to, __pyx_k_Only_support_ndarray_with_up_to, sizeof(__pyx_k_Only_support_ndarray_with_up_to), 0, 1, 0, 0},
    {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1},
    {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
    {&__pyx_n_s_Series, __pyx_k_Series, sizeof(__pyx_k_Series), 0, 0, 1, 1},
    {&__pyx_kp_u_Series_s, __pyx_k_Series_s, sizeof(__pyx_k_Series_s), 0, 1, 0, 0},
    {&__pyx_n_u_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 1, 0, 1},
    {&__pyx_n_s_TD_UNIT_ADJUSTMENT, __pyx_k_TD_UNIT_ADJUSTMENT, sizeof(__pyx_k_TD_UNIT_ADJUSTMENT), 0, 0, 1, 1},
    {&__pyx_n_s_TIME_END, __pyx_k_TIME_END, sizeof(__pyx_k_TIME_END), 0, 0, 1, 1},
    {&__pyx_n_s_TIME_START, __pyx_k_TIME_START, sizeof(__pyx_k_TIME_START), 0, 0, 1, 1},
    {&__pyx_kp_u_The_format_string_for_datetime_i, __pyx_k_The_format_string_for_datetime_i, sizeof(__pyx_k_The_format_string_for_datetime_i), 0, 1, 0, 0},
    {&__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_kp_u_Timezone_expects_offset_86_340_8, __pyx_k_Timezone_expects_offset_86_340_8, sizeof(__pyx_k_Timezone_expects_offset_86_340_8), 0, 1, 0, 0},
    {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
    {&__pyx_n_s_US_DAY, __pyx_k_US_DAY, sizeof(__pyx_k_US_DAY), 0, 0, 1, 1},
    {&__pyx_n_s_US_HOUR, __pyx_k_US_HOUR, sizeof(__pyx_k_US_HOUR), 0, 0, 1, 1},
    {&__pyx_n_s_UTC, __pyx_k_UTC, sizeof(__pyx_k_UTC), 0, 0, 1, 1},
    {&__pyx_kp_u_Unable_to_parse_ndarray_datetime, __pyx_k_Unable_to_parse_ndarray_datetime, sizeof(__pyx_k_Unable_to_parse_ndarray_datetime), 0, 1, 0, 0},
    {&__pyx_kp_u_Unable_to_parse_ndarray_timedelt, __pyx_k_Unable_to_parse_ndarray_timedelt, sizeof(__pyx_k_Unable_to_parse_ndarray_timedelt), 0, 1, 0, 0},
    {&__pyx_kp_u_Unknown_ndarray_datetime64_time, __pyx_k_Unknown_ndarray_datetime64_time, sizeof(__pyx_k_Unknown_ndarray_datetime64_time), 0, 1, 0, 0},
    {&__pyx_kp_u_Unknown_ndarray_timedelta64_time, __pyx_k_Unknown_ndarray_timedelta64_time, sizeof(__pyx_k_Unknown_ndarray_timedelta64_time), 0, 1, 0, 0},
    {&__pyx_kp_u_Unsupported_ndarray_datetime64_t, __pyx_k_Unsupported_ndarray_datetime64_t, sizeof(__pyx_k_Unsupported_ndarray_datetime64_t), 0, 1, 0, 0},
    {&__pyx_kp_u_Unsupported_ndarray_timedelta64, __pyx_k_Unsupported_ndarray_timedelta64, sizeof(__pyx_k_Unsupported_ndarray_timedelta64), 0, 1, 0, 0},
    {&__pyx_kp_u_Unsupported_numpy_datetime64_tim, __pyx_k_Unsupported_numpy_datetime64_tim, sizeof(__pyx_k_Unsupported_numpy_datetime64_tim), 0, 1, 0, 0},
    {&__pyx_kp_u_Unsupported_numpy_timedelta64_ti, __pyx_k_Unsupported_numpy_timedelta64_ti, sizeof(__pyx_k_Unsupported_numpy_timedelta64_ti), 0, 1, 0, 0},
    {&__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_Y, __pyx_k_Y, sizeof(__pyx_k_Y), 0, 1, 0, 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_n_s__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 0, 1, 1},
    {&__pyx_n_s__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 0, 1, 1},
    {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0},
    {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0},
    {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0},
    {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0},
    {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0},
    {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0},
    {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
    {&__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_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_cytimes, __pyx_k_cytimes, sizeof(__pyx_k_cytimes), 0, 0, 1, 1},
    {&__pyx_n_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 1},
    {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1},
    {&__pyx_kp_u_datetime_tzinfo_dst_must_return, __pyx_k_datetime_tzinfo_dst_must_return, sizeof(__pyx_k_datetime_tzinfo_dst_must_return), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime_tzinfo_tzname_must_ret, __pyx_k_datetime_tzinfo_tzname_must_ret, sizeof(__pyx_k_datetime_tzinfo_tzname_must_ret), 0, 1, 0, 0},
    {&__pyx_kp_u_datetime_tzinfo_utcoffset_must, __pyx_k_datetime_tzinfo_utcoffset_must, sizeof(__pyx_k_datetime_tzinfo_utcoffset_must), 0, 1, 0, 0},
    {&__pyx_n_s_day, __pyx_k_day, sizeof(__pyx_k_day), 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_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
    {&__pyx_n_u_fs, __pyx_k_fs, sizeof(__pyx_k_fs), 0, 1, 0, 1},
    {&__pyx_n_u_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 1, 0, 1},
    {&__pyx_n_s_hour, __pyx_k_hour, sizeof(__pyx_k_hour), 0, 0, 1, 1},
    {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
    {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
    {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
    {&__pyx_n_s_localtime, __pyx_k_localtime, sizeof(__pyx_k_localtime), 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_microsecond, __pyx_k_microsecond, sizeof(__pyx_k_microsecond), 0, 0, 1, 1},
    {&__pyx_n_s_minute, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 0, 1, 1},
    {&__pyx_n_s_month, __pyx_k_month, sizeof(__pyx_k_month), 0, 0, 1, 1},
    {&__pyx_n_u_ms, __pyx_k_ms, sizeof(__pyx_k_ms), 0, 1, 0, 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_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
    {&__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_pandas, __pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 0, 1, 1},
    {&__pyx_n_u_ps, __pyx_k_ps, sizeof(__pyx_k_ps), 0, 1, 0, 1},
    {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1},
    {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
    {&__pyx_n_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 1},
    {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1},
    {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
    {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 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_s_time_localtime, __pyx_k_time_localtime, sizeof(__pyx_k_time_localtime), 0, 0, 1, 1},
    {&__pyx_n_s_tm_gmtoff, __pyx_k_tm_gmtoff, sizeof(__pyx_k_tm_gmtoff), 0, 0, 1, 1},
    {&__pyx_n_s_tm_hour, __pyx_k_tm_hour, sizeof(__pyx_k_tm_hour), 0, 0, 1, 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_s_tm_min, __pyx_k_tm_min, sizeof(__pyx_k_tm_min), 0, 0, 1, 1},
    {&__pyx_n_s_tm_mon, __pyx_k_tm_mon, sizeof(__pyx_k_tm_mon), 0, 0, 1, 1},
    {&__pyx_n_s_tm_sec, __pyx_k_tm_sec, sizeof(__pyx_k_tm_sec), 0, 0, 1, 1},
    {&__pyx_n_s_tm_wday, __pyx_k_tm_wday, sizeof(__pyx_k_tm_wday), 0, 0, 1, 1},
    {&__pyx_n_s_tm_yday, __pyx_k_tm_yday, sizeof(__pyx_k_tm_yday), 0, 0, 1, 1},
    {&__pyx_n_s_tm_year, __pyx_k_tm_year, sizeof(__pyx_k_tm_year), 0, 0, 1, 1},
    {&__pyx_n_s_typeref, __pyx_k_typeref, sizeof(__pyx_k_typeref), 0, 0, 1, 1},
    {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1},
    {&__pyx_n_s_tzname, __pyx_k_tzname, sizeof(__pyx_k_tzname), 0, 0, 1, 1},
    {&__pyx_n_u_us, __pyx_k_us, sizeof(__pyx_k_us), 0, 1, 0, 1},
    {&__pyx_n_s_utcoffset, __pyx_k_utcoffset, sizeof(__pyx_k_utcoffset), 0, 0, 1, 1},
    {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
    {&__pyx_n_s_week, __pyx_k_week, sizeof(__pyx_k_week), 0, 0, 1, 1},
    {&__pyx_n_s_weekday, __pyx_k_weekday, sizeof(__pyx_k_weekday), 0, 0, 1, 1},
    {&__pyx_n_s_year, __pyx_k_year, sizeof(__pyx_k_year), 0, 0, 1, 1},
    {0, 0, 0, 0, 0, 0, 0}
  };
  return __Pyx_InitStrings(__pyx_string_tab);
}
/* #### Code section: cached_builtins ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 84, __pyx_L1_error)
  __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(0, 113, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 445, __pyx_L1_error)
  __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(1, 1369, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 2159, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2217, __pyx_L1_error)
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1026, __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-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1026
 *         __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(2, 1026, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "../../../../../tmp/build-env-wsn_nuq9/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1032
 *         _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(2, 1032, __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(4, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "cytimes/cydatetime.py":3202
 *         if arr.shape[1] == 0:
 *             return parse_dt64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 3:
 *         if arr.shape[2] == 0:
 */
  __pyx_tuple__12 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 3202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "cytimes/cydatetime.py":3206
 *         if arr.shape[2] == 0:
 *             return parse_dt64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0, 0, 0])             # <<<<<<<<<<<<<<
 *     elif ndim == 4:
 *         if arr.shape[3] == 0:
 */
  __pyx_tuple__13 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 3206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "cytimes/cydatetime.py":3210
 *         if arr.shape[3] == 0:
 *             return parse_dt64array_unit(arr)
 *         unit = np.get_datetime64_unit(arr[0, 0, 0, 0])             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
 */
  __pyx_tuple__14 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 3210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "cytimes/cydatetime.py":48
 * # . time
 * TIME_START: datetime.time = datetime.time(0, 0, 0, 0)
 * TIME_END: datetime.time = datetime.time(23, 59, 59, 999999)             # <<<<<<<<<<<<<<
 * # . microsecond
 * US_DAY: cython.longlong = 86_400_000_000
 */
  __pyx_tuple__16 = PyTuple_Pack(4, __pyx_int_23, __pyx_int_59, __pyx_int_59, __pyx_int_999999); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### Code section: init_constants ### */

static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
  if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(1, 1, __pyx_L1_error);
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_23 = PyInt_FromLong(23); if (unlikely(!__pyx_int_23)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_24 = PyInt_FromLong(24); if (unlikely(!__pyx_int_24)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_59 = PyInt_FromLong(59); if (unlikely(!__pyx_int_59)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_90 = PyInt_FromLong(90); if (unlikely(!__pyx_int_90)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_181 = PyInt_FromLong(181); if (unlikely(!__pyx_int_181)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_273 = PyInt_FromLong(273); if (unlikely(!__pyx_int_273)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_365 = PyInt_FromLong(365); if (unlikely(!__pyx_int_365)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_1440 = PyInt_FromLong(1440); if (unlikely(!__pyx_int_1440)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_3600 = PyInt_FromLong(3600); if (unlikely(!__pyx_int_3600)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_60000 = PyInt_FromLong(60000L); if (unlikely(!__pyx_int_60000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_86400 = PyInt_FromLong(86400L); if (unlikely(!__pyx_int_86400)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_719163 = PyInt_FromLong(719163L); if (unlikely(!__pyx_int_719163)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_999999 = PyInt_FromLong(999999L); if (unlikely(!__pyx_int_999999)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_1000000 = PyInt_FromLong(1000000L); if (unlikely(!__pyx_int_1000000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_3600000 = PyInt_FromLong(3600000L); if (unlikely(!__pyx_int_3600000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_60000000 = PyInt_FromLong(60000000L); if (unlikely(!__pyx_int_60000000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_86400000 = PyInt_FromLong(86400000L); if (unlikely(!__pyx_int_86400000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_1000000000 = PyInt_FromLong(1000000000L); if (unlikely(!__pyx_int_1000000000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_3600000000 = PyInt_FromString((char *)"3600000000", 0, 0); if (unlikely(!__pyx_int_3600000000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_60000000000 = PyInt_FromString((char *)"60000000000", 0, 0); if (unlikely(!__pyx_int_60000000000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_86400000000 = PyInt_FromString((char *)"86400000000", 0, 0); if (unlikely(!__pyx_int_86400000000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_1000000000000 = PyInt_FromString((char *)"1000000000000", 0, 0); if (unlikely(!__pyx_int_1000000000000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_3600000000000 = PyInt_FromString((char *)"3600000000000", 0, 0); if (unlikely(!__pyx_int_3600000000000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_0x3691d6afc000 = PyInt_FromString((char *)"0x3691d6afc000", 0, 0); if (unlikely(!__pyx_int_0x3691d6afc000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_0x4e94914f0000 = PyInt_FromString((char *)"0x4e94914f0000", 0, 0); if (unlikely(!__pyx_int_0x4e94914f0000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_0x38d7ea4c68000 = PyInt_FromString((char *)"0x38d7ea4c68000", 0, 0); if (unlikely(!__pyx_int_0x38d7ea4c68000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_0xcca2e51310000 = PyInt_FromString((char *)"0xcca2e51310000", 0, 0); if (unlikely(!__pyx_int_0xcca2e51310000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_0xd529ae9e860000 = PyInt_FromString((char *)"0xd529ae9e860000", 0, 0); if (unlikely(!__pyx_int_0xd529ae9e860000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_0x132f4579c980000 = PyInt_FromString((char *)"0x132f4579c980000", 0, 0); if (unlikely(!__pyx_int_0x132f4579c980000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_0xde0b6b3a7640000 = PyInt_FromString((char *)"0xde0b6b3a7640000", 0, 0); if (unlikely(!__pyx_int_0xde0b6b3a7640000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_0x31f5c4ed27680000 = PyInt_FromString((char *)"0x31f5c4ed27680000", 0, 0); if (unlikely(!__pyx_int_0x31f5c4ed27680000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_0x340aad21b3b700000 = PyInt_FromString((char *)"0x340aad21b3b700000", 0, 0); if (unlikely(!__pyx_int_0x340aad21b3b700000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_0x4af0a763bb1c00000 = PyInt_FromString((char *)"0x4af0a763bb1c00000", 0, 0); if (unlikely(!__pyx_int_0x4af0a763bb1c00000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_0xc328093e61ee400000 = PyInt_FromString((char *)"0xc328093e61ee400000", 0, 0); if (unlikely(!__pyx_int_0xc328093e61ee400000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_0x124bc0ddd92e56000000 = PyInt_FromString((char *)"0x124bc0ddd92e56000000", 0, 0); if (unlikely(!__pyx_int_0x124bc0ddd92e56000000)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(1, 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(1, 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_v_7cytimes_10cydatetime_DAYS_BR_QUARTER_NDARRAY = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  __pyx_v_7cytimes_10cydatetime_UTC = ((PyDateTime_TZInfo *)Py_None); Py_INCREF(Py_None);
  __pyx_v_7cytimes_10cydatetime_EPOCH_UTC = ((PyDateTime_DateTime *)Py_None); Py_INCREF(Py_None);
  __pyx_v_7cytimes_10cydatetime_TIME_START = ((PyDateTime_Time *)Py_None); Py_INCREF(Py_None);
  __pyx_v_7cytimes_10cydatetime_TIME_END = ((PyDateTime_Time *)Py_None); Py_INCREF(Py_None);
  __pyx_v_7cytimes_10cydatetime_TD_UNIT_ADJUSTMENT = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7cytimes_10cydatetime_FN_TIME_LOCALTIME = Py_None; Py_INCREF(Py_None);
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DAYS_BR_MONTH, (void *)&__pyx_v_7cytimes_10cydatetime_DAYS_BR_MONTH, "unsigned int [13]") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DAYS_IN_MONTH, (void *)&__pyx_v_7cytimes_10cydatetime_DAYS_IN_MONTH, "unsigned int [13]") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DAYS_BR_QUARTER, (void *)&__pyx_v_7cytimes_10cydatetime_DAYS_BR_QUARTER, "unsigned int [5]") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DAYS_BR_QUARTER_NDARRAY, (void *)&__pyx_v_7cytimes_10cydatetime_DAYS_BR_QUARTER_NDARRAY, "PyArrayObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DAYS_IN_QUARTER, (void *)&__pyx_v_7cytimes_10cydatetime_DAYS_IN_QUARTER, "unsigned int [5]") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_MONTH_TO_QUARTER, (void *)&__pyx_v_7cytimes_10cydatetime_MONTH_TO_QUARTER, "unsigned int [13]") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_UTC, (void *)&__pyx_v_7cytimes_10cydatetime_UTC, "PyDateTime_TZInfo *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_EPOCH_UTC, (void *)&__pyx_v_7cytimes_10cydatetime_EPOCH_UTC, "PyDateTime_DateTime *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_EPOCH_US, (void *)&__pyx_v_7cytimes_10cydatetime_EPOCH_US, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_EPOCH_SEC, (void *)&__pyx_v_7cytimes_10cydatetime_EPOCH_SEC, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_EPOCH_DAY, (void *)&__pyx_v_7cytimes_10cydatetime_EPOCH_DAY, "int") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DT_MAX_US, (void *)&__pyx_v_7cytimes_10cydatetime_DT_MAX_US, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DT_MIN_US, (void *)&__pyx_v_7cytimes_10cydatetime_DT_MIN_US, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_TIME_START, (void *)&__pyx_v_7cytimes_10cydatetime_TIME_START, "PyDateTime_Time *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_TIME_END, (void *)&__pyx_v_7cytimes_10cydatetime_TIME_END, "PyDateTime_Time *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_US_DAY, (void *)&__pyx_v_7cytimes_10cydatetime_US_DAY, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_US_HOUR, (void *)&__pyx_v_7cytimes_10cydatetime_US_HOUR, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_NS_DAY, (void *)&__pyx_v_7cytimes_10cydatetime_NS_DAY, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_NS_HOUR, (void *)&__pyx_v_7cytimes_10cydatetime_NS_HOUR, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_NS_MINUTE, (void *)&__pyx_v_7cytimes_10cydatetime_NS_MINUTE, "PY_LONG_LONG") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_TD_UNIT_ADJUSTMENT, (void *)&__pyx_v_7cytimes_10cydatetime_TD_UNIT_ADJUSTMENT, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_FN_TIME_LOCALTIME, (void *)&__pyx_v_7cytimes_10cydatetime_FN_TIME_LOCALTIME, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  if (__Pyx_ExportFunction("is_leapyear", (void (*)(void))__pyx_f_7cytimes_10cydatetime_is_leapyear, "int (unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("leap_bt_years", (void (*)(void))__pyx_f_7cytimes_10cydatetime_leap_bt_years, "unsigned int (unsigned int, unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("days_in_year", (void (*)(void))__pyx_f_7cytimes_10cydatetime_days_in_year, "unsigned int (unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("days_bf_year", (void (*)(void))__pyx_f_7cytimes_10cydatetime_days_bf_year, "unsigned int (unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("days_of_year", (void (*)(void))__pyx_f_7cytimes_10cydatetime_days_of_year, "unsigned int (unsigned int, unsigned int, unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("quarter_of_month", (void (*)(void))__pyx_f_7cytimes_10cydatetime_quarter_of_month, "unsigned int (unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("days_in_quarter", (void (*)(void))__pyx_f_7cytimes_10cydatetime_days_in_quarter, "unsigned int (unsigned int, unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("days_bf_quarter", (void (*)(void))__pyx_f_7cytimes_10cydatetime_days_bf_quarter, "unsigned int (unsigned int, unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("days_of_quarter", (void (*)(void))__pyx_f_7cytimes_10cydatetime_days_of_quarter, "unsigned int (unsigned int, unsigned int, unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("quarter_1st_month", (void (*)(void))__pyx_f_7cytimes_10cydatetime_quarter_1st_month, "unsigned int (unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("quarter_lst_month", (void (*)(void))__pyx_f_7cytimes_10cydatetime_quarter_lst_month, "unsigned int (unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("days_in_month", (void (*)(void))__pyx_f_7cytimes_10cydatetime_days_in_month, "unsigned int (unsigned int, unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("days_bf_month", (void (*)(void))__pyx_f_7cytimes_10cydatetime_days_bf_month, "unsigned int (unsigned int, unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("ymd_weekday", (void (*)(void))__pyx_f_7cytimes_10cydatetime_ymd_weekday, "unsigned int (unsigned int, unsigned int, unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("ymd_isoweekday", (void (*)(void))__pyx_f_7cytimes_10cydatetime_ymd_isoweekday, "unsigned int (unsigned int, unsigned int, unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("ymd_isoweek", (void (*)(void))__pyx_f_7cytimes_10cydatetime_ymd_isoweek, "unsigned int (unsigned int, unsigned int, unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("ymd_isoyear", (void (*)(void))__pyx_f_7cytimes_10cydatetime_ymd_isoyear, "unsigned int (unsigned int, unsigned int, unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("ymd_isocalendar", (void (*)(void))__pyx_f_7cytimes_10cydatetime_ymd_isocalendar, "__pyx_t_7cytimes_10cydatetime_iso (unsigned int, unsigned int, unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("iso1st_ordinal", (void (*)(void))__pyx_f_7cytimes_10cydatetime_iso1st_ordinal, "unsigned int (unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("ymd_to_ordinal", (void (*)(void))__pyx_f_7cytimes_10cydatetime_ymd_to_ordinal, "unsigned int (unsigned int, unsigned int, unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("ordinal_to_ymd", (void (*)(void))__pyx_f_7cytimes_10cydatetime_ordinal_to_ymd, "__pyx_t_7cytimes_10cydatetime_ymd (int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("isocalendar_to_ymd", (void (*)(void))__pyx_f_7cytimes_10cydatetime_isocalendar_to_ymd, "__pyx_t_7cytimes_10cydatetime_ymd (unsigned int, unsigned int, unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("days_of_year_to_ymd", (void (*)(void))__pyx_f_7cytimes_10cydatetime_days_of_year_to_ymd, "__pyx_t_7cytimes_10cydatetime_ymd (unsigned int, unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("microseconds_to_hms", (void (*)(void))__pyx_f_7cytimes_10cydatetime_microseconds_to_hms, "__pyx_t_7cytimes_10cydatetime_hms (PY_LONG_LONG)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("gen_date", (void (*)(void))__pyx_f_7cytimes_10cydatetime_gen_date, "PyDateTime_Date *(struct __pyx_opt_args_7cytimes_10cydatetime_gen_date *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("gen_date_now", (void (*)(void))__pyx_f_7cytimes_10cydatetime_gen_date_now, "PyDateTime_Date *(void)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("gen_date_now_utc", (void (*)(void))__pyx_f_7cytimes_10cydatetime_gen_date_now_utc, "PyDateTime_Date *(void)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("gen_date_now_tz", (void (*)(void))__pyx_f_7cytimes_10cydatetime_gen_date_now_tz, "PyDateTime_Date *(PyDateTime_TZInfo *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("is_date", (void (*)(void))__pyx_f_7cytimes_10cydatetime_is_date, "int (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("is_date_exact", (void (*)(void))__pyx_f_7cytimes_10cydatetime_is_date_exact, "int (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_is_leapyear", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_is_leapyear, "int (PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_leap_bt_years", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_leap_bt_years, "unsigned int (PyDateTime_Date *, PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_days_in_year", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_days_in_year, "unsigned int (PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_days_bf_year", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_days_bf_year, "unsigned int (PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_days_of_year", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_days_of_year, "unsigned int (PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_quarter", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_quarter, "unsigned int (PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_days_in_quarter", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_days_in_quarter, "unsigned int (PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_days_bf_quarter", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_days_bf_quarter, "unsigned int (PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_days_of_quarter", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_days_of_quarter, "unsigned int (PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_quarter_1st_month", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_quarter_1st_month, "unsigned int (PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_quarter_lst_month", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_quarter_lst_month, "unsigned int (PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_days_in_month", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_days_in_month, "unsigned int (PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_days_bf_month", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_days_bf_month, "unsigned int (PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_weekday", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_weekday, "unsigned int (PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_isoweekday", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_isoweekday, "unsigned int (PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_isoweek", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_isoweek, "unsigned int (PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_isoyear", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_isoyear, "unsigned int (PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_isocalendar", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_isocalendar, "__pyx_t_7cytimes_10cydatetime_iso (PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_to_isoformat", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_to_isoformat, "PyObject *(PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_to_strformat", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_to_strformat, "PyObject *(PyDateTime_Date *, PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_to_ordinal", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_to_ordinal, "unsigned int (PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_to_seconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_to_seconds, "PY_LONG_LONG (PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_to_microseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_to_microseconds, "PY_LONG_LONG (PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_to_timestamp", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_to_timestamp, "PY_LONG_LONG (PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_fr_dt", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_fr_dt, "PyDateTime_Date *(PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_fr_date", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_fr_date, "PyDateTime_Date *(PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_fr_ordinal", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_fr_ordinal, "PyDateTime_Date *(int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_fr_seconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_fr_seconds, "PyDateTime_Date *(double)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_fr_microseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_fr_microseconds, "PyDateTime_Date *(PY_LONG_LONG)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_fr_timestamp", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_fr_timestamp, "PyDateTime_Date *(double)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_add", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_add, "PyDateTime_Date *(PyDateTime_Date *, struct __pyx_opt_args_7cytimes_10cydatetime_date_add *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_add_td", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_add_td, "PyDateTime_Date *(PyDateTime_Date *, PyDateTime_Delta *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_sub_td", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_sub_td, "PyDateTime_Date *(PyDateTime_Date *, PyDateTime_Delta *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_sub_date", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_sub_date, "PyDateTime_Delta *(PyDateTime_Date *, PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_sub_date_days", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_sub_date_days, "int (PyDateTime_Date *, PyDateTime_Date *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_replace", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_replace, "PyDateTime_Date *(PyDateTime_Date *, struct __pyx_opt_args_7cytimes_10cydatetime_date_replace *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("date_adj_weekday", (void (*)(void))__pyx_f_7cytimes_10cydatetime_date_adj_weekday, "PyDateTime_Date *(PyDateTime_Date *, unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("gen_dt", (void (*)(void))__pyx_f_7cytimes_10cydatetime_gen_dt, "PyDateTime_DateTime *(struct __pyx_opt_args_7cytimes_10cydatetime_gen_dt *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("gen_dt_now", (void (*)(void))__pyx_f_7cytimes_10cydatetime_gen_dt_now, "PyDateTime_DateTime *(void)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("gen_dt_now_utc", (void (*)(void))__pyx_f_7cytimes_10cydatetime_gen_dt_now_utc, "PyDateTime_DateTime *(void)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("gen_dt_now_tz", (void (*)(void))__pyx_f_7cytimes_10cydatetime_gen_dt_now_tz, "PyDateTime_DateTime *(PyDateTime_TZInfo *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("is_dt", (void (*)(void))__pyx_f_7cytimes_10cydatetime_is_dt, "int (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("is_dt_exact", (void (*)(void))__pyx_f_7cytimes_10cydatetime_is_dt_exact, "int (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_tzname", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_tzname, "PyObject *(PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_dst", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_dst, "PyDateTime_Delta *(PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_utcoffset", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_utcoffset, "PyDateTime_Delta *(PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_is_leapyear", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_is_leapyear, "int (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_leap_bt_years", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_leap_bt_years, "unsigned int (PyDateTime_DateTime *, PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_days_in_year", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_days_in_year, "unsigned int (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_days_bf_year", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_days_bf_year, "unsigned int (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_days_of_year", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_days_of_year, "unsigned int (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_quarter", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_quarter, "unsigned int (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_days_in_quarter", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_days_in_quarter, "unsigned int (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_days_bf_quarter", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_days_bf_quarter, "unsigned int (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_days_of_quarter", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_days_of_quarter, "unsigned int (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_quarter_1st_month", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_quarter_1st_month, "unsigned int (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_quarter_lst_month", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_quarter_lst_month, "unsigned int (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_days_in_month", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_days_in_month, "unsigned int (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_days_bf_month", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_days_bf_month, "unsigned int (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_weekday", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_weekday, "unsigned int (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_isoweekday", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_isoweekday, "unsigned int (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_isoweek", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_isoweek, "unsigned int (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_isoyear", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_isoyear, "unsigned int (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_isocalendar", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_isocalendar, "__pyx_t_7cytimes_10cydatetime_iso (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_to_isoformat", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_to_isoformat, "PyObject *(PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_to_isoformat_tz", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_to_isoformat_tz, "PyObject *(PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_to_isospaceformat", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_to_isospaceformat, "PyObject *(PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_to_isospaceformat_tz", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_to_isospaceformat_tz, "PyObject *(PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_to_strformat", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_to_strformat, "PyObject *(PyDateTime_DateTime *, PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_to_ordinal", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_to_ordinal, "unsigned int (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_to_seconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_to_seconds, "double (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_to_seconds_utc", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_to_seconds_utc, "double (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_to_microseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_to_microseconds, "PY_LONG_LONG (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_to_microseconds_utc", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_to_microseconds_utc, "PY_LONG_LONG (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_to_posixts", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_to_posixts, "PY_LONG_LONG (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_to_timestamp", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_to_timestamp, "double (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_to_stime", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_to_stime, "struct tm (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_to_stime_utc", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_to_stime_utc, "struct tm (PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_fr_dt", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_fr_dt, "PyDateTime_DateTime *(PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_fr_date", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_fr_date, "PyDateTime_DateTime *(PyDateTime_Date *, struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_date *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_fr_time", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_fr_time, "PyDateTime_DateTime *(PyDateTime_Time *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_fr_date_n_time", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_fr_date_n_time, "PyDateTime_DateTime *(PyDateTime_Date *, PyDateTime_Time *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_fr_ordinal", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_fr_ordinal, "PyDateTime_DateTime *(int, struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_ordinal *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_fr_seconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_fr_seconds, "PyDateTime_DateTime *(double, struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_seconds *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_fr_microseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_fr_microseconds, "PyDateTime_DateTime *(PY_LONG_LONG, struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_microseconds *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_fr_timestamp", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_fr_timestamp, "PyDateTime_DateTime *(double, struct __pyx_opt_args_7cytimes_10cydatetime_dt_fr_timestamp *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_add", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_add, "PyDateTime_DateTime *(PyDateTime_DateTime *, struct __pyx_opt_args_7cytimes_10cydatetime_dt_add *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_add_td", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_add_td, "PyDateTime_DateTime *(PyDateTime_DateTime *, PyDateTime_Delta *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_sub_td", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_sub_td, "PyDateTime_DateTime *(PyDateTime_DateTime *, PyDateTime_Delta *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_sub_dt", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_sub_dt, "PyDateTime_Delta *(PyDateTime_DateTime *, PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_sub_dt_us", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_sub_dt_us, "PY_LONG_LONG (PyDateTime_DateTime *, PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_replace", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_replace, "PyDateTime_DateTime *(PyDateTime_DateTime *, struct __pyx_opt_args_7cytimes_10cydatetime_dt_replace *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_replace_tzinfo", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_replace_tzinfo, "PyDateTime_DateTime *(PyDateTime_DateTime *, PyDateTime_TZInfo *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_replace_fold", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_replace_fold, "PyDateTime_DateTime *(PyDateTime_DateTime *, unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_adj_weekday", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_adj_weekday, "PyDateTime_DateTime *(PyDateTime_DateTime *, unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt_astimezone", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt_astimezone, "PyDateTime_DateTime *(PyDateTime_DateTime *, PyDateTime_TZInfo *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("gen_time", (void (*)(void))__pyx_f_7cytimes_10cydatetime_gen_time, "PyDateTime_Time *(struct __pyx_opt_args_7cytimes_10cydatetime_gen_time *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("gen_time_now", (void (*)(void))__pyx_f_7cytimes_10cydatetime_gen_time_now, "PyDateTime_Time *(void)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("gen_time_now_utc", (void (*)(void))__pyx_f_7cytimes_10cydatetime_gen_time_now_utc, "PyDateTime_Time *(void)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("gen_time_now_tz", (void (*)(void))__pyx_f_7cytimes_10cydatetime_gen_time_now_tz, "PyDateTime_Time *(PyDateTime_TZInfo *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("is_time", (void (*)(void))__pyx_f_7cytimes_10cydatetime_is_time, "int (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("is_time_exact", (void (*)(void))__pyx_f_7cytimes_10cydatetime_is_time_exact, "int (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("time_tzname", (void (*)(void))__pyx_f_7cytimes_10cydatetime_time_tzname, "PyObject *(PyDateTime_Time *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("time_dst", (void (*)(void))__pyx_f_7cytimes_10cydatetime_time_dst, "PyDateTime_Delta *(PyDateTime_Time *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("time_utcoffset", (void (*)(void))__pyx_f_7cytimes_10cydatetime_time_utcoffset, "PyDateTime_Delta *(PyDateTime_Time *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("time_to_isoformat", (void (*)(void))__pyx_f_7cytimes_10cydatetime_time_to_isoformat, "PyObject *(PyDateTime_Time *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("time_to_strformat", (void (*)(void))__pyx_f_7cytimes_10cydatetime_time_to_strformat, "PyObject *(PyDateTime_Time *, PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("time_to_seconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_time_to_seconds, "double (PyDateTime_Time *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("time_to_microseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_time_to_microseconds, "PY_LONG_LONG (PyDateTime_Time *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("time_fr_dt", (void (*)(void))__pyx_f_7cytimes_10cydatetime_time_fr_dt, "PyDateTime_Time *(PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("time_fr_seconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_time_fr_seconds, "PyDateTime_Time *(double, struct __pyx_opt_args_7cytimes_10cydatetime_time_fr_seconds *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("time_fr_microseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_time_fr_microseconds, "PyDateTime_Time *(PY_LONG_LONG, struct __pyx_opt_args_7cytimes_10cydatetime_time_fr_microseconds *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("time_replace", (void (*)(void))__pyx_f_7cytimes_10cydatetime_time_replace, "PyDateTime_Time *(PyDateTime_Time *, struct __pyx_opt_args_7cytimes_10cydatetime_time_replace *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("time_replace_tzinfo", (void (*)(void))__pyx_f_7cytimes_10cydatetime_time_replace_tzinfo, "PyDateTime_Time *(PyDateTime_Time *, PyDateTime_TZInfo *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("time_replace_fold", (void (*)(void))__pyx_f_7cytimes_10cydatetime_time_replace_fold, "PyDateTime_Time *(PyDateTime_Time *, unsigned int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("gen_td", (void (*)(void))__pyx_f_7cytimes_10cydatetime_gen_td, "PyDateTime_Delta *(struct __pyx_opt_args_7cytimes_10cydatetime_gen_td *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("is_td", (void (*)(void))__pyx_f_7cytimes_10cydatetime_is_td, "int (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("is_td_exact", (void (*)(void))__pyx_f_7cytimes_10cydatetime_is_td_exact, "int (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td_to_isoformat", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td_to_isoformat, "PyObject *(PyDateTime_Delta *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td_to_utcformat", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td_to_utcformat, "PyObject *(PyDateTime_Delta *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td_to_seconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td_to_seconds, "double (PyDateTime_Delta *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td_to_microseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td_to_microseconds, "PY_LONG_LONG (PyDateTime_Delta *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td_fr_td", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td_fr_td, "PyDateTime_Delta *(PyDateTime_Delta *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td_fr_seconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td_fr_seconds, "PyDateTime_Delta *(double)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td_fr_microseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td_fr_microseconds, "PyDateTime_Delta *(PY_LONG_LONG)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td_add", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td_add, "PyDateTime_Delta *(PyDateTime_Delta *, struct __pyx_opt_args_7cytimes_10cydatetime_td_add *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td_add_td", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td_add_td, "PyDateTime_Delta *(PyDateTime_Delta *, PyDateTime_Delta *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td_sub_td", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td_sub_td, "PyDateTime_Delta *(PyDateTime_Delta *, PyDateTime_Delta *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("gen_tzinfo", (void (*)(void))__pyx_f_7cytimes_10cydatetime_gen_tzinfo, "PyDateTime_TZInfo *(int)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("gen_tzinfo_local", (void (*)(void))__pyx_f_7cytimes_10cydatetime_gen_tzinfo_local, "PyDateTime_TZInfo *(struct __pyx_opt_args_7cytimes_10cydatetime_gen_tzinfo_local *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("is_tzinfo", (void (*)(void))__pyx_f_7cytimes_10cydatetime_is_tzinfo, "int (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("is_tzinfo_exact", (void (*)(void))__pyx_f_7cytimes_10cydatetime_is_tzinfo_exact, "int (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("tzinfo_name", (void (*)(void))__pyx_f_7cytimes_10cydatetime_tzinfo_name, "PyObject *(PyObject *, PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("tzinfo_dst", (void (*)(void))__pyx_f_7cytimes_10cydatetime_tzinfo_dst, "PyDateTime_Delta *(PyObject *, PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("tzinfo_utcoffset", (void (*)(void))__pyx_f_7cytimes_10cydatetime_tzinfo_utcoffset, "PyDateTime_Delta *(PyObject *, PyDateTime_DateTime *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("is_dt64", (void (*)(void))__pyx_f_7cytimes_10cydatetime_is_dt64, "int (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("validate_dt64", (void (*)(void))__pyx_f_7cytimes_10cydatetime_validate_dt64, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64_to_isoformat", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64_to_isoformat, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64_to_isospaceformat", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64_to_isospaceformat, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64_to_int", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64_to_int, "PY_LONG_LONG (PyObject *, PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64_to_days", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64_to_days, "PY_LONG_LONG (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64_to_hours", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64_to_hours, "PY_LONG_LONG (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64_to_minutes", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64_to_minutes, "PY_LONG_LONG (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64_to_seconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64_to_seconds, "PY_LONG_LONG (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64_to_milliseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64_to_milliseconds, "PY_LONG_LONG (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64_to_microseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64_to_microseconds, "PY_LONG_LONG (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64_to_nanoseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64_to_nanoseconds, "PY_LONG_LONG (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64_to_date", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64_to_date, "PyDateTime_Date *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64_to_dt", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64_to_dt, "PyDateTime_DateTime *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64_to_time", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64_to_time, "PyDateTime_Time *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("is_td64", (void (*)(void))__pyx_f_7cytimes_10cydatetime_is_td64, "int (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("validate_td64", (void (*)(void))__pyx_f_7cytimes_10cydatetime_validate_td64, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64_to_isoformat", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64_to_isoformat, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64_to_int", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64_to_int, "PY_LONG_LONG (PyObject *, PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64_to_days", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64_to_days, "PY_LONG_LONG (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64_to_hours", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64_to_hours, "PY_LONG_LONG (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64_to_minutes", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64_to_minutes, "PY_LONG_LONG (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64_to_seconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64_to_seconds, "PY_LONG_LONG (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64_to_milliseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64_to_milliseconds, "PY_LONG_LONG (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64_to_microseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64_to_microseconds, "PY_LONG_LONG (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64_to_nanoseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64_to_nanoseconds, "PY_LONG_LONG (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64_to_td", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64_to_td, "PyDateTime_Delta *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("is_dt64array", (void (*)(void))__pyx_f_7cytimes_10cydatetime_is_dt64array, "int (PyArrayObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("validate_dt64array", (void (*)(void))__pyx_f_7cytimes_10cydatetime_validate_dt64array, "PyObject *(PyArrayObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("get_dt64array_unit", (void (*)(void))__pyx_f_7cytimes_10cydatetime_get_dt64array_unit, "PyObject *(PyArrayObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64array_to_int", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64array_to_int, "PyArrayObject *(PyArrayObject *, PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64array_to_days", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64array_to_days, "PyArrayObject *(PyArrayObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64array_to_hours", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64array_to_hours, "PyArrayObject *(PyArrayObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64array_to_minutes", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64array_to_minutes, "PyArrayObject *(PyArrayObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64array_to_seconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64array_to_seconds, "PyArrayObject *(PyArrayObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64array_to_milliseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64array_to_milliseconds, "PyArrayObject *(PyArrayObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64array_to_microseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64array_to_microseconds, "PyArrayObject *(PyArrayObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64array_to_nanoseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64array_to_nanoseconds, "PyArrayObject *(PyArrayObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64array_to_ordinals", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64array_to_ordinals, "PyArrayObject *(PyArrayObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64array_to_timestamps", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64array_to_timestamps, "PyArrayObject *(PyArrayObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("is_td64array", (void (*)(void))__pyx_f_7cytimes_10cydatetime_is_td64array, "int (PyArrayObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("validate_td64array", (void (*)(void))__pyx_f_7cytimes_10cydatetime_validate_td64array, "PyObject *(PyArrayObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("get_td64array_unit", (void (*)(void))__pyx_f_7cytimes_10cydatetime_get_td64array_unit, "PyObject *(PyArrayObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64array_to_int", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64array_to_int, "PyArrayObject *(PyArrayObject *, PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64array_to_days", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64array_to_days, "PyArrayObject *(PyArrayObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64array_to_hours", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64array_to_hours, "PyArrayObject *(PyArrayObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64array_to_minutes", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64array_to_minutes, "PyArrayObject *(PyArrayObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64array_to_seconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64array_to_seconds, "PyArrayObject *(PyArrayObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64array_to_milliseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64array_to_milliseconds, "PyArrayObject *(PyArrayObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64array_to_microseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64array_to_microseconds, "PyArrayObject *(PyArrayObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64array_to_nanoseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64array_to_nanoseconds, "PyArrayObject *(PyArrayObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("is_dt64series", (void (*)(void))__pyx_f_7cytimes_10cydatetime_is_dt64series, "int (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("validate_dt64series", (void (*)(void))__pyx_f_7cytimes_10cydatetime_validate_dt64series, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("get_dt64series_arr", (void (*)(void))__pyx_f_7cytimes_10cydatetime_get_dt64series_arr, "PyArrayObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("get_dt64series_unit", (void (*)(void))__pyx_f_7cytimes_10cydatetime_get_dt64series_unit, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64series_to_int", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64series_to_int, "PyObject *(PyObject *, PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64series_to_days", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64series_to_days, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64series_to_hours", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64series_to_hours, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64series_to_minutes", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64series_to_minutes, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64series_to_seconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64series_to_seconds, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64series_to_milliseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64series_to_milliseconds, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64series_to_microseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64series_to_microseconds, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64series_to_nanoseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64series_to_nanoseconds, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64series_to_ordinals", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64series_to_ordinals, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("dt64series_to_timestamps", (void (*)(void))__pyx_f_7cytimes_10cydatetime_dt64series_to_timestamps, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("is_td64series", (void (*)(void))__pyx_f_7cytimes_10cydatetime_is_td64series, "int (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("validate_td64series", (void (*)(void))__pyx_f_7cytimes_10cydatetime_validate_td64series, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("get_td64series_arr", (void (*)(void))__pyx_f_7cytimes_10cydatetime_get_td64series_arr, "PyArrayObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("get_td64series_unit", (void (*)(void))__pyx_f_7cytimes_10cydatetime_get_td64series_unit, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64series_to_int", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64series_to_int, "PyObject *(PyObject *, PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64series_to_days", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64series_to_days, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64series_to_hours", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64series_to_hours, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64series_to_minutes", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64series_to_minutes, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64series_to_seconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64series_to_seconds, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64series_to_milliseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64series_to_milliseconds, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64series_to_microseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64series_to_microseconds, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64series_to_nanoseconds", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64series_to_nanoseconds, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("td64series_adjust_unit", (void (*)(void))__pyx_f_7cytimes_10cydatetime_td64series_adjust_unit, "PyObject *(PyObject *, PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

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_10(__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_10(PyTypeObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_0_10); 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_10(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyBoolObject),__Pyx_ImportType_CheckSize_Warn_3_0_10); 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_10(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyComplexObject),__Pyx_ImportType_CheckSize_Warn_3_0_10); 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(2, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_10(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_10); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 271, __pyx_L1_error)
  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_10(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_10); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 316, __pyx_L1_error)
  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_10(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_10); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 320, __pyx_L1_error)
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_10(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_10); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 359, __pyx_L1_error)
  __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_10(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_10); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 848, __pyx_L1_error)
  __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_10(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_10); if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 850, __pyx_L1_error)
  __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_10(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_10); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 852, __pyx_L1_error)
  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_10(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_10); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 854, __pyx_L1_error)
  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_10(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_10); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 856, __pyx_L1_error)
  __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_10(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_10); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 858, __pyx_L1_error)
  __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_10(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_10); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 860, __pyx_L1_error)
  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_10(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_10); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 862, __pyx_L1_error)
  __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_10(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_10); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 864, __pyx_L1_error)
  __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_10(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_10); if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 866, __pyx_L1_error)
  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_10(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_10); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 930, __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(4, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_8datetime_date = __Pyx_ImportType_3_0_10(__pyx_t_1, "datetime", "date", sizeof(PyDateTime_Date), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyDateTime_Date),__Pyx_ImportType_CheckSize_Warn_3_0_10); if (!__pyx_ptype_7cpython_8datetime_date) __PYX_ERR(4, 70, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_time = __Pyx_ImportType_3_0_10(__pyx_t_1, "datetime", "time", sizeof(PyDateTime_Time), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyDateTime_Time),__Pyx_ImportType_CheckSize_Warn_3_0_10); if (!__pyx_ptype_7cpython_8datetime_time) __PYX_ERR(4, 83, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_datetime = __Pyx_ImportType_3_0_10(__pyx_t_1, "datetime", "datetime", sizeof(PyDateTime_DateTime), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyDateTime_DateTime),__Pyx_ImportType_CheckSize_Warn_3_0_10); if (!__pyx_ptype_7cpython_8datetime_datetime) __PYX_ERR(4, 109, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_timedelta = __Pyx_ImportType_3_0_10(__pyx_t_1, "datetime", "timedelta", sizeof(PyDateTime_Delta), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyDateTime_Delta),__Pyx_ImportType_CheckSize_Warn_3_0_10); if (!__pyx_ptype_7cpython_8datetime_timedelta) __PYX_ERR(4, 147, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_tzinfo = __Pyx_ImportType_3_0_10(__pyx_t_1, "datetime", "tzinfo", sizeof(PyDateTime_TZInfo), __PYX_GET_STRUCT_ALIGNMENT_3_0_10(PyDateTime_TZInfo),__Pyx_ImportType_CheckSize_Warn_3_0_10); if (!__pyx_ptype_7cpython_8datetime_tzinfo) __PYX_ERR(4, 160, __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.typeref"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "ZONEINFO", (void **)&__pyx_vp_7cytimes_7typeref_ZONEINFO, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "STRUCT_TIME", (void **)&__pyx_vp_7cytimes_7typeref_STRUCT_TIME, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "DATETIME64", (void **)&__pyx_vp_7cytimes_7typeref_DATETIME64, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "DT64_ARRAY", (void **)&__pyx_vp_7cytimes_7typeref_DT64_ARRAY, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "TIMEDELTA64", (void **)&__pyx_vp_7cytimes_7typeref_TIMEDELTA64, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "TD64_ARRAY", (void **)&__pyx_vp_7cytimes_7typeref_TD64_ARRAY, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "SERIES", (void **)&__pyx_vp_7cytimes_7typeref_SERIES, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "DATETIMEINDEX", (void **)&__pyx_vp_7cytimes_7typeref_DATETIMEINDEX, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "TIMESTAMP", (void **)&__pyx_vp_7cytimes_7typeref_TIMESTAMP, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "DT64TZ_ARRAY", (void **)&__pyx_vp_7cytimes_7typeref_DT64TZ_ARRAY, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "TIMEDELTAINDEX", (void **)&__pyx_vp_7cytimes_7typeref_TIMEDELTAINDEX, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "TIMEDELTA", (void **)&__pyx_vp_7cytimes_7typeref_TIMEDELTA, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "BASEOFFSET", (void **)&__pyx_vp_7cytimes_7typeref_BASEOFFSET, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "OFST_DATEOFFSET", (void **)&__pyx_vp_7cytimes_7typeref_OFST_DATEOFFSET, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "OFST_MICRO", (void **)&__pyx_vp_7cytimes_7typeref_OFST_MICRO, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "OFST_DAY", (void **)&__pyx_vp_7cytimes_7typeref_OFST_DAY, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "OFST_MONTHBEGIN", (void **)&__pyx_vp_7cytimes_7typeref_OFST_MONTHBEGIN, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "OFST_MONTHEND", (void **)&__pyx_vp_7cytimes_7typeref_OFST_MONTHEND, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "OFST_QUARTERBEGIN", (void **)&__pyx_vp_7cytimes_7typeref_OFST_QUARTERBEGIN, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "OFST_QUARTEREND", (void **)&__pyx_vp_7cytimes_7typeref_OFST_QUARTEREND, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "OFST_YEARBEGIN", (void **)&__pyx_vp_7cytimes_7typeref_OFST_YEARBEGIN, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "OFST_YEAREND", (void **)&__pyx_vp_7cytimes_7typeref_OFST_YEAREND, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "PARSERINFO", (void **)&__pyx_vp_7cytimes_7typeref_PARSERINFO, "PyObject *") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ImportVoidPtr_3_0_10(__pyx_t_1, "RELATIVEDELTA", (void **)&__pyx_vp_7cytimes_7typeref_RELATIVEDELTA, "PyObject *") < 0) __PYX_ERR(1, 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
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_cydatetime(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_cydatetime},
  {0, NULL}
};
#endif

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "cydatetime",
      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 initcydatetime(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initcydatetime(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_cydatetime(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_cydatetime(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_cydatetime(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;
  static unsigned int __pyx_t_5[13];
  static unsigned int __pyx_t_6[13];
  static unsigned int __pyx_t_7[5];
  PyObject *__pyx_t_8 = NULL;
  static unsigned int __pyx_t_9[5];
  static unsigned int __pyx_t_10[13];
  struct __pyx_opt_args_7cpython_8datetime_datetime_new __pyx_t_11;
  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 'cydatetime' 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("cydatetime", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
  #elif CYTHON_USE_MODULE_STATE
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 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 "cydatetime" pseudovariable */
    if (unlikely((add_module_result < 0))) __PYX_ERR(1, 1, __pyx_L1_error)
    pystate_addmodule_run = 1;
  }
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
  #endif
  #endif
  CYTHON_UNUSED_VAR(__pyx_t_1);
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 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_cydatetime(void)", 0);
  if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(1, 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(1, 1, __pyx_L1_error)
  stringtab_initialized = 1;
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_cytimes__cydatetime) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "cytimes.cydatetime")) {
      if (unlikely((PyDict_SetItemString(modules, "cytimes.cydatetime", __pyx_m) < 0))) __PYX_ERR(1, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  if (unlikely((__Pyx_modinit_variable_export_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error)
  (void)__Pyx_modinit_type_init_code();
  if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_variable_import_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error)
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  #endif

  /* "cytimes/cydatetime.py":17
 * from cython.cimports.cytimes import typeref  # 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(1, 17, __pyx_L1_error)

  /* "cytimes/cydatetime.py":18
 * 
 * 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(1, 18, __pyx_L1_error)

  /* "cytimes/cydatetime.py":19
 * np.import_array()
 * np.import_umath()
 * datetime.import_datetime()             # <<<<<<<<<<<<<<
 * 
 * # Python imports
 */
  __pyx_f_7cpython_8datetime_import_datetime();

  /* "cytimes/cydatetime.py":22
 * 
 * # Python imports
 * from typing import Literal             # <<<<<<<<<<<<<<
 * import datetime, numpy as np
 * from time import localtime as time_localtime
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_Literal);
  __Pyx_GIVEREF(__pyx_n_s_Literal);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Literal)) __PYX_ERR(1, 22, __pyx_L1_error);
  __pyx_t_4 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 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_Literal); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Literal, __pyx_t_3) < 0) __PYX_ERR(1, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/cydatetime.py":23
 * # Python imports
 * from typing import Literal
 * import datetime, numpy as np             # <<<<<<<<<<<<<<
 * from time import localtime as time_localtime
 * from pandas import Series
 */
  __pyx_t_4 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_4) < 0) __PYX_ERR(1, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_4) < 0) __PYX_ERR(1, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/cydatetime.py":24
 * from typing import Literal
 * import datetime, numpy as np
 * from time import localtime as time_localtime             # <<<<<<<<<<<<<<
 * from pandas import Series
 * from cytimes import typeref
 */
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_n_s_localtime);
  __Pyx_GIVEREF(__pyx_n_s_localtime);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_localtime)) __PYX_ERR(1, 24, __pyx_L1_error);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_time, __pyx_t_4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 24, __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_localtime); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time_localtime, __pyx_t_4) < 0) __PYX_ERR(1, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/cydatetime.py":25
 * import datetime, numpy as np
 * from time import localtime as time_localtime
 * from pandas import Series             # <<<<<<<<<<<<<<
 * from cytimes import typeref
 * 
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_Series);
  __Pyx_GIVEREF(__pyx_n_s_Series);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Series)) __PYX_ERR(1, 25, __pyx_L1_error);
  __pyx_t_4 = __Pyx_Import(__pyx_n_s_pandas, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 25, __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_Series); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Series, __pyx_t_3) < 0) __PYX_ERR(1, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cytimes/cydatetime.py":26
 * from time import localtime as time_localtime
 * from pandas import Series
 * from cytimes import typeref             # <<<<<<<<<<<<<<
 * 
 * # Constants --------------------------------------------------------------------------------------------
 */
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_n_s_typeref);
  __Pyx_GIVEREF(__pyx_n_s_typeref);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_typeref)) __PYX_ERR(1, 26, __pyx_L1_error);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_cytimes, __pyx_t_4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 26, __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_typeref); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_typeref, __pyx_t_4) < 0) __PYX_ERR(1, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cytimes/cydatetime.py":31
 * # . calendar
 * # fmt: off
 * DAYS_BR_MONTH: cython.uint[13] = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]             # <<<<<<<<<<<<<<
 * DAYS_IN_MONTH: cython.uint[13] = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
 * DAYS_BR_QUARTER: cython.uint[5] = [0, 90, 181, 273, 365]
 */
  __pyx_t_5[0] = 0;
  __pyx_t_5[1] = 31;
  __pyx_t_5[2] = 59;
  __pyx_t_5[3] = 90;
  __pyx_t_5[4] = 0x78;
  __pyx_t_5[5] = 0x97;
  __pyx_t_5[6] = 0xB5;
  __pyx_t_5[7] = 0xD4;
  __pyx_t_5[8] = 0xF3;
  __pyx_t_5[9] = 0x111;
  __pyx_t_5[10] = 0x130;
  __pyx_t_5[11] = 0x14E;
  __pyx_t_5[12] = 0x16D;
  memcpy(&(__pyx_v_7cytimes_10cydatetime_DAYS_BR_MONTH[0]), __pyx_t_5, sizeof(__pyx_v_7cytimes_10cydatetime_DAYS_BR_MONTH[0]) * (13));

  /* "cytimes/cydatetime.py":32
 * # fmt: off
 * DAYS_BR_MONTH: cython.uint[13] = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]
 * DAYS_IN_MONTH: cython.uint[13] = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]             # <<<<<<<<<<<<<<
 * DAYS_BR_QUARTER: cython.uint[5] = [0, 90, 181, 273, 365]
 * DAYS_BR_QUARTER_NDARRAY: np.ndarray = np.array([0, 90, 181, 273, 365])
 */
  __pyx_t_6[0] = 0;
  __pyx_t_6[1] = 31;
  __pyx_t_6[2] = 28;
  __pyx_t_6[3] = 31;
  __pyx_t_6[4] = 30;
  __pyx_t_6[5] = 31;
  __pyx_t_6[6] = 30;
  __pyx_t_6[7] = 31;
  __pyx_t_6[8] = 31;
  __pyx_t_6[9] = 30;
  __pyx_t_6[10] = 31;
  __pyx_t_6[11] = 30;
  __pyx_t_6[12] = 31;
  memcpy(&(__pyx_v_7cytimes_10cydatetime_DAYS_IN_MONTH[0]), __pyx_t_6, sizeof(__pyx_v_7cytimes_10cydatetime_DAYS_IN_MONTH[0]) * (13));

  /* "cytimes/cydatetime.py":33
 * DAYS_BR_MONTH: cython.uint[13] = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]
 * DAYS_IN_MONTH: cython.uint[13] = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
 * DAYS_BR_QUARTER: cython.uint[5] = [0, 90, 181, 273, 365]             # <<<<<<<<<<<<<<
 * DAYS_BR_QUARTER_NDARRAY: np.ndarray = np.array([0, 90, 181, 273, 365])
 * DAYS_IN_QUARTER: cython.uint[5] = [0, 90, 91, 92, 92]
 */
  __pyx_t_7[0] = 0;
  __pyx_t_7[1] = 90;
  __pyx_t_7[2] = 0xB5;
  __pyx_t_7[3] = 0x111;
  __pyx_t_7[4] = 0x16D;
  memcpy(&(__pyx_v_7cytimes_10cydatetime_DAYS_BR_QUARTER[0]), __pyx_t_7, sizeof(__pyx_v_7cytimes_10cydatetime_DAYS_BR_QUARTER[0]) * (5));

  /* "cytimes/cydatetime.py":34
 * DAYS_IN_MONTH: cython.uint[13] = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
 * DAYS_BR_QUARTER: cython.uint[5] = [0, 90, 181, 273, 365]
 * DAYS_BR_QUARTER_NDARRAY: np.ndarray = np.array([0, 90, 181, 273, 365])             # <<<<<<<<<<<<<<
 * DAYS_IN_QUARTER: cython.uint[5] = [0, 90, 91, 92, 92]
 * MONTH_TO_QUARTER: cython.uint[13] = [1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyList_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_0)) __PYX_ERR(1, 34, __pyx_L1_error);
  __Pyx_INCREF(__pyx_int_90);
  __Pyx_GIVEREF(__pyx_int_90);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_90)) __PYX_ERR(1, 34, __pyx_L1_error);
  __Pyx_INCREF(__pyx_int_181);
  __Pyx_GIVEREF(__pyx_int_181);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_int_181)) __PYX_ERR(1, 34, __pyx_L1_error);
  __Pyx_INCREF(__pyx_int_273);
  __Pyx_GIVEREF(__pyx_int_273);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_int_273)) __PYX_ERR(1, 34, __pyx_L1_error);
  __Pyx_INCREF(__pyx_int_365);
  __Pyx_GIVEREF(__pyx_int_365);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 4, __pyx_int_365)) __PYX_ERR(1, 34, __pyx_L1_error);
  __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 34, __pyx_L1_error)
  __Pyx_XGOTREF((PyObject *)__pyx_v_7cytimes_10cydatetime_DAYS_BR_QUARTER_NDARRAY);
  __Pyx_DECREF_SET(__pyx_v_7cytimes_10cydatetime_DAYS_BR_QUARTER_NDARRAY, ((PyArrayObject *)__pyx_t_8));
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_t_8 = 0;

  /* "cytimes/cydatetime.py":35
 * DAYS_BR_QUARTER: cython.uint[5] = [0, 90, 181, 273, 365]
 * DAYS_BR_QUARTER_NDARRAY: np.ndarray = np.array([0, 90, 181, 273, 365])
 * DAYS_IN_QUARTER: cython.uint[5] = [0, 90, 91, 92, 92]             # <<<<<<<<<<<<<<
 * MONTH_TO_QUARTER: cython.uint[13] = [1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4]
 * # fmt: on
 */
  __pyx_t_9[0] = 0;
  __pyx_t_9[1] = 90;
  __pyx_t_9[2] = 91;
  __pyx_t_9[3] = 92;
  __pyx_t_9[4] = 92;
  memcpy(&(__pyx_v_7cytimes_10cydatetime_DAYS_IN_QUARTER[0]), __pyx_t_9, sizeof(__pyx_v_7cytimes_10cydatetime_DAYS_IN_QUARTER[0]) * (5));

  /* "cytimes/cydatetime.py":36
 * DAYS_BR_QUARTER_NDARRAY: np.ndarray = np.array([0, 90, 181, 273, 365])
 * DAYS_IN_QUARTER: cython.uint[5] = [0, 90, 91, 92, 92]
 * MONTH_TO_QUARTER: cython.uint[13] = [1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4]             # <<<<<<<<<<<<<<
 * # fmt: on
 * # . datetime
 */
  __pyx_t_10[0] = 1;
  __pyx_t_10[1] = 1;
  __pyx_t_10[2] = 1;
  __pyx_t_10[3] = 1;
  __pyx_t_10[4] = 2;
  __pyx_t_10[5] = 2;
  __pyx_t_10[6] = 2;
  __pyx_t_10[7] = 3;
  __pyx_t_10[8] = 3;
  __pyx_t_10[9] = 3;
  __pyx_t_10[10] = 4;
  __pyx_t_10[11] = 4;
  __pyx_t_10[12] = 4;
  memcpy(&(__pyx_v_7cytimes_10cydatetime_MONTH_TO_QUARTER[0]), __pyx_t_10, sizeof(__pyx_v_7cytimes_10cydatetime_MONTH_TO_QUARTER[0]) * (13));

  /* "cytimes/cydatetime.py":39
 * # fmt: on
 * # . datetime
 * UTC: datetime.tzinfo = datetime.get_utc()             # <<<<<<<<<<<<<<
 * EPOCH_UTC: datetime.datetime = datetime.datetime_new(1970, 1, 1, 0, 0, 0, 0, UTC, 0)  # type: ignore
 * EPOCH_US: cython.longlong = 62_135_683_200_000_000
 */
  __pyx_t_8 = __pyx_f_7cpython_8datetime_get_utc(); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_7cpython_8datetime_tzinfo))))) __PYX_ERR(1, 39, __pyx_L1_error)
  __Pyx_XGOTREF((PyObject *)__pyx_v_7cytimes_10cydatetime_UTC);
  __Pyx_DECREF_SET(__pyx_v_7cytimes_10cydatetime_UTC, ((PyDateTime_TZInfo *)__pyx_t_8));
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_t_8 = 0;

  /* "cytimes/cydatetime.py":40
 * # . datetime
 * UTC: datetime.tzinfo = datetime.get_utc()
 * EPOCH_UTC: datetime.datetime = datetime.datetime_new(1970, 1, 1, 0, 0, 0, 0, UTC, 0)  # type: ignore             # <<<<<<<<<<<<<<
 * EPOCH_US: cython.longlong = 62_135_683_200_000_000
 * EPOCH_SEC: cython.longlong = 62_135_683_200
 */
  __pyx_t_8 = ((PyObject *)__pyx_v_7cytimes_10cydatetime_UTC);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_11.__pyx_n = 1;
  __pyx_t_11.fold = 0;
  __pyx_t_3 = ((PyObject *)__pyx_f_7cpython_8datetime_datetime_new(0x7B2, 1, 1, 0, 0, 0, 0, __pyx_t_8, &__pyx_t_11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_XGOTREF((PyObject *)__pyx_v_7cytimes_10cydatetime_EPOCH_UTC);
  __Pyx_DECREF_SET(__pyx_v_7cytimes_10cydatetime_EPOCH_UTC, ((PyDateTime_DateTime *)__pyx_t_3));
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/cydatetime.py":41
 * UTC: datetime.tzinfo = datetime.get_utc()
 * EPOCH_UTC: datetime.datetime = datetime.datetime_new(1970, 1, 1, 0, 0, 0, 0, UTC, 0)  # type: ignore
 * EPOCH_US: cython.longlong = 62_135_683_200_000_000             # <<<<<<<<<<<<<<
 * EPOCH_SEC: cython.longlong = 62_135_683_200
 * EPOCH_DAY: cython.int = 719_163
 */
  __pyx_v_7cytimes_10cydatetime_EPOCH_US = 0xDCC0131D032000;

  /* "cytimes/cydatetime.py":42
 * EPOCH_UTC: datetime.datetime = datetime.datetime_new(1970, 1, 1, 0, 0, 0, 0, UTC, 0)  # type: ignore
 * EPOCH_US: cython.longlong = 62_135_683_200_000_000
 * EPOCH_SEC: cython.longlong = 62_135_683_200             # <<<<<<<<<<<<<<
 * EPOCH_DAY: cython.int = 719_163
 * DT_MAX_US: cython.longlong = 315_537_983_999_999_999
 */
  __pyx_v_7cytimes_10cydatetime_EPOCH_SEC = 0xE77934880;

  /* "cytimes/cydatetime.py":43
 * EPOCH_US: cython.longlong = 62_135_683_200_000_000
 * EPOCH_SEC: cython.longlong = 62_135_683_200
 * EPOCH_DAY: cython.int = 719_163             # <<<<<<<<<<<<<<
 * DT_MAX_US: cython.longlong = 315_537_983_999_999_999
 * DT_MIN_US: cython.longlong = 86_400_000_000
 */
  __pyx_v_7cytimes_10cydatetime_EPOCH_DAY = 0xAF93B;

  /* "cytimes/cydatetime.py":44
 * EPOCH_SEC: cython.longlong = 62_135_683_200
 * EPOCH_DAY: cython.int = 719_163
 * DT_MAX_US: cython.longlong = 315_537_983_999_999_999             # <<<<<<<<<<<<<<
 * DT_MIN_US: cython.longlong = 86_400_000_000
 * # . time
 */
  __pyx_v_7cytimes_10cydatetime_DT_MAX_US = 0x461041FE9767FFF;

  /* "cytimes/cydatetime.py":45
 * EPOCH_DAY: cython.int = 719_163
 * DT_MAX_US: cython.longlong = 315_537_983_999_999_999
 * DT_MIN_US: cython.longlong = 86_400_000_000             # <<<<<<<<<<<<<<
 * # . time
 * TIME_START: datetime.time = datetime.time(0, 0, 0, 0)
 */
  __pyx_v_7cytimes_10cydatetime_DT_MIN_US = 0x141DD76000;

  /* "cytimes/cydatetime.py":47
 * DT_MIN_US: cython.longlong = 86_400_000_000
 * # . time
 * TIME_START: datetime.time = datetime.time(0, 0, 0, 0)             # <<<<<<<<<<<<<<
 * TIME_END: datetime.time = datetime.time(23, 59, 59, 999999)
 * # . microsecond
 */
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cpython_8datetime_time), __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_XGOTREF((PyObject *)__pyx_v_7cytimes_10cydatetime_TIME_START);
  __Pyx_DECREF_SET(__pyx_v_7cytimes_10cydatetime_TIME_START, ((PyDateTime_Time *)__pyx_t_3));
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/cydatetime.py":48
 * # . time
 * TIME_START: datetime.time = datetime.time(0, 0, 0, 0)
 * TIME_END: datetime.time = datetime.time(23, 59, 59, 999999)             # <<<<<<<<<<<<<<
 * # . microsecond
 * US_DAY: cython.longlong = 86_400_000_000
 */
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cpython_8datetime_time), __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_XGOTREF((PyObject *)__pyx_v_7cytimes_10cydatetime_TIME_END);
  __Pyx_DECREF_SET(__pyx_v_7cytimes_10cydatetime_TIME_END, ((PyDateTime_Time *)__pyx_t_3));
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/cydatetime.py":50
 * TIME_END: datetime.time = datetime.time(23, 59, 59, 999999)
 * # . microsecond
 * US_DAY: cython.longlong = 86_400_000_000             # <<<<<<<<<<<<<<
 * US_HOUR: cython.longlong = 3_600_000_000
 * # . nanosecond
 */
  __pyx_v_7cytimes_10cydatetime_US_DAY = 0x141DD76000;

  /* "cytimes/cydatetime.py":51
 * # . microsecond
 * US_DAY: cython.longlong = 86_400_000_000
 * US_HOUR: cython.longlong = 3_600_000_000             # <<<<<<<<<<<<<<
 * # . nanosecond
 * NS_DAY: cython.longlong = 864_00_000_000_000
 */
  __pyx_v_7cytimes_10cydatetime_US_HOUR = 0xD693A400;

  /* "cytimes/cydatetime.py":53
 * US_HOUR: cython.longlong = 3_600_000_000
 * # . nanosecond
 * NS_DAY: cython.longlong = 864_00_000_000_000             # <<<<<<<<<<<<<<
 * NS_HOUR: cython.longlong = 36_00_000_000_000
 * NS_MINUTE: cython.longlong = 60_000_000_000
 */
  __pyx_v_7cytimes_10cydatetime_NS_DAY = 0x4E94914F0000;

  /* "cytimes/cydatetime.py":54
 * # . nanosecond
 * NS_DAY: cython.longlong = 864_00_000_000_000
 * NS_HOUR: cython.longlong = 36_00_000_000_000             # <<<<<<<<<<<<<<
 * NS_MINUTE: cython.longlong = 60_000_000_000
 * # . timedelta unit adjustment
 */
  __pyx_v_7cytimes_10cydatetime_NS_HOUR = 0x34630B8A000;

  /* "cytimes/cydatetime.py":55
 * NS_DAY: cython.longlong = 864_00_000_000_000
 * NS_HOUR: cython.longlong = 36_00_000_000_000
 * NS_MINUTE: cython.longlong = 60_000_000_000             # <<<<<<<<<<<<<<
 * # . timedelta unit adjustment
 * TD_UNIT_ADJUSTMENT: set[str] = {"s", "ms", "us", "ns"}
 */
  __pyx_v_7cytimes_10cydatetime_NS_MINUTE = 0xDF8475800;

  /* "cytimes/cydatetime.py":57
 * NS_MINUTE: cython.longlong = 60_000_000_000
 * # . timedelta unit adjustment
 * TD_UNIT_ADJUSTMENT: set[str] = {"s", "ms", "us", "ns"}             # <<<<<<<<<<<<<<
 * # . function
 * FN_TIME_LOCALTIME: object = time_localtime
 */
  __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PySet_Add(__pyx_t_3, __pyx_n_u_s) < 0) __PYX_ERR(1, 57, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_n_u_ms) < 0) __PYX_ERR(1, 57, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_n_u_us) < 0) __PYX_ERR(1, 57, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_n_u_ns) < 0) __PYX_ERR(1, 57, __pyx_L1_error)
  __Pyx_XGOTREF(__pyx_v_7cytimes_10cydatetime_TD_UNIT_ADJUSTMENT);
  __Pyx_DECREF_SET(__pyx_v_7cytimes_10cydatetime_TD_UNIT_ADJUSTMENT, ((PyObject*)__pyx_t_3));
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/cydatetime.py":59
 * TD_UNIT_ADJUSTMENT: set[str] = {"s", "ms", "us", "ns"}
 * # . function
 * FN_TIME_LOCALTIME: object = time_localtime             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_time_localtime); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_XGOTREF(__pyx_v_7cytimes_10cydatetime_FN_TIME_LOCALTIME);
  __Pyx_DECREF_SET(__pyx_v_7cytimes_10cydatetime_FN_TIME_LOCALTIME, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytimes/cydatetime.py":1
 * # cython: language_level=3             # <<<<<<<<<<<<<<
 * # cython: wraparound=False
 * # cython: boundscheck=False
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  if (__pyx_m) {
    if (__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init cytimes.cydatetime", __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.cydatetime");
  }
  __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);
}

/* DivInt[Py_ssize_t] */
static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
    Py_ssize_t q = a / b;
    Py_ssize_t r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

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

/* ModInt[Py_ssize_t] */
static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
    Py_ssize_t r = a % b;
    r += ((r != 0) & ((r ^ b) < 0)) * b;
    return r;
}

/* WriteUnraisableException */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
    else state = (PyGILState_STATE)0;
#endif
    CYTHON_UNUSED_VAR(clineno);
    CYTHON_UNUSED_VAR(lineno);
    CYTHON_UNUSED_VAR(filename);
    CYTHON_MAYBE_UNUSED_VAR(nogil);
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

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

/* ModFloat[double] */
static CYTHON_INLINE double __Pyx_mod_double(double a, double b) {
    double r = fmod(a, b);
    r += ((r != 0) & ((r < 0) ^ (b < 0))) * b;
    return r;
}

/* UnicodeConcatInPlace */
# if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
static int
__Pyx_unicode_modifiable(PyObject *unicode)
{
    if (Py_REFCNT(unicode) != 1)
        return 0;
    if (!PyUnicode_CheckExact(unicode))
        return 0;
    if (PyUnicode_CHECK_INTERNED(unicode))
        return 0;
    return 1;
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right
        #if CYTHON_REFNANNY
        , void* __pyx_refnanny
        #endif
    ) {
    PyObject *left = *p_left;
    Py_ssize_t left_len, right_len, new_len;
    if (unlikely(__Pyx_PyUnicode_READY(left) == -1))
        return NULL;
    if (unlikely(__Pyx_PyUnicode_READY(right) == -1))
        return NULL;
    left_len = PyUnicode_GET_LENGTH(left);
    if (left_len == 0) {
        Py_INCREF(right);
        return right;
    }
    right_len = PyUnicode_GET_LENGTH(right);
    if (right_len == 0) {
        Py_INCREF(left);
        return left;
    }
    if (unlikely(left_len > PY_SSIZE_T_MAX - right_len)) {
        PyErr_SetString(PyExc_OverflowError,
                        "strings are too large to concat");
        return NULL;
    }
    new_len = left_len + right_len;
    if (__Pyx_unicode_modifiable(left)
            && PyUnicode_CheckExact(right)
            && PyUnicode_KIND(right) <= PyUnicode_KIND(left)
            && !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right))) {
        int ret;
        __Pyx_GIVEREF(*p_left);
        ret = PyUnicode_Resize(p_left, new_len);
        __Pyx_GOTREF(*p_left);
        if (unlikely(ret != 0))
            return NULL;
        #if PY_VERSION_HEX >= 0x030d0000
        if (unlikely(PyUnicode_CopyCharacters(*p_left, left_len, right, 0, right_len) < 0)) return NULL;
        #else
        _PyUnicode_FastCopyCharacters(*p_left, left_len, right, 0, right_len);
        #endif
        __Pyx_INCREF(*p_left);
        __Pyx_GIVEREF(*p_left);
        return *p_left;
    } else {
        return __Pyx_PyUnicode_Concat(left, right);
    }
  }
#endif

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

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

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

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

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_unsigned_int(unsigned int value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(unsigned int)*3+2];
    char *dpos, *end = digits + sizeof(unsigned int)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    unsigned int remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned 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 = (unsigned 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 = (unsigned 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 = (unsigned 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);
}

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

/* DivInt[npy_datetime] */
static CYTHON_INLINE npy_datetime __Pyx_div_npy_datetime(npy_datetime a, npy_datetime b) {
    npy_datetime q = a / b;
    npy_datetime r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

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

/* DivInt[npy_timedelta] */
static CYTHON_INLINE npy_timedelta __Pyx_div_npy_timedelta(npy_timedelta a, npy_timedelta b) {
    npy_timedelta q = a / b;
    npy_timedelta r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

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

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType_3_0_10
#define __PYX_HAVE_RT_ImportType_3_0_10
static PyTypeObject *__Pyx_ImportType_3_0_10(PyObject *module, const char *module_name, const char *class_name,
    size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_10 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_10 &&
            ((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_10 && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *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;
}

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

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

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

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

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned 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(unsigned int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(unsigned int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        return _PyLong_FromByteArray(bytes, sizeof(unsigned int),
                                     little, !is_unsigned);
#else
        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(unsigned 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
    }
}

/* 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
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
#else
        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
    }
}

/* 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;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        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;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
#endif
            if (likely(v)) {
                int ret = -1;
#if 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 *)v,
                                           bytes, sizeof(val),
                                           is_little, !is_unsigned);
#else
                PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
                int bits, remaining_bits, is_negative = 0;
                long idigit;
                int chunk_size = (sizeof(long) < 8) ? 30 : 62;
                if (unlikely(!PyLong_CheckExact(v))) {
                    PyObject *tmp = v;
                    v = PyNumber_Long(v);
                    assert(PyLong_CheckExact(v));
                    Py_DECREF(tmp);
                    if (unlikely(!v)) return (long) -1;
                }
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
                if (Py_SIZE(x) == 0)
                    return (long) 0;
                is_negative = Py_SIZE(x) < 0;
#else
                {
                    int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                    if (unlikely(result < 0))
                        return (long) -1;
                    is_negative = result == 1;
                }
#endif
                if (is_unsigned && unlikely(is_negative)) {
                    goto raise_neg_overflow;
                } else if (is_negative) {
                    stepval = PyNumber_Invert(v);
                    if (unlikely(!stepval))
                        return (long) -1;
                } else {
                    stepval = __Pyx_NewRef(v);
                }
                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;
                    digit = PyNumber_And(stepval, mask);
                    if (unlikely(!digit)) goto done;
                    idigit = PyLong_AsLong(digit);
                    Py_DECREF(digit);
                    if (unlikely(idigit < 0)) goto done;
                    tmp = PyNumber_Rshift(stepval, shift);
                    if (unlikely(!tmp)) goto done;
                    Py_DECREF(stepval); stepval = tmp;
                    val |= ((long) idigit) << bits;
                    #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
                    if (Py_SIZE(stepval) == 0)
                        goto unpacking_done;
                    #endif
                }
                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 CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
            unpacking_done:
            #endif
                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
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntFromPy */
static CYTHON_INLINE 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;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        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;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
#endif
            if (likely(v)) {
                int ret = -1;
#if 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 *)v,
                                           bytes, sizeof(val),
                                           is_little, !is_unsigned);
#else
                PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
                int bits, remaining_bits, is_negative = 0;
                long idigit;
                int chunk_size = (sizeof(long) < 8) ? 30 : 62;
                if (unlikely(!PyLong_CheckExact(v))) {
                    PyObject *tmp = v;
                    v = PyNumber_Long(v);
                    assert(PyLong_CheckExact(v));
                    Py_DECREF(tmp);
                    if (unlikely(!v)) return (PY_LONG_LONG) -1;
                }
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
                if (Py_SIZE(x) == 0)
                    return (PY_LONG_LONG) 0;
                is_negative = Py_SIZE(x) < 0;
#else
                {
                    int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                    if (unlikely(result < 0))
                        return (PY_LONG_LONG) -1;
                    is_negative = result == 1;
                }
#endif
                if (is_unsigned && unlikely(is_negative)) {
                    goto raise_neg_overflow;
                } else if (is_negative) {
                    stepval = PyNumber_Invert(v);
                    if (unlikely(!stepval))
                        return (PY_LONG_LONG) -1;
                } else {
                    stepval = __Pyx_NewRef(v);
                }
                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;
                    digit = PyNumber_And(stepval, mask);
                    if (unlikely(!digit)) goto done;
                    idigit = PyLong_AsLong(digit);
                    Py_DECREF(digit);
                    if (unlikely(idigit < 0)) goto done;
                    tmp = PyNumber_Rshift(stepval, shift);
                    if (unlikely(!tmp)) goto done;
                    Py_DECREF(stepval); stepval = tmp;
                    val |= ((PY_LONG_LONG) idigit) << bits;
                    #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
                    if (Py_SIZE(stepval) == 0)
                        goto unpacking_done;
                    #endif
                }
                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 CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
            unpacking_done:
            #endif
                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
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
            return (PY_LONG_LONG) -1;
        }
    } else {
        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;
    }
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;
}

/* 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;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        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;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
#endif
            if (likely(v)) {
                int ret = -1;
#if 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 *)v,
                                           bytes, sizeof(val),
                                           is_little, !is_unsigned);
#else
                PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
                int bits, remaining_bits, is_negative = 0;
                long idigit;
                int chunk_size = (sizeof(long) < 8) ? 30 : 62;
                if (unlikely(!PyLong_CheckExact(v))) {
                    PyObject *tmp = v;
                    v = PyNumber_Long(v);
                    assert(PyLong_CheckExact(v));
                    Py_DECREF(tmp);
                    if (unlikely(!v)) return (int) -1;
                }
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
                if (Py_SIZE(x) == 0)
                    return (int) 0;
                is_negative = Py_SIZE(x) < 0;
#else
                {
                    int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                    if (unlikely(result < 0))
                        return (int) -1;
                    is_negative = result == 1;
                }
#endif
                if (is_unsigned && unlikely(is_negative)) {
                    goto raise_neg_overflow;
                } else if (is_negative) {
                    stepval = PyNumber_Invert(v);
                    if (unlikely(!stepval))
                        return (int) -1;
                } else {
                    stepval = __Pyx_NewRef(v);
                }
                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;
                    digit = PyNumber_And(stepval, mask);
                    if (unlikely(!digit)) goto done;
                    idigit = PyLong_AsLong(digit);
                    Py_DECREF(digit);
                    if (unlikely(idigit < 0)) goto done;
                    tmp = PyNumber_Rshift(stepval, shift);
                    if (unlikely(!tmp)) goto done;
                    Py_DECREF(stepval); stepval = tmp;
                    val |= ((int) idigit) << bits;
                    #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
                    if (Py_SIZE(stepval) == 0)
                        goto unpacking_done;
                    #endif
                }
                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 CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
            unpacking_done:
            #endif
                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
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* 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
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
#else
        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
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_NPY_DATETIMEUNIT(NPY_DATETIMEUNIT value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const NPY_DATETIMEUNIT neg_one = (NPY_DATETIMEUNIT) -1, const_zero = (NPY_DATETIMEUNIT) 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_DATETIMEUNIT) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(NPY_DATETIMEUNIT) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(NPY_DATETIMEUNIT) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(NPY_DATETIMEUNIT) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(NPY_DATETIMEUNIT) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        return _PyLong_FromByteArray(bytes, sizeof(NPY_DATETIMEUNIT),
                                     little, !is_unsigned);
#else
        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_DATETIMEUNIT));
        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__17);
    }
    return name;
}
#endif

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

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

/* PyObjectSetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* VoidPtrExport */
static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) {
    PyObject *d;
    PyObject *cobj = 0;
    d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi);
    Py_XINCREF(d);
    if (!d) {
        d = PyDict_New();
        if (!d)
            goto bad;
        if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0)
            goto bad;
    }
    cobj = PyCapsule_New(p, sig, 0);
    if (!cobj)
        goto bad;
    if (PyDict_SetItem(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

/* FunctionExport */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
    if (!d) {
        PyErr_Clear();
        d = PyDict_New();
        if (!d)
            goto bad;
        Py_INCREF(d);
        if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
            goto bad;
    }
    tmp.fp = f;
    cobj = PyCapsule_New(tmp.p, sig, 0);
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

/* VoidPtrImport */
#ifndef __PYX_HAVE_RT_ImportVoidPtr_3_0_10
#define __PYX_HAVE_RT_ImportVoidPtr_3_0_10
static int __Pyx_ImportVoidPtr_3_0_10(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

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